- Turned on warning level 4 just to see what it would produce: a lot of

warnings. At first, I was going to try and clean them all up. Then I decided
  that was a worthless cause and went about just acting on the ones that
  might actually be helpful:
   C4189 (local variable is initialized but not referenced)
   C4702 (unreachable code)
   C4512 (assignment operator could not be generated)


SVN r420 (trunk)
This commit is contained in:
Randy Heit 2006-12-21 04:34:43 +00:00
parent c8d07f3883
commit e1bd63e876
47 changed files with 127 additions and 124 deletions

View file

@ -1,3 +1,12 @@
December 20, 2006
- Turned on warning level 4 just to see what it would produce: a lot of
warnings. At first, I was going to try and clean them all up. Then I decided
that was a worthless cause and went about just acting on the ones that
might actually be helpful:
C4189 (local variable is initialized but not referenced)
C4702 (unreachable code)
C4512 (assignment operator could not be generated)
December 19, 2006
- Fixed: D3DFB::Reset() also needs to restore the texture border color,
otherwise it gets reset to black and unused.

View file

@ -335,7 +335,6 @@ void DCajunMaster::WhatToGet (AActor *actor, AActor *item)
if (item->IsKindOf (RUNTIME_CLASS(AWeapon)))
{
// FIXME
AWeapon *weapon = static_cast<AWeapon *> (item);
AWeapon *heldWeapon;
heldWeapon = static_cast<AWeapon *> (b->mo->FindInventory (item->GetClass()));

View file

@ -331,6 +331,8 @@ public:
bool operator= (bool boolval)
{ UCVarValue val; val.Bool = boolval; SetGenericRep (val, CVAR_Bool); return boolval; }
bool operator= (FFlagCVar &flag)
{ UCVarValue val; val.Bool = !!flag; SetGenericRep (val, CVAR_Bool); return val.Bool; }
inline operator int () const { return (ValueVar & BitVal); }
inline int operator *() const { return (ValueVar & BitVal); }

View file

@ -76,5 +76,5 @@ BYTE FColorMatcher::Pick (int r, int g, int b)
if (Pal == NULL)
return 1;
return BestColor ((uint32 *)Pal, r, g, b);
return (BYTE)BestColor ((uint32 *)Pal, r, g, b);
}

View file

@ -180,7 +180,7 @@ void D_PickRandomTeam (int player)
static char teamline[8] = "\\team\\X";
BYTE *foo = (BYTE *)teamline;
teamline[6] = D_PickRandomTeam() + '0';
teamline[6] = (char)D_PickRandomTeam() + '0';
D_ReadUserInfoStrings (player, &foo, teamplay);
}
@ -461,9 +461,9 @@ void D_SendServerFlagChange (const FBaseCVar *cvar, int bitnum, bool set)
namelen = (int)strlen (cvar->GetName ());
Net_WriteByte (DEM_SINFCHANGEDXOR);
Net_WriteByte (namelen);
Net_WriteByte ((BYTE)namelen);
Net_WriteBytes ((BYTE *)cvar->GetName (), namelen);
Net_WriteByte (bitnum | (set << 5));
Net_WriteByte (BYTE(bitnum | (set << 5)));
}
void D_DoServerInfoChange (BYTE **stream, bool singlebit)

View file

@ -74,6 +74,8 @@ public:
private:
TWeightedList<FDecalBase *> Choices;
FDecalGroup &operator= (const FDecalGroup &) { return *this; }
};
struct FDecalLib::FTranslation

View file

@ -173,7 +173,7 @@ private: \
// Taking the address of a field in an object at address 1 instead of
// address 0 keeps GCC from complaining about possible misuse of offsetof.
#define DECLARE_POINTER(field) (size_t)&((ThisClass*)1)->field - 1,
#define END_POINTERS ~0 };
#define END_POINTERS ~(size_t)0 };
#if defined(_MSC_VER)
# pragma data_seg(".creg$u")
@ -289,12 +289,12 @@ public:
protected:
// This form of placement new and delete is for use *only* by PClass's
// CreateNew() method. Do not use them for some other purpose.
void *operator new(size_t len, EInPlace *mem)
void *operator new(size_t, EInPlace *mem)
{
return (void *)mem;
}
void operator delete (void *mem, EInPlace *foo)
void operator delete (void *mem, EInPlace *)
{
free (mem);
}

View file

