mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-10-17 11:59:28 +00:00
More signed/unsigned comparison fixes. int -> size_t.
This commit is contained in:
parent
4134140be2
commit
9bb3fe86f6
15 changed files with 126 additions and 179 deletions
|
@ -41,7 +41,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
//#pragma warning(disable:4005)
|
||||
#pragma warning(disable:4305)
|
||||
|
||||
#pragma warning(disable:4018) // signed/unsigned mismatch
|
||||
//#pragma warning(disable:4018) // signed/unsigned mismatch
|
||||
#pragma warning(disable:4244) // conversion from types with possible loss of data
|
||||
#pragma warning(disable:4800) // forcing value to bool 'true' or 'false (performance warning)
|
||||
|
||||
|
|
|
@ -198,14 +198,14 @@ void ParticleManager::endParticle(Particle *p)
|
|||
p->reset();
|
||||
}
|
||||
|
||||
void ParticleManager::nextFree(int jump)
|
||||
void ParticleManager::nextFree(size_t jump)
|
||||
{
|
||||
free+=jump;
|
||||
if (free >= size)
|
||||
free -= size;
|
||||
}
|
||||
|
||||
void ParticleManager::prevFree(int jump)
|
||||
void ParticleManager::prevFree(size_t jump)
|
||||
{
|
||||
if(free < jump) {
|
||||
free = free + size - jump;
|
||||
|
|
|
@ -237,8 +237,8 @@ protected:
|
|||
size_t numActive;
|
||||
Particle* stomp();
|
||||
|
||||
void nextFree(int f=1);
|
||||
void prevFree(int f=1);
|
||||
void nextFree(size_t f=1);
|
||||
void prevFree(size_t f=1);
|
||||
|
||||
size_t oldFree;
|
||||
|
||||
|
|
|
@ -429,7 +429,6 @@ ImageTGA *Texture::TGAloadMem(void *mem, int size)
|
|||
byte bits = 0; // The bits per pixel for the image (16, 24, 32)
|
||||
uint32_t channels = 0; // The channels of the image (3 = RGA : 4 = RGBA)
|
||||
uint32_t stride = 0; // The stride (channels * width)
|
||||
size_t i = 0; // A counter
|
||||
|
||||
// This function loads in a TARGA (.TGA) file and returns its data to be
|
||||
// used as a texture or what have you. This currently loads in a 16, 24
|
||||
|
@ -498,7 +497,7 @@ ImageTGA *Texture::TGAloadMem(void *mem, int size)
|
|||
|
||||
// Go through all of the pixels and swap the B and R values since TGA
|
||||
// files are stored as BGR instead of RGB (or use GL_BGR_EXT verses GL_RGB)
|
||||
for(i = 0; i < stride; i += channels)
|
||||
for(unsigned i = 0; i < stride; i += channels)
|
||||
{
|
||||
int temp = pLine[i];
|
||||
pLine[i] = pLine[i + 2];
|
||||
|
@ -578,7 +577,8 @@ ImageTGA *Texture::TGAloadMem(void *mem, int size)
|
|||
byte *pColors = new byte [channels];
|
||||
|
||||
// Load in all the pixel data
|
||||
while(i < width*height)
|
||||
const size_t datalen = size_t(width) * size_t(height);
|
||||
for(size_t i = 0; i < datalen; )
|
||||
{
|
||||
// Read in the current color count + 1
|
||||
bb >> rleID;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue