diff --git a/Screens.cpp b/Screens.cpp index 68f58fa26..bede75ef5 100644 --- a/Screens.cpp +++ b/Screens.cpp @@ -7,6 +7,7 @@ int iResolution; // INI file int iPlayIntro; int iDisableMouseScrolling; +int iUseWinFonts; /* WANNE, Sgt.Kolja * INI file (Windowed or Fullscreen) * REPLACE all defines WINDOWED_MODE with this variable diff --git a/Standard Gaming Platform/Font.cpp b/Standard Gaming Platform/Font.cpp index 4ecc6d6a5..fc36caa96 100644 --- a/Standard Gaming Platform/Font.cpp +++ b/Standard Gaming Platform/Font.cpp @@ -142,13 +142,13 @@ UINT32 uiRed, uiGreen, uiBlue; uiBlue=(UINT32)FontObjs[FontDefault]->pPaletteEntry[ubForeground].peBlue; FontForeground16=Get16BPPColor(FROMRGB(uiRed, uiGreen, uiBlue)); -#ifdef WINFONTS - if (GET_WINFONT() != -1) - { - uiRed=FROMRGB(uiRed, uiGreen, uiBlue); - SetWinFontForeColor(GET_WINFONT(), &uiRed); - } -#endif + if ( iUseWinFonts) { + if (GET_WINFONT() != -1) + { + uiRed=FROMRGB(uiRed, uiGreen, uiBlue); + SetWinFontForeColor(GET_WINFONT(), &uiRed); + } + } } void SetFontShadow(UINT8 ubShadow ) @@ -207,13 +207,13 @@ UINT32 uiRed, uiGreen, uiBlue; uiBlue=(UINT32)FontObjs[FontDefault]->pPaletteEntry[ubBackground].peBlue; FontBackground16=Get16BPPColor(FROMRGB(uiRed, uiGreen, uiBlue)); -#ifdef WINFONTS - if (GET_WINFONT() != -1) - { - uiRed=FROMRGB(uiRed, uiGreen, uiBlue); - SetWinFontBackColor(GET_WINFONT(), &uiRed); - } -#endif + if ( iUseWinFonts) { + if (GET_WINFONT() != -1) + { + uiRed=FROMRGB(uiRed, uiGreen, uiBlue); + SetWinFontBackColor(GET_WINFONT(), &uiRed); + } + } } @@ -570,14 +570,14 @@ INT16 StringPixLength(const STR16 string, INT32 UseFont) { UINT32 Cur; UINT16 *curletter,transletter; -#ifdef WINFONTS - INT32 MapFont; - MapFont = WinFontMap[UseFont]; - if (MapFont !=-1 ) - { - return(WinFontStringPixLength(string, MapFont)); - } -#endif + if ( iUseWinFonts ) { + INT32 MapFont; + MapFont = WinFontMap[UseFont]; + if (MapFont !=-1 ) + { + return(WinFontStringPixLength(string, MapFont)); + } + } if (string == NULL) { return(0); @@ -699,14 +699,14 @@ UINT16 GetFontHeight(INT32 FontNum) Assert(FontNum >= 0); Assert(FontNum <= MAX_FONTS); Assert(FontObjs[FontNum]!=NULL); -#ifdef WINFONTS - INT32 MapFont; - MapFont = WinFontMap[FontNum]; - if (FontNum != -1) - { - return (GetWinFontHeight(L"A", MapFont)); - } -#endif + if ( iUseWinFonts ) { + INT32 MapFont; + MapFont = WinFontMap[FontNum]; + if (FontNum != -1) + { + return (GetWinFontHeight(L"A", MapFont)); + } + } return((UINT16)GetHeight(FontObjs[FontNum], 0)); } @@ -753,19 +753,19 @@ CHAR16 GetUnicodeChar(CHAR16 siChar) #ifdef GERMAN //switch( siChar ) //{ - // // + // // ? // case 252: siChar = 252; break; - // // + // // ? // case 220: siChar = 220; break; - // // + // // ? // case 228: siChar = 228; break; - // // + // // ? // case 196: siChar = 196; break; - // // + // // ? // case 246: siChar = 246; break; - // // + // // ? // case 214: siChar = 214; break; - // // + // // ? // case 223: siChar = 223; break; //} #endif @@ -809,17 +809,17 @@ CHAR16 GetUnicodeChar(CHAR16 siChar) case 223: siChar = 1071; break; //U+042F d0 af CYRILLIC CAPITAL LETTER YA //small letters - case 185: siChar = 8470; break; // - case 178: siChar = 1030; break; // - case 161: siChar = 1038; break; // - case 179: siChar = 1110; break; // - case 162: siChar = 1118; break; // - case 165: siChar = 1168; break; // - case 170: siChar = 1028; break; // - case 175: siChar = 1031; break; // - case 180: siChar = 1169; break; // - case 186: siChar = 1108; break; // - case 191: siChar = 1111; break; // + case 185: siChar = 8470; break; // ? + case 178: siChar = 1030; break; // ? + case 161: siChar = 1038; break; // ? + case 179: siChar = 1110; break; // ? + case 162: siChar = 1118; break; // ? + case 165: siChar = 1168; break; // ? + case 170: siChar = 1028; break; // ? + case 175: siChar = 1031; break; // ? + case 180: siChar = 1169; break; // ? + case 186: siChar = 1108; break; // ? + case 191: siChar = 1111; break; // ? case 184: siChar = 1105; break; //U+0451 d1 91 CYRILLIC SMALL LETTER IO case 224: siChar = 1072; break; //U+0430 a d0 b0 CYRILLIC SMALL LETTER A @@ -887,33 +887,33 @@ CHAR16 GetUnicodeChar(CHAR16 siChar) switch( siChar ) { //capital letters - //case 192: siChar = 192; break; // - //case 194: siChar = 194; break; // - //case 199: siChar = 199; break; // - //case 200: siChar = 200; break; // - //case 201: siChar = 201; break; // - //case 202: siChar = 202; break; // - //case 203: siChar = 203; break; // - //case 206: siChar = 206; break; // - //case 207: siChar = 207; break; // - //case 212: siChar = 212; break; // - //case 217: siChar = 217; break; // - //case 219: siChar = 219; break; // - case 143: siChar = 376; break; // + //case 192: siChar = 192; break; //? + //case 194: siChar = 194; break; //? + //case 199: siChar = 199; break; //? + //case 200: siChar = 200; break; //? + //case 201: siChar = 201; break; //? + //case 202: siChar = 202; break; //? + //case 203: siChar = 203; break; //? + //case 206: siChar = 206; break; //? + //case 207: siChar = 207; break; //? + //case 212: siChar = 212; break; //? + //case 217: siChar = 217; break; //? + //case 219: siChar = 219; break; //? + case 143: siChar = 376; break; //? //small letters - //case 224: siChar = 224; break; // - //case 226: siChar = 226; break; // - //case 231: siChar = 231; break; // - //case 232: siChar = 232; break; // - //case 233: siChar = 233; break; // - //case 234: siChar = 234; break; // - //case 235: siChar = 235; break; // - //case 238: siChar = 238; break; // - //case 239: siChar = 239; break; // - //case 244: siChar = 244; break; // - //case 249: siChar = 249; break; // - //case 251: siChar = 251; break; // + //case 224: siChar = 224; break; //? + //case 226: siChar = 226; break; //? + //case 231: siChar = 231; break; //? + //case 232: siChar = 232; break; //? + //case 233: siChar = 233; break; //? + //case 234: siChar = 234; break; //? + //case 235: siChar = 235; break; //? + //case 238: siChar = 238; break; //? + //case 239: siChar = 239; break; //? + //case 244: siChar = 244; break; //? + //case 249: siChar = 249; break; //? + //case 251: siChar = 251; break; //? //case 255: siChar = 255; break; // //inshy: italian letters //case 204: siChar = 204; break; //I' @@ -922,10 +922,10 @@ CHAR16 GetUnicodeChar(CHAR16 siChar) //case 242: siChar = 242; break; //o' //inshy: French ligatures //Ligature - //case 198: siChar = 198; break; // - //case 140: siChar = 338; break; // - //case 230: siChar = 230; break; // - //case 156: siChar = 339; break; // + //case 198: siChar = 198; break; //? + //case 140: siChar = 338; break; //? + //case 230: siChar = 230; break; //? + //case 156: siChar = 339; break; //? } #endif @@ -948,9 +948,9 @@ BOOLEAN SetFont(INT32 iFontIndex) SGP_THROW_IFFALSE( iFontIndex >= 0 ,"negative font index"); SGP_THROW_IFFALSE( iFontIndex <= MAX_FONTS, "font index > MAX_FONTS" ); SGP_THROW_IFFALSE( FontObjs[iFontIndex]!=NULL, "font is not initialized" ); -#ifdef WINFONTS - SET_WINFONT(WinFontMap[iFontIndex]); -#endif + if ( iUseWinFonts ) { + SET_WINFONT(WinFontMap[iFontIndex]); + } FontDefault=iFontIndex; return(TRUE); } @@ -1002,13 +1002,13 @@ UINT8 *pDestBuf; vswprintf(string, pFontString, argptr); // process gprintf string (get output str) va_end(argptr); -#ifdef WINFONTS - if (GET_WINFONT() != -1) - { - PrintWinFont(FontDestBuffer, GET_WINFONT(), x, y, string); - return(0); - } -#endif + if ( iUseWinFonts ) { + if (GET_WINFONT() != -1) + { + PrintWinFont(FontDestBuffer, GET_WINFONT(), x, y, string); + return(0); + } + } curletter=string; @@ -1116,13 +1116,14 @@ UINT8 *pDestBuf; va_start(argptr, pFontString); // Set up variable argument pointer vswprintf(string, pFontString, argptr); // process gprintf string (get output str) va_end(argptr); -#ifdef WINFONTS - if (GET_WINFONT() != -1) - { - PrintWinFont(FontDestBuffer, GET_WINFONT(), x, y, string); - return(0); - } -#endif + + if ( iUseWinFonts ) { + if (GET_WINFONT() != -1) + { + PrintWinFont(FontDestBuffer, GET_WINFONT(), x, y, string); + return(0); + } + } curletter=string; destx=x; @@ -1173,14 +1174,14 @@ UINT8 *pDestBuf; va_start(argptr, pFontString); // Set up variable argument pointer vswprintf(string, pFontString, argptr); // process gprintf string (get output str) va_end(argptr); -#ifdef WINFONTS - if (GET_WINFONT() != -1) - { - PrintWinFont(FontDestBuffer, GET_WINFONT(), x, y, string); - InvalidateRegion(x, y, x + StringPixLength(string, FontDefault), y + GetFontHeight(FontDefault)); - return(0); - } -#endif + if ( iUseWinFonts ) { + if (GET_WINFONT() != -1) + { + PrintWinFont(FontDestBuffer, GET_WINFONT(), x, y, string); + InvalidateRegion(x, y, x + StringPixLength(string, FontDefault), y + GetFontHeight(FontDefault)); + return(0); + } + } curletter=string; destx=x; @@ -1291,15 +1292,15 @@ CHAR16 string[512]; va_start(argptr, pFontString); // Set up variable argument pointer vswprintf(string, pFontString, argptr); // process gprintf string (get output str) va_end(argptr); -#ifdef WINFONTS - if (GET_WINFONT() != -1) - { - UnLockVideoSurface( CurrentSurface ); - PrintWinFont(CurrentSurface, GET_WINFONT(), x, y, string); - pDestBuf = LockVideoSurface( CurrentSurface, &uiDestPitchBYTES ); - return(0); - } -#endif + if ( iUseWinFonts ) { + if (GET_WINFONT() != -1) + { + UnLockVideoSurface( CurrentSurface ); + PrintWinFont(CurrentSurface, GET_WINFONT(), x, y, string); + pDestBuf = LockVideoSurface( CurrentSurface, &uiDestPitchBYTES ); + return(0); + } + } curletter=string; destx=x; @@ -1343,15 +1344,15 @@ UINT16 usOldForeColor; va_start(argptr, pFontString); // Set up variable argument pointer vswprintf(string, pFontString, argptr); // process gprintf string (get output str) va_end(argptr); -#ifdef WINFONTS - if (GET_WINFONT() != -1) - { - UnLockVideoSurface( CurrentSurface ); - PrintWinFont(CurrentSurface, GET_WINFONT(), x, y, pFontString); - pDestBuf = LockVideoSurface( CurrentSurface, &uiDestPitchBYTES ); - return(0); - } -#endif + if ( iUseWinFonts ) { + if (GET_WINFONT() != -1) + { + UnLockVideoSurface( CurrentSurface ); + PrintWinFont(CurrentSurface, GET_WINFONT(), x, y, pFontString); + pDestBuf = LockVideoSurface( CurrentSurface, &uiDestPitchBYTES ); + return(0); + } + } curletter=string; destx=x; @@ -1413,13 +1414,13 @@ UINT8 *pDestBuf; va_start(argptr, pFontString); // Set up variable argument pointer vswprintf(string, pFontString, argptr); // process gprintf string (get output str) va_end(argptr); -#ifdef WINFONTS - if (GET_WINFONT() != -1) + if ( iUseWinFonts ) { + if (GET_WINFONT() != -1) { PrintWinFont(FontDestBuffer, GET_WINFONT(), x, y, pFontString); return(0); } -#endif + } curletter=string; destx=x; @@ -1814,252 +1815,252 @@ FontTranslationTable *CreateEnglishTransTable( ) temp++; // RUSSIAN letters in UNICODE - *temp = 1040; // + *temp = 1040; //? temp++; - *temp = 1041; // + *temp = 1041; //? temp++; - *temp = 1042; // + *temp = 1042; //? temp++; - *temp = 1043; // + *temp = 1043; //? temp++; - *temp = 1044; // + *temp = 1044; //? temp++; - *temp = 1045; // + *temp = 1045; //? temp++; - *temp = 1046; // + *temp = 1046; //? temp++; - *temp = 1047; // + *temp = 1047; //? temp++; - *temp = 1048; // + *temp = 1048; //? temp++; - *temp = 1049; // + *temp = 1049; //? temp++; - *temp = 1050; // + *temp = 1050; //? temp++; - *temp = 1051; // + *temp = 1051; //? temp++; - *temp = 1052; // + *temp = 1052; //? temp++; - *temp = 1053; // + *temp = 1053; //? temp++; - *temp = 1054; // + *temp = 1054; //? temp++; - *temp = 1055; // + *temp = 1055; //? temp++; - *temp = 1056; // + *temp = 1056; //? temp++; - *temp = 1057; // + *temp = 1057; //? temp++; - *temp = 1058; // + *temp = 1058; //? temp++; - *temp = 1059; // + *temp = 1059; //? temp++; - *temp = 1060; // + *temp = 1060; //? temp++; - *temp = 1061; // + *temp = 1061; //? temp++; - *temp = 1062; // + *temp = 1062; //? temp++; - *temp = 1063; // + *temp = 1063; //? temp++; - *temp = 1064; // + *temp = 1064; //? temp++; - *temp = 1065; // + *temp = 1065; //? temp++; - *temp = 1066; // + *temp = 1066; //? temp++; - *temp = 1067; // + *temp = 1067; //? temp++; - *temp = 1068; // + *temp = 1068; //? temp++; - *temp = 1069; // + *temp = 1069; //? temp++; - *temp = 1070; // + *temp = 1070; //? temp++; - *temp = 1071; // + *temp = 1071; //? temp++; - *temp = 1072; // + *temp = 1072; // ? temp++; - *temp = 1073; // + *temp = 1073; // ? temp++; - *temp = 1074; // + *temp = 1074; // ? temp++; - *temp = 1075; // + *temp = 1075; // ? temp++; - *temp = 1076; // + *temp = 1076; // ? temp++; - *temp = 1077; // + *temp = 1077; // ? temp++; - *temp = 1078; // + *temp = 1078; // ? temp++; - *temp = 1079; // + *temp = 1079; // ? temp++; - *temp = 1080; // + *temp = 1080; // ? temp++; - *temp = 1081; // + *temp = 1081; // ? temp++; - *temp = 1082; // + *temp = 1082; // ? temp++; - *temp = 1083; // + *temp = 1083; // ? temp++; - *temp = 1084; // + *temp = 1084; // ? temp++; - *temp = 1085; // + *temp = 1085; // ? temp++; - *temp = 1086; // + *temp = 1086; // ? temp++; - *temp = 1087; // + *temp = 1087; // ? temp++; - *temp = 1088; // + *temp = 1088; // ? temp++; - *temp = 1089; // + *temp = 1089; // ? temp++; - *temp = 1090; // + *temp = 1090; // ? temp++; - *temp = 1091; // + *temp = 1091; // ? temp++; - *temp = 1092; // + *temp = 1092; // ? temp++; - *temp = 1093; // + *temp = 1093; // ? temp++; - *temp = 1094; // + *temp = 1094; // ? temp++; - *temp = 1095; // + *temp = 1095; // ? temp++; - *temp = 1096; // + *temp = 1096; // ? temp++; - *temp = 1097; // + *temp = 1097; // ? temp++; - *temp = 1098; // + *temp = 1098; // ? temp++; - *temp = 1099; // + *temp = 1099; // ? temp++; - *temp = 1100; // + *temp = 1100; // ? temp++; - *temp = 1101; // + *temp = 1101; // ? temp++; - *temp = 1102; // + *temp = 1102; // ? temp++; *temp = 1103; // temp++; // BELORUSSIAN and UKRAINIAN letters in UNICODE - *temp = 8470; // + *temp = 8470; // ? temp++; - *temp = 1025; // + *temp = 1025; // ? temp++; - *temp = 1030; // + *temp = 1030; // ? temp++; - *temp = 1038; // + *temp = 1038; // ? temp++; - *temp = 1105; // + *temp = 1105; // ? temp++; - *temp = 1110; // + *temp = 1110; // ? temp++; - *temp = 1118; // + *temp = 1118; // ? temp++; - *temp = 1168; // + *temp = 1168; // ? temp++; - *temp = 1028; // + *temp = 1028; // ? temp++; - *temp = 1031; // + *temp = 1031; // ? temp++; - *temp = 1169; // + *temp = 1169; // ? temp++; - *temp = 1108; // + *temp = 1108; // ? temp++; - *temp = 1111; // + *temp = 1111; // ? temp++; // POLISH letters in UNICODE - *temp = 260; // (on) + *temp = 260; // ?(on) temp++; - *temp = 262; // (tse) + *temp = 262; // ?(tse) temp++; - *temp = 280; // (en') + *temp = 280; // ?(en') temp++; - *temp = 321; // (el') + *temp = 321; // ?(el') temp++; - *temp = 323; // (en) + *temp = 323; // ?(en) temp++; - *temp = 211; // (o kratkoe) + *temp = 211; // ?(o kratkoe) temp++; - *temp = 346; // (es') + *temp = 346; // ?(es') temp++; - *temp = 379; // (zhet) + *temp = 379; // ?(zhet) temp++; - *temp = 377; // (zet) + *temp = 377; // ?(zet) temp++; - *temp = 261; // () + *temp = 261; // ?() temp++; - *temp = 263; // () + *temp = 263; // ?() temp++; - *temp = 281; // () + *temp = 281; // ?() temp++; - *temp = 322; // () + *temp = 322; // ?(? temp++; - *temp = 324; // () + *temp = 324; // ?(? temp++; - *temp = 243; // ( ) + *temp = 243; // ?(?? temp++; - *temp = 347; // () + *temp = 347; // ?(? temp++; - *temp = 380; // () + *temp = 380; // ?(? temp++; - *temp = 378; // () + *temp = 378; // ?(? temp++; // FRENCH and ITALIAN letters in UNICODE - *temp = 192; // + *temp = 192; //? temp++; - *temp = 194; // + *temp = 194; //? temp++; - *temp = 199; // + *temp = 199; //? temp++; - *temp = 200; // + *temp = 200; //? temp++; - *temp = 201; // + *temp = 201; //? temp++; - *temp = 202; // + *temp = 202; //? temp++; - *temp = 203; // + *temp = 203; //? temp++; - *temp = 206; // + *temp = 206; //? temp++; - *temp = 207; // + *temp = 207; //? temp++; - *temp = 212; // + *temp = 212; //? temp++; - *temp = 217; // + *temp = 217; //? temp++; - *temp = 219; // + *temp = 219; //? temp++; - *temp = 376; // + *temp = 376; //? temp++; //small letters - *temp = 224; // + *temp = 224; //? temp++; - *temp = 226; // + *temp = 226; //? temp++; - *temp = 231; // + *temp = 231; //? temp++; - *temp = 232; // + *temp = 232; //? temp++; - *temp = 233; // + *temp = 233; //? temp++; - *temp = 234; // + *temp = 234; //? temp++; - *temp = 235; // + *temp = 235; //? temp++; - *temp = 238; // + *temp = 238; //? temp++; - *temp = 239; // + *temp = 239; //? temp++; - *temp = 244; // + *temp = 244; //? temp++; - *temp = 249; // + *temp = 249; //? temp++; - *temp = 251; // + *temp = 251; //? temp++; *temp = 255; // temp++; @@ -2074,13 +2075,13 @@ FontTranslationTable *CreateEnglishTransTable( ) temp++; //French ligatures - *temp = 198; // + *temp = 198; //? temp++; - *temp = 338; // + *temp = 338; //? temp++; - *temp = 230; // + *temp = 230; //? temp++; - *temp = 339; // + *temp = 339; //? temp++; diff --git a/Standard Gaming Platform/Font.h b/Standard Gaming Platform/Font.h index 630f72d71..7c7000f68 100644 --- a/Standard Gaming Platform/Font.h +++ b/Standard Gaming Platform/Font.h @@ -4,9 +4,9 @@ #include "Types.h" #include "himage.h" #include "vobject.h" -#ifdef WINFONTS +//#ifdef WINFONTS #include "WinFont.h" -#endif +//#endif #include "Font Control.h" #define DEFAULT_SHADOW 2 diff --git a/Standard Gaming Platform/sgp.cpp b/Standard Gaming Platform/sgp.cpp index bd8afa683..350f20d71 100644 --- a/Standard Gaming Platform/sgp.cpp +++ b/Standard Gaming Platform/sgp.cpp @@ -1646,7 +1646,7 @@ void GetRuntimeSettings( ) // WANNE: Should we play the intro? iPlayIntro = (int) GetPrivateProfileInt( "Ja2 Settings","PLAY_INTRO", iPlayIntro, INIFile ); - + iUseWinFonts = (int) GetPrivateProfileInt( "Ja2 Settings","USE_WINFONTS", iUseWinFonts, INIFile,); // haydent: mouse scrolling iDisableMouseScrolling = (int) GetPrivateProfileInt( "Ja2 Settings","DISABLE_MOUSE_SCROLLING", iDisableMouseScrolling, INIFile ); @@ -1688,6 +1688,8 @@ void GetRuntimeSettings( ) // WANNE: Should we play the intro? iPlayIntro = (int)oProps.getIntProperty("Ja2 Settings","PLAY_INTRO", iPlayIntro); + iUseWinFonts= (int)oProps.getIntProperty("Ja2 Settings","USE_WINFONTS", iUseWinFonts); + // haydent: mouse scrolling iDisableMouseScrolling = (int)oProps.getIntProperty("Ja2 Settings","DISABLE_MOUSE_SCROLLING", iDisableMouseScrolling); diff --git a/Standard Gaming Platform/video.cpp b/Standard Gaming Platform/video.cpp index 11fee320c..f6d767821 100644 --- a/Standard Gaming Platform/video.cpp +++ b/Standard Gaming Platform/video.cpp @@ -117,9 +117,8 @@ static LPDIRECTDRAWSURFACE _gpBackBuffer = NULL; extern RECT rcWindow; extern POINT ptWindowSize; -#ifdef WINFONTS - UINT32 CurrentSurface = BACKBUFFER; -#endif +UINT32 CurrentSurface = BACKBUFFER; + // // Globals for mouse cursor // @@ -2640,12 +2639,12 @@ LPDIRECTDRAWSURFACE2 GetFrameBufferObject(void) LPDIRECTDRAWSURFACE2 GetMouseBufferObject(void) { Assert( gpPrimarySurface != NULL ); -#ifdef WINFONTS - //It's a damn bug. - return gpMouseCursorOriginal; -#else - return gpMouseCursor; -#endif + if ( iUseWinFonts ) { + //It's a damn bug. + return gpMouseCursorOriginal; + } else { + return gpMouseCursor; + } } diff --git a/Standard Gaming Platform/video.h b/Standard Gaming Platform/video.h index bdbf567a1..a0dd64d80 100644 --- a/Standard Gaming Platform/video.h +++ b/Standard Gaming Platform/video.h @@ -24,9 +24,9 @@ extern HWND ghWindow; extern UINT32 guiMouseBufferState; // BUFFER_READY, BUFFER_DIRTY, BUFFER_DISABLED -#ifdef WINFONTS +//#ifdef WINFONTS extern UINT32 CurrentSurface; -#endif +//#endif /* #ifdef __cplusplus extern "C" { diff --git a/Standard Gaming Platform/vsurface.cpp b/Standard Gaming Platform/vsurface.cpp index a9a517d68..fcb4938cc 100644 --- a/Standard Gaming Platform/vsurface.cpp +++ b/Standard Gaming Platform/vsurface.cpp @@ -453,9 +453,9 @@ BYTE *LockVideoSurface( UINT32 uiVSurface, UINT32 *puiPitch ) { VSURFACE_NODE *curr; -#ifdef WINFONTS - CurrentSurface = uiVSurface; -#endif + if ( iUseWinFonts ) { + CurrentSurface = uiVSurface; + } // // Check if given backbuffer or primary buffer // diff --git a/Utils/Font Control.cpp b/Utils/Font Control.cpp index 38744f659..c1d7cf9fc 100644 --- a/Utils/Font Control.cpp +++ b/Utils/Font Control.cpp @@ -225,9 +225,9 @@ BOOLEAN InitializeFonts( ) gfFontsInit = TRUE; // ATE: Init WinFont System and any winfonts we wish... -#ifdef WINFONTS - InitWinFonts( ); -#endif + if ( iUseWinFonts ) { + InitWinFonts( ); + } return( TRUE ); } @@ -255,9 +255,9 @@ void ShutdownFonts( ) #endif // ATE: Shutdown any win fonts -#ifdef WINFONTS + if ( iUseWinFonts ) { ShutdownWinFonts(); -#endif + } } // Set shades for fonts diff --git a/local.h b/local.h index 615decb70..ca9548ba4 100644 --- a/local.h +++ b/local.h @@ -31,6 +31,7 @@ extern UINT16 SCREEN_HEIGHT; extern int iResolution; // Resolution id from the ini file extern int iPlayIntro; +extern int iUseWinFonts; extern int iDisableMouseScrolling; extern INT16 iScreenWidthOffset; extern INT16 iScreenHeightOffset;