Hi,

attached two patches convert some more strresGetString calls to using
gettext. 
The first converts some calls and removes one unused function (which was
using the sttres system).
The second patch only removes some unused functions (which were using
the strres system).

@Per: please check and ack.

Regards,
Stefan

Index: src/structure.c
===================================================================
--- src/structure.c	(revision 970)
+++ src/structure.c	(working copy)
@@ -7901,8 +7901,8 @@
                 //add a console message for the selected Player
 		        if (psStructure->player == selectedPlayer)
 		        {
-       			    CONPRINTF(ConsoleString,(ConsoleString,strresGetString(
-                        psStringRes,STR_GAM_ELECDAM),
+       			    CONPRINTF(ConsoleString,(ConsoleString,
+			            _("%s - Electronically Damaged"),
 		    		    getStatName(psStructure->pStructureType)));
                     //tell the scripts if selectedPlayer has lost a structure
                     eventFireCallbackTrigger((TRIGGER_TYPE)CALL_ELECTRONIC_TAKEOVER);
Index: src/multigifts.c
===================================================================
--- src/multigifts.c	(revision 970)
+++ src/multigifts.c	(working copy)
@@ -207,8 +207,8 @@
 	{
 		if(to == selectedPlayer)
 		{
-			CONPRINTF(ConsoleString,(ConsoleString,strresGetString(psStringRes,
-				STR_GIFT_VIS),getPlayerName(from)));
+			CONPRINTF(ConsoleString,(ConsoleString,_("%s Gives You A Visibility Report"),
+				getPlayerName(from)));
 		}
 	}
 }
@@ -919,8 +919,8 @@
 			if( (IsResearchCompleted(&pO[topic]) ) && (IsResearchPossible(&pR[topic])==FALSE )  )
 			{
 				MakeResearchPossible(&pR[topic]);
-				CONPRINTF(ConsoleString,(ConsoleString,strresGetString(psStringRes,
-					STR_MUL_ARTIF),getName(asResearch[topic].pName)));
+				CONPRINTF(ConsoleString,(ConsoleString,_("You Discover Blueprints For %s"),
+					getName(asResearch[topic].pName)));
 				return;
 			}
 		}
Index: src/frontend.c
===================================================================
--- src/frontend.c	(revision 970)
+++ src/frontend.c	(working copy)
@@ -1579,20 +1579,9 @@
 }
 
 
-//// Given a string id, set a text buttons dimensions.
-////
-//void SetTextButtonExt(W_BUTINIT *psButInit,UWORD x,UWORD y,UDWORD StringID)
-//{
-//	psButInit->x = x;
-//	psButInit->y = y;
-//	psButInit->width = iV_GetTextWidth(strresGetString(psStringRes,StringID));
-//	psButInit->height = iV_GetTextLineSize();
-//}
-
-
 // Placed here to avoid automatic inlining in InGameOp.c by the Playstation compiler.
 //