@ -9,7 +9,7 @@ TArray<PClass *> PClass::m_Types;
PClass *PClass::TypeHash[PClass::HASH_SIZE];
// A harmless non_NULL FlatPointer for classes without pointers.
static const size_t TheEnd = ~0;
static const size_t TheEnd = ~0u;
static int STACK_ARGS cregcmp (const void *a, const void *b)
{

View file

@ -783,7 +783,6 @@ void F_DemonScroll ()
{
int yval;
FTexture *final1 = TexMan("FINAL1");
FTexture *final2 = TexMan("FINAL2");
int fwidth = final1->GetWidth();
int fheight = final1->GetHeight();

View file

@ -258,8 +258,8 @@ protected:
void AttachToFile (FFile &file);
private:
FArchive (const FArchive &src) {}
void operator= (const FArchive &src) {}
FArchive (const FArchive &) {}
void operator= (const FArchive &) {}
};
// Create an FPNGChunkFile and FArchive in one step

View file

@ -131,6 +131,8 @@ private:
BYTE InBuff[BUFF_SIZE];
void FillBuffer ();
FileReaderZ &operator= (const FileReaderZ &) { return *this; }
};

View file

@ -133,7 +133,7 @@ FState AHereticImpLeader::States[] =
IMPLEMENT_ACTOR (AHereticImpLeader, Heretic, 5, 7)
PROP_SpawnHealth (80)
PROP_MeleeState (~0)
PROP_MeleeState (PROP_CLEAR_STATE)
PROP_MissileState (S_IMP_MSATK2)
PROP_Flags4Clear(MF4_MISSILEMORE) // The imp leader does have a 'normal' missile range!

View file

@ -132,6 +132,7 @@ END_DEFAULTS
void AHammerMissile::GetExplodeParms (int &damage, int &dist, bool &hurtSource)
{
damage = 128;
dist;
hurtSource = false;
}

View file

