diff options
Diffstat (limited to 'src/avp/win95/frontend/avp_menus.c')
| -rw-r--r-- | src/avp/win95/frontend/avp_menus.c | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/src/avp/win95/frontend/avp_menus.c b/src/avp/win95/frontend/avp_menus.c index 8964de7..a5a59da 100644 --- a/src/avp/win95/frontend/avp_menus.c +++ b/src/avp/win95/frontend/avp_menus.c @@ -48,9 +48,9 @@ extern void EndMenuBackgroundBink(void); extern int IDemandSelect(void); -extern char *GetVideoModeDescription(void); -extern char *GetVideoModeDescription2(void); -extern char *GetVideoModeDescription3(void); +extern const char *GetVideoModeDescription(void); +extern const char *GetVideoModeDescription2(void); +extern const char *GetVideoModeDescription3(void); extern void PreviousVideoMode(void); extern void PreviousVideoMode2(void); extern void NextVideoMode(void); @@ -77,9 +77,9 @@ extern void PlayIntroSequence(void); extern void MinimalNetCollectMessages(void); -extern int DirectPlay_HostGame(char *playerName, char *sessionName,int species,int gamestyle,int level); +extern int DirectPlay_HostGame(const char *playerName, const char *sessionName,int species,int gamestyle,int level); extern int DirectPlay_JoinGame(void); -extern int DirectPlay_ConnectToSession(int sessionNumber, char *playerName); +extern int DirectPlay_ConnectToSession(int sessionNumber, const char *playerName); extern int DirectPlay_Disconnect(void); extern void ShowSplashScreens(void); @@ -113,7 +113,7 @@ static int HeightOfMenuElement(AVPMENU_ELEMENT *elementPtr); void DisplayVideoModeUnavailableScreen(void); void CheckForCredits(void); void DoCredits(void); -BOOL RollCreditsText(int position, unsigned char *textPtr); +BOOL RollCreditsText(int position, const unsigned char *textPtr); extern void SelectMenuDisplayMode(void); static void InitMainMenusBackdrop(void); extern void DrawMainMenusBackdrop(void); @@ -206,7 +206,7 @@ static int Brightness[16]; static unsigned char MultipleAssignments[2][32]; -static char *GetDescriptionOfKey(unsigned char key); +static const char *GetDescriptionOfKey(unsigned char key); static int OkayToPlayNextEpisode(void); static PLAYER_INPUT_CONFIGURATION PlayerInputPrimaryConfig; static PLAYER_INPUT_CONFIGURATION PlayerInputSecondaryConfig; @@ -1397,7 +1397,7 @@ static void RenderMenu(void) /* Render Menu Title */ if (AvPMenus.MenusState == MENUSSTATE_MAINMENUS) { - char *textPtr = GetTextString(AvPMenusData[AvPMenus.CurrentMenu].MenuTitle); + const char *textPtr = GetTextString(AvPMenusData[AvPMenus.CurrentMenu].MenuTitle); RenderMenuText(textPtr,MENU_CENTREX,70,ONE_FIXED,AVPMENUFORMAT_CENTREJUSTIFIED); #if 1 // and now we've been told to remove the "Gamers Edition" etc. :) @@ -1410,7 +1410,7 @@ static void RenderMenu(void) #if 0 else { - char *textPtr = GetTextString(AvPMenusData[AvPMenus.CurrentMenu].MenuTitle); + const char *textPtr = GetTextString(AvPMenusData[AvPMenus.CurrentMenu].MenuTitle); Hardware_RenderSmallMenuText(textPtr,MENU_CENTREX,70,ONE_FIXED,AVPMENUFORMAT_CENTREJUSTIFIED); } #endif @@ -1502,7 +1502,7 @@ static void RenderEpisodeSelectMenu(void) } } { - char *textPtr = GetTextString(AvPMenusData[AvPMenus.CurrentMenu].MenuTitle); + const char *textPtr = GetTextString(AvPMenusData[AvPMenus.CurrentMenu].MenuTitle); RenderMenuText(textPtr,MENU_CENTREX,70,ONE_FIXED,AVPMENUFORMAT_CENTREJUSTIFIED); } for (i=0; i<=elementPtr->b.MaxSliderValue; i++) @@ -1513,7 +1513,7 @@ static void RenderEpisodeSelectMenu(void) if (y>=-150 && y<=150) { - char *textPtr = GetTextString(elementPtr->a.TextDescription+i); + const char *textPtr = GetTextString(elementPtr->a.TextDescription+i); int b; int targetBrightness; @@ -1552,7 +1552,7 @@ static void RenderEpisodeSelectMenu(void) if (MaximumSelectableLevel>=i) { - char *completedTextPtr; + const char *completedTextPtr; if (i<numberOfBasicLevels) { @@ -1641,7 +1641,7 @@ static void RenderKeyConfigurationMenu(void) if (AvPMenus.MenusState == MENUSSTATE_MAINMENUS) { - char *textPtr = GetTextString(AvPMenusData[AvPMenus.CurrentMenu].MenuTitle); + const char *textPtr = GetTextString(AvPMenusData[AvPMenus.CurrentMenu].MenuTitle); int b; if (AvPMenus.CurrentlySelectedElement>=2) { @@ -1784,7 +1784,7 @@ static void RenderScrollyMenu() AVPMENU_ELEMENT *elementPtr = AvPMenus.MenuElements; { //draw the title - char *textPtr = GetTextString(AvPMenusData[AvPMenus.CurrentMenu].MenuTitle); + const char *textPtr = GetTextString(AvPMenusData[AvPMenus.CurrentMenu].MenuTitle); RenderMenuText(textPtr,MENU_CENTREX,70,ONE_FIXED,AVPMENUFORMAT_CENTREJUSTIFIED); } @@ -1880,7 +1880,7 @@ static void RenderUserProfileSelectMenu(void) int i; AVP_USER_PROFILE *profilePtr = GetFirstUserProfile(); { - char *textPtr = GetTextString(AvPMenusData[AvPMenus.CurrentMenu].MenuTitle); + const char *textPtr = GetTextString(AvPMenusData[AvPMenus.CurrentMenu].MenuTitle); RenderMenuText(textPtr,MENU_CENTREX,70,ONE_FIXED,AVPMENUFORMAT_CENTREJUSTIFIED); } @@ -1892,7 +1892,7 @@ static void RenderUserProfileSelectMenu(void) if (y>=-150 && y<=150) { - char *textPtr = profilePtr->Name; + const char *textPtr = profilePtr->Name; time_t FileTime = profilePtr->FileTime; int b; int targetBrightness; @@ -1954,7 +1954,7 @@ static void RenderLoadGameMenu(void) AVPMENU_ELEMENT *elementPtr = AvPMenus.MenuElements; int e; int y; - int (*RenderText)(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format); + int (*RenderText)(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format); if (AvPMenus.MenusState == MENUSSTATE_MAINMENUS) { @@ -2069,12 +2069,12 @@ static void RenderLoadGameMenu(void) /* Render Menu Title */ if (AvPMenus.MenusState == MENUSSTATE_MAINMENUS) { - char *textPtr = GetTextString(AvPMenusData[AvPMenus.CurrentMenu].MenuTitle); + const char *textPtr = GetTextString(AvPMenusData[AvPMenus.CurrentMenu].MenuTitle); RenderMenuText(textPtr,MENU_CENTREX,70,ONE_FIXED,AVPMENUFORMAT_CENTREJUSTIFIED); } else { - char *textPtr = GetTextString(AvPMenusData[AvPMenus.CurrentMenu].MenuTitle); + const char *textPtr = GetTextString(AvPMenusData[AvPMenus.CurrentMenu].MenuTitle); AVPMENU_ELEMENT *elementPtr = &AvPMenus.MenuElements[AvPMenus.CurrentlySelectedElement]; y = (ScreenDescriptorBlock.SDB_Height - AvPMenus.MenuHeight)/2 - 30; RenderText(textPtr,MENU_CENTREX,y,ONE_FIXED,AVPMENUFORMAT_CENTREJUSTIFIED); @@ -3027,7 +3027,7 @@ static void InteractWithMenuElement(enum AVPMENU_ELEMENT_INTERACTION_ID interact { if (interactionID == AVPMENU_ELEMENT_INTERACTION_SELECT) { - extern int DirectPlay_HostGame(char *playerName, char *sessionName,int species,int gamestyle,int level); + extern int DirectPlay_HostGame(const char *playerName, const char *sessionName,int species,int gamestyle,int level); extern char MP_PlayerName[]; extern char MP_SessionName[]; extern int MP_Species; @@ -3385,14 +3385,14 @@ static void InteractWithMenuElement(enum AVPMENU_ELEMENT_INTERACTION_ID interact } -int LengthOfMenuText(char *textPtr); -int LengthOfSmallMenuText(char *textPtr); +int LengthOfMenuText(const char *textPtr); +int LengthOfSmallMenuText(const char *textPtr); static void RenderMenuElement(AVPMENU_ELEMENT *elementPtr, int e, int y) { - int (*RenderText)(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format); - int (*RenderText_Coloured)(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int r, int g, int b); - int (*MenuTextLength)(char *textPtr); + int (*RenderText)(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format); + int (*RenderText_Coloured)(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int r, int g, int b); + int (*MenuTextLength)(const char *textPtr); if (AvPMenus.FontToUse==AVPMENU_FONT_BIG) { @@ -3441,7 +3441,7 @@ static void RenderMenuElement(AVPMENU_ELEMENT *elementPtr, int e, int y) case AVPMENU_ELEMENT_DELETEMPCONFIG: case AVPMENU_ELEMENT_SAVESETTINGS: { - char *textPtr = GetTextString(elementPtr->a.TextDescription); + const char *textPtr = GetTextString(elementPtr->a.TextDescription); RenderText(textPtr,MENU_CENTREX,y,elementPtr->Brightness,AVPMENUFORMAT_CENTREJUSTIFIED); break; } @@ -3450,7 +3450,7 @@ static void RenderMenuElement(AVPMENU_ELEMENT *elementPtr, int e, int y) case AVPMENU_ELEMENT_STARTMARINEGAME: case AVPMENU_ELEMENT_STARTPREDATORGAME: { - char *textPtr = GetTextString(elementPtr->a.TextDescription); + const char *textPtr = GetTextString(elementPtr->a.TextDescription); RenderText(textPtr,MENU_LEFTXEDGE,MENU_BOTTOMYEDGE,elementPtr->Brightness,AVPMENUFORMAT_LEFTJUSTIFIED); break; } @@ -3459,7 +3459,7 @@ static void RenderMenuElement(AVPMENU_ELEMENT *elementPtr, int e, int y) case AVPMENU_ELEMENT_ALIENEPISODE: case AVPMENU_ELEMENT_PREDATOREPISODE: { - char *textPtr = GetTextString(elementPtr->a.TextDescription+*(elementPtr->SliderValuePtr)); + const char *textPtr = GetTextString(elementPtr->a.TextDescription+*(elementPtr->SliderValuePtr)); RenderText(textPtr,MENU_LEFTXEDGE,MENU_TOPYEDGE,elementPtr->Brightness,AVPMENUFORMAT_LEFTJUSTIFIED); break; } @@ -3474,7 +3474,7 @@ static void RenderMenuElement(AVPMENU_ELEMENT *elementPtr, int e, int y) case AVPMENU_ELEMENT_CHEATMODE_SPECIES_TEXTSLIDER: case AVPMENU_ELEMENT_CHEATMODE_ENVIRONMENT_TEXTSLIDER: { - char *textPtr = ""; + const char *textPtr = ""; if(elementPtr->ElementID == AVPMENU_ELEMENT_TEXTSLIDER_POINTER || elementPtr->ElementID == AVPMENU_ELEMENT_DUMMYTEXTSLIDER_POINTER) { @@ -3825,8 +3825,8 @@ static void RenderMenuElement(AVPMENU_ELEMENT *elementPtr, int e, int y) } case AVPMENU_ELEMENT_KEYCONFIG: { - unsigned char *primaryKey = ((unsigned char*)&PlayerInputPrimaryConfig)+e-2; - unsigned char *secondaryKey = ((unsigned char*)&PlayerInputSecondaryConfig)+e-2; + const unsigned char *primaryKey = ((unsigned char*)&PlayerInputPrimaryConfig)+e-2; + const unsigned char *secondaryKey = ((unsigned char*)&PlayerInputSecondaryConfig)+e-2; if (e==AvPMenus.CurrentlySelectedElement) { int x,g; @@ -4022,10 +4022,10 @@ static int HeightOfMenuElement(AVPMENU_ELEMENT *elementPtr) return h; } -static char *GetDescriptionOfKey(unsigned char key) +static const char *GetDescriptionOfKey(unsigned char key) { static char KeyDescBuffer[2]="\0\0"; - char *textPtr; + const char *textPtr; switch (key) { @@ -4681,7 +4681,7 @@ void DoCredits(void) UnloadTextFile("credits.txt",creditsPtr); } -BOOL RollCreditsText(int position, unsigned char *textPtr) +BOOL RollCreditsText(int position, const unsigned char *textPtr) { int y=0; @@ -5212,8 +5212,8 @@ static void TestValidityOfCheatMenu(void) CheatMode_GetNextAllowedEnvironment(AvPMenus.MenuElements[2].c.SliderValuePtr,TRUE); } -static unsigned char *BriefingTextString[5]; -static unsigned char BlankLine[]=""; +static const unsigned char *BriefingTextString[5]; +static const unsigned char BlankLine[]=""; void SetBriefingTextForEpisode(int episode, I_PLAYER_TYPE playerID) { @@ -5442,7 +5442,7 @@ void RenderBriefingText(int centreY, int brightness) { int length = 0; { - char *ptr = BriefingTextString[i]; + const char *ptr = BriefingTextString[i]; while(*ptr) { |