-BOOL addIGTextButton(UDWORD id,UWORD y,UDWORD StringID,UDWORD Style)
+BOOL addIGTextButton(UDWORD id, UWORD y, const char *string, UDWORD Style)
 {
 	W_BUTINIT sButInit;
 
@@ -1602,7 +1591,6 @@
 	sButInit.formID		= INTINGAMEOP;
 	sButInit.id			= id;
 	sButInit.style		= Style;
-//	SetTextButtonExt(&sButInit,INTINGAMEOP_1_X,y,StringID);
 
 
 	sButInit.x			= INTINGAMEOP_1_X;
@@ -1612,7 +1600,7 @@
 
 	sButInit.FontID		= WFont;
 	sButInit.pDisplay	= displayTextOption;
-	sButInit.pText		= strresGetString(psStringRes,StringID);
+	sButInit.pText		= string;
 	widgAddButton(psWScreen, &sButInit);
 
 	return TRUE;
Index: src/frontend.h
===================================================================
--- src/frontend.h	(revision 970)
+++ src/frontend.h	(working copy)
@@ -104,7 +104,7 @@
 BOOL		runGameOptions3Menu		(void);
 
 
-BOOL addIGTextButton(UDWORD id,UWORD y,UDWORD StringID,UDWORD Style);
+BOOL addIGTextButton(UDWORD id, UWORD y, const char *string, UDWORD Style);
 
 
 // ////////////////////////////////////////////////////////////////////////////
Index: src/keymap.c
===================================================================
--- src/keymap.c	(revision 970)
+++ src/keymap.c	(working copy)
@@ -374,7 +374,7 @@
 	keyAddMapping(KEYMAP_ASSIGNABLE,KEY_IGNORE,KEY_E,KEYMAP_PRESSED,kf_SetDroidAttackReturn,	_("Return Fire"));
 	keyAddMapping(KEYMAP_ASSIGNABLE,KEY_IGNORE,KEY_F,KEYMAP_PRESSED,kf_SetDroidAttackAtWill,	_("Fire at Will"));
 	keyAddMapping(KEYMAP_ASSIGNABLE,KEY_IGNORE,KEY_H,KEYMAP_PRESSED,kf_SetDroidReturnToBase,	_("Return to HQ"));
-	keyAddMapping(KEYMAP_ASSIGNABLE,KEY_IGNORE,KEY_I,KEYMAP_PRESSED,kf_SetDroidRangeDefault,	strresGetString(psStringRes,STR_BIND_DEFR));
+	keyAddMapping(KEYMAP_ASSIGNABLE,KEY_IGNORE,KEY_I,KEYMAP_PRESSED,kf_SetDroidRangeDefault,	_("Optimum Range"));
 	keyAddMapping(KEYMAP_ASSIGNABLE,KEY_IGNORE,KEY_O,KEYMAP_PRESSED,kf_SetDroidRangeShort,		_("Short Range"));
 	keyAddMapping(KEYMAP_ASSIGNABLE,KEY_IGNORE,KEY_P,KEYMAP_PRESSED,kf_SetDroidMovePursue ,		_("Pursue"));
 	keyAddMapping(KEYMAP_ASSIGNABLE,KEY_IGNORE,KEY_Q,KEYMAP_PRESSED,kf_SetDroidMovePatrol ,		_("Patrol"));
Index: src/ingameop.c
===================================================================
--- src/ingameop.c	(revision 970)
+++ src/ingameop.c	(working copy)
@@ -102,13 +96,13 @@
 	widgAddForm(psWScreen, &sFormInit);
 
 	//resume
-	addIGTextButton(INTINGAMEOP_RESUME,INTINGAMEOP_1_Y,STR_GAME_RESUME,OPALIGN);
+	addIGTextButton(INTINGAMEOP_RESUME, INTINGAMEOP_1_Y, _("Resume Game"), OPALIGN);
 
 
 	SetCurrentSnapID(&InterfaceSnap,INTINGAMEOP_RESUME);
 
 	//  quit
-	addIGTextButton(INTINGAMEOP_QUIT_CONFIRM,INTINGAMEOP_2_Y,STR_GAME_QUIT,OPALIGN);
+	addIGTextButton(INTINGAMEOP_QUIT_CONFIRM, INTINGAMEOP_2_Y, _("Quit"), OPALIGN);
 
 	SetMousePos(INTINGAMEOP3_X + INTINGAMEOP_1_X, INTINGAMEOP3_Y + INTINGAMEOP_1_Y); // move mouse to resume.
 
@@ -143,20 +137,20 @@
 
 	widgAddForm(psWScreen, &sFormInit);
 
-	addIGTextButton(INTINGAMEOP_RESUME,INTINGAMEOP_4_Y,STR_GAME_RESUME,WBUT_PLAIN);
+	addIGTextButton(INTINGAMEOP_RESUME, INTINGAMEOP_4_Y, _("Resume Game"), WBUT_PLAIN);
 
 	// fx vol
-	addIGTextButton(INTINGAMEOP_FXVOL, INTINGAMEOP_1_Y, STR_FE_FX, WBUT_PLAIN);
+	addIGTextButton(INTINGAMEOP_FXVOL, INTINGAMEOP_1_Y, _("Voice Volume"), WBUT_PLAIN);
 	addFESlider(INTINGAMEOP_FXVOL_S, INTINGAMEOP, INTINGAMEOP_MID, INTINGAMEOP_1_Y-5,
 				AUDIO_VOL_MAX, mixer_GetWavVolume(), INTINGAMEOP_FXVOL);
 
 	// fx vol
-	addIGTextButton(INTINGAMEOP_3DFXVOL, INTINGAMEOP_2_Y, STR_FE_3D_FX, WBUT_PLAIN);
+	addIGTextButton(INTINGAMEOP_3DFXVOL, INTINGAMEOP_2_Y, _("FX Volume"), WBUT_PLAIN);
 	addFESlider(INTINGAMEOP_3DFXVOL_S, INTINGAMEOP, INTINGAMEOP_MID, INTINGAMEOP_2_Y-5,
 				AUDIO_VOL_MAX, mixer_Get3dWavVolume(), INTINGAMEOP_3DFXVOL);
 
 	// cd vol
-	addIGTextButton(INTINGAMEOP_CDVOL, INTINGAMEOP_3_Y, STR_FE_MUSIC, WBUT_PLAIN);
+	addIGTextButton(INTINGAMEOP_CDVOL, INTINGAMEOP_3_Y, _("Music Volume"), WBUT_PLAIN);
 	addFESlider(INTINGAMEOP_CDVOL_S, INTINGAMEOP, INTINGAMEOP_MID, INTINGAMEOP_3_Y-5,
 				AUDIO_VOL_MAX, mixer_GetCDVolume(), INTINGAMEOP_CDVOL);
 
@@ -166,7 +160,7 @@
 	// gamma
 	if (pie_GetRenderEngine() == ENGINE_GLIDE)
 	{
-		addIGTextButton(INTINGAMEOP_GAMMA,INTINGAMEOP_3_Y,STR_FE_GAMMA,WBUT_PLAIN);
+		addIGTextButton(INTINGAMEOP_GAMMA, INTINGAMEOP_3_Y, _("Gamma"), WBUT_PLAIN);
 
 		if(gammaValue>3)	   gammaValue = (float)2.9;
 		if(gammaValue<0.5)  gammaValue = (float).5;
@@ -275,28 +248,28 @@
 
     if ( (!bMultiPlayer || (NetPlay.bComms==0) )  && !bInTutorial)
 	{
-		addIGTextButton(INTINGAMEOP_QUIT,INTINGAMEOP_5_Y,STR_GAME_QUIT,OPALIGN);
+		addIGTextButton(INTINGAMEOP_QUIT, INTINGAMEOP_5_Y, _("Quit"), OPALIGN);
 
 	}
 	else
 	{
-		addIGTextButton(INTINGAMEOP_QUIT,INTINGAMEOP_3_Y,STR_GAME_QUIT,OPALIGN);
+		addIGTextButton(INTINGAMEOP_QUIT, INTINGAMEOP_3_Y, _("Quit"), OPALIGN);
 	}
 
 	// add 'resume'
-	addIGTextButton(INTINGAMEOP_RESUME,INTINGAMEOP_1_Y,STR_GAME_RESUME,OPALIGN);
+	addIGTextButton(INTINGAMEOP_RESUME, INTINGAMEOP_1_Y, _("Resume Game"), OPALIGN);
 
 	SetCurrentSnapID(&InterfaceSnap,INTINGAMEOP_RESUME);
 
 	// add 'options'
-	addIGTextButton(INTINGAMEOP_OPTIONS,INTINGAMEOP_2_Y,STR_FE_OPTIONS,OPALIGN);
+	addIGTextButton(INTINGAMEOP_OPTIONS, INTINGAMEOP_2_Y, _("Options"), OPALIGN);
 
 
 	if ( (!bMultiPlayer || (NetPlay.bComms==0) )  && !bInTutorial)
 	{		// add 'load'
-		addIGTextButton(INTINGAMEOP_LOAD,INTINGAMEOP_3_Y,STR_MISC_LOADGAME,OPALIGN);
+		addIGTextButton(INTINGAMEOP_LOAD, INTINGAMEOP_3_Y, _("Load Game"), OPALIGN);
 		// add 'save'
-		addIGTextButton(INTINGAMEOP_SAVE,INTINGAMEOP_4_Y,STR_MISC_SAVEGAME,OPALIGN);
+		addIGTextButton(INTINGAMEOP_SAVE, INTINGAMEOP_4_Y, _("Save Game"), OPALIGN);
 	}
 
 
Index: src/ingameop.c
===================================================================
--- src/ingameop.c	(revision 970)
+++ src/ingameop.c	(working copy)
@@ -65,12 +65,6 @@
 // ////////////////////////////////////////////////////////////////////////////
 
 
-void AddMaxStringWidth(STR_RES *psRes, UDWORD StringID);
-UDWORD GetMaxStringWidth(void);
-void ResetMaxStringWidth(void);
-
-
-
 static BOOL addQuitOptions(void)
 {
 	W_FORMINIT		sFormInit;
@@ -188,27 +182,6 @@
 
 // ////////////////////////////////////////////////////////////////////////////
 
-static UDWORD MaxStringWidth;
-
-void ResetMaxStringWidth(void)
-{
-	MaxStringWidth=0;
-}
-
-void AddMaxStringWidth(STR_RES *psRes, UDWORD StringID)
-{
-	UDWORD StringWidth;
-	StringWidth=iV_GetTextWidth(strresGetString(psRes,StringID));
-	if (StringWidth>MaxStringWidth) MaxStringWidth=StringWidth;
-
-}
-UDWORD GetMaxStringWidth(void)
-{
-	return MaxStringWidth;
-}
-
-
-
 static BOOL _intAddInGameOptions(void)
 {
 //	UWORD WindowWidth;
_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev

Reply via email to