@ -43,60 +43,60 @@
#define NUM_WORLDVARS 256
#define NUM_GLOBALVARS 64
#define LEVEL_NOINTERMISSION 0x00000001
#define LEVEL_NOINVENTORYBAR 0x00000002 // This effects Doom only, since it's the only one without a standard inventory bar.
#define LEVEL_DOUBLESKY 0x00000004
#define LEVEL_HASFADETABLE 0x00000008 // Level uses Hexen's fadetable mapinfo to get fog
#define LEVEL_NOINTERMISSION UCONST64(0x00000001)
#define LEVEL_NOINVENTORYBAR UCONST64(0x00000002) // This effects Doom only, since it's the only one without a standard inventory bar.
#define LEVEL_DOUBLESKY UCONST64(0x00000004)
#define LEVEL_HASFADETABLE UCONST64(0x00000008) // Level uses Hexen's fadetable mapinfo to get fog
#define LEVEL_MAP07SPECIAL 0x00000010
#define LEVEL_BRUISERSPECIAL 0x00000020
#define LEVEL_CYBORGSPECIAL 0x00000040
#define LEVEL_SPIDERSPECIAL 0x00000080
#define LEVEL_MAP07SPECIAL UCONST64(0x00000010)
#define LEVEL_BRUISERSPECIAL UCONST64(0x00000020)
#define LEVEL_CYBORGSPECIAL UCONST64(0x00000040)
#define LEVEL_SPIDERSPECIAL UCONST64(0x00000080)
#define LEVEL_SPECLOWERFLOOR 0x00000100
#define LEVEL_SPECOPENDOOR 0x00000200
#define LEVEL_SPECACTIONSMASK 0x00000300
#define LEVEL_SPECLOWERFLOOR UCONST64(0x00000100)
#define LEVEL_SPECOPENDOOR UCONST64(0x00000200)
#define LEVEL_SPECACTIONSMASK UCONST64(0x00000300)
#define LEVEL_MONSTERSTELEFRAG 0x00000400
#define LEVEL_ACTOWNSPECIAL 0x00000800
#define LEVEL_SNDSEQTOTALCTRL 0x00001000
#define LEVEL_FORCENOSKYSTRETCH 0x00002000
#define LEVEL_MONSTERSTELEFRAG UCONST64(0x00000400)
#define LEVEL_ACTOWNSPECIAL UCONST64(0x00000800)
#define LEVEL_SNDSEQTOTALCTRL UCONST64(0x00001000)
#define LEVEL_FORCENOSKYSTRETCH UCONST64(0x00002000)
#define LEVEL_JUMP_NO 0x00004000
#define LEVEL_JUMP_YES 0x00008000
#define LEVEL_FREELOOK_NO 0x00010000
#define LEVEL_FREELOOK_YES 0x00020000
#define LEVEL_JUMP_NO UCONST64(0x00004000)
#define LEVEL_JUMP_YES UCONST64(0x00008000)
#define LEVEL_FREELOOK_NO UCONST64(0x00010000)
#define LEVEL_FREELOOK_YES UCONST64(0x00020000)
// The absence of both of the following bits means that this level does not
// use falling damage (though damage can be forced with dmflags).
#define LEVEL_FALLDMG_ZD 0x00040000 // Level uses ZDoom's falling damage
#define LEVEL_FALLDMG_HX 0x00080000 // Level uses Hexen's falling damage
#define LEVEL_FALLDMG_ZD UCONST64(0x00040000) // Level uses ZDoom's falling damage
#define LEVEL_FALLDMG_HX UCONST64(0x00080000) // Level uses Hexen's falling damage
#define LEVEL_HEADSPECIAL 0x00100000 // Heretic episode 1/4
#define LEVEL_MINOTAURSPECIAL 0x00200000 // Heretic episode 2/5
#define LEVEL_SORCERER2SPECIAL 0x00400000 // Heretic episode 3
#define LEVEL_SPECKILLMONSTERS 0x00800000
#define LEVEL_HEADSPECIAL UCONST64(0x00100000) // Heretic episode 1/4
#define LEVEL_MINOTAURSPECIAL UCONST64(0x00200000) // Heretic episode 2/5
#define LEVEL_SORCERER2SPECIAL UCONST64(0x00400000) // Heretic episode 3
#define LEVEL_SPECKILLMONSTERS UCONST64(0x00800000)
#define LEVEL_STARTLIGHTNING 0x01000000 // Automatically start lightning
#define LEVEL_FILTERSTARTS 0x02000000 // Apply mapthing filtering to player starts
#define LEVEL_LOOKUPLEVELNAME 0x04000000 // Level name is the name of a language string
#define LEVEL_HEXENFORMAT 0x08000000 // Level uses the Hexen map format
#define LEVEL_STARTLIGHTNING UCONST64(0x01000000) // Automatically start lightning
#define LEVEL_FILTERSTARTS UCONST64(0x02000000) // Apply mapthing filtering to player starts
#define LEVEL_LOOKUPLEVELNAME UCONST64(0x04000000) // Level name is the name of a language string
#define LEVEL_HEXENFORMAT UCONST64(0x08000000) // Level uses the Hexen map format
#define LEVEL_SWAPSKIES 0x10000000 // Used by lightning
#define LEVEL_NOALLIES 0x20000000 // i.e. Inside Strife's front base
#define LEVEL_CHANGEMAPCHEAT 0x40000000 // Don't display cluster messages
#define LEVEL_VISITED UCONST64(0x80000000) // Used for intermission map
#define LEVEL_SWAPSKIES UCONST64(0x10000000) // Used by lightning
#define LEVEL_NOALLIES UCONST64(0x20000000) // i.e. Inside Strife's front base
#define LEVEL_CHANGEMAPCHEAT UCONST64(0x40000000) // Don't display cluster messages
#define LEVEL_VISITED UCONST64(0x80000000) // Used for intermission map
#define LEVEL_DEATHSLIDESHOW UCONST64(0x100000000) // Slideshow on death
#define LEVEL_ALLMAP UCONST64(0x200000000) // The player picked up a map on this level
#define LEVEL_DEATHSLIDESHOW UCONST64(0x100000000) // Slideshow on death
#define LEVEL_ALLMAP UCONST64(0x200000000) // The player picked up a map on this level
#define LEVEL_LAXMONSTERACTIVATION UCONST64(0x400000000) // Monsters can open doors depending on the door speed
#define LEVEL_LAXACTIVATIONMAPINFO UCONST64(0x800000000) // LEVEL_LAXMONSTERACTIVATION is not a default.
#define LEVEL_LAXMONSTERACTIVATION UCONST64(0x400000000) // Monsters can open doors depending on the door speed
#define LEVEL_LAXACTIVATIONMAPINFO UCONST64(0x800000000) // LEVEL_LAXMONSTERACTIVATION is not a default.
// some unused bits here!
#define LEVEL_KEEPFULLINVENTORY UCONST64(0x4000000000) // doesn't reduce the amount of inventory items to 1
#define LEVEL_KEEPFULLINVENTORY UCONST64(0x4000000000) // doesn't reduce the amount of inventory items to 1
#define LEVEL_MUSICDEFINED UCONST64(0x8000000000) // a marker to disable the $map command in SNDINFO for this map
#define LEVEL_MUSICDEFINED UCONST64(0x8000000000) // a marker to disable the $map command in SNDINFO for this map
#define LEVEL_MONSTERFALLINGDAMAGE UCONST64(0x10000000000)
#define LEVEL_CLIPMIDTEX UCONST64(0x20000000000)
#define LEVEL_WRAPMIDTEX UCONST64(0x40000000000)

