From Carlos García and Paul Baker, Port of Paul Baker's Quake3 BSP loader to OSG by Carlos García.

Added Quake3 BSP plugin.
This commit is contained in:
Robert Osfield
2006-05-15 09:46:54 +00:00
parent 8af7b04c5b
commit f104656d9f
8 changed files with 1311 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
//////////////////////////////////////////////////////////////////////////////////////////
// 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"
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 m_bits_aux[bitNumber>>3] & 1<<(bitNumber&7);
}