Add new debug log category 'fog', and remove more unused code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1170 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
a2c2035f6f
commit
d5b70b2384
|
@ -62,6 +62,7 @@ static const char *code_part_names[] = {
|
|||
"script",
|
||||
"movement",
|
||||
"attack",
|
||||
"fog",
|
||||
"last"
|
||||
};
|
||||
|
||||
|
|
|
@ -105,6 +105,7 @@ typedef enum {
|
|||
LOG_SCRIPT,
|
||||
LOG_MOVEMENT,
|
||||
LOG_ATTACK,
|
||||
LOG_FOG,
|
||||
LOG_LAST /* _must_ be last! */
|
||||
} code_part;
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@ void pie_SetDefaultStates(void)//Sets all states
|
|||
pie_SetDepthBufferStatus(DEPTH_CMP_LEQ_WRT_ON);
|
||||
|
||||
//set render mode
|
||||
pie_SetTranslucent(TRUE);
|
||||
pie_SetAdditive(TRUE);
|
||||
|
||||
//basic gouraud textured rendering
|
||||
|
@ -62,23 +61,6 @@ void pie_SetDefaultStates(void)//Sets all states
|
|||
pie_SetBilinear(TRUE);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
//
|
||||
// pie_SetTranslucent(BOOL val);
|
||||
//
|
||||
// Global enable/disable Translucent effects
|
||||
//
|
||||
//***************************************************************************
|
||||
|
||||
void pie_SetTranslucent(BOOL val)
|
||||
{
|
||||
rendStates.translucent = val;
|
||||
}
|
||||
|
||||
BOOL pie_Translucent(void)
|
||||
{
|
||||
return rendStates.translucent;
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
//
|
||||
|
@ -129,10 +111,13 @@ void pie_EnableFog(BOOL val)
|
|||
{
|
||||
if (rendStates.fogCap == FOG_CAP_NO)
|
||||
{
|
||||
debug(LOG_FOG, "pie_EnableFog: Trying to fog set fog to %s, but global fog disabled",
|
||||
val ? "ON" : "OFF");
|
||||
val = FALSE;
|
||||
}
|
||||
if (rendStates.fogEnabled != val)
|
||||
{
|
||||
debug(LOG_FOG, "pie_EnableFog: Setting fog to %s", val ? "ON" : "OFF");
|
||||
rendStates.fogEnabled = val;
|
||||
if (val == TRUE)
|
||||
{
|
||||
|
|
|
@ -79,7 +79,6 @@ typedef enum FOG_CAP
|
|||
{
|
||||
FOG_CAP_NO,
|
||||
FOG_CAP_GREY,
|
||||
FOG_CAP_COLOURED,
|
||||
FOG_CAP_UNDEFINED
|
||||
}
|
||||
FOG_CAP;
|
||||
|
@ -119,7 +118,6 @@ typedef enum ALPHA_MODE
|
|||
|
||||
typedef struct RENDER_STATE
|
||||
{
|
||||
BOOL translucent;
|
||||
BOOL additive;
|
||||
FOG_CAP fogCap;
|
||||
BOOL fogEnabled;
|
||||
|
@ -160,8 +158,6 @@ extern void pie_SetDefaultStates(void);//Sets all states
|
|||
extern void pie_SetDepthBufferStatus(DEPTH_MODE depthMode);
|
||||
extern void pie_SetGammaValue(float val);
|
||||
//renderer capability
|
||||
extern void pie_SetTranslucent(BOOL val);
|
||||
extern BOOL pie_Translucent(void);
|
||||
extern void pie_SetAdditive(BOOL val);
|
||||
extern BOOL pie_Additive(void);
|
||||
extern void pie_SetFogCap(FOG_CAP val);
|
||||
|
|
|
@ -94,6 +94,7 @@ void pie_SetFogStatus(BOOL val)
|
|||
if (rendStates.fog != val)
|
||||
{
|
||||
rendStates.fog = val;
|
||||
debug(LOG_FOG, "pie_SetFogStatus set %s", val ? "ON" : "OFF");
|
||||
|
||||
if (rendStates.fog) {
|
||||
fog.argb = pie_GetFogColour();
|
||||
|
@ -119,6 +120,7 @@ void pie_SetFogStatus(BOOL val)
|
|||
//fog disabled so turn it off if not off already
|
||||
if (rendStates.fog != FALSE)
|
||||
{
|
||||
debug(LOG_FOG, "pie_SetFogStatus(%s) but fog disabled", val ? "ON" : "OFF");
|
||||
rendStates.fog = FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@ static BOOL bRevealActive = FALSE;
|
|||
// ------------------------------------------------------------------------------------
|
||||
void avSetStatus(BOOL var)
|
||||
{
|
||||
debug(LOG_FOG, "avSetStatus: Setting visual fog %s", var ? "ON" : "OFF");
|
||||
bRevealActive = var;
|
||||
}
|
||||
|
||||
|
@ -195,6 +196,7 @@ BOOL getRevealStatus( void )
|
|||
// ------------------------------------------------------------------------------------
|
||||
void setRevealStatus( BOOL val )
|
||||
{
|
||||
debug(LOG_FOG, "avSetRevealStatus: Setting reveal to %s", val ? "ON" : "OFF");
|
||||
bRevealActive = val;
|
||||
}
|
||||
// ------------------------------------------------------------------------------------
|
||||
|
|
|
@ -451,15 +451,6 @@ void startSinglePlayerMenu(void)
|
|||
addMultiBut(psWScreen,FRONTEND_BOTFORM,FRONTEND_QUIT,10,10,30,29, STR_FE_RETURN,IMAGE_RETURN,IMAGE_RETURN_HI,TRUE);
|
||||
}
|
||||
|
||||
#ifdef PSX_DIFFICULTY_MENU
|
||||
static void endSinglePlayerMenu( void )
|
||||
{
|
||||
removeTopForm();
|
||||
removeBottomForm();
|
||||
removeBackdrop();
|
||||
}
|
||||
#endif
|
||||
|
||||
static void frontEndNewGame( void )
|
||||
{
|
||||
switch(StartWithGame) {
|
||||
|
@ -526,36 +517,22 @@ BOOL runSinglePlayerMenu(void)
|
|||
break;
|
||||
|
||||
case FRONTEND_LOADCAM2:
|
||||
#ifdef PSX_DIFFICULTY_MENU
|
||||
StartMenuDepth = 1;
|
||||
StartWithGame = 2;
|
||||
endSinglePlayerMenu();
|
||||
startDifficultyMenu();
|
||||
#else
|
||||
strcpy(pLevelName,"CAM_2A");
|
||||
changeTitleMode(STARTGAME);
|
||||
#ifdef LOADINGBACKDROPS
|
||||
AddLoadingBackdrop(TRUE);
|
||||
#else
|
||||
initLoadingScreen(TRUE);
|
||||
#endif
|
||||
#endif
|
||||
break;
|
||||
|
||||
case FRONTEND_LOADCAM3:
|
||||
#ifdef PSX_DIFFICULTY_MENU
|
||||
StartMenuDepth = 1;
|
||||
StartWithGame = 3;
|
||||
endSinglePlayerMenu();
|
||||
startDifficultyMenu();
|
||||
#else
|
||||
strcpy(pLevelName,"CAM_3A");
|
||||
changeTitleMode(STARTGAME);
|
||||
#ifdef LOADINGBACKDROPS
|
||||
AddLoadingBackdrop(TRUE);
|
||||
#else
|
||||
initLoadingScreen(TRUE);
|
||||
#endif
|
||||
#endif
|
||||
break;
|
||||
case FRONTEND_LOADGAME:
|
||||
|
@ -816,19 +793,6 @@ BOOL startGameOptions2Menu(void)
|
|||
addTextButton(FRONTEND_FOGTYPE_R,FRONTEND_POS4M-55,FRONTEND_POS4Y, strresGetString(psStringRes,STR_FE_GOODFOG),TRUE,FALSE);
|
||||
}
|
||||
|
||||
/* ////////////
|
||||
// fog
|
||||
addTextButton(FRONTEND_FOG, FRONTEND_POS5X-15,FRONTEND_POS5Y, strresGetString(psStringRes, STR_FE_FOG),TRUE,FALSE);
|
||||
if (war_GetFog())
|
||||
{
|
||||
addTextButton(FRONTEND_FOG_R, FRONTEND_POS5M-55, FRONTEND_POS5Y, strresGetString(psStringRes,STR_FE_ON),TRUE,FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
addTextButton(FRONTEND_FOG_R, FRONTEND_POS5M-55, FRONTEND_POS5Y, strresGetString(psStringRes,STR_FE_OFF),TRUE,FALSE);
|
||||
}
|
||||
*/
|
||||
|
||||
// ////////////
|
||||
// //sequence mode.
|
||||
addTextButton(FRONTEND_SEQUENCE, FRONTEND_POS6X-35,FRONTEND_POS6Y, strresGetString(psStringRes, STR_SEQ_PLAYBACK),TRUE,FALSE);
|
||||
|
@ -934,14 +898,16 @@ BOOL runGameOptions2Menu(void)
|
|||
|
||||
case FRONTEND_FOGTYPE:
|
||||
case FRONTEND_FOGTYPE_R:
|
||||
if( war_GetFog() )
|
||||
if (war_GetFog())
|
||||
{ // turn off crap fog, turn on vis fog.
|
||||
debug(LOG_FOG, "runGameOptions2Menu: Fog of war ON, visual fog OFF");
|
||||
war_SetFog(FALSE);
|
||||
avSetStatus(TRUE);
|
||||
widgSetString(psWScreen,FRONTEND_FOGTYPE_R, strresGetString(psStringRes,STR_FE_GOODFOG));
|
||||
}
|
||||
else
|
||||
{ // turn off vis fog, turn on normal crap fog.
|
||||
debug(LOG_FOG, "runGameOptions2Menu: Fog of war OFF, visual fog ON");
|
||||
avSetStatus(FALSE);
|
||||
war_SetFog(TRUE);
|
||||
widgSetString(psWScreen,FRONTEND_FOGTYPE_R, strresGetString(psStringRes,STR_FE_CRAPFOG));
|
||||
|
@ -966,23 +932,6 @@ BOOL runGameOptions2Menu(void)
|
|||
}
|
||||
break;
|
||||
|
||||
|
||||
/* case FRONTEND_FOG:
|
||||
case FRONTEND_FOG_R:
|
||||
if (war_GetFog())
|
||||
{
|
||||
war_SetFog(FALSE);
|
||||
widgSetString(psWScreen,FRONTEND_FOG_R,strresGetString(psStringRes,STR_FE_OFF));
|
||||
}
|
||||
else
|
||||
{
|
||||
war_SetFog(TRUE);
|
||||
widgSetString(psWScreen,FRONTEND_FOG_R,strresGetString(psStringRes,STR_FE_ON));
|
||||
}
|
||||
break;
|
||||
*/
|
||||
|
||||
|
||||
// case FRONTEND_TRANSPARENCY:
|
||||
// case FRONTEND_TRANSPARENCY_R:
|
||||
// if (!war_GetTranslucent())
|
||||
|
|
|
@ -978,7 +978,6 @@ BOOL systemInitialise(void)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
pie_SetTranslucent(war_GetTranslucent());
|
||||
pie_SetAdditive(war_GetAdditive());
|
||||
pie_SetGammaValue((float)gammaValue / 20.0f);
|
||||
|
||||
|
|
|
@ -117,6 +117,7 @@ BOOL war_getFullscreen(void) {
|
|||
/***************************************************************************/
|
||||
void war_SetFog(BOOL val)
|
||||
{
|
||||
debug(LOG_FOG, "Fog of war turned %s", val ? "ON" : "OFF");
|
||||
if (warGlobs.bFog != val)
|
||||
{
|
||||
warGlobs.bFog = val;
|
||||
|
@ -141,7 +142,6 @@ BOOL war_GetFog(void)
|
|||
/***************************************************************************/
|
||||
void war_SetTranslucent(BOOL val)
|
||||
{
|
||||
pie_SetTranslucent(val);
|
||||
if (warGlobs.bTranslucent != val)
|
||||
{
|
||||
warGlobs.bTranslucent = val;
|
||||
|
|
Loading…
Reference in New Issue