View file

@ -832,7 +832,6 @@ void A_MinotaurLook (AActor *actor)
return;
}
AMinotaurFriend *self = static_cast<AMinotaurFriend *> (actor);
AActor *mo = NULL;
player_t *player;
fixed_t dist;

View file

@ -1695,7 +1695,6 @@ void AHexenArmor::AbsorbDamage (int damage, FName damageType, int &newdamage)
if (damageType != NAME_Water)
{
fixed_t savedPercent = Slots[0] + Slots[1] + Slots[2] + Slots[3] + Slots[4];
APlayerPawn *ppawn = Owner->player != NULL ? Owner->player->mo : NULL;
if (savedPercent)
{ // armor absorbed some damage

View file

@ -200,8 +200,6 @@ void FBaseStatusBar::SetScaled (bool scale)
}
else
{
bool wide = !(CheckRatio (SCREENWIDTH, SCREENHEIGHT) & 3);
int basewidth = wide ? 1280 : 960;
ST_X = 0;
ST_Y = 200 - RelTop;
::ST_Y = Scale (ST_Y, SCREENHEIGHT, 200);

View file

@ -207,7 +207,7 @@ void AProgLevelEnder::Tick ()
PalEntry AProgLevelEnder::GetBlend ()
{
return PalEntry (special1, 0, 0, 0);
return PalEntry ((BYTE)special1, 0, 0, 0);
}
//============================================================================

View file

@ -302,7 +302,7 @@ void A_Beacon (AActor *self)
{
// Rebels are the same color as their owner
rebel->Translation = owner->Translation;
rebel->FriendPlayer = owner->player != NULL ? int(owner->player - players + 1) : 0;
rebel->FriendPlayer = owner->player != NULL ? BYTE(owner->player - players + 1) : 0;
// Set the rebel's target to whatever last hurt the player, so long as it's not
// one of the player's other rebels.
if (owner->target != NULL && !rebel->IsFriend (owner->target))

View file

@ -1394,7 +1394,7 @@ void A_MaulerTorpedoWave (AActor *self)
for (int i = 0; i < 80; ++i)
{
self->angle += ANGLE_45/10;
AActor *wave = P_SpawnSubMissile (self, RUNTIME_CLASS(AMaulerTorpedoWave), self->target);
P_SpawnSubMissile (self, RUNTIME_CLASS(AMaulerTorpedoWave), self->target);
}
self->z = savedz;
}

View file

@ -27,11 +27,11 @@
//
// Globally visible constants.
//
const BYTE HU_FONTSTART = '!'; // the first font characters
const BYTE HU_FONTEND = 'ß'; // the last font characters
#define HU_FONTSTART BYTE('!') // the first font characters
#define HU_FONTEND BYTE('ß') // the last font characters
// Calculate # of glyphs in font.
const int HU_FONTSIZE = HU_FONTEND - HU_FONTSTART + 1;
#define HU_FONTSIZE (HU_FONTEND - HU_FONTSTART + 1)
//
// Chat routines

View file

@ -173,7 +173,7 @@ FArchive &operator<< (FArchive &arc, FState *&state);
#if _MSC_VER
#define _S__SPRITE_(spr) \
{ {{(char)(#@spr>>24),(char)(#@spr>>16),(char)(#@spr>>8),(char)#@spr}}
{ {{(char)(#@spr>>24),(char)((#@spr>>16)&255),(char)((#@spr>>8)&255),(char)(#@spr&255)}}
#else
#define _S__SPRITE_(spr) \
{ {{#spr}}

View file

@ -107,7 +107,7 @@ static void ApplyActorDefault (int defnum, const char *datastr, int dataint)
datasound = S_FindSound (datastr);
}
}
else if (defnum > ADEF_LastString && dataint >= 0 && dataint < 255)
else if (defnum > ADEF_LastString && dataint >= 0 && dataint < PROP_CLEAR_STATE)
{
datastate = DefaultStates (sgClass) + dataint;
}
@ -120,7 +120,6 @@ static void ApplyActorDefault (int defnum, const char *datastr, int dataint)
ABasicArmorPickup *const armorp = (ABasicArmorPickup *)sgDefaults;
APuzzleItem *const puzzl = (APuzzleItem *)sgDefaults;
APowerup *const power = (APowerup *)sgDefaults;
AKey *const key = (AKey *)sgDefaults;
AWeapon *const weapon = (AWeapon *)sgDefaults;
ASigil *const sigil = (ASigil *)sgDefaults;
AAmmo *const ammo = (AAmmo *)sgDefaults;

View file

@ -65,6 +65,8 @@ typedef void (*voidfunc_)();
************** Visual C++ macros ****************
************************************************/
#pragma warning(disable: 4207) // nonstandard extension used : extended initializer form
#pragma data_seg(".areg$u") // ActorInfo initializer list
#pragma data_seg(".greg$u") // AT_GAME_SET list
#pragma data_seg(".sreg$u") // AT_SPEED_SET list
@ -87,7 +89,7 @@ typedef void (*voidfunc_)();
#endif
#define ADD_BYTE_PROP(prop,val) BREAK_WORD(prop|ADEFTYPE_Byte), val,
#define ADD_FIXD_PROP(prop,val) BREAK_WORD(prop|ADEFTYPE_FixedMul), val,
#define ADD_FIXD_PROP(prop,val) BREAK_WORD(prop|ADEFTYPE_FixedMul), (BYTE)(val),
#define ADD_WORD_PROP(prop,val) BREAK_WORD(prop|ADEFTYPE_Word), BREAK_WORD(val),
#define ADD_LONG_PROP(prop,val) BREAK_WORD(prop|ADEFTYPE_Long), BREAK_LONG(val),
#ifdef WORDS_BIGENDIAN
@ -280,6 +282,7 @@ public:
#define PROP_EDeathState(x) ADD_BYTE_PROP(ADEF_EDeathState,x)
#define PROP_RaiseState(x) ADD_BYTE_PROP(ADEF_RaiseState,x)
#define PROP_WoundState(x) ADD_BYTE_PROP(ADEF_WoundState,x)
#define PROP_CLEAR_STATE 255
#define PROP_StrifeType(x) ADD_WORD_PROP(ADEF_StrifeType,x)
#define PROP_StrifeTeaserType(x) ADD_WORD_PROP(ADEF_StrifeTeaserType,x)

View file

@ -138,6 +138,9 @@ struct List
TailPred->Succ = (Node *)&Tail;
return node;
}
private:
List &operator= (const List&) { return *this; }
};
#endif //__LISTS_H__

View file

@ -116,6 +116,8 @@ class FNodeBuilder
assert (y <= MaxY);
return (unsigned(x - MinX) >> BLOCK_SHIFT) + (unsigned(y - MinY) >> BLOCK_SHIFT) * BlocksWide;
}
FVertexMap &operator= (const FVertexMap &) { return *this; }
};
friend class FVertexMap;
@ -233,6 +235,8 @@ private:
double InterceptVector (const node_t &splitter, const FPrivSeg &seg);
void PrintSet (int l, DWORD set);
FNodeBuilder &operator= (const FNodeBuilder &) { return *this; }
};
// Points within this distance of a line will be considered on the line.

View file

@ -604,7 +604,6 @@ FUNC(LS_Generic_Ceiling)
return EV_DoCeiling (type, ln, arg0, SPEED(arg1), SPEED(arg1), arg2*FRACUNIT,
(arg4 & 16) ? 20 : -1, 0, arg4 & 7);
return false;
}
FUNC(LS_Generic_Crusher)

View file

@ -1464,11 +1464,6 @@ void P_VavoomSlope(sector_t * sec, int id, fixed_t x, fixed_t y, fixed_t z, int
srcplane->d = -TMulScale16 (srcplane->a, x,
srcplane->b, y,
srcplane->c, z);
int v=srcplane->ZatPoint(x,y);
int w=srcplane->ZatPoint(l->v1->x,l->v1->y);
int x=srcplane->ZatPoint(l->v2->x,l->v2->y);
return;
}
}

View file

@ -720,7 +720,7 @@ public:
{
totexnum = fromtexnum;
}
Translation[fromtexnum] = totexnum;
Translation[fromtexnum] = WORD(totexnum);
}
}

View file

@ -105,9 +105,9 @@ size_t numskins;
BYTE OtherGameSkinRemap[256];
// [RH] particle globals
int NumParticles;
int ActiveParticles;
int InactiveParticles;
WORD NumParticles;
WORD ActiveParticles;
WORD InactiveParticles;
particle_t *Particles;
CVAR (Bool, r_particles, true, 0);

View file

@ -38,9 +38,9 @@ struct particle_t
WORD snext;
};
extern int NumParticles;
extern int ActiveParticles;
extern int InactiveParticles;
extern WORD NumParticles;
extern WORD ActiveParticles;
extern WORD InactiveParticles;
extern particle_t *Particles;
const WORD NO_PARTICLE = 0xffff;
@ -53,7 +53,7 @@ inline particle_t *NewParticle (void)
result = Particles + InactiveParticles;
InactiveParticles = result->tnext;
result->tnext = ActiveParticles;
ActiveParticles = (int)(result - Particles);
ActiveParticles = WORD(result - Particles);
}
return result;
}

View file

@ -1039,7 +1039,6 @@ int FMODSoundRenderer::PutSampleData (FSOUND_SAMPLE *sample, const BYTE *data, i
return FALSE;
}
}
return TRUE;
}
void FMODSoundRenderer::DoLoad (void **slot, sfxinfo_t *sfx)

View file

@ -46,7 +46,7 @@ bool FAutomapTexture::Check(FileReader & data)
return true;
}
FTexture *FAutomapTexture::Create(FileReader & file, int lumpnum)
FTexture *FAutomapTexture::Create(FileReader &, int lumpnum)
{
return new FAutomapTexture(lumpnum);
}
@ -55,7 +55,7 @@ FAutomapTexture::FAutomapTexture (int lumpnum)
: Pixels(NULL), LumpNum(lumpnum)
{
Width = 320;
Height = Wads.LumpLength(lumpnum) / 320;
Height = WORD(Wads.LumpLength(lumpnum) / 320);
CalcBitSize ();
DummySpan[0].TopOffset = 0;

View file

@ -52,7 +52,6 @@ bool FPatchTexture::Check(FileReader & file)
int height = LittleShort(foo->height);
int width = LittleShort(foo->width);
bool gapAtStart=true;
if (height > 0 && height < 2048 && width > 0 && width <= 2048 && width < file.GetLength()/4)
{

View file

@ -55,7 +55,7 @@ int CleanWidth, CleanHeight;
CVAR (Bool, hud_scale, false, CVAR_ARCHIVE);
void STACK_ARGS DCanvas::DrawTexture (FTexture *img, int x0, int y0, DWORD tags_first, ...)
void STACK_ARGS DCanvas::DrawTexture (FTexture *img, int x0, int y0, int tags_first, ...)
{
FTexture::Span unmaskedSpan[2];
const FTexture::Span **spanptr, *spans;

View file

@ -1469,7 +1469,6 @@ void V_InitCustomFonts()
int lumplist[256];
bool notranslate[256];
char namebuffer[16], templatebuf[16];
int adder=0;
int i;
int llump,lastlump=0;
int format;

View file

@ -67,7 +67,7 @@ class FTexture;
#define TAG_MORE (2) /* Ends this list and continues with the */
/* list pointed to in ti_Data */
#define TAG_USER ((DWORD)(1u<<31))
#define TAG_USER ((DWORD)(1u<<30))
enum
{
@ -169,7 +169,7 @@ public:
virtual void SetFont (FFont *font);
// 2D Texture drawing
void STACK_ARGS DrawTexture (FTexture *img, int x, int y, DWORD tags, ...);
void STACK_ARGS DrawTexture (FTexture *img, int x, int y, int tags, ...);
void FillBorder (FTexture *img); // Fills the border around a 4:3 part of the screen on non-4:3 displays
// 2D Text drawing

View file

@ -72,6 +72,8 @@ class TWeightedList
FRandom &RandomClass;
void RecalcRandomVals ();
TWeightedList &operator= (const TWeightedList &) { return *this; }
};
template<class T>

View file

@ -715,13 +715,10 @@ static void WI_DrawCharPatch (FTexture *patch, int x, int y)
int WI_DrawName(int y,const char * levelname, bool nomove=false)
{
int i,len=0;
int i;
size_t l;
const char * p;
int h=0;
int lastlinelen=0;
int lastindex=0;
int firstindex=0;
int lumph;
lumph=BigFont->GetHeight();

View file

@ -211,7 +211,7 @@ D3DFB::D3DFB (int width, int height, bool fullscreen)
for (i = 0; i < 256; i++)
{
GammaTable[i] = i;
GammaTable[i] = (BYTE)i;
}
memcpy (SourcePalette, GPalette.BaseColors, sizeof(PalEntry)*256);
@ -439,9 +439,9 @@ void D3DFB::DoOffByOneCheck ()
{
for (i = 0; i < 256; ++i)
{
Pal32[i][0] = (i & 0x03) << 6; // blue
Pal32[i][1] = (i & 0x1C) << 3; // green
Pal32[i][2] = (i & 0xE0); // red;
Pal32[i][0] = BYTE(i & 0x03) << 6; // blue
Pal32[i][1] = BYTE(i & 0x1C) << 3; // green
Pal32[i][2] = BYTE(i & 0xE0); // red;
Pal32[i][3] = 255;
}
}
@ -449,9 +449,9 @@ void D3DFB::DoOffByOneCheck ()
{
for (i = 0; i < 256; ++i)
{
Pal16[i] = ((i & 0xE0) << 8) | // red
((i & 0x1C) << 6) | // green
((i & 0x03) << 3); // blue
Pal16[i] = WORD((i & 0xE0) << 8) | // red
((i & 0x1C) << 6) | // green
((i & 0x03) << 3); // blue
}
}
// Upload the palette
@ -469,7 +469,7 @@ void D3DFB::DoOffByOneCheck ()
{
for (i = 0; i < 256; ++i)
{
((BYTE *)lockrect.pBits)[i] = i;
((BYTE *)lockrect.pBits)[i] = (BYTE)i;
}
FBTexture->UnlockRect (0);
}
@ -713,10 +713,6 @@ void D3DFB::Unlock ()
void D3DFB::Update ()
{
bool pchanged = false;
LOG3 ("Update <%d,%c:%d>\n", LockCount, AppActive?'Y':'N', SessionState);
if (LockCount != 1)
{
//I_FatalError ("Framebuffer must have exactly 1 lock to be updated");

View file

@ -160,7 +160,7 @@ DDrawFB::DDrawFB (int width, int height, bool fullscreen)
PalEntries[i].peRed = GPalette.BaseColors[i].r;
PalEntries[i].peGreen = GPalette.BaseColors[i].g;
PalEntries[i].peBlue = GPalette.BaseColors[i].b;
GammaTable[0][i] = GammaTable[1][i] = GammaTable[2][i] = i;
GammaTable[0][i] = GammaTable[1][i] = GammaTable[2][i] = (BYTE)i;
}
memcpy (SourcePalette, GPalette.BaseColors, sizeof(PalEntry)*256);
@ -796,7 +796,7 @@ void DDrawFB::RebuildColorTable ()
}
for (i = 0; i < 256; i++)
{
GPfxPal.Pal8[i] = BestColor ((uint32 *)syspal, PalEntries[i].peRed,
GPfxPal.Pal8[i] = (BYTE)BestColor ((uint32 *)syspal, PalEntries[i].peRed,
PalEntries[i].peGreen, PalEntries[i].peBlue);
}
}
@ -848,6 +848,7 @@ bool DDrawFB::Lock (bool useSimpleCanvas)
else
{
HRESULT hr GCCNOWARN = BlitSurf->Flip (NULL, DDFLIP_WAIT);
hr;
LOG1 ("Blit flip = %08lx\n", hr);
LockSurfRes res = LockSurf (NULL, BlitSurf);

View file

@ -290,6 +290,4 @@ DWORD FHelperThread::ThreadLoop ()
DefaultDispatch ();
}
}
return 0;
}

View file

@ -2983,7 +2983,6 @@ static void SaveReport (HANDLE file)
else
{
DWORD fileLen = GetFileSize (file, NULL), fileLeft;
DWORD bytesCopied = 0;
char xferbuf[1024];
SetFilePointer (file, 0, NULL, FILE_BEGIN);

View file

@ -604,8 +604,6 @@ void RestoreConView()
void ShowErrorPane(const char *text)
{
size_t len = strlen(text);
ErrorPane = CreateDialogParam (g_hInst, MAKEINTRESOURCE(IDD_ERRORPANE), Window, ErrorPaneProc, (LPARAM)text);
if (ErrorPane == NULL)
@ -649,6 +647,7 @@ void DoMain (HINSTANCE hInstance)
int height, width, x, y;
RECT cRect;
TIMECAPS tc;
DEVMODE displaysettings;
try
{
@ -739,7 +738,10 @@ void DoMain (HINSTANCE hInstance)
width = 512;
height = 384;
DEVMODE displaysettings = { sizeof(displaysettings) };
// Many Windows structures that specify their size do so with the first
// element. DEVMODE is not one of those structures.
memset (&displaysettings, 0, sizeof(displaysettings));
displaysettings.dmSize = sizeof(displaysettings);
EnumDisplaySettings (NULL, ENUM_CURRENT_SETTINGS, &displaysettings);
x = (displaysettings.dmPelsWidth - width) / 2;
y = (displaysettings.dmPelsHeight - height) / 2;

View file

@ -391,14 +391,14 @@ namespace StringFormat
{ // Decimal
while (intarg != 0)
{
*--ibuff = (intarg % 10) + '0'; intarg /= 10;
*--ibuff = char(intarg % 10) + '0'; intarg /= 10;
}
}
else if (type == 'o')
{ // Octal
while (intarg != 0)
{
*--ibuff = (intarg & 7) + '0'; intarg >>= 3;
*--ibuff = char(intarg & 7) + '0'; intarg >>= 3;
}
}
else
@ -437,7 +437,7 @@ namespace StringFormat
else if (type == 'c')
{
intarg = va_arg (arglist, int);
buffer[0] = intarg;
buffer[0] = char(intarg);
bufflen = 1;
obuff = buffer;
}
@ -472,11 +472,11 @@ namespace StringFormat
{
if (size == F_HALFHALF)
{
*va_arg (arglist, char *) = inlen;
*va_arg (arglist, char *) = (char)inlen;
}
else if (size == F_HALF)
{
*va_arg (arglist, short *) = inlen;
*va_arg (arglist, short *) = (short)inlen;
}
else if (size == F_LONG)
{
@ -605,6 +605,5 @@ namespace StringFormat
len += outlen;
}
}
return len;
}
};

View file

@ -478,7 +478,7 @@ void FString::ToUpper ()
size_t max = Len();
for (size_t i = 0; i < max; ++i)
{
Chars[i] = toupper(Chars[i]);
Chars[i] = (char)toupper(Chars[i]);
}
UnlockBuffer();
}
@ -489,7 +489,7 @@ void FString::ToLower ()
size_t max = Len();
for (size_t i = 0; i < max; ++i)
{
Chars[i] = tolower(Chars[i]);
Chars[i] = (char)tolower(Chars[i]);
}
UnlockBuffer();
}
@ -502,11 +502,11 @@ void FString::SwapCase ()
{
if (isupper(Chars[i]))
{
Chars[i] = tolower(Chars[i]);
Chars[i] = (char)tolower(Chars[i]);
}
else
{
Chars[i] = toupper(Chars[i]);
Chars[i] = (char)toupper(Chars[i]);
}
}
UnlockBuffer();

View file

@ -50,7 +50,6 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="&quot; /I /fmod/api/inc&quot; &quot; /I /fmod/api/inc&quot; &quot; /I /fmod/api/inc&quot; &quot; /I /fmod/api/inc&quot; "
Optimization="3"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
@ -284,7 +283,6 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="&quot; /I /fmod/api/inc&quot; &quot; /I /fmod/api/inc&quot; &quot; /I /fmod/api/inc&quot; &quot; /I /fmod/api/inc&quot; "
Optimization="0"
AdditionalIncludeDirectories="src\win32;src\sound;src;zlib;src\g_shared;src\g_doom;src\g_raven;src\g_heretic;src\g_hexen;src\g_strife;flac;jpeg-6b"
PreprocessorDefinitions="WIN32,_DEBUG,_WIN32,_WINDOWS,USEASM,_CRTDBG_MAP_ALLOC,HAVE_STRUPR,HAVE_FILELENGTH"
@ -303,6 +301,7 @@
DebugInformationFormat="4"
CompileAs="0"
DisableSpecificWarnings="4996"
ForcedIncludeFiles=""
/>
<Tool
Name="VCManagedResourceCompilerTool"