diff --git a/src/component.c b/src/component.c index 3d945b4e1..6d7b15d4f 100644 --- a/src/component.c +++ b/src/component.c @@ -413,7 +413,7 @@ void displayStructureButton(STRUCTURE *psStructure, Vector3i *Rotation, Vector3i 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 *mountImd[STRUCT_MAXWEAPS]; diff --git a/src/component.h b/src/component.h index e6fa02e7a..697597b8a 100644 --- a/src/component.h +++ b/src/component.h @@ -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 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 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); diff --git a/src/console.c b/src/console.c index a23558025..96677d526 100644 --- a/src/console.c +++ b/src/console.c @@ -446,13 +446,12 @@ void setConsoleTextColor(SDWORD player) void displayConsoleMessages( void ) { CONSOLE_MESSAGE *psMessage; - int numProcessed; int linePitch; int boxDepth; int drop; int MesY; int clipDepth; - int exceed; + unsigned int exceed, numProcessed; /* Are there any to display? */ if(consoleMessages == NULL && !bConsoleDropped) @@ -467,9 +466,6 @@ void displayConsoleMessages( void ) return; } - /* Haven't done any yet */ - numProcessed = 0; - /* Get the travel to the next line */ linePitch = iV_GetTextLineSize(); @@ -489,13 +485,13 @@ void displayConsoleMessages( void ) /* Do we want a box under it? */ if(bTextBoxActive) { - for(psMessage = consoleMessages,exceed = 0; - psMessage && (numProcessedpsNext) + for (psMessage = consoleMessages, exceed = 0; + psMessage && consoleVisibleLines > 0 && exceed < 4; // ho ho ho!!! + 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); /* Add on the extra - hope it doesn't exceed two lines! */ - boxDepth+=exceed; + boxDepth += exceed; /* GET RID OF THE MAGIC NUMBERS BELOW */ 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 */ MesY = mainConsole.topY + drop; - for(psMessage = consoleMessages,numProcessed = 0; - psMessage && numProcessedpsNext) + for (psMessage = consoleMessages, numProcessed = 0; + psMessage && numProcessed < consoleVisibleLines && MesY < (pie_GetVideoBufferHeight() - linePitch); + psMessage = psMessage->psNext) { /* Set text color depending on message type */ @@ -532,7 +528,7 @@ void displayConsoleMessages( void ) mainConsole.width, psMessage->JustifyType); /* Move on */ - numProcessed++; + ++numProcessed; } } @@ -540,18 +536,16 @@ void displayConsoleMessages( void ) \return The number of messages actually shown */ int displayOldMessages() { - int thisIndex; int i; - int count; BOOL bGotIt; BOOL bQuit; int marker = 0; int linePitch; int MesY; + unsigned int count = 0; /* Check there actually are any messages */ - thisIndex = messageId; - count = 0; + int thisIndex = messageId; if(thisIndex) { @@ -560,7 +554,7 @@ int displayOldMessages() { for(i=0,bGotIt = false; ipsNext) { + unsigned int i; + for (i = 0; i < psStruct->numWeaps; i++) { if ((DROID *)psStruct->psTarget[i] == psVictimDroid) @@ -243,6 +245,8 @@ BOOL droidCheckReferences(DROID *psVictimDroid) } for (psDroid = apsDroidLists[plr]; psDroid != NULL; psDroid = psDroid->psNext) { + unsigned int i; + if ((DROID *)psDroid->psTarget == psVictimDroid && psVictimDroid != psDroid) { #ifndef DEBUG @@ -2821,7 +2825,8 @@ UDWORD calcDroidPower(DROID *psDroid) UDWORD calcDroidPoints(DROID *psDroid) { - int points, i; + unsigned int i; + int points; points = getBodyStats(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. BOOL noDroid(UDWORD x, UDWORD y) { - UDWORD i; - DROID *pD; + unsigned int i; + // check each droid list - for(i=0;ipsNext) + 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; - } } } } @@ -3789,19 +3793,15 @@ static BOOL oneDroid(UDWORD x, UDWORD y) { 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; - } - else - { - bFound = true;//first droid on this square so continue - } + return false; } + + bFound = true;//first droid on this square so continue } } } diff --git a/src/e3demo.c b/src/e3demo.c index cdb82f155..3b537d1fd 100644 --- a/src/e3demo.c +++ b/src/e3demo.c @@ -49,14 +49,11 @@ #define DROID_MOVE_INTERVAL (GAME_TICKS_PER_SEC/4) // ------------------------------------------------------------------------- -BOOL tooNearEdge ( UDWORD x, UDWORD y ); BOOL demoGetStatus ( void ); void initDemoCamera ( void ); -void demoRequestStart ( void ); void processDemoCam ( void ); void toggleDemoStatus ( void ); -BOOL getDemoStatus ( void ); -void findSomethingInteresting( void ); +static void findSomethingInteresting(void); void setFindNewTarget ( void ); // ------------------------------------------------------------------------- @@ -84,14 +81,6 @@ void initDemoCamera( void ) 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 */ void processDemoCam( void ) @@ -216,15 +205,19 @@ BOOL demoGetStatus( void ) /* Attempts to find a new location for the tracking camera to go to, or 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 ) +void findSomethingInteresting() { -UDWORD type; + enum + { + SEEK_DROID, + SEEK_TARGET, + + SEEK_LAST, + + SEEK_OVERRIDE, + } type; + UDWORD player,otherPlayer; BOOL gotNewTarget; DROID *psDroid; @@ -272,19 +265,19 @@ PROPULSION_STATS *psPropStats; if(bSeekOnlyLocations) { /* Then force the switch outcome - hacky I know, but same as if else in code */ - type = OVERRIDE_SEEK; + type = SEEK_OVERRIDE; } else { /* We're off hunting droids */ - type = rand()%NUM_CHOICES; + type = rand() % SEEK_LAST; } /* Check which */ - switch(type) + switch (type) { /* Go after a droid, or a droid location */ - case DROID_SEEK: - case TAR_SEEK: + case SEEK_DROID: + case SEEK_TARGET: /* Choose a player at random */ player = rand()%MAX_PLAYERS; @@ -349,7 +342,7 @@ PROPULSION_STATS *psPropStats; } break; /* 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 ); gotNewTarget = true; break; @@ -385,20 +378,3 @@ UDWORD droidIndex; 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); - } -} diff --git a/src/e3demo.h b/src/e3demo.h index 7333ec090..3fc294bfa 100644 --- a/src/e3demo.h +++ b/src/e3demo.h @@ -22,7 +22,6 @@ #define __INCLUDED_SRC_E3DEMO_H__ extern void initDemoCamera ( void ); -extern void demoRequestStart ( void ); extern void processDemoCam ( void ); extern void toggleDemoStatus ( void ); extern BOOL demoGetStatus ( void ); diff --git a/src/feature.c b/src/feature.c index bddec10c8..1cece08ab 100644 --- a/src/feature.c +++ b/src/feature.c @@ -103,9 +103,9 @@ void featureInitVars(void) 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) { diff --git a/src/fpath.c b/src/fpath.c index 57ecb2def..0937f9e46 100644 --- a/src/fpath.c +++ b/src/fpath.c @@ -253,7 +253,10 @@ BOOL fpathBlockingTile(SDWORD x, SDWORD y, PROPULSION_TYPE propulsion) MAPTILE *psTile; /* 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; } diff --git a/src/frontend.c b/src/frontend.c index 297841028..aeb2ebca2 100644 --- a/src/frontend.c +++ b/src/frontend.c @@ -832,15 +832,15 @@ BOOL startGameOptions3Menu(void) // 2d audio 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 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 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. 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 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 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; diff --git a/src/frontend.h b/src/frontend.h index e225f1639..ca9a912f9 100644 --- a/src/frontend.h +++ b/src/frontend.h @@ -79,7 +79,7 @@ extern void addBottomForm (void); extern void addBackdrop (void); 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 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 displayTextOption (WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *pColours); diff --git a/src/hci.c b/src/hci.c index 1b9ff7b5c..69e885e39 100644 --- a/src/hci.c +++ b/src/hci.c @@ -448,7 +448,7 @@ static BOOL intAddCommand(DROID *psSelected); /* 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 */ static void intStopStructPosition(void); @@ -1496,7 +1496,7 @@ static void intProcessEditStats(UDWORD id) return; } } - intStartStructPosition(psPositionStats, NULL); + intStartStructPosition(psPositionStats); editPosMode = IED_POS; } else if (id == IDSTAT_CLOSE) @@ -3230,8 +3230,7 @@ void intCommanderSelected(DROID *psDroid) extern void FinishStructurePosition(UDWORD xPos,UDWORD yPos,void *UserData); /* Start looking for a structure location */ -//static void intStartStructPosition(UDWORD width, UDWORD height) -static void intStartStructPosition(BASE_STATS *psStats,DROID *psDroid) +static void intStartStructPosition(BASE_STATS *psStats) { init3DBuilding(psStats,NULL,NULL); @@ -6157,7 +6156,7 @@ static BOOL setConstructionStats(BASE_OBJECT *psObj, BASE_STATS *psStats) { objMode = IOBJ_BUILDSEL; - intStartStructPosition(psStats,psDroid); + intStartStructPosition(psStats); //set the droids current program /*for (i=0; i < psDroid->numProgs; i++) diff --git a/src/ingameop.c b/src/ingameop.c index ba2489737..48b5ff4a1 100644 --- a/src/ingameop.c +++ b/src/ingameop.c @@ -154,17 +154,17 @@ static BOOL addSlideOptions(void) // fx vol addIGTextButton(INTINGAMEOP_FXVOL, INTINGAMEOP_1_Y, _("Voice Volume"), WBUT_PLAIN); 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 addIGTextButton(INTINGAMEOP_3DFXVOL, INTINGAMEOP_2_Y, _("FX Volume"), WBUT_PLAIN); 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 addIGTextButton(INTINGAMEOP_CDVOL, INTINGAMEOP_3_Y, _("Music Volume"), WBUT_PLAIN); 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; } diff --git a/src/intdisplay.c b/src/intdisplay.c index b93f2c95a..2ec86a949 100644 --- a/src/intdisplay.c +++ b/src/intdisplay.c @@ -2476,7 +2476,7 @@ void CreateIMDButton(IMAGEFILE *ImageFile, UWORD ImageID, void *Object, UDWORD P } else if(IMDType == IMDTYPE_STRUCTURE) { displayStructureButton((STRUCTURE*)Object,&Rotation,&Position,true, scale); } else if(IMDType == IMDTYPE_STRUCTURESTAT) { - displayStructureStatButton((STRUCTURE_STATS*)Object,Player,&Rotation,&Position,true, scale); + displayStructureStatButton((STRUCTURE_STATS*)Object, &Rotation, &Position, true, scale); } else { displayIMDButton((iIMDShape*)Object,&Rotation,&Position,true, scale); } diff --git a/src/intelmap.c b/src/intelmap.c index 6b53853eb..0f1f88c3c 100644 --- a/src/intelmap.c +++ b/src/intelmap.c @@ -1291,7 +1291,7 @@ void intDisplayPIEView(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, WZ_DECL #ifndef NO_VIDEO /* 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; diff --git a/src/keybind.c b/src/keybind.c index 1a4b42a0e..c38d98f7a 100644 --- a/src/keybind.c +++ b/src/keybind.c @@ -1700,7 +1700,6 @@ void kf_SendTextMessage(void) { char ch; char tmp[MAX_CONSOLE_STRING_LENGTH + 100]; - SDWORD i; if(bAllowOtherKeyPresses) // just starting. { @@ -1752,6 +1751,8 @@ void kf_SendTextMessage(void) } else { + unsigned int i; + //show the message we sent on our local console as well (even in skirmish, to see console commands) sstrcpy(tmp, getPlayerName(selectedPlayer)); sstrcat(tmp, " : "); // seperator @@ -1759,9 +1760,10 @@ void kf_SendTextMessage(void) addConsoleMessage(tmp,DEFAULT_JUSTIFY, selectedPlayer); //in skirmish send directly to AIs, for command and chat procesing - for(i=0; ix; UDWORD y = yOffset+psWidget->y; diff --git a/src/loadsave.c b/src/loadsave.c index 290540ca0..101f10493 100644 --- a/src/loadsave.c +++ b/src/loadsave.c @@ -650,7 +650,7 @@ void removeWildcards(char *pStr) // //////////////////////////////////////////////////////////////////////////// // 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; 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; @@ -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 y = yOffset+psWidget->y; diff --git a/src/mapdisplay.c b/src/mapdisplay.c index dd8a92af3..22afcb235 100644 --- a/src/mapdisplay.c +++ b/src/mapdisplay.c @@ -171,8 +171,7 @@ void renderResearchToBuffer(RESEARCH *psResearch, } else if(IMDType == IMDTYPE_RESEARCH) { displayResearchButton(psResGraphic,&Rotation,&Position,true, scale); } else if(IMDType == IMDTYPE_STRUCTURESTAT) { - displayStructureStatButton((STRUCTURE_STATS *)psResGraphic,selectedPlayer,&Rotation, - &Position,true, scale); + displayStructureStatButton((STRUCTURE_STATS *)psResGraphic, &Rotation, &Position, true, scale); } else { ASSERT( false, "renderResearchToBuffer: Unknown PIEType" ); } diff --git a/src/mapgrid.c b/src/mapgrid.c index f08c61e70..b54e57d72 100644 --- a/src/mapgrid.c +++ b/src/mapgrid.c @@ -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 -static int gridObjRange(const BASE_OBJECT* psObj) +static int gridObjRange(WZ_DECL_UNUSED const BASE_OBJECT* psObj) { #if 0 SDWORD range; diff --git a/src/multiint.c b/src/multiint.c index 157faf9fe..522f7d812 100644 --- a/src/multiint.c +++ b/src/multiint.c @@ -1521,7 +1521,7 @@ UDWORD addPlayerBox(BOOL players) sFormInit.UserData = i; widgAddForm(psWScreen, &sFormInit); 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) } } } diff --git a/src/multilimit.c b/src/multilimit.c index 9bdc45d58..4ad6eca84 100644 --- a/src/multilimit.c +++ b/src/multilimit.c @@ -218,7 +218,7 @@ BOOL startLimitScreen(void) addFESlider(sButInit.id,sButInit.id-1, 290,11, asStructLimits[0][i].globalLimit, - asStructLimits[0][i].limit, 0); + asStructLimits[0][i].limit); sButInit.id ++; 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); - displayStructureStatButton(stat ,0, &Rotation,&Position,true, scale); + displayStructureStatButton(stat, &Rotation, &Position, true, scale); pie_SetDepthBufferStatus(DEPTH_CMP_ALWAYS_WRT_ON); // draw name