* Remove several unused parameters
 * Fix several "comparison between signed and unsigned" warnings
 * Move variables into a more local scope where possible
 * Merge the conditions of some nested if-statements
 * Use an enum instead of some "magically defined" macros
 * Remove unused functions tooNearEdge and demoRequestStart
 * Mark function findSomethingInteresting as static
 * Use ARRAY_SIZE(array) instead of sizeof(array) / sizeof(array[0])
 * Get rid of some unnecessary casting from float to int
 * Mark several unused parameters with WZ_DECL_UNUSED for callback functions

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6161 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2008-10-14 22:02:35 +00:00
parent 71ddbdc5e4
commit 0e1438c795
21 changed files with 90 additions and 118 deletions

View File

@ -413,7 +413,7 @@ void displayStructureButton(STRUCTURE *psStructure, Vector3i *Rotation, Vector3i
unsetMatrix(); unsetMatrix();
} }
void displayStructureStatButton(STRUCTURE_STATS *Stats, UDWORD Player, Vector3i *Rotation, Vector3i *Position, BOOL RotXYZ, SDWORD scale) void displayStructureStatButton(STRUCTURE_STATS *Stats, Vector3i *Rotation, Vector3i *Position, BOOL RotXYZ, SDWORD scale)
{ {
iIMDShape *baseImd,*strImd;//*mountImd,*weaponImd; iIMDShape *baseImd,*strImd;//*mountImd,*weaponImd;
iIMDShape *mountImd[STRUCT_MAXWEAPS]; iIMDShape *mountImd[STRUCT_MAXWEAPS];

View File

@ -57,7 +57,7 @@ extern UDWORD getStructureStatHeight(STRUCTURE_STATS *psStat);
extern void displayIMDButton(iIMDShape *IMDShape, Vector3i *Rotation, Vector3i *Position, BOOL RotXYZ, SDWORD scale); extern void displayIMDButton(iIMDShape *IMDShape, Vector3i *Rotation, Vector3i *Position, BOOL RotXYZ, SDWORD scale);
extern void displayStructureButton(STRUCTURE *psStructure, Vector3i *Rotation, Vector3i *Position, BOOL RotXYZ, SDWORD scale); extern void displayStructureButton(STRUCTURE *psStructure, Vector3i *Rotation, Vector3i *Position, BOOL RotXYZ, SDWORD scale);
extern void displayStructureStatButton(STRUCTURE_STATS *Stats,UDWORD Player, Vector3i *Rotation, Vector3i *Position, BOOL RotXYZ, SDWORD scale); extern void displayStructureStatButton(STRUCTURE_STATS *Stats, Vector3i *Rotation, Vector3i *Position, BOOL RotXYZ, SDWORD scale);
extern void displayComponentButton(BASE_STATS *Stat, Vector3i *Rotation, Vector3i *Position, BOOL RotXYZ, SDWORD scale); extern void displayComponentButton(BASE_STATS *Stat, Vector3i *Rotation, Vector3i *Position, BOOL RotXYZ, SDWORD scale);
extern void displayResearchButton(BASE_STATS *Stat, Vector3i *Rotation, Vector3i *Position, BOOL RotXYZ, SDWORD scale); extern void displayResearchButton(BASE_STATS *Stat, Vector3i *Rotation, Vector3i *Position, BOOL RotXYZ, SDWORD scale);
extern void displayComponentButtonTemplate(DROID_TEMPLATE *psTemplate, Vector3i *Rotation, Vector3i *Position, BOOL RotXYZ, SDWORD scale); extern void displayComponentButtonTemplate(DROID_TEMPLATE *psTemplate, Vector3i *Rotation, Vector3i *Position, BOOL RotXYZ, SDWORD scale);

View File

@ -446,13 +446,12 @@ void setConsoleTextColor(SDWORD player)
void displayConsoleMessages( void ) void displayConsoleMessages( void )
{ {
CONSOLE_MESSAGE *psMessage; CONSOLE_MESSAGE *psMessage;
int numProcessed;
int linePitch; int linePitch;
int boxDepth; int boxDepth;
int drop; int drop;
int MesY; int MesY;
int clipDepth; int clipDepth;
int exceed; unsigned int exceed, numProcessed;
/* Are there any to display? */ /* Are there any to display? */
if(consoleMessages == NULL && !bConsoleDropped) if(consoleMessages == NULL && !bConsoleDropped)
@ -467,9 +466,6 @@ void displayConsoleMessages( void )
return; return;
} }
/* Haven't done any yet */
numProcessed = 0;
/* Get the travel to the next line */ /* Get the travel to the next line */
linePitch = iV_GetTextLineSize(); linePitch = iV_GetTextLineSize();
@ -489,13 +485,13 @@ void displayConsoleMessages( void )
/* Do we want a box under it? */ /* Do we want a box under it? */
if(bTextBoxActive) if(bTextBoxActive)
{ {
for(psMessage = consoleMessages,exceed = 0; for (psMessage = consoleMessages, exceed = 0;
psMessage && (numProcessed<consoleVisibleLines) && (exceed < 4); // ho ho ho!!! psMessage && consoleVisibleLines > 0 && exceed < 4; // ho ho ho!!!
psMessage = psMessage->psNext) psMessage = psMessage->psNext)
{ {
if((UDWORD)iV_GetTextWidth(psMessage->text) > mainConsole.width) if (iV_GetTextWidth(psMessage->text) > mainConsole.width)
{ {
exceed++; ++exceed;
} }
} }
@ -503,7 +499,7 @@ void displayConsoleMessages( void )
boxDepth = (numActiveMessages> consoleVisibleLines ? consoleVisibleLines-1 : numActiveMessages-1); boxDepth = (numActiveMessages> consoleVisibleLines ? consoleVisibleLines-1 : numActiveMessages-1);
/* Add on the extra - hope it doesn't exceed two lines! */ /* Add on the extra - hope it doesn't exceed two lines! */
boxDepth+=exceed; boxDepth += exceed;
/* GET RID OF THE MAGIC NUMBERS BELOW */ /* GET RID OF THE MAGIC NUMBERS BELOW */
clipDepth = (mainConsole.topY+(boxDepth*linePitch)+CON_BORDER_HEIGHT+drop); clipDepth = (mainConsole.topY+(boxDepth*linePitch)+CON_BORDER_HEIGHT+drop);
@ -519,9 +515,9 @@ void displayConsoleMessages( void )
/* Stop when we've drawn enough or we're at the end */ /* Stop when we've drawn enough or we're at the end */
MesY = mainConsole.topY + drop; MesY = mainConsole.topY + drop;
for(psMessage = consoleMessages,numProcessed = 0; for (psMessage = consoleMessages, numProcessed = 0;
psMessage && numProcessed<consoleVisibleLines && MesY < (pie_GetVideoBufferHeight()-linePitch); psMessage && numProcessed < consoleVisibleLines && MesY < (pie_GetVideoBufferHeight() - linePitch);
psMessage = psMessage->psNext) psMessage = psMessage->psNext)
{ {
/* Set text color depending on message type */ /* Set text color depending on message type */
@ -532,7 +528,7 @@ void displayConsoleMessages( void )
mainConsole.width, psMessage->JustifyType); mainConsole.width, psMessage->JustifyType);
/* Move on */ /* Move on */
numProcessed++; ++numProcessed;
} }
} }
@ -540,18 +536,16 @@ void displayConsoleMessages( void )
\return The number of messages actually shown */ \return The number of messages actually shown */
int displayOldMessages() int displayOldMessages()
{ {
int thisIndex;
int i; int i;
int count;
BOOL bGotIt; BOOL bGotIt;
BOOL bQuit; BOOL bQuit;
int marker = 0; int marker = 0;
int linePitch; int linePitch;
int MesY; int MesY;
unsigned int count = 0;
/* Check there actually are any messages */ /* Check there actually are any messages */
thisIndex = messageId; int thisIndex = messageId;
count = 0;
if(thisIndex) if(thisIndex)
{ {
@ -560,7 +554,7 @@ int displayOldMessages()
{ {
for(i=0,bGotIt = false; i<MAX_CONSOLE_MESSAGES && !bGotIt; i++) for(i=0,bGotIt = false; i<MAX_CONSOLE_MESSAGES && !bGotIt; i++)
{ {
if(consoleStorage[i].id == thisIndex-1) if (consoleStorage[i].id == thisIndex-1)
{ {
bGotIt = true; bGotIt = true;
marker = i; marker = i;

View File

@ -218,7 +218,7 @@ float droidDamage(DROID *psDroid, UDWORD damage, UDWORD weaponClass, UDWORD weap
// Check that psVictimDroid is not referred to by any other object in the game // Check that psVictimDroid is not referred to by any other object in the game
BOOL droidCheckReferences(DROID *psVictimDroid) BOOL droidCheckReferences(DROID *psVictimDroid)
{ {
int plr, i; int plr;
for (plr = 0; plr < MAX_PLAYERS; plr++) for (plr = 0; plr < MAX_PLAYERS; plr++)
{ {
@ -227,6 +227,8 @@ BOOL droidCheckReferences(DROID *psVictimDroid)
for (psStruct = apsStructLists[plr]; psStruct != NULL; psStruct = psStruct->psNext) for (psStruct = apsStructLists[plr]; psStruct != NULL; psStruct = psStruct->psNext)
{ {
unsigned int i;
for (i = 0; i < psStruct->numWeaps; i++) for (i = 0; i < psStruct->numWeaps; i++)
{ {
if ((DROID *)psStruct->psTarget[i] == psVictimDroid) if ((DROID *)psStruct->psTarget[i] == psVictimDroid)
@ -243,6 +245,8 @@ BOOL droidCheckReferences(DROID *psVictimDroid)
} }
for (psDroid = apsDroidLists[plr]; psDroid != NULL; psDroid = psDroid->psNext) for (psDroid = apsDroidLists[plr]; psDroid != NULL; psDroid = psDroid->psNext)
{ {
unsigned int i;
if ((DROID *)psDroid->psTarget == psVictimDroid && psVictimDroid != psDroid) if ((DROID *)psDroid->psTarget == psVictimDroid && psVictimDroid != psDroid)
{ {
#ifndef DEBUG #ifndef DEBUG
@ -2821,7 +2825,8 @@ UDWORD calcDroidPower(DROID *psDroid)
UDWORD calcDroidPoints(DROID *psDroid) UDWORD calcDroidPoints(DROID *psDroid)
{ {
int points, i; unsigned int i;
int points;
points = getBodyStats(psDroid)->buildPoints; points = getBodyStats(psDroid)->buildPoints;
points += getBrainStats(psDroid)->buildPoints; points += getBrainStats(psDroid)->buildPoints;
@ -3758,19 +3763,18 @@ void droidSetName(DROID *psDroid,const char *pName)
// returns true when no droid on x,y square. // returns true when no droid on x,y square.
BOOL noDroid(UDWORD x, UDWORD y) BOOL noDroid(UDWORD x, UDWORD y)
{ {
UDWORD i; unsigned int i;
DROID *pD;
// check each droid list // check each droid list
for(i=0;i<MAX_PLAYERS;i++) for (i = 0; i < MAX_PLAYERS; ++i)
{ {
for(pD = apsDroidLists[i]; pD ; pD= pD->psNext) const DROID* psDroid;
for (psDroid = apsDroidLists[i]; psDroid; psDroid = psDroid->psNext)
{ {
if (map_coord(pD->pos.x) == x) if (map_coord(psDroid->pos.x) == x
&& map_coord(psDroid->pos.y) == y)
{ {
if (map_coord(pD->pos.y) == y)
{
return false; return false;
}
} }
} }
} }
@ -3789,19 +3793,15 @@ static BOOL oneDroid(UDWORD x, UDWORD y)
{ {
for(pD = apsDroidLists[i]; pD ; pD= pD->psNext) for(pD = apsDroidLists[i]; pD ; pD= pD->psNext)
{ {
if (map_coord(pD->pos.x) == x) if (map_coord(pD->pos.x) == x
&& map_coord(pD->pos.y) == y)
{ {
if (map_coord(pD->pos.y) == y) if (bFound)
{ {
if (bFound) return false;
{
return false;
}
else
{
bFound = true;//first droid on this square so continue
}
} }
bFound = true;//first droid on this square so continue
} }
} }
} }

View File

@ -49,14 +49,11 @@
#define DROID_MOVE_INTERVAL (GAME_TICKS_PER_SEC/4) #define DROID_MOVE_INTERVAL (GAME_TICKS_PER_SEC/4)
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
BOOL tooNearEdge ( UDWORD x, UDWORD y );
BOOL demoGetStatus ( void ); BOOL demoGetStatus ( void );
void initDemoCamera ( void ); void initDemoCamera ( void );
void demoRequestStart ( void );
void processDemoCam ( void ); void processDemoCam ( void );
void toggleDemoStatus ( void ); void toggleDemoStatus ( void );
BOOL getDemoStatus ( void ); static void findSomethingInteresting(void);
void findSomethingInteresting( void );
void setFindNewTarget ( void ); void setFindNewTarget ( void );
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
@ -84,14 +81,6 @@ void initDemoCamera( void )
lastHeight = 0; lastHeight = 0;
} }
// -------------------------------------------------------------------------
/* Tells the camera demo stuff to start... */
void demoRequestStart( void )
{
lastCameraMove = 0;
presentStatus = DC_ISACTIVE;
}
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
/* Updates the camera's point of interest if it's time to */ /* Updates the camera's point of interest if it's time to */
void processDemoCam( void ) void processDemoCam( void )
@ -216,15 +205,19 @@ BOOL demoGetStatus( void )
/* Attempts to find a new location for the tracking camera to go to, or /* Attempts to find a new location for the tracking camera to go to, or
a new object (target) for it to track. a new object (target) for it to track.
*/ */
#define NUM_CHOICES 2
#define DROID_SEEK 0
#define TAR_SEEK 1
#define OVERRIDE_SEEK 99
void findSomethingInteresting()
void findSomethingInteresting( void )
{ {
UDWORD type; enum
{
SEEK_DROID,
SEEK_TARGET,
SEEK_LAST,
SEEK_OVERRIDE,
} type;
UDWORD player,otherPlayer; UDWORD player,otherPlayer;
BOOL gotNewTarget; BOOL gotNewTarget;
DROID *psDroid; DROID *psDroid;
@ -272,19 +265,19 @@ PROPULSION_STATS *psPropStats;
if(bSeekOnlyLocations) if(bSeekOnlyLocations)
{ {
/* Then force the switch outcome - hacky I know, but same as if else in code */ /* Then force the switch outcome - hacky I know, but same as if else in code */
type = OVERRIDE_SEEK; type = SEEK_OVERRIDE;
} }
else else
{ {
/* We're off hunting droids */ /* We're off hunting droids */
type = rand()%NUM_CHOICES; type = rand() % SEEK_LAST;
} }
/* Check which */ /* Check which */
switch(type) switch (type)
{ {
/* Go after a droid, or a droid location */ /* Go after a droid, or a droid location */
case DROID_SEEK: case SEEK_DROID:
case TAR_SEEK: case SEEK_TARGET:
/* Choose a player at random */ /* Choose a player at random */
player = rand()%MAX_PLAYERS; player = rand()%MAX_PLAYERS;
@ -349,7 +342,7 @@ PROPULSION_STATS *psPropStats;
} }
break; break;
/* Go to a new location cos there's no droids left in the world....ahhhhhhh*/ /* Go to a new location cos there's no droids left in the world....ahhhhhhh*/
case OVERRIDE_SEEK: case SEEK_OVERRIDE:
requestRadarTrack((16 + rand()%(mapWidth-31))*TILE_UNITS, (16 + rand()%(mapHeight-31)) * TILE_UNITS ); requestRadarTrack((16 + rand()%(mapWidth-31))*TILE_UNITS, (16 + rand()%(mapHeight-31)) * TILE_UNITS );
gotNewTarget = true; gotNewTarget = true;
break; break;
@ -385,20 +378,3 @@ UDWORD droidIndex;
return(NULL); return(NULL);
} }
} }
// -------------------------------------------------------------------------
/* Hack! */
BOOL tooNearEdge( UDWORD x, UDWORD y )
{
if( (x > ((visibleTiles.x/2) * TILE_UNITS)) &&
(x < ((mapWidth-(visibleTiles.x/2)) * TILE_UNITS)) &&
(y > ((visibleTiles.y/2) * TILE_UNITS)) &&
(y < ((mapHeight-(visibleTiles.y/2)) * TILE_UNITS)) )
{
return(false);
}
else
{
return(true);
}
}

View File

@ -22,7 +22,6 @@
#define __INCLUDED_SRC_E3DEMO_H__ #define __INCLUDED_SRC_E3DEMO_H__
extern void initDemoCamera ( void ); extern void initDemoCamera ( void );
extern void demoRequestStart ( void );
extern void processDemoCam ( void ); extern void processDemoCam ( void );
extern void toggleDemoStatus ( void ); extern void toggleDemoStatus ( void );
extern BOOL demoGetStatus ( void ); extern BOOL demoGetStatus ( void );

View File

@ -103,9 +103,9 @@ void featureInitVars(void)
static void featureType(FEATURE_STATS* psFeature, const char *pType) static void featureType(FEATURE_STATS* psFeature, const char *pType)
{ {
int i; unsigned int i;
for (i = 0; i < sizeof(map) / sizeof(map[0]); i++) for (i = 0; i < ARRAY_SIZE(map); i++)
{ {
if (strcmp(pType, map[i].typeStr) == 0) if (strcmp(pType, map[i].typeStr) == 0)
{ {

View File

@ -253,7 +253,10 @@ BOOL fpathBlockingTile(SDWORD x, SDWORD y, PROPULSION_TYPE propulsion)
MAPTILE *psTile; MAPTILE *psTile;
/* All tiles outside of the map and on map border are blocking. */ /* All tiles outside of the map and on map border are blocking. */
if (x < 1 || y < 1 || x >= mapWidth - 1 || y >= mapHeight - 1) if (x < 1
|| y < 1
|| x > mapWidth
|| y > mapHeight)
{ {
return true; return true;
} }

View File

@ -832,15 +832,15 @@ BOOL startGameOptions3Menu(void)
// 2d audio // 2d audio
addTextButton(FRONTEND_FX, FRONTEND_POS2X-25,FRONTEND_POS2Y, _("Voice Volume"),true,false); addTextButton(FRONTEND_FX, FRONTEND_POS2X-25,FRONTEND_POS2Y, _("Voice Volume"),true,false);
addFESlider(FRONTEND_FX_SL, FRONTEND_BOTFORM, FRONTEND_POS2M, FRONTEND_POS2Y+5, AUDIO_VOL_MAX, (int)(sound_GetUIVolume() * 100.0), FRONTEND_FX ); addFESlider(FRONTEND_FX_SL, FRONTEND_BOTFORM, FRONTEND_POS2M, FRONTEND_POS2Y+5, AUDIO_VOL_MAX, sound_GetUIVolume() * 100.0);
// 3d audio // 3d audio
addTextButton(FRONTEND_3D_FX, FRONTEND_POS3X-25,FRONTEND_POS3Y, _("FX Volume"),true,false); addTextButton(FRONTEND_3D_FX, FRONTEND_POS3X-25,FRONTEND_POS3Y, _("FX Volume"),true,false);
addFESlider(FRONTEND_3D_FX_SL, FRONTEND_BOTFORM, FRONTEND_POS3M, FRONTEND_POS3Y+5, AUDIO_VOL_MAX, (int)(sound_GetEffectsVolume() * 100.0), FRONTEND_3D_FX ); addFESlider(FRONTEND_3D_FX_SL, FRONTEND_BOTFORM, FRONTEND_POS3M, FRONTEND_POS3Y+5, AUDIO_VOL_MAX, sound_GetEffectsVolume() * 100.0);
// cd audio // cd audio
addTextButton(FRONTEND_MUSIC, FRONTEND_POS4X-25,FRONTEND_POS4Y, _("Music Volume"),true,false); addTextButton(FRONTEND_MUSIC, FRONTEND_POS4X-25,FRONTEND_POS4Y, _("Music Volume"),true,false);
addFESlider(FRONTEND_MUSIC_SL, FRONTEND_BOTFORM, FRONTEND_POS4M, FRONTEND_POS4Y+5, AUDIO_VOL_MAX, (int)(sound_GetMusicVolume() * 100.0), FRONTEND_MUSIC ); addFESlider(FRONTEND_MUSIC_SL, FRONTEND_BOTFORM, FRONTEND_POS4M, FRONTEND_POS4Y+5, AUDIO_VOL_MAX, sound_GetMusicVolume() * 100.0);
// quit. // quit.
addMultiBut(psWScreen, FRONTEND_BOTFORM, FRONTEND_QUIT, 10, 10, 30, 29, P_("menu", "Return"), IMAGE_RETURN, IMAGE_RETURN_HI, IMAGE_RETURN_HI); addMultiBut(psWScreen, FRONTEND_BOTFORM, FRONTEND_QUIT, 10, 10, 30, 29, P_("menu", "Return"), IMAGE_RETURN, IMAGE_RETURN_HI, IMAGE_RETURN_HI);
@ -1217,7 +1217,7 @@ BOOL startGameOptionsMenu(void)
// Scroll speed // Scroll speed
addTextButton(FRONTEND_SCROLLSPEED, FRONTEND_POS3X-25, FRONTEND_POS3Y, _("Scroll Speed"), true, false); addTextButton(FRONTEND_SCROLLSPEED, FRONTEND_POS3X-25, FRONTEND_POS3Y, _("Scroll Speed"), true, false);
addFESlider(FRONTEND_SCROLLSPEED_SL, FRONTEND_BOTFORM, FRONTEND_POS3M, FRONTEND_POS3Y+5, 16, scroll_speed_accel / 100, FRONTEND_SCROLLSPEED); addFESlider(FRONTEND_SCROLLSPEED_SL, FRONTEND_BOTFORM, FRONTEND_POS3M, FRONTEND_POS3Y+5, 16, scroll_speed_accel / 100);
// Colour stuff // Colour stuff
w = iV_GetImageWidth(FrontImages, IMAGE_PLAYER0); w = iV_GetImageWidth(FrontImages, IMAGE_PLAYER0);
@ -1516,7 +1516,7 @@ void addTextButton(UDWORD id, UDWORD PosX, UDWORD PosY, const char *txt,BOOL bA
} }
// //////////////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////////////////
void addFESlider(UDWORD id, UDWORD parent, UDWORD x,UDWORD y,UDWORD stops,UDWORD pos,UDWORD attachID ) void addFESlider(UDWORD id, UDWORD parent, UDWORD x, UDWORD y, UDWORD stops, UDWORD pos)
{ {
W_SLDINIT sSldInit; W_SLDINIT sSldInit;

View File

@ -79,7 +79,7 @@ extern void addBottomForm (void);
extern void addBackdrop (void); extern void addBackdrop (void);
extern void addTextButton (UDWORD id, UDWORD PosX, UDWORD PosY, const char *txt,BOOL bAlignLeft,BOOL bGrey); extern void addTextButton (UDWORD id, UDWORD PosX, UDWORD PosY, const char *txt,BOOL bAlignLeft,BOOL bGrey);
extern void addSideText (UDWORD id, UDWORD PosX, UDWORD PosY, const char *txt); extern void addSideText (UDWORD id, UDWORD PosX, UDWORD PosY, const char *txt);
extern void addFESlider (UDWORD id, UDWORD parent, UDWORD x,UDWORD y,UDWORD stops,UDWORD pos,UDWORD attachID ); extern void addFESlider (UDWORD id, UDWORD parent, UDWORD x, UDWORD y, UDWORD stops, UDWORD pos);
extern void displayLogo (WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *pColours); extern void displayLogo (WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *pColours);
extern void displayTextOption (WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *pColours); extern void displayTextOption (WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *pColours);

View File

@ -448,7 +448,7 @@ static BOOL intAddCommand(DROID *psSelected);
/* Start looking for a structure location */ /* Start looking for a structure location */
static void intStartStructPosition(BASE_STATS *psStats,DROID *psDroid); static void intStartStructPosition(BASE_STATS *psStats);
/* Stop looking for a structure location */ /* Stop looking for a structure location */
static void intStopStructPosition(void); static void intStopStructPosition(void);
@ -1496,7 +1496,7 @@ static void intProcessEditStats(UDWORD id)
return; return;
} }
} }
intStartStructPosition(psPositionStats, NULL); intStartStructPosition(psPositionStats);
editPosMode = IED_POS; editPosMode = IED_POS;
} }
else if (id == IDSTAT_CLOSE) else if (id == IDSTAT_CLOSE)
@ -3230,8 +3230,7 @@ void intCommanderSelected(DROID *psDroid)
extern void FinishStructurePosition(UDWORD xPos,UDWORD yPos,void *UserData); extern void FinishStructurePosition(UDWORD xPos,UDWORD yPos,void *UserData);
/* Start looking for a structure location */ /* Start looking for a structure location */
//static void intStartStructPosition(UDWORD width, UDWORD height) static void intStartStructPosition(BASE_STATS *psStats)
static void intStartStructPosition(BASE_STATS *psStats,DROID *psDroid)
{ {
init3DBuilding(psStats,NULL,NULL); init3DBuilding(psStats,NULL,NULL);
@ -6157,7 +6156,7 @@ static BOOL setConstructionStats(BASE_OBJECT *psObj, BASE_STATS *psStats)
{ {
objMode = IOBJ_BUILDSEL; objMode = IOBJ_BUILDSEL;
intStartStructPosition(psStats,psDroid); intStartStructPosition(psStats);
//set the droids current program //set the droids current program
/*for (i=0; i < psDroid->numProgs; i++) /*for (i=0; i < psDroid->numProgs; i++)

View File

@ -154,17 +154,17 @@ static BOOL addSlideOptions(void)
// fx vol // fx vol
addIGTextButton(INTINGAMEOP_FXVOL, INTINGAMEOP_1_Y, _("Voice Volume"), WBUT_PLAIN); addIGTextButton(INTINGAMEOP_FXVOL, INTINGAMEOP_1_Y, _("Voice Volume"), WBUT_PLAIN);
addFESlider(INTINGAMEOP_FXVOL_S, INTINGAMEOP, INTINGAMEOP_MID, INTINGAMEOP_1_Y-5, addFESlider(INTINGAMEOP_FXVOL_S, INTINGAMEOP, INTINGAMEOP_MID, INTINGAMEOP_1_Y-5,
AUDIO_VOL_MAX, (int)(sound_GetUIVolume() * 100.0), INTINGAMEOP_FXVOL); AUDIO_VOL_MAX, (int)(sound_GetUIVolume() * 100.0));
// fx vol // fx vol
addIGTextButton(INTINGAMEOP_3DFXVOL, INTINGAMEOP_2_Y, _("FX Volume"), WBUT_PLAIN); addIGTextButton(INTINGAMEOP_3DFXVOL, INTINGAMEOP_2_Y, _("FX Volume"), WBUT_PLAIN);
addFESlider(INTINGAMEOP_3DFXVOL_S, INTINGAMEOP, INTINGAMEOP_MID, INTINGAMEOP_2_Y-5, addFESlider(INTINGAMEOP_3DFXVOL_S, INTINGAMEOP, INTINGAMEOP_MID, INTINGAMEOP_2_Y-5,
AUDIO_VOL_MAX, (int)(sound_GetEffectsVolume() * 100.0), INTINGAMEOP_3DFXVOL); AUDIO_VOL_MAX, (int)(sound_GetEffectsVolume() * 100.0));
// cd vol // cd vol
addIGTextButton(INTINGAMEOP_CDVOL, INTINGAMEOP_3_Y, _("Music Volume"), WBUT_PLAIN); addIGTextButton(INTINGAMEOP_CDVOL, INTINGAMEOP_3_Y, _("Music Volume"), WBUT_PLAIN);
addFESlider(INTINGAMEOP_CDVOL_S, INTINGAMEOP, INTINGAMEOP_MID, INTINGAMEOP_3_Y-5, addFESlider(INTINGAMEOP_CDVOL_S, INTINGAMEOP, INTINGAMEOP_MID, INTINGAMEOP_3_Y-5,
AUDIO_VOL_MAX, (int)(sound_GetMusicVolume() * 100), INTINGAMEOP_CDVOL); AUDIO_VOL_MAX, (int)(sound_GetMusicVolume() * 100));
return true; return true;
} }

View File

@ -2476,7 +2476,7 @@ void CreateIMDButton(IMAGEFILE *ImageFile, UWORD ImageID, void *Object, UDWORD P
} else if(IMDType == IMDTYPE_STRUCTURE) { } else if(IMDType == IMDTYPE_STRUCTURE) {
displayStructureButton((STRUCTURE*)Object,&Rotation,&Position,true, scale); displayStructureButton((STRUCTURE*)Object,&Rotation,&Position,true, scale);
} else if(IMDType == IMDTYPE_STRUCTURESTAT) { } else if(IMDType == IMDTYPE_STRUCTURESTAT) {
displayStructureStatButton((STRUCTURE_STATS*)Object,Player,&Rotation,&Position,true, scale); displayStructureStatButton((STRUCTURE_STATS*)Object, &Rotation, &Position, true, scale);
} else { } else {
displayIMDButton((iIMDShape*)Object,&Rotation,&Position,true, scale); displayIMDButton((iIMDShape*)Object,&Rotation,&Position,true, scale);
} }

View File

@ -1291,7 +1291,7 @@ void intDisplayPIEView(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, WZ_DECL
#ifndef NO_VIDEO #ifndef NO_VIDEO
/* displays the FLIC view for the current message */ /* displays the FLIC view for the current message */
void intDisplayFLICView(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *pColours) void intDisplayFLICView(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, WZ_DECL_UNUSED PIELIGHT *pColours)
{ {
W_TABFORM *Form = (W_TABFORM*)psWidget; W_TABFORM *Form = (W_TABFORM*)psWidget;

View File

@ -1700,7 +1700,6 @@ void kf_SendTextMessage(void)
{ {
char ch; char ch;
char tmp[MAX_CONSOLE_STRING_LENGTH + 100]; char tmp[MAX_CONSOLE_STRING_LENGTH + 100];
SDWORD i;
if(bAllowOtherKeyPresses) // just starting. if(bAllowOtherKeyPresses) // just starting.
{ {
@ -1752,6 +1751,8 @@ void kf_SendTextMessage(void)
} }
else else
{ {
unsigned int i;
//show the message we sent on our local console as well (even in skirmish, to see console commands) //show the message we sent on our local console as well (even in skirmish, to see console commands)
sstrcpy(tmp, getPlayerName(selectedPlayer)); sstrcpy(tmp, getPlayerName(selectedPlayer));
sstrcat(tmp, " : "); // seperator sstrcat(tmp, " : "); // seperator
@ -1759,9 +1760,10 @@ void kf_SendTextMessage(void)
addConsoleMessage(tmp,DEFAULT_JUSTIFY, selectedPlayer); addConsoleMessage(tmp,DEFAULT_JUSTIFY, selectedPlayer);
//in skirmish send directly to AIs, for command and chat procesing //in skirmish send directly to AIs, for command and chat procesing
for(i=0; i<game.maxPlayers; i++) //don't use MAX_PLAYERS here, although possible for (i = 0; i < game.maxPlayers; ++i) //don't use MAX_PLAYERS here, although possible
{ {
if(openchannels[i] && i != selectedPlayer) if (openchannels[i]
&& i != selectedPlayer)
{ {
sendAIMessage(sTextToSend, selectedPlayer, i); sendAIMessage(sTextToSend, selectedPlayer, i);
} }

View File

@ -84,7 +84,7 @@ static KEY_MAPPING *selectedKeyMap;
BOOL runKeyMapEditor (void); BOOL runKeyMapEditor (void);
static BOOL keyMapToString (char *pStr, KEY_MAPPING *psMapping); static BOOL keyMapToString (char *pStr, KEY_MAPPING *psMapping);
void displayKeyMap (WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *pColours); static void displayKeyMap(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *pColours);
BOOL startKeyMapEditor (BOOL first); BOOL startKeyMapEditor (BOOL first);
BOOL saveKeyMap (void); BOOL saveKeyMap (void);
BOOL loadKeyMap (void); BOOL loadKeyMap (void);
@ -308,7 +308,7 @@ static BOOL keyMapToString(char *pStr, KEY_MAPPING *psMapping)
// //////////////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////////////////
// display a keymap on the interface. // display a keymap on the interface.
void displayKeyMap(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *pColours) void displayKeyMap(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, WZ_DECL_UNUSED PIELIGHT *pColours)
{ {
UDWORD x = xOffset+psWidget->x; UDWORD x = xOffset+psWidget->x;
UDWORD y = yOffset+psWidget->y; UDWORD y = yOffset+psWidget->y;

View File

@ -650,7 +650,7 @@ void removeWildcards(char *pStr)
// //////////////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////////////////
// DISPLAY FUNCTIONS // DISPLAY FUNCTIONS
static void displayLoadBanner(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *pColours) static void displayLoadBanner(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, WZ_DECL_UNUSED PIELIGHT *pColours)
{ {
PIELIGHT col; PIELIGHT col;
UDWORD x = xOffset+psWidget->x; UDWORD x = xOffset+psWidget->x;
@ -670,7 +670,7 @@ static void displayLoadBanner(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset,
} }
// //////////////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////////////////
static void displayLoadSlot(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *pColours) static void displayLoadSlot(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, WZ_DECL_UNUSED PIELIGHT *pColours)
{ {
UDWORD x = xOffset+psWidget->x; UDWORD x = xOffset+psWidget->x;
@ -697,7 +697,7 @@ static void displayLoadSlot(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PI
} }
// //////////////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////////////////
static void displayLoadSaveEdit(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *pColours) static void displayLoadSaveEdit(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, WZ_DECL_UNUSED PIELIGHT *pColours)
{ {
UDWORD x = xOffset+psWidget->x; UDWORD x = xOffset+psWidget->x;
UDWORD y = yOffset+psWidget->y; UDWORD y = yOffset+psWidget->y;

View File

@ -171,8 +171,7 @@ void renderResearchToBuffer(RESEARCH *psResearch,
} else if(IMDType == IMDTYPE_RESEARCH) { } else if(IMDType == IMDTYPE_RESEARCH) {
displayResearchButton(psResGraphic,&Rotation,&Position,true, scale); displayResearchButton(psResGraphic,&Rotation,&Position,true, scale);
} else if(IMDType == IMDTYPE_STRUCTURESTAT) { } else if(IMDType == IMDTYPE_STRUCTURESTAT) {
displayStructureStatButton((STRUCTURE_STATS *)psResGraphic,selectedPlayer,&Rotation, displayStructureStatButton((STRUCTURE_STATS *)psResGraphic, &Rotation, &Position, true, scale);
&Position,true, scale);
} else { } else {
ASSERT( false, "renderResearchToBuffer: Unknown PIEType" ); ASSERT( false, "renderResearchToBuffer: Unknown PIEType" );
} }

View File

@ -594,7 +594,7 @@ static BOOL gridIntersect(const int x1, const int y1, const int x2, const int y2
} }
// Get the range of effect of an object // Get the range of effect of an object
static int gridObjRange(const BASE_OBJECT* psObj) static int gridObjRange(WZ_DECL_UNUSED const BASE_OBJECT* psObj)
{ {
#if 0 #if 0
SDWORD range; SDWORD range;

View File

@ -1521,7 +1521,7 @@ UDWORD addPlayerBox(BOOL players)
sFormInit.UserData = i; sFormInit.UserData = i;
widgAddForm(psWScreen, &sFormInit); widgAddForm(psWScreen, &sFormInit);
addFESlider(MULTIOP_SKSLIDE+i,sFormInit.id, 43,9, DIFF_SLIDER_STOPS, addFESlider(MULTIOP_SKSLIDE+i,sFormInit.id, 43,9, DIFF_SLIDER_STOPS,
(game.skDiff[i] <= DIFF_SLIDER_STOPS ? game.skDiff[i] : DIFF_SLIDER_STOPS / 2), 0); //set to 50% (value of UBYTE_MAX == human player) (game.skDiff[i] <= DIFF_SLIDER_STOPS ? game.skDiff[i] : DIFF_SLIDER_STOPS / 2)); //set to 50% (value of UBYTE_MAX == human player)
} }
} }
} }

View File

@ -218,7 +218,7 @@ BOOL startLimitScreen(void)
addFESlider(sButInit.id,sButInit.id-1, 290,11, addFESlider(sButInit.id,sButInit.id-1, 290,11,
asStructLimits[0][i].globalLimit, asStructLimits[0][i].globalLimit,
asStructLimits[0][i].limit, 0); asStructLimits[0][i].limit);
sButInit.id ++; sButInit.id ++;
if (sButInit.y + BARHEIGHT + 2 > (BUTPERFORM*(BARHEIGHT+2) - 4) ) if (sButInit.y + BARHEIGHT + 2 > (BUTPERFORM*(BARHEIGHT+2) - 4) )
@ -410,7 +410,7 @@ static void displayStructureBar(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset
} }
pie_SetDepthBufferStatus(DEPTH_CMP_LEQ_WRT_ON); pie_SetDepthBufferStatus(DEPTH_CMP_LEQ_WRT_ON);
displayStructureStatButton(stat ,0, &Rotation,&Position,true, scale); displayStructureStatButton(stat, &Rotation, &Position, true, scale);
pie_SetDepthBufferStatus(DEPTH_CMP_ALWAYS_WRT_ON); pie_SetDepthBufferStatus(DEPTH_CMP_ALWAYS_WRT_ON);
// draw name // draw name