mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
replace header preprocessor conditional with cpp function
This commit is contained in:
committed by
majcosta
parent
b5ec955324
commit
f8f8461a65
@@ -562,7 +562,7 @@ void CreateFileDialog( STR16 zTitle )
|
|||||||
//File list window
|
//File list window
|
||||||
iFileDlgButtons[4] = CreateHotSpot( (iScreenWidthOffset + 179+4), (iScreenHeightOffset + 69+3), (179+4+240), (69+120+3), MSYS_PRIORITY_HIGH-1, BUTTON_NO_CALLBACK, FDlgNamesCallback);
|
iFileDlgButtons[4] = CreateHotSpot( (iScreenWidthOffset + 179+4), (iScreenHeightOffset + 69+3), (179+4+240), (69+120+3), MSYS_PRIORITY_HIGH-1, BUTTON_NO_CALLBACK, FDlgNamesCallback);
|
||||||
//Title button
|
//Title button
|
||||||
iFileDlgButtons[5] = CreateTextButton(zTitle, HUGEFONT, FONT_LTKHAKI, FONT_DKKHAKI,
|
iFileDlgButtons[5] = CreateTextButton(zTitle, GetHugeFont(), FONT_LTKHAKI, FONT_DKKHAKI,
|
||||||
BUTTON_USE_DEFAULT,iScreenWidthOffset + 179, iScreenHeightOffset + 39,281,30,BUTTON_NO_TOGGLE,
|
BUTTON_USE_DEFAULT,iScreenWidthOffset + 179, iScreenHeightOffset + 39,281,30,BUTTON_NO_TOGGLE,
|
||||||
MSYS_PRIORITY_HIGH-2,BUTTON_NO_CALLBACK,BUTTON_NO_CALLBACK);
|
MSYS_PRIORITY_HIGH-2,BUTTON_NO_CALLBACK,BUTTON_NO_CALLBACK);
|
||||||
DisableButton(iFileDlgButtons[5]);
|
DisableButton(iFileDlgButtons[5]);
|
||||||
@@ -1013,7 +1013,7 @@ UINT32 ProcessFileIO()
|
|||||||
case INITIATE_MAP_SAVE: //draw save message
|
case INITIATE_MAP_SAVE: //draw save message
|
||||||
StartFrameBufferRender( );
|
StartFrameBufferRender( );
|
||||||
SaveFontSettings();
|
SaveFontSettings();
|
||||||
SetFont( HUGEFONT );
|
SetFont( GetHugeFont() );
|
||||||
SetFontForeground( FONT_LTKHAKI );
|
SetFontForeground( FONT_LTKHAKI );
|
||||||
SetFontShadow( FONT_DKKHAKI );
|
SetFontShadow( FONT_DKKHAKI );
|
||||||
SetFontBackground( 0 );
|
SetFontBackground( 0 );
|
||||||
|
|||||||
@@ -3075,11 +3075,11 @@ void ApologizeOverrideAndForceUpdateEverything()
|
|||||||
//Draw it
|
//Draw it
|
||||||
DrawButton( iSummaryButton[ SUMMARY_BACKGROUND ] );
|
DrawButton( iSummaryButton[ SUMMARY_BACKGROUND ] );
|
||||||
InvalidateRegion( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
|
InvalidateRegion( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
|
||||||
SetFont( HUGEFONT );
|
SetFont( GetHugeFont() );
|
||||||
SetFontForeground( FONT_RED );
|
SetFontForeground( FONT_RED );
|
||||||
SetFontShadow( FONT_NEARBLACK );
|
SetFontShadow( FONT_NEARBLACK );
|
||||||
swprintf( str, pApologizeOverrideAndForceUpdateEverythingText[0] );
|
swprintf( str, pApologizeOverrideAndForceUpdateEverythingText[0] );
|
||||||
mprintf( (iScreenWidthOffset + 320) - StringPixLength( str, HUGEFONT )/2, iScreenHeightOffset + 105, str );
|
mprintf( (iScreenWidthOffset + 320) - StringPixLength( str, GetHugeFont() )/2, iScreenHeightOffset + 105, str );
|
||||||
SetFont( FONT10ARIAL );
|
SetFont( FONT10ARIAL );
|
||||||
SetFontForeground( FONT_YELLOW );
|
SetFontForeground( FONT_YELLOW );
|
||||||
swprintf( str, pApologizeOverrideAndForceUpdateEverythingText[1], gusNumberOfMapsToBeForceUpdated );
|
swprintf( str, pApologizeOverrideAndForceUpdateEverythingText[1], gusNumberOfMapsToBeForceUpdated );
|
||||||
|
|||||||
@@ -93,6 +93,14 @@ UINT16 CreateFontPaletteTables(HVOBJECT pObj );
|
|||||||
|
|
||||||
extern UINT16 gzFontName[32];
|
extern UINT16 gzFontName[32];
|
||||||
|
|
||||||
|
auto GetHugeFont() -> INT32 {
|
||||||
|
#if defined(JA2EDITOR) && defined(ENGLISH)
|
||||||
|
return gpHugeFont;
|
||||||
|
#else
|
||||||
|
return gp16PointArial;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
BOOLEAN InitializeFonts( )
|
BOOLEAN InitializeFonts( )
|
||||||
{
|
{
|
||||||
//INT16 zWinFontName[128]; // unused (jonathanl)
|
//INT16 zWinFontName[128]; // unused (jonathanl)
|
||||||
|
|||||||
+1
-11
@@ -89,11 +89,6 @@ extern HVOBJECT gvoBlockFontNarrow;
|
|||||||
extern INT32 gp14PointHumanist;
|
extern INT32 gp14PointHumanist;
|
||||||
extern HVOBJECT gvo14PointHumanist;
|
extern HVOBJECT gvo14PointHumanist;
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
|
||||||
extern INT32 gpHugeFont;
|
|
||||||
extern HVOBJECT gvoHugeFont;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//extern INT32 giSubTitleWinFont;
|
//extern INT32 giSubTitleWinFont;
|
||||||
|
|
||||||
|
|
||||||
@@ -124,12 +119,7 @@ extern BOOLEAN gfFontsInit;
|
|||||||
#define BLOCKFONTNARROW gpBlockFontNarrow
|
#define BLOCKFONTNARROW gpBlockFontNarrow
|
||||||
#define FONT14HUMANIST gp14PointHumanist
|
#define FONT14HUMANIST gp14PointHumanist
|
||||||
|
|
||||||
#if defined( JA2EDITOR ) && defined( ENGLISH )
|
auto GetHugeFont() -> INT32;
|
||||||
#define HUGEFONT gpHugeFont
|
|
||||||
#else
|
|
||||||
#define HUGEFONT gp16PointArial
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#define FONT_SHADE_RED 6
|
#define FONT_SHADE_RED 6
|
||||||
#define FONT_SHADE_BLUE 1
|
#define FONT_SHADE_BLUE 1
|
||||||
|
|||||||
Reference in New Issue
Block a user