GCC fixes.

SVN r677 (trunk)
This commit is contained in:
Randy Heit 2008-01-08 01:48:33 +00:00
parent 016ac67376
commit bec0d3438f
9 changed files with 30 additions and 22 deletions

View file

@ -1821,4 +1821,4 @@ void AM_SerializeMarkers(FArchive &arc)
{ {
arc << markpoints[i].x << markpoints[i].y; arc << markpoints[i].x << markpoints[i].y;
} }
} }

View file

@ -104,7 +104,7 @@ bool wipe_doMelt (int ticks)
int i, j, dy, x; int i, j, dy, x;
const short *s; const short *s;
short *d; short *d;
bool done; bool done = true;
while (ticks--) while (ticks--)
{ {
@ -437,4 +437,4 @@ void wipe_Cleanup()
{ {
(*wipes[(CurrentWipeType-1)*3+2])(0); (*wipes[(CurrentWipeType-1)*3+2])(0);
} }
} }

View file

@ -2166,7 +2166,7 @@ static void M_PlayerSetupDrawer ()
(PSetupDef.y + LINEHEIGHT*3 + 57 - 104)*CleanYfac + (SCREENHEIGHT/2), (PSetupDef.y + LINEHEIGHT*3 + 57 - 104)*CleanYfac + (SCREENHEIGHT/2),
DTA_DestWidth, MulScale16 (tex->GetWidth() * CleanXfac, Scale), DTA_DestWidth, MulScale16 (tex->GetWidth() * CleanXfac, Scale),
DTA_DestHeight, MulScale16 (tex->GetHeight() * CleanYfac, Scale), DTA_DestHeight, MulScale16 (tex->GetHeight() * CleanYfac, Scale),
DTA_Translation, translationtables[TRANSLATION_Players][MAXPLAYERS], DTA_Translation, translationtables[TRANSLATION_Players](MAXPLAYERS),
TAG_DONE); TAG_DONE);
} }
} }
@ -2596,7 +2596,7 @@ static void M_ChangePlayerTeam (int choice)
} }
else else
{ {
if (team == teams.Size () - 1) if (team == int(teams.Size () - 1))
{ {
team = TEAM_None; team = TEAM_None;
} }

View file

@ -173,7 +173,7 @@ int FTextureManager::ListTextures (const char *name, TArray<int> &list)
// NULL textures must be ignored. // NULL textures must be ignored.
if (tex->UseType!=FTexture::TEX_Null) if (tex->UseType!=FTexture::TEX_Null)
{ {
int j; unsigned int j;
for(j = 0; j < list.Size(); j++) for(j = 0; j < list.Size(); j++)
{ {
// Check for overriding definitions from newer WADs // Check for overriding definitions from newer WADs
@ -383,7 +383,7 @@ void FTextureManager::AddHiresTextures ()
} }
else else
{ {
for(int i = 0; i < tlist.Size(); i++) for(unsigned int i = 0; i < tlist.Size(); i++)
{ {
FTexture * newtex = FTexture::CreateTexture (firsttx, FTexture::TEX_Any); FTexture * newtex = FTexture::CreateTexture (firsttx, FTexture::TEX_Any);
if (newtex != NULL) if (newtex != NULL)
@ -460,7 +460,7 @@ void FTextureManager::LoadHiresTex()
} }
else else
{ {
for(int i = 0; i < tlist.Size(); i++) for(unsigned int i = 0; i < tlist.Size(); i++)
{ {
FTexture * oldtex = Textures[tlist[i]].Texture; FTexture * oldtex = Textures[tlist[i]].Texture;
int sl; int sl;

View file

@ -44,7 +44,7 @@
#include "gi.h" #include "gi.h"
#include "stats.h" #include "stats.h"
TAutoGrowArray<FRemapTablePtr> translationtables[NUM_TRANSLATION_TABLES]; TAutoGrowArray<FRemapTablePtr, FRemapTable *> translationtables[NUM_TRANSLATION_TABLES];
/****************************************************/ /****************************************************/
/****************************************************/ /****************************************************/
@ -281,7 +281,7 @@ FRemapTable *TranslationToTable(int translation)
{ {
unsigned int type = GetTranslationType(translation); unsigned int type = GetTranslationType(translation);
unsigned int index = GetTranslationIndex(translation); unsigned int index = GetTranslationIndex(translation);
TAutoGrowArray<FRemapTablePtr> *slots; TAutoGrowArray<FRemapTablePtr, FRemapTable *> *slots;
if (type <= 0 || type >= NUM_TRANSLATION_TABLES) if (type <= 0 || type >= NUM_TRANSLATION_TABLES)
{ {

View file

@ -56,7 +56,7 @@ class FRemapTablePtr
public: public:
FRemapTablePtr() throw() : Ptr(0) {} FRemapTablePtr() throw() : Ptr(0) {}
FRemapTablePtr(FRemapTable *p) throw() : Ptr(p) {} FRemapTablePtr(FRemapTable *p) throw() : Ptr(p) {}
FRemapTablePtr(FRemapTablePtr &p) throw() : Ptr(p.Ptr) {} FRemapTablePtr(const FRemapTablePtr &p) throw() : Ptr(p.Ptr) {}
operator FRemapTable *() const throw() { return Ptr; } operator FRemapTable *() const throw() { return Ptr; }
FRemapTablePtr &operator= (FRemapTable *p) throw() { Ptr = p; return *this; } FRemapTablePtr &operator= (FRemapTable *p) throw() { Ptr = p; return *this; }
FRemapTablePtr &operator= (FRemapTablePtr &p) throw() { Ptr = p.Ptr; return *this; } FRemapTablePtr &operator= (FRemapTablePtr &p) throw() { Ptr = p.Ptr; return *this; }
@ -66,7 +66,7 @@ private:
FRemapTable *Ptr; FRemapTable *Ptr;
}; };
extern TAutoGrowArray<FRemapTablePtr> translationtables[NUM_TRANSLATION_TABLES]; extern TAutoGrowArray<FRemapTablePtr, FRemapTable *> translationtables[NUM_TRANSLATION_TABLES];
#define TRANSLATION_SHIFT 16 #define TRANSLATION_SHIFT 16
#define TRANSLATION_MASK ((1<<TRANSLATION_SHIFT)-1) #define TRANSLATION_MASK ((1<<TRANSLATION_SHIFT)-1)
@ -87,8 +87,8 @@ inline int GetTranslationIndex(DWORD trans)
// Retrieve the FRemapTable that an actor's translation value maps to. // Retrieve the FRemapTable that an actor's translation value maps to.
FRemapTable *TranslationToTable(int translation); FRemapTable *TranslationToTable(int translation);
const int MAX_ACS_TRANSLATIONS = 65535; #define MAX_ACS_TRANSLATIONS 65535
const int MAX_DECORATE_TRANSLATIONS = 65535; #define MAX_DECORATE_TRANSLATIONS 65535
// Initialize color translation tables, for player rendering etc. // Initialize color translation tables, for player rendering etc.
void R_InitTranslationTables (void); void R_InitTranslationTables (void);

View file

@ -43,7 +43,9 @@
// TArray ------------------------------------------------------------------- // TArray -------------------------------------------------------------------
template <class T> // T is the type stored in the array.
// TT is the type returned by operator().
template <class T, class TT=T>
class TArray class TArray
{ {
public: public:
@ -107,10 +109,16 @@ public:
Most = 0; Most = 0;
} }
} }
// Return a reference to an element
T &operator[] (unsigned int index) const T &operator[] (unsigned int index) const
{ {
return Array[index]; return Array[index];
} }
// Returns the value of an element
TT operator() (unsigned int index) const
{
return Array[index];
}
unsigned int Push (const T &item) unsigned int Push (const T &item)
{ {
Grow (1); Grow (1);
@ -283,8 +291,8 @@ private:
// It can still be used as a normal TArray if needed. ACS uses this for // It can still be used as a normal TArray if needed. ACS uses this for
// world and global arrays. // world and global arrays.
template <class T> template <class T, class TT=T>
class TAutoGrowArray : public TArray<T> class TAutoGrowArray : public TArray<T, TT>
{ {
public: public:
T GetVal (unsigned int index) T GetVal (unsigned int index)

View file

@ -1584,13 +1584,13 @@ void WI_drawNetgameStats ()
x = NG_STATSX; x = NG_STATSX;
// [RH] Only use one graphic for the face backgrounds // [RH] Only use one graphic for the face backgrounds
screen->DrawTexture (p, x - p->GetWidth(), y, screen->DrawTexture (p, x - p->GetWidth(), y,
DTA_Translation, translationtables[TRANSLATION_Players][i], DTA_Translation, translationtables[TRANSLATION_Players](i),
DTA_Clean, true, DTA_Clean, true,
TAG_DONE); TAG_DONE);
if (i == me) if (i == me)
screen->DrawTexture (star, x - p->GetWidth(), y, screen->DrawTexture (star, x - p->GetWidth(), y,
DTA_Translation, translationtables[TRANSLATION_Players][i], DTA_Translation, translationtables[TRANSLATION_Players](i),
DTA_Clean, true, DTA_Clean, true,
TAG_DONE); TAG_DONE);
@ -1634,13 +1634,13 @@ void WI_drawNetgameStats ()
if (gameinfo.gametype == GAME_Heretic) if (gameinfo.gametype == GAME_Heretic)
{ {
screen->DrawTexture (star, 25, y, screen->DrawTexture (star, 25, y,
DTA_Translation, translationtables[TRANSLATION_Players][i], DTA_Translation, translationtables[TRANSLATION_Players](i),
DTA_Clean, true, DTA_Clean, true,
TAG_DONE); TAG_DONE);
} }
else // Hexen and Strife don't have a face graphic for this. else // Hexen and Strife don't have a face graphic for this.
{ {
char pstr[3]={'P', '1'+i}; char pstr[3]={'P', '1'+i, 0};
screen->SetFont (BigFont); screen->SetFont (BigFont);
screen->DrawText(CR_UNTRANSLATED, 25, y+10, pstr, DTA_Clean, true, TAG_DONE); screen->DrawText(CR_UNTRANSLATED, 25, y+10, pstr, DTA_Clean, true, TAG_DONE);
} }

View file

@ -530,7 +530,7 @@ bool D3DFB::Wiper_Melt::Run(int ticks, D3DFB *fb)
fb->D3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, verts, sizeof(FBVERTEX)); fb->D3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, verts, sizeof(FBVERTEX));
int i, dy; int i, dy;
bool done; bool done = true;
// Copy the old screen in vertical strips on top of the new one. // Copy the old screen in vertical strips on top of the new one.
while (ticks--) while (ticks--)