Files
OpenSceneGraph/src/osgPlugins/bsp/BITSET.cpp
Robert Osfield b24353b12c From Rafa Gaitan and Jorge Izquierdo, build support for Android NDK.
"- In order to build against GLES1 we execute:
$ mkdir build_android_gles1
$ cd build_android_gles1
$ cmake .. -DOSG_BUILD_PLATFORM_ANDROID=ON -DDYNAMIC_OPENTHREADS=OFF
-DDYNAMIC_OPENSCENEGRAPH=OFF -DANDROID_NDK=<path_to_android_ndk>/
-DOSG_GLES1_AVAILABLE=ON -DOSG_GL1_AVAILABLE=OFF
-DOSG_GL2_AVAILABLE=OFF -DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF -DJ=2
-DOSG_CPP_EXCEPTIONS_AVAILABLE=OFF
$ make
 If all is correct you will have and static OSG inside:
build_android_gles1/bin/ndk/local/armeabi.

- GLES2 is not tested/proved, but I think it could be possible build
it with the correct cmake flags.
- The flag -DJ=2 is used to pass to the ndk-build the number of
processors to speed up the building.
- make install is not yet supported."
2011-03-08 16:35:37 +00:00

55 lines
1.2 KiB
C++

//////////////////////////////////////////////////////////////////////////////////////////
// BITSET.cpp
// functions for class for set of bits to represent many true/falses
// You may use this code however you wish, but if you do, please credit me and
// provide a link to my website in a readme file or similar
// Downloaded from: www.paulsprojects.net
// Created: 8th August 2002
//////////////////////////////////////////////////////////////////////////////////////////
#include "memory.h"
#include "BITSET.h"
#include <cstring>
bool BITSET::Init(int numberOfBits)
{
//Delete any memory allocated to bits
m_bits.clear();
//Calculate size
m_numBytes=(numberOfBits>>3)+1;
//Create memory
m_bits.reserve(m_numBytes);
m_bits_aux=&m_bits[0];
ClearAll();
return true;
}
void BITSET::ClearAll()
{
memset(m_bits_aux, 0, m_numBytes);
}
void BITSET::SetAll()
{
memset(m_bits_aux, 0xFF, m_numBytes);
}
void BITSET::Clear(int bitNumber)
{
m_bits_aux[bitNumber>>3] &= ~(1<<(bitNumber & 7));
}
void BITSET::Set(int bitNumber)
{
m_bits_aux[bitNumber>>3] |= 1<<(bitNumber&7);
}
unsigned char BITSET::IsSet(int bitNumber) const
{
return static_cast<unsigned char>(m_bits_aux[bitNumber>>3] & 1<<(bitNumber&7));
}