1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-23 04:00:00 +00:00

Merge branch 'miami' of https://github.com/GTAmodding/re3 into miami

This commit is contained in:
erorcun 2021-02-19 02:30:02 +03:00
commit dfa0c8bf19
36 changed files with 435 additions and 277 deletions

BIN
gamefiles/TEXT/russian.gxt Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -387,7 +387,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command)
#if (defined GTAVC_JP_PATCH || defined SUPPORT_JAPANESE_SCRIPT) #if (defined GTAVC_JP_PATCH || defined SUPPORT_JAPANESE_SCRIPT)
case COMMAND_IS_JAPANESE_GAME: case COMMAND_IS_JAPANESE_GAME:
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
UpdateCompareFlag(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_JAPANESE); UpdateCompareFlag(FrontEndMenuManager.m_PrefsLanguage == CMenuManager::LANGUAGE_JAPANESE);
#elif (defined GTAVC_JP_PATCH) #elif (defined GTAVC_JP_PATCH)
UpdateCompareFlag(true); UpdateCompareFlag(true);
#else #else

View file

@ -3097,11 +3097,10 @@ CMenuManager::LoadSettings()
#ifdef LOAD_INI_SETTINGS #ifdef LOAD_INI_SETTINGS
if (LoadINISettings()) { if (LoadINISettings()) {
LoadINIControllerSettings(); LoadINIControllerSettings();
} else {
// no re3.ini, create it
SaveINISettings();
SaveINIControllerSettings();
} }
// if no reVC.ini, create it, or update it with new values
SaveINISettings();
SaveINIControllerSettings();
#endif #endif
#ifdef FIX_BUGS #ifdef FIX_BUGS
@ -5490,6 +5489,9 @@ CMenuManager::SwitchMenuOnAndOff()
} }
Initialise(); Initialise();
LoadAllTextures(); LoadAllTextures();
#ifdef FIX_BUGS
CPad::StopPadsShaking();
#endif
} else { } else {
#ifdef EXTENDED_COLOURFILTER #ifdef EXTENDED_COLOURFILTER
// we always expect CPostFX to be open // we always expect CPostFX to be open

View file

@ -181,38 +181,6 @@ void IslandLoadingAfterChange(int8 before, int8 after) {
} }
#endif #endif
#ifdef MORE_LANGUAGES
void LangPolSelect(int8 action)
{
if (action == FEOPTION_ACTION_SELECT) {
FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_POLISH;
FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true;
FrontEndMenuManager.InitialiseChangedLanguageSettings();
FrontEndMenuManager.SaveSettings();
}
}
void LangRusSelect(int8 action)
{
if (action == FEOPTION_ACTION_SELECT) {
FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_RUSSIAN;
FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true;
FrontEndMenuManager.InitialiseChangedLanguageSettings();
FrontEndMenuManager.SaveSettings();
}
}
void LangJapSelect(int8 action)
{
if (action == FEOPTION_ACTION_SELECT) {
FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_JAPANESE;
FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true;
FrontEndMenuManager.InitialiseChangedLanguageSettings();
FrontEndMenuManager.SaveSettings();
}
}
#endif
#ifndef MULTISAMPLING #ifndef MULTISAMPLING
void GraphicsGoBack() { void GraphicsGoBack() {
} }
@ -471,11 +439,6 @@ CMenuScreenCustom aScreens[] = {
MENUACTION_LANG_GER, "FEL_GER", {nil, SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS}, 0, 0, MENUALIGN_CENTER, MENUACTION_LANG_GER, "FEL_GER", {nil, SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS}, 0, 0, MENUALIGN_CENTER,
MENUACTION_LANG_ITA, "FEL_ITA", {nil, SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS}, 0, 0, MENUALIGN_CENTER, MENUACTION_LANG_ITA, "FEL_ITA", {nil, SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS}, 0, 0, MENUALIGN_CENTER,
MENUACTION_LANG_SPA, "FEL_SPA", {nil, SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS}, 0, 0, MENUALIGN_CENTER, MENUACTION_LANG_SPA, "FEL_SPA", {nil, SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS}, 0, 0, MENUALIGN_CENTER,
#ifdef MORE_LANGUAGES
MENUACTION_CFO_DYNAMIC, "FEL_POL", { new CCFODynamic(nil, nil, nil, nil, LangPolSelect) }, 0, 0, MENUALIGN_CENTER,
MENUACTION_CFO_DYNAMIC, "FEL_RUS", { new CCFODynamic(nil, nil, nil, nil, LangRusSelect) }, 0, 0, MENUALIGN_CENTER
MENUACTION_CFO_DYNAMIC, "FEL_JAP", { new CCFODynamic(nil, nil, nil, nil, LangJapSelect) }, 0, 0, MENUALIGN_CENTER,
#endif
MENUACTION_GOBACK, "FEDS_TB", {nil, SAVESLOT_NONE, MENUPAGE_NONE}, 0, 0, MENUALIGN_CENTER, MENUACTION_GOBACK, "FEDS_TB", {nil, SAVESLOT_NONE, MENUPAGE_NONE}, 0, 0, MENUALIGN_CENTER,
}, },

View file

@ -1,5 +1,6 @@
#include "common.h" #include "common.h"
#include "main.h"
#include "Timer.h" #include "Timer.h"
#include "ModelIndices.h" #include "ModelIndices.h"
#include "Streaming.h" #include "Streaming.h"
@ -91,9 +92,11 @@ void
CRopes::Render(void) CRopes::Render(void)
{ {
int i; int i;
PUSH_RENDERGROUP("CRopes::Render");
for(i = 0; i < ARRAY_SIZE(aRopes); i++) for(i = 0; i < ARRAY_SIZE(aRopes); i++)
if(aRopes[i].m_bActive) if(aRopes[i].m_bActive)
aRopes[i].Render(); aRopes[i].Render();
POP_RENDERGROUP();
} }
bool bool

View file

@ -232,7 +232,6 @@ enum Config {
// not in master builds // not in master builds
#define VALIDATE_SAVE_SIZE #define VALIDATE_SAVE_SIZE
#define NO_MOVIES // disable intro videos
#define DEBUGMENU #define DEBUGMENU
#endif #endif
@ -246,11 +245,13 @@ enum Config {
#endif #endif
#define FIX_BUGS // fixes bugs that we've came across during reversing. You can undefine this only on release builds. #define FIX_BUGS // fixes bugs that we've came across during reversing. You can undefine this only on release builds.
//#define MORE_LANGUAGES // Add more translations to the game #define MORE_LANGUAGES // Add more translations to the game
#define COMPATIBLE_SAVES // this allows changing structs while keeping saves compatible #define COMPATIBLE_SAVES // this allows changing structs while keeping saves compatible
#define LOAD_INI_SETTINGS // as the name suggests. fundamental for CUSTOM_FRONTEND_OPTIONS #define LOAD_INI_SETTINGS // as the name suggests. fundamental for CUSTOM_FRONTEND_OPTIONS
#define FIX_HIGH_FPS_BUGS_ON_FRONTEND #define FIX_HIGH_FPS_BUGS_ON_FRONTEND
#define NO_MOVIES // add option to disable intro videos
#if defined(__LP64__) || defined(_WIN64) #if defined(__LP64__) || defined(_WIN64)
#define FIX_BUGS_64 // Must have fixes to be able to run 64 bit build #define FIX_BUGS_64 // Must have fixes to be able to run 64 bit build
#endif #endif

View file

@ -95,7 +95,10 @@ bool gbModelViewer;
bool gbShowTimebars; bool gbShowTimebars;
#endif #endif
#ifdef DRAW_GAME_VERSION_TEXT #ifdef DRAW_GAME_VERSION_TEXT
bool gDrawVersionText; // Our addition, we think it was always enabled on !MASTER builds bool gbDrawVersionText; // Our addition, we think it was always enabled on !MASTER builds
#endif
#ifdef NO_MOVIES
bool gbNoMovies;
#endif #endif
volatile int32 frameCount; volatile int32 frameCount;
@ -1068,7 +1071,7 @@ DisplayGameDebugText()
#ifdef DRAW_GAME_VERSION_TEXT #ifdef DRAW_GAME_VERSION_TEXT
wchar ver[200]; wchar ver[200];
if(gDrawVersionText) // This realtime switch is our thing if(gbDrawVersionText) // This realtime switch is our thing
{ {
#ifdef USE_OUR_VERSIONING #ifdef USE_OUR_VERSIONING
@ -1261,6 +1264,7 @@ if(gbRenderEverythingBarRoads)
void void
RenderScene_new(void) RenderScene_new(void)
{ {
PUSH_RENDERGROUP("RenderScene_new");
CClouds::Render(); CClouds::Render();
DoRWRenderHorizon(); DoRWRenderHorizon();
@ -1268,6 +1272,7 @@ RenderScene_new(void)
DefinedState(); DefinedState();
// CMattRenderer::ResetRenderStates // CMattRenderer::ResetRenderStates
// moved CRenderer::RenderBoats to before transparent water // moved CRenderer::RenderBoats to before transparent water
POP_RENDERGROUP();
} }
// TODO // TODO
@ -1275,6 +1280,7 @@ bool FredIsInFirstPersonCam(void) { return false; }
void void
RenderEffects_new(void) RenderEffects_new(void)
{ {
PUSH_RENDERGROUP("RenderEffects_new");
CShadows::RenderStaticShadows(); CShadows::RenderStaticShadows();
// CRenderer::GenerateEnvironmentMap // CRenderer::GenerateEnvironmentMap
CShadows::RenderStoredShadows(); CShadows::RenderStoredShadows();
@ -1319,6 +1325,7 @@ if(gbRenderFadingInEntities)
CPointLights::RenderFogEffect(); CPointLights::RenderFogEffect();
CMovingThings::Render(); CMovingThings::Render();
CRenderer::RenderFirstPersonVehicle(); CRenderer::RenderFirstPersonVehicle();
POP_RENDERGROUP();
} }
#endif #endif
@ -1331,6 +1338,7 @@ RenderScene(void)
return; return;
} }
#endif #endif
PUSH_RENDERGROUP("RenderScene");
CClouds::Render(); CClouds::Render();
DoRWRenderHorizon(); DoRWRenderHorizon();
CRenderer::RenderRoads(); CRenderer::RenderRoads();
@ -1346,11 +1354,13 @@ RenderScene(void)
RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE); RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE);
CWeather::RenderRainStreaks(); CWeather::RenderRainStreaks();
CCoronas::RenderSunReflection(); CCoronas::RenderSunReflection();
POP_RENDERGROUP();
} }
void void
RenderDebugShit(void) RenderDebugShit(void)
{ {
PUSH_RENDERGROUP("RenderDebugShit");
CTheScripts::RenderTheScriptDebugLines(); CTheScripts::RenderTheScriptDebugLines();
#ifndef FINAL #ifndef FINAL
if(gbShowCollisionLines) if(gbShowCollisionLines)
@ -1359,6 +1369,7 @@ RenderDebugShit(void)
CDebug::DrawLines(); CDebug::DrawLines();
DefinedState(); DefinedState();
#endif #endif
POP_RENDERGROUP();
} }
void void
@ -1370,6 +1381,7 @@ RenderEffects(void)
return; return;
} }
#endif #endif
PUSH_RENDERGROUP("RenderEffects");
CGlass::Render(); CGlass::Render();
CWaterCannons::Render(); CWaterCannons::Render();
CSpecialFX::Render(); CSpecialFX::Render();
@ -1386,11 +1398,13 @@ RenderEffects(void)
CPointLights::RenderFogEffect(); CPointLights::RenderFogEffect();
CMovingThings::Render(); CMovingThings::Render();
CRenderer::RenderFirstPersonVehicle(); CRenderer::RenderFirstPersonVehicle();
POP_RENDERGROUP();
} }
void void
Render2dStuff(void) Render2dStuff(void)
{ {
PUSH_RENDERGROUP("Render2dStuff");
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
@ -1462,6 +1476,7 @@ Render2dStuff(void)
#ifdef DEBUGMENU #ifdef DEBUGMENU
DebugMenuRender(); DebugMenuRender();
#endif #endif
POP_RENDERGROUP();
} }
void void
@ -1469,7 +1484,9 @@ RenderMenus(void)
{ {
if (FrontEndMenuManager.m_bMenuActive) if (FrontEndMenuManager.m_bMenuActive)
{ {
PUSH_RENDERGROUP("RenderMenus");
FrontEndMenuManager.DrawFrontEnd(); FrontEndMenuManager.DrawFrontEnd();
POP_RENDERGROUP();
} }
#ifndef MASTER #ifndef MASTER
else else
@ -1480,6 +1497,7 @@ RenderMenus(void)
void void
Render2dStuffAfterFade(void) Render2dStuffAfterFade(void)
{ {
PUSH_RENDERGROUP("Render2dStuffAfterFade");
#ifndef MASTER #ifndef MASTER
DisplayGameDebugText(); DisplayGameDebugText();
#endif #endif
@ -1490,6 +1508,7 @@ Render2dStuffAfterFade(void)
CHud::DrawAfterFade(); CHud::DrawAfterFade();
CFont::DrawFonts(); CFont::DrawFonts();
CCredits::Render(); CCredits::Render();
POP_RENDERGROUP();
} }
void void

View file

@ -1,5 +1,16 @@
#pragma once #pragma once
#ifndef FINAL
// defined in RwHelpder.cpp
void PushRendergroup(const char *name);
void PopRendergroup(void);
#define PUSH_RENDERGROUP(str) PushRendergroup(str)
#define POP_RENDERGROUP() PopRendergroup()
#else
#define PUSH_RENDERGROUP(str)
#define POP_RENDERGROUP()
#endif
struct GlobalScene struct GlobalScene
{ {
RpWorld *world; RpWorld *world;
@ -55,3 +66,11 @@ void SaveINIControllerSettings();
extern bool gbNewRenderer; extern bool gbNewRenderer;
bool FredIsInFirstPersonCam(void); bool FredIsInFirstPersonCam(void);
#endif #endif
#ifdef DRAW_GAME_VERSION_TEXT
extern bool gbDrawVersionText;
#endif
#ifdef NO_MOVIES
extern bool gbNoMovies;
#endif

View file

@ -90,16 +90,51 @@ mysrand(unsigned int seed)
#ifdef CUSTOM_FRONTEND_OPTIONS #ifdef CUSTOM_FRONTEND_OPTIONS
#include "frontendoption.h" #include "frontendoption.h"
#ifdef MORE_LANGUAGES
void LangPolSelect(int8 action)
{
if (action == FEOPTION_ACTION_SELECT) {
FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_POLISH;
FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true;
FrontEndMenuManager.InitialiseChangedLanguageSettings();
FrontEndMenuManager.SaveSettings();
}
}
void LangRusSelect(int8 action)
{
if (action == FEOPTION_ACTION_SELECT) {
FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_RUSSIAN;
FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true;
FrontEndMenuManager.InitialiseChangedLanguageSettings();
FrontEndMenuManager.SaveSettings();
}
}
void LangJapSelect(int8 action)
{
if (action == FEOPTION_ACTION_SELECT) {
FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_JAPANESE;
FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true;
FrontEndMenuManager.InitialiseChangedLanguageSettings();
FrontEndMenuManager.SaveSettings();
}
}
#endif
void void
CustomFrontendOptionsPopulate(void) CustomFrontendOptionsPopulate(void)
{ {
// Moved to an array in MenuScreensCustom.cpp, but APIs are still available. see frontendoption.h // Moved to an array in MenuScreensCustom.cpp, but APIs are still available. see frontendoption.h
int fd;
// These work only if we have neo folder, so they're dynamically added // These work only if we have neo folder, so they're dynamically added
#ifdef EXTENDED_PIPELINES #ifdef EXTENDED_PIPELINES
const char *vehPipelineNames[] = { "FED_MFX", "FED_NEO" }; const char *vehPipelineNames[] = { "FED_MFX", "FED_NEO" };
const char *off_on[] = { "FEM_OFF", "FEM_ON" }; const char *off_on[] = { "FEM_OFF", "FEM_ON" };
int fd = CFileMgr::OpenFile("neo/neo.txd","r"); fd = CFileMgr::OpenFile("neo/neo.txd","r");
if (fd) { if (fd) {
#ifdef GRAPHICS_MENU_OPTIONS #ifdef GRAPHICS_MENU_OPTIONS
FrontendOptionSetCursor(MENUPAGE_GRAPHICS_SETTINGS, -3, false); FrontendOptionSetCursor(MENUPAGE_GRAPHICS_SETTINGS, -3, false);
@ -116,6 +151,38 @@ CustomFrontendOptionsPopulate(void)
#endif #endif
CFileMgr::CloseFile(fd); CFileMgr::CloseFile(fd);
} }
#endif
// Add outsourced language translations, if files are found
#ifdef MORE_LANGUAGES
int fd2;
FrontendOptionSetCursor(MENUPAGE_LANGUAGE_SETTINGS, 5, false);
#if 0
if (fd = CFileMgr::OpenFile("text/polish.gxt")) {
if (fd2 = CFileMgr::OpenFile("models/fonts_p.txd")) {
FrontendOptionAddDynamic("FEL_POL", 0, 0, MENUALIGN_CENTER, nil, nil, LangPolSelect, nil, nil);
CFileMgr::CloseFile(fd2);
}
CFileMgr::CloseFile(fd);
}
#endif
if (fd = CFileMgr::OpenFile("text/russian.gxt")) {
if (fd2 = CFileMgr::OpenFile("models/fonts_r.txd")) {
FrontendOptionAddDynamic("FEL_RUS", 0, 0, MENUALIGN_CENTER, nil, nil, LangRusSelect, nil, nil);
CFileMgr::CloseFile(fd2);
}
CFileMgr::CloseFile(fd);
}
#if 0
if (fd = CFileMgr::OpenFile("text/japanese.gxt")) {
if (fd2 = CFileMgr::OpenFile("models/fonts_j.txd")) {
FrontendOptionAddDynamic("FEL_JAP", 0, 0, MENUALIGN_CENTER, nil, nil, LangJapSelect, nil, nil);
CFileMgr::CloseFile(fd2);
}
CFileMgr::CloseFile(fd);
}
#endif
#endif #endif
} }
@ -466,8 +533,10 @@ bool LoadINISettings()
ReadIniIfExists("Draw", "FixSprites", &CDraw::ms_bFixSprites); ReadIniIfExists("Draw", "FixSprites", &CDraw::ms_bFixSprites);
#endif #endif
#ifdef DRAW_GAME_VERSION_TEXT #ifdef DRAW_GAME_VERSION_TEXT
extern bool gDrawVersionText; ReadIniIfExists("General", "DrawVersionText", &gbDrawVersionText);
ReadIniIfExists("General", "DrawVersionText", &gDrawVersionText); #endif
#ifdef NO_MOVIES
ReadIniIfExists("General", "NoMovies", &gbNoMovies);
#endif #endif
#ifdef CUSTOM_FRONTEND_OPTIONS #ifdef CUSTOM_FRONTEND_OPTIONS
@ -563,8 +632,10 @@ void SaveINISettings()
StoreIni("Draw", "FixSprites", CDraw::ms_bFixSprites); StoreIni("Draw", "FixSprites", CDraw::ms_bFixSprites);
#endif #endif
#ifdef DRAW_GAME_VERSION_TEXT #ifdef DRAW_GAME_VERSION_TEXT
extern bool gDrawVersionText; StoreIni("General", "DrawVersionText", gbDrawVersionText);
StoreIni("General", "DrawVersionText", gDrawVersionText); #endif
#ifdef NO_MOVIES
StoreIni("General", "NoMovies", gbNoMovies);
#endif #endif
#ifdef CUSTOM_FRONTEND_OPTIONS #ifdef CUSTOM_FRONTEND_OPTIONS
for (int i = 0; i < MENUPAGES; i++) { for (int i = 0; i < MENUPAGES; i++) {
@ -994,8 +1065,7 @@ extern bool gbRenderWorld2;
#ifdef DRAW_GAME_VERSION_TEXT #ifdef DRAW_GAME_VERSION_TEXT
extern bool gDrawVersionText; DebugMenuAddVarBool8("Debug", "Version Text", &gbDrawVersionText, nil);
DebugMenuAddVarBool8("Debug", "Version Text", &gDrawVersionText, nil);
#endif #endif
DebugMenuAddVarBool8("Debug", "Show DebugStuffInRelease", &gbDebugStuffInRelease, nil); DebugMenuAddVarBool8("Debug", "Show DebugStuffInRelease", &gbDebugStuffInRelease, nil);
#ifdef TIMEBARS #ifdef TIMEBARS
@ -1107,7 +1177,7 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con
strcat_s(re3_buff, re3_buffsize, "(Press Retry to debug the application)"); strcat_s(re3_buff, re3_buffsize, "(Press Retry to debug the application)");
nCode = ::MessageBoxA(nil, re3_buff, "RE3 Assertion Failed!", nCode = ::MessageBoxA(nil, re3_buff, "REVC Assertion Failed!",
MB_ABORTRETRYIGNORE|MB_ICONHAND|MB_SETFOREGROUND|MB_TASKMODAL); MB_ABORTRETRYIGNORE|MB_ICONHAND|MB_SETFOREGROUND|MB_TASKMODAL);
if (nCode == IDABORT) if (nCode == IDABORT)
@ -1128,7 +1198,7 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con
abort(); abort();
#else #else
// TODO // TODO
printf("\nRE3 ASSERT FAILED\n\tFile: %s\n\tLine: %d\n\tFunction: %s\n\tExpression: %s\n",filename,lineno,func,expr); printf("\nREVC ASSERT FAILED\n\tFile: %s\n\tLine: %d\n\tFunction: %s\n\tExpression: %s\n",filename,lineno,func,expr);
assert(false); assert(false);
#endif #endif
} }
@ -1180,14 +1250,14 @@ void re3_usererror(const char *format, ...)
vsprintf_s(re3_buff, re3_buffsize, format, va); vsprintf_s(re3_buff, re3_buffsize, format, va);
va_end(va); va_end(va);
::MessageBoxA(nil, re3_buff, "RE3 Error!", ::MessageBoxA(nil, re3_buff, "REVC Error!",
MB_OK|MB_ICONHAND|MB_SETFOREGROUND|MB_TASKMODAL); MB_OK|MB_ICONHAND|MB_SETFOREGROUND|MB_TASKMODAL);
raise(SIGABRT); raise(SIGABRT);
_exit(3); _exit(3);
#else #else
vsprintf(re3_buff, format, va); vsprintf(re3_buff, format, va);
printf("\nRE3 Error!\n\t%s\n",re3_buff); printf("\nREVC Error!\n\t%s\n",re3_buff);
assert(false); assert(false);
#endif #endif
} }

View file

@ -91,13 +91,7 @@ vehicleRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
setWorldMatrix(atomic->getFrame()->getLTM()); setWorldMatrix(atomic->getFrame()->getLTM());
lightingCB(atomic); lightingCB(atomic);
#ifdef RW_GL_USE_VAOS setupVertexInput(header);
glBindVertexArray(header->vao);
#else
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, header->ibo);
glBindBuffer(GL_ARRAY_BUFFER, header->vbo);
setAttribPointers(header->attribDesc, header->numAttribs);
#endif
InstanceData *inst = header->inst; InstanceData *inst = header->inst;
rw::int32 n = header->numMeshes; rw::int32 n = header->numMeshes;
@ -138,9 +132,7 @@ vehicleRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
SetRenderState(SRCBLEND, BLENDSRCALPHA); SetRenderState(SRCBLEND, BLENDSRCALPHA);
#ifndef RW_GL_USE_VAOS teardownVertexInput(header);
disableAttribPointers(header->attribDesc, header->numAttribs);
#endif
} }
void void
@ -211,13 +203,7 @@ worldRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
setWorldMatrix(atomic->getFrame()->getLTM()); setWorldMatrix(atomic->getFrame()->getLTM());
lightingCB(atomic); lightingCB(atomic);
#ifdef RW_GL_USE_VAOS setupVertexInput(header);
glBindVertexArray(header->vao);
#else
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, header->ibo);
glBindBuffer(GL_ARRAY_BUFFER, header->vbo);
setAttribPointers(header->attribDesc, header->numAttribs);
#endif
InstanceData *inst = header->inst; InstanceData *inst = header->inst;
rw::int32 n = header->numMeshes; rw::int32 n = header->numMeshes;
@ -255,9 +241,7 @@ worldRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
inst++; inst++;
} }
setTexture(1, nil); setTexture(1, nil);
#ifndef RW_GL_USE_VAOS teardownVertexInput(header);
disableAttribPointers(header->attribDesc, header->numAttribs);
#endif
} }
void void
@ -319,13 +303,7 @@ glossRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
Material *m; Material *m;
#ifdef RW_GL_USE_VAOS setupVertexInput(header);
glBindVertexArray(header->vao);
#else
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, header->ibo);
glBindBuffer(GL_ARRAY_BUFFER, header->vbo);
setAttribPointers(header->attribDesc, header->numAttribs);
#endif
InstanceData *inst = header->inst; InstanceData *inst = header->inst;
rw::int32 n = header->numMeshes; rw::int32 n = header->numMeshes;
@ -368,9 +346,7 @@ glossRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
SetRenderState(SRCBLEND, BLENDSRCALPHA); SetRenderState(SRCBLEND, BLENDSRCALPHA);
SetRenderState(DESTBLEND, BLENDINVSRCALPHA); SetRenderState(DESTBLEND, BLENDINVSRCALPHA);
#ifndef RW_GL_USE_VAOS teardownVertexInput(header);
disableAttribPointers(header->attribDesc, header->numAttribs);
#endif
} }
void void
@ -454,13 +430,7 @@ rimSkinRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
setWorldMatrix(atomic->getFrame()->getLTM()); setWorldMatrix(atomic->getFrame()->getLTM());
lightingCB(atomic); lightingCB(atomic);
#ifdef RW_GL_USE_VAOS setupVertexInput(header);
glBindVertexArray(header->vao);
#else
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, header->ibo);
glBindBuffer(GL_ARRAY_BUFFER, header->vbo);
setAttribPointers(header->attribDesc, header->numAttribs);
#endif
InstanceData *inst = header->inst; InstanceData *inst = header->inst;
rw::int32 n = header->numMeshes; rw::int32 n = header->numMeshes;
@ -483,9 +453,7 @@ rimSkinRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
drawInst(header, inst); drawInst(header, inst);
inst++; inst++;
} }
#ifndef RW_GL_USE_VAOS teardownVertexInput(header);
disableAttribPointers(header->attribDesc, header->numAttribs);
#endif
} }
static void static void
@ -505,13 +473,7 @@ rimRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
setWorldMatrix(atomic->getFrame()->getLTM()); setWorldMatrix(atomic->getFrame()->getLTM());
lightingCB(atomic); lightingCB(atomic);
#ifdef RW_GL_USE_VAOS setupVertexInput(header);
glBindVertexArray(header->vao);
#else
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, header->ibo);
glBindBuffer(GL_ARRAY_BUFFER, header->vbo);
setAttribPointers(header->attribDesc, header->numAttribs);
#endif
InstanceData *inst = header->inst; InstanceData *inst = header->inst;
rw::int32 n = header->numMeshes; rw::int32 n = header->numMeshes;
@ -532,9 +494,7 @@ rimRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
drawInst(header, inst); drawInst(header, inst);
inst++; inst++;
} }
#ifndef RW_GL_USE_VAOS teardownVertexInput(header);
disableAttribPointers(header->attribDesc, header->numAttribs);
#endif
} }
void void
@ -697,13 +657,7 @@ AtomicFirstPass(RpAtomic *atomic, int pass)
if(!setupDone){ if(!setupDone){
defaultShader->use(); defaultShader->use();
setWorldMatrix(&building->matrix); setWorldMatrix(&building->matrix);
#ifdef RW_GL_USE_VAOS setupVertexInput(building->instHeader);
glBindVertexArray(building->instHeader->vao);
#else
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, building->instHeader->ibo);
glBindBuffer(GL_ARRAY_BUFFER, building->instHeader->vbo);
setAttribPointers(building->instHeader->attribDesc, building->instHeader->numAttribs);
#endif
setLights(&lights); setLights(&lights);
setupDone = true; setupDone = true;
} }
@ -714,9 +668,7 @@ AtomicFirstPass(RpAtomic *atomic, int pass)
drawInst(building->instHeader, inst); drawInst(building->instHeader, inst);
} }
#ifndef RW_GL_USE_VAOS teardownVertexInput(building->instHeader);
disableAttribPointers(building->instHeader->attribDesc, building->instHeader->numAttribs);
#endif
if(defer) if(defer)
numBlendInsts[pass]++; numBlendInsts[pass]++;
} }
@ -755,13 +707,7 @@ RenderBlendPass(int pass)
for(i = 0; i < numBlendInsts[pass]; i++){ for(i = 0; i < numBlendInsts[pass]; i++){
BuildingInst *building = &blendInsts[pass][i]; BuildingInst *building = &blendInsts[pass][i];
#ifdef RW_GL_USE_VAOS setupVertexInput(building->instHeader);
glBindVertexArray(building->instHeader->vao);
#else
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, building->instHeader->ibo);
glBindBuffer(GL_ARRAY_BUFFER, building->instHeader->vbo);
setAttribPointers(building->instHeader->attribDesc, building->instHeader->numAttribs);
#endif
setWorldMatrix(&building->matrix); setWorldMatrix(&building->matrix);
if(building->lighting) if(building->lighting)
lights.ambient = pAmbient->color; lights.ambient = pAmbient->color;
@ -783,9 +729,7 @@ RenderBlendPass(int pass)
drawInst(building->instHeader, inst); drawInst(building->instHeader, inst);
} }
#ifndef RW_GL_USE_VAOS teardownVertexInput(building->instHeader);
disableAttribPointers(building->instHeader->attribDesc, building->instHeader->numAttribs);
#endif
} }
} }
} }

View file

@ -7,6 +7,7 @@
#error "Need librw for EXTENDED_COLOURFILTER" #error "Need librw for EXTENDED_COLOURFILTER"
#endif #endif
#include "main.h"
#include "RwHelper.h" #include "RwHelper.h"
#include "Camera.h" #include "Camera.h"
#include "MBlur.h" #include "MBlur.h"
@ -385,6 +386,8 @@ CPostFX::GetBackBuffer(RwCamera *cam)
void void
CPostFX::Render(RwCamera *cam, uint32 red, uint32 green, uint32 blue, uint32 blur, int32 type, uint32 bluralpha) CPostFX::Render(RwCamera *cam, uint32 red, uint32 green, uint32 blue, uint32 blur, int32 type, uint32 bluralpha)
{ {
PUSH_RENDERGROUP("CPostFX::Render");
if(pFrontBuffer == nil) if(pFrontBuffer == nil)
Open(cam); Open(cam);
assert(pFrontBuffer); assert(pFrontBuffer);
@ -446,6 +449,8 @@ CPostFX::Render(RwCamera *cam, uint32 red, uint32 green, uint32 blue, uint32 blu
bJustInitialised = false; bJustInitialised = false;
}else }else
bJustInitialised = true; bJustInitialised = true;
POP_RENDERGROUP();
} }
int CPostFX::PrevRed[NUMAVERAGE], CPostFX::AvgRed; int CPostFX::PrevRed[NUMAVERAGE], CPostFX::AvgRed;

View file

@ -1,5 +1,6 @@
#include "common.h" #include "common.h"
#include "main.h"
#include "Antennas.h" #include "Antennas.h"
CAntenna CAntennas::aAntennas[NUMANTENNAS]; CAntenna CAntennas::aAntennas[NUMANTENNAS];
@ -70,6 +71,7 @@ CAntennas::Render(void)
{ {
int i, j; int i, j;
PUSH_RENDERGROUP("CAntennas::Render");
for(i = 0; i < NUMANTENNAS; i++){ for(i = 0; i < NUMANTENNAS; i++){
if(!aAntennas[i].active) if(!aAntennas[i].active)
continue; continue;
@ -101,6 +103,8 @@ CAntennas::Render(void)
} }
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
POP_RENDERGROUP();
} }
void void

View file

@ -1,5 +1,6 @@
#include "common.h" #include "common.h"
#include "main.h"
#include "Sprite.h" #include "Sprite.h"
#include "Sprite2d.h" #include "Sprite2d.h"
#include "General.h" #include "General.h"
@ -119,6 +120,8 @@ CClouds::Render(void)
if(!CGame::CanSeeOutSideFromCurrArea()) if(!CGame::CanSeeOutSideFromCurrArea())
return; return;
PUSH_RENDERGROUP("CClouds::Render");
CCoronas::SunBlockedByClouds = false; CCoronas::SunBlockedByClouds = false;
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
@ -301,6 +304,8 @@ CClouds::Render(void)
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA); RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA);
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA); RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA);
POP_RENDERGROUP();
} }
bool bool
@ -313,6 +318,8 @@ void
CClouds::RenderBackground(int16 topred, int16 topgreen, int16 topblue, CClouds::RenderBackground(int16 topred, int16 topgreen, int16 topblue,
int16 botred, int16 botgreen, int16 botblue, int16 alpha) int16 botred, int16 botgreen, int16 botblue, int16 alpha)
{ {
PUSH_RENDERGROUP("CClouds::RenderBackground");
CVector right = CrossProduct(TheCamera.GetUp(), TheCamera.GetForward()); CVector right = CrossProduct(TheCamera.GetUp(), TheCamera.GetForward());
right.Normalise(); right.Normalise();
float c = right.Magnitude2D(); float c = right.Magnitude2D();
@ -415,6 +422,8 @@ CClouds::RenderBackground(int16 topred, int16 topgreen, int16 topblue,
ms_colourBottom.g = fogg; ms_colourBottom.g = fogg;
ms_colourBottom.b = fogb; ms_colourBottom.b = fogb;
} }
POP_RENDERGROUP();
} }
void void
@ -423,6 +432,8 @@ CClouds::RenderHorizon(void)
if(UseDarkBackground()) if(UseDarkBackground())
return; return;
PUSH_RENDERGROUP("CClouds::RenderHorizon");
ms_colourBottom.a = 230; ms_colourBottom.a = 230;
ms_colourTop.a = 80; ms_colourTop.a = 80;
@ -457,4 +468,6 @@ CClouds::RenderHorizon(void)
CSprite2d::DrawAnyRect(0.0f, topleft, SCREEN_WIDTH, topright, 0.0f, botleft, SCREEN_WIDTH, botright, CSprite2d::DrawAnyRect(0.0f, topleft, SCREEN_WIDTH, topright, 0.0f, botleft, SCREEN_WIDTH, botright,
ms_colourBkGrd, ms_colourBkGrd, ms_colourBkGrd, ms_colourBkGrd); ms_colourBkGrd, ms_colourBkGrd, ms_colourBkGrd, ms_colourBkGrd);
POP_RENDERGROUP();
} }

View file

@ -249,6 +249,8 @@ CCoronas::Render(void)
int i, j; int i, j;
int screenw, screenh; int screenw, screenh;
PUSH_RENDERGROUP("CCoronas::Render");
screenw = RwRasterGetWidth(RwCameraGetRaster(Scene.camera)); screenw = RwRasterGetWidth(RwCameraGetRaster(Scene.camera));
screenh = RwRasterGetHeight(RwCameraGetRaster(Scene.camera)); screenh = RwRasterGetHeight(RwCameraGetRaster(Scene.camera));
@ -432,6 +434,8 @@ CCoronas::Render(void)
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
POP_RENDERGROUP();
} }
void void
@ -442,6 +446,8 @@ CCoronas::RenderReflections(void)
CEntity *entity; CEntity *entity;
if(CWeather::WetRoads > 0.0f){ if(CWeather::WetRoads > 0.0f){
PUSH_RENDERGROUP("CCoronas::RenderReflections");
CSprite::InitSpriteBuffer(); CSprite::InitSpriteBuffer();
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)FALSE);
@ -517,6 +523,8 @@ CCoronas::RenderReflections(void)
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE);
POP_RENDERGROUP();
}else{ }else{
for(i = 0; i < NUMCORONAS; i++) for(i = 0; i < NUMCORONAS; i++)
aCoronas[i].renderReflection = false; aCoronas[i].renderReflection = false;

View file

@ -459,6 +459,7 @@ void CMovingThings::Update()
void CMovingThings::Render() void CMovingThings::Render()
{ {
PUSH_RENDERGROUP("CMovingThings::Render");
CSmokeTrails::Update(); CSmokeTrails::Update();
int i; int i;
@ -471,6 +472,7 @@ void CMovingThings::Render()
CPlaneTrails::Render(); CPlaneTrails::Render();
CSmokeTrails::Render(); CSmokeTrails::Render();
CPlaneBanners::Render(); CPlaneBanners::Render();
POP_RENDERGROUP();
} }
void CMovingThings::RegisterOne(CEntity *pEnt, uint16 nType) { void CMovingThings::RegisterOne(CEntity *pEnt, uint16 nType) {

View file

@ -71,8 +71,8 @@ int16 CFont::Size[MAX_FONTS][210] = {
18, 10, 17, 17, 17, 17, 17, 15, 12, 16, 5, 30, 30, 30, 30, 30, 18, 10, 17, 17, 17, 17, 17, 15, 12, 16, 5, 30, 30, 30, 30, 30,
// A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, // A, B, C, D, E, F, G, H, I, J, K, L, M, N, O,
12, 16, 19, 16, 19, 18, 18, 17, 22, 11, 17, 18, 18, 30, 22, 19, 12, 16, 19, 16, 19, 18, 18, 17, 22, 11, 17, 18, 18, 30, 22, 19,
#ifdef FIX_BUGS
//P, Q, R, S, T, U, V, W, X, Y, Z, ??, ??, ??, ¡, \, //P, Q, R, S, T, U, V, W, X, Y, Z, ??, ??, ??, ¡, \,
#ifdef FIX_BUGS
22, 19, 19, 20, 18, 19, 19, 29, 19, 18, 19, 19, 33, 33, 10, 19, 22, 19, 19, 20, 18, 19, 19, 29, 19, 18, 19, 19, 33, 33, 10, 19,
#else #else
22, 19, 19, 20, 18, 19, 19, 29, 19, 18, 19, 19, 33, 33, 19, 19, 22, 19, 19, 20, 18, 19, 19, 29, 19, 18, 19, 19, 33, 33, 19, 19,
@ -85,8 +85,8 @@ int16 CFont::Size[MAX_FONTS][210] = {
16, 16, 16, 16, 33, 17, 18, 18, 18, 18, 11, 11, 11, 11, 19, 19, 16, 16, 16, 16, 33, 17, 18, 18, 18, 18, 11, 11, 11, 11, 19, 19,
//Ô, Ö, Ù, Ú, Û, Ü, ß, à, á, â, ä, æ, ç, è, é, ê, //Ô, Ö, Ù, Ú, Û, Ü, ß, à, á, â, ä, æ, ç, è, é, ê,
19, 19, 19, 19, 19, 19, 15, 14, 14, 14, 14, 20, 14, 11, 11, 11, 19, 19, 19, 19, 19, 19, 15, 14, 14, 14, 14, 20, 14, 11, 11, 11,
#ifdef FIX_BUGS
//ë, ì, í, î, ï, ò, ó, ô, ö, ù, ú, û, ü, Ñ, ñ, ¿, //ë, ì, í, î, ï, ò, ó, ô, ö, ù, ú, û, ü, Ñ, ñ, ¿,
#ifdef FIX_BUGS
11, 10, 10, 10, 10, 12, 12, 12, 12, 15, 15, 15, 15, 22, 18, 21, 11, 10, 10, 10, 10, 12, 12, 12, 12, 15, 15, 15, 15, 22, 18, 21,
#else #else
11, 10, 10, 10, 10, 12, 12, 12, 12, 15, 15, 15, 15, 24, 18, 21, 11, 10, 10, 10, 10, 12, 12, 12, 12, 15, 15, 15, 15, 24, 18, 21,
@ -96,7 +96,7 @@ int16 CFont::Size[MAX_FONTS][210] = {
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
//??,?? //space, unprop
19, 16 19, 16
}, },
{ {
@ -110,8 +110,8 @@ int16 CFont::Size[MAX_FONTS][210] = {
20, 7, 20, 20, 21, 20, 20, 19, 21, 20, 8, 30, 24, 30, 24, 19, 20, 7, 20, 20, 21, 20, 20, 19, 21, 20, 8, 30, 24, 30, 24, 19,
//TM,A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, //TM,A, B, C, D, E, F, G, H, I, J, K, L, M, N, O,
20, 22, 22, 21, 22, 18, 18, 22, 22, 9, 14, 21, 18, 27, 21, 24, 20, 22, 22, 21, 22, 18, 18, 22, 22, 9, 14, 21, 18, 27, 21, 24,
#ifdef FIX_BUGS
//P, Q, R, S, T, U, V, W, X, Y, Z, *I, \, *I, ¡, °, //P, Q, R, S, T, U, V, W, X, Y, Z, *I, \, *I, ¡, °,
#ifdef FIX_BUGS
22, 22, 23, 20, 19, 23, 22, 31, 23, 23, 21, 25, 13, 30, 7, 19, 22, 22, 23, 20, 19, 23, 22, 31, 23, 23, 21, 25, 13, 30, 7, 19,
#else #else
22, 22, 23, 20, 19, 23, 22, 31, 23, 23, 21, 25, 13, 30, 10, 19, 22, 22, 23, 20, 19, 23, 22, 31, 23, 23, 21, 25, 13, 30, 10, 19,
@ -124,8 +124,8 @@ int16 CFont::Size[MAX_FONTS][210] = {
20, 20, 20, 20, 29, 22, 19, 19, 19, 19, 9, 9, 9, 9, 23, 23, 20, 20, 20, 20, 29, 22, 19, 19, 19, 19, 9, 9, 9, 9, 23, 23,
//Ô, Ö, Ù, Ú, Û, Ü, ß, à, á, â, ä, æ, ç, è, é, ê, //Ô, Ö, Ù, Ú, Û, Ü, ß, à, á, â, ä, æ, ç, è, é, ê,
23, 23, 24, 24, 24, 24, 20, 19, 17, 17, 17, 30, 16, 17, 17, 17, 23, 23, 24, 24, 24, 24, 20, 19, 17, 17, 17, 30, 16, 17, 17, 17,
#ifdef FIX_BUGS
//ë, ì, í, î, ï, ò, ó, ô, ö, ù, ú, û, ü, Ñ, ñ, ¿, //ë, ì, í, î, ï, ò, ó, ô, ö, ù, ú, û, ü, Ñ, ñ, ¿,
#ifdef FIX_BUGS
17, 11, 11, 15, 12, 17, 17, 17, 17, 17, 17, 17, 17, 21, 17, 19, 17, 11, 11, 15, 12, 17, 17, 17, 17, 17, 17, 17, 17, 21, 17, 19,
#else #else
17, 11, 11, 15, 12, 17, 17, 17, 17, 17, 17, 17, 17, 19, 20, 20, 17, 11, 11, 15, 12, 17, 17, 17, 17, 17, 17, 17, 17, 19, 20, 20,
@ -136,113 +136,114 @@ int16 CFont::Size[MAX_FONTS][210] = {
16, 19, 19, 9, 19, 20, 14, 29, 19, 19, 19, 19, 19, 19, 21, 19, 16, 19, 19, 9, 19, 20, 14, 29, 19, 19, 19, 19, 19, 19, 21, 19,
//V2,W2,X2, Y2, Z2, À2, Á2, Â2, Ä2, Æ2, Ç2, È2, É2, Ê2, Ë2, Ì2, //V2,W2,X2, Y2, Z2, À2, Á2, Â2, Ä2, Æ2, Ç2, È2, É2, Ê2, Ë2, Ì2,
20, 32, 20, 19, 19, 19, 19, 19, 19, 29, 19, 19, 19, 19, 19, 9, 20, 32, 20, 19, 19, 19, 19, 19, 19, 29, 19, 19, 19, 19, 19, 9,
#ifdef FIX_BUGS
//Í2,Î2,Ï2, Ò2, Ó2, Ô2, Ö2, Ù2, Ú2, Û2, Ü2, ß2, Ñ2, ¿2, '2, .2, //Í2,Î2,Ï2, Ò2, Ó2, Ô2, Ö2, Ù2, Ú2, Û2, Ü2, ß2, Ñ2, ¿2, '2, .2,
#ifdef FIX_BUGS
9, 9, 9, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 10, 9, 9, 9, 9, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 10, 9,
#else #else
9, 9, 9, 19, 19, 19, 19, 19, 19, 19, 19, 19, 21, 21, 10, 9, 9, 9, 9, 19, 19, 19, 19, 19, 19, 19, 19, 19, 21, 21, 10, 9,
#endif #endif
//??,?? //space, unprop
10, 20 10, 20
} }
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
}, },
{ {
{ 13, 12, 31, 35, 23, 35, 31, 9, 14, 15, 25, 30, 11, 17, {
13, 31, 23, 16, 22, 21, 24, 23, 23, 20, 23, 22, 10, 5, 9, 9, 0, 17, 17, 23, 3, 21, 18, 0, 8, 3, 8, 3, 0,
35, 26, 26, 26, 26, 30, 26, 24, 23, 24, 22, 21, 24, 16, 9, 16, 16, 15, 19, 15, 14, 17, 17, 4, 4, 0, 0, 0, 17,
26, 10, 20, 26, 22, 29, 26, 25, 23, 25, 24, 24, 22, 19, 17, 19, 15, 21, 18, 19, 16, 21, 13, 15, 21, 20, 28, 21, 18,
25, 24, 29, 29, 23, 25, 37, 22, 37, 35, 37, 35, 21, 22, 17, 21, 20, 18, 18, 20, 26, 22, 18, 18, 0, 8, 0, 9, 8,
22, 21, 21, 22, 13, 22, 21, 10, 16, 22, 11, 32, 21, 0, 14, 11, 12, 16, 11, 13, 13, 15, 10, 14, 15, 11, 21, 17, 10,
21, 23, 22, 16, 20, 14, 21, 20, 30, 25, 21, 21, 13, 20, 15, 12, 12, 16, 17, 13, 16, 13, 21, 11, 0, 0, 0, 0, 0,
33, 13, 13, 13, 24, 22, 22, 19, 26, 21, 30, 20, 23, 20, 19, 19, 22, 27, 15, 18, 18, 20, 26, 21, 23, 17, 22, 21, 17,
23, 21, 24, 26, 23, 22, 23, 21, 22, 20, 20, 26, 25, 26, 25, 26, 17, 20, 26, 17, 16, 11, 12, 13, 21, 11, 17, 17, 12,
24, 22, 31, 32, 23, 30, 22, 22, 32, 23, 19, 18, 18, 21, 17, 17, 15, 24, 16, 10, 20, 23, 16, 7, 9, 16, 23, 12, 11,
15, 22, 19, 27, 19, 20, 20, 18, 22, 24, 20, 19, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
20, 19, 16, 19, 28, 20, 20, 18, 26, 27, 19, 26, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
19, 27, 19, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
26, 26, 26, 18, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19,
26, 26, 26, 26, 26, 26, 26, 26, 26, 20 }, 19, 16
{ 13, 9, 21, 35, 23, 35, 35, 11, 35, 35, 25, 35, 11, },
17, 13, 33, 28, 14, 22, 21, 24, 23, 23, 21, 23, 22, {
10, 35, 13, 35, 13, 33, 5, 25, 22, 23, 24, 21, 21, 24, 11, 5, 10, 15, 19, 22, 20, 5, 9, 8, 11, 12, 5, 12, 6, 12,
24, 9, 20, 24, 21, 27, 25, 25, 22, 25, 23, 20, 23, 23, 19, 5, 18, 19, 20, 18, 19, 18, 20, 19, 5, 6, 26, 12, 30, 19,
23, 31, 23, 23, 23, 37, 33, 37, 35, 37, 35, 21, 19, 23, 21, 20, 20, 20, 16, 16, 21, 19, 5, 13, 19, 16, 24, 20, 21,
19, 21, 19, 17, 21, 21, 8, 17, 18, 14, 24, 21, 21, 20, 20, 21, 20, 19, 17, 20, 21, 30, 22, 21, 20, 25, 13, 30, 5, 9,
22, 19, 20, 20, 19, 20, 26, 21, 20, 21, 33, 33, 33, 10, 15, 15, 14, 15, 16, 10, 15, 15, 5, 5, 15, 5, 23, 15, 16,
33, 35, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 15, 15, 9, 16, 10, 15, 17, 24, 18, 15, 15, 27, 5, 19, 2, 2,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 16, 23, 30, 19, 20, 20, 21, 24, 19, 19, 20, 23, 22, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 27, 29, 25, 20, 20, 28, 24, 16, 16, 14, 19, 25, 16, 16, 16, 17,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 16, 16, 17, 25, 19, 15, 23, 26, 21, 16, 14, 22, 20, 16, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 15, 14, 15, 16, 17, 15, 15, 15, 15, 15, 7, 15, 15, 15, 15, 15,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 13, 15, 15, 7, 15, 16, 13, 23, 15, 15, 15, 15, 15, 15, 17, 15,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 16, 24, 17, 17, 17, 15, 15, 13, 20, 23, 15, 17, 17, 16, 24, 15,
19, 19, 19, 19, 19, 19, 19, 16, }, 15, 15, 23, 18, 15, 23, 26, 23, 16, 15, 23, 15, 15, 19, 2, 2,
{ 15, 14, 16, 25, 19, 10, 20
26, 22, 11, 18, 18, 27, 26, 13, 19, 9, 27, 19, 18, 19, },
19, 22, 19, 20, 18, 19, 20, 12, 32, 15, 32, 15, 35,
15, 19, 19, 19, 19, 19, 16, 19, 20, 9, 19, 20, 14, 29,
19, 20, 19, 19, 19, 19, 21, 19, 20, 32, 20, 19, 19,
33, 31, 39, 37, 39, 37, 21, 21, 21, 23, 21, 19, 23, 23, 10, 19, 20, 16, 26, 23,
21, 21, 20, 20, 22, 21, 22, 22, 26, 22, 22, 23, 35,
35, 35, 35, 37, 19, 19, 19, 19, 19, 19, 29, 19, 19,
19, 20, 22, 31, 19, 19, 19, 19, 19, 29, 19, 29, 19,
21, 19, 30, 31, 21, 29, 19, 19, 29, 19, 21, 23, 32,
21, 21, 30, 31, 22, 21, 32, 33, 23, 32, 21, 21, 32,
21, 19, 19, 30, 31, 22, 22, 21, 32, 33, 23, 32, 21,
21, 32, 21, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 11, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19 },
}, },
{ {
{ {
13, 12, 31, 35, 23, 35, 31, 9, 14, 15, 25, 30, 11, 17, 13, 31, //FONT2 EFIGS
23, 16, 22, 21, 24, 23, 23, 20, 23, 22, 10, 35, 26, 26, 26, 26, //SPC,!, $, %, &, ', [, ], +, , -, .,
30, 26, 24, 23, 24, 22, 21, 24, 26, 10, 20, 26, 22, 29, 26, 25, 12, 9, 22, 17, 19, 19, 25, 4, 33, 33, 25, 35, 11, 10, 6, 33,
23, 25, 24, 24, 22, 25, 24, 29, 29, 23, 25, 37, 22, 37, 35, 37, //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ??,
35, 21, 22, 21, 21, 22, 13, 22, 21, 10, 16, 22, 11, 32, 21, 21, 18, 10, 17, 17, 17, 17, 17, 15, 12, 16, 5, 30, 30, 30, 30, 30,
23, 22, 16, 20, 14, 21, 20, 30, 25, 21, 21, 33, 33, 33, 33, 35, // A, B, C, D, E, F, G, H, I, J, K, L, M, N, O,
27, 27, 27, 27, 32, 24, 23, 23, 23, 23, 11, 11, 11, 11, 26, 26, 12, 16, 19, 16, 19, 18, 18, 17, 22, 11, 17, 18, 18, 30, 22, 19,
26, 26, 26, 26, 26, 25, 26, 21, 21, 21, 21, 32, 23, 22, 22, 22, //P, Q, R, S, T, U, V, W, X, Y, Z, ??, ??, ??, ¡, \,
22, 11, 11, 11, 11, 22, 22, 22, 22, 22, 22, 22, 22, 26, 21, 24, 22, 19, 19, 20, 18, 19, 19, 29, 19, 18, 19, 19, 33, 33, 10, 19,
12, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, //??,a, b, c, d, e, f, g, h, i, j, k, l, m, n, o,
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 18, 26, 26, 12, 14, 11, 11, 16, 11, 12, 14, 14, 10, 13, 12, 10, 19, 18, 12,
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, //p, q, r, s, t, u, v, w, x, y, z, ??, ??, ??, ??, ??,
20 16, 13, 13, 11, 12, 15, 12, 15, 13, 12, 12, 37, 33, 37, 35, 37,
//À, Á, Â, Ä, Æ, Ç, È, É, Ê, Ë, Ì, Í, Î, Ï, Ò, Ó,
16, 16, 16, 16, 33, 17, 18, 18, 18, 18, 11, 11, 11, 11, 19, 19,
//Ô, Ö, Ù, Ú, Û, Ü, ß, à, á, â, ä, æ, ç, è, é, ê,
19, 19, 19, 19, 19, 19, 15, 14, 14, 14, 14, 20, 14, 11, 11, 11,
//ë, ì, í, î, ï, ò, ó, ô, ö, ù, ú, û, ü, Ñ, ñ, ¿,
11, 10, 10, 10, 10, 12, 12, 12, 12, 15, 15, 15, 15, 22, 18, 21,
//i,BLANKS
10, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
//space, unprop
19, 16
}, },
{ {
13, 9, 21, 35, 23, 35, 35, 11, 35, 35, 25, 35, 11, 17, 13, 33, //FONT1 EFIGS
28, 14, 22, 21, 24, 23, 23, 21, 23, 22, 10, 35, 13, 35, 13, 33, //Characters with a '2' refer to the Pricedown font.
5, 25, 22, 23, 24, 21, 21, 24, 24, 9, 20, 24, 21, 27, 25, 25, //Characters that are referred as '*I' are characters that contain icons for PS2/XBOX, but contain regular characters on PC
22, 25, 23, 20, 23, 23, 23, 31, 23, 23, 23, 37, 33, 37, 35, 37, //in order to display them properly in the Keyboard controls menu.
35, 21, 19, 19, 21, 19, 17, 21, 21, 8, 17, 18, 14, 24, 21, 21, //!2,!, *I,(R), $, %, &, ', [, ], *I, +, , -, ., *I,
20, 22, 19, 20, 20, 19, 20, 26, 21, 20, 21, 33, 33, 33, 33, 35, 15, 7, 31, 25, 20, 23, 21, 7, 11, 10, 26, 14, 6, 12, 6, 26,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, *I, *I, *I, *I, ?,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 7, 20, 20, 21, 20, 20, 19, 21, 20, 8, 30, 24, 30, 24, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, //TM,A, B, C, D, E, F, G, H, I, J, K, L, M, N, O,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 22, 22, 21, 22, 18, 18, 22, 22, 9, 14, 21, 18, 27, 21, 24,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, //P, Q, R, S, T, U, V, W, X, Y, Z, *I, \, *I, ¡, °,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 22, 22, 23, 20, 19, 23, 22, 31, 23, 23, 21, 25, 13, 30, 7, 19,
16 //(C),a, b, c, d, e, f, g, h, i, j, k, l, m, n, o,
}, 10, 17, 17, 16, 17, 17, 11, 17, 17, 7, 7, 18, 7, 25, 17, 17,
//p, q, r, s, t, u, v, w, x, y, z, *I, *I, $2, (2, )2,
{ 17, 17, 11, 17, 11, 17, 18, 25, 19, 18, 17, 28, 26, 20, 15, 15,
15, 14, 16, 25, 19, 26, 22, 11, 18, 18, 27, 26, 13, 19, 9, 27, //À, Á, Â, Ä, Æ, Ç, È, É, Ê, Ë, Ì, Í, Î, Ï, Ò, Ó,
19, 18, 19, 19, 22, 19, 20, 18, 19, 20, 12, 32, 15, 32, 15, 35, 20, 20, 20, 20, 29, 22, 19, 19, 19, 19, 9, 9, 9, 9, 23, 23,
15, 19, 19, 19, 19, 19, 16, 19, 20, 9, 19, 20, 14, 29, 19, 20, //Ô, Ö, Ù, Ú, Û, Ü, ß, à, á, â, ä, æ, ç, è, é, ê,
19, 19, 19, 19, 21, 19, 20, 32, 20, 19, 19, 33, 31, 39, 37, 39, 23, 23, 24, 24, 24, 24, 20, 19, 17, 17, 17, 30, 16, 17, 17, 17,
37, 21, 21, 21, 23, 21, 19, 23, 23, 10, 19, 20, 16, 26, 23, 23, //ë, ì, í, î, ï, ò, ó, ô, ö, ù, ú, û, ü, Ñ, ñ, ¿,
20, 20, 20, 22, 21, 22, 22, 26, 22, 22, 23, 35, 35, 35, 35, 37, 17, 11, 11, 15, 12, 17, 17, 17, 17, 17, 17, 17, 17, 21, 17, 19,
19, 19, 19, 19, 29, 19, 19, 19, 19, 19, 9, 9, 9, 9, 19, 19, //02,12,22, 32, 42, 52, 62, 72, 82, 92, :2, A2, B2, C2, D2, E2,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 30, 19, 19, 19, 19, 20, 18, 19, 19, 21, 19, 19, 19, 19, 19, 16, 19, 19, 19, 20, 19,
19, 10, 10, 10, 10, 19, 19, 19, 19, 19, 19, 19, 19, 19, 23, 35, //F2,G2,H2, I2, J2, K2, L2, M2, N2, O2, P2, Q2, R2, S2, T2, U2,
12, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 16, 19, 19, 9, 19, 20, 14, 29, 19, 19, 19, 19, 19, 19, 21, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 11, 19, 19, //V2,W2,X2, Y2, Z2, À2, Á2, Â2, Ä2, Æ2, Ç2, È2, É2, Ê2, Ë2, Ì2,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 32, 20, 19, 19, 19, 19, 19, 19, 29, 19, 19, 19, 19, 19, 9,
19 //Í2,Î2,Ï2, Ò2, Ó2, Ô2, Ö2, Ù2, Ú2, Û2, Ü2, ß2, Ñ2, ¿2, '2, .2,
9, 9, 9, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 10, 9,
//space, unprop
10, 20
} }
} }
#endif #endif
@ -417,9 +418,8 @@ CFont::ReloadFonts(uint8 set)
if (Slot != -1 && LanguageSet != set) { if (Slot != -1 && LanguageSet != set) {
Sprite[0].Delete(); Sprite[0].Delete();
Sprite[1].Delete(); Sprite[1].Delete();
Sprite[2].Delete();
if (IsJapanese()) if (IsJapanese())
Sprite[3].Delete(); Sprite[2].Delete();
CTxdStore::PushCurrentTxd(); CTxdStore::PushCurrentTxd();
CTxdStore::RemoveTxd(Slot); CTxdStore::RemoveTxd(Slot);
switch (set) switch (set)
@ -441,12 +441,9 @@ CFont::ReloadFonts(uint8 set)
CTxdStore::SetCurrentTxd(Slot); CTxdStore::SetCurrentTxd(Slot);
Sprite[0].SetTexture("font2", "font2_mask"); Sprite[0].SetTexture("font2", "font2_mask");
if (set == FONT_LANGSET_JAPANESE) { if (set == FONT_LANGSET_JAPANESE) {
Sprite[1].SetTexture("FONTJAP", "FONTJAP_mask"); Sprite[2].SetTexture("FONTJAP", "FONTJAP_mask");
Sprite[3].SetTexture("FONTJAP", "FONTJAP_mask");
} }
else Sprite[1].SetTexture("font1", "font1_mask");
Sprite[1].SetTexture("pager", "pager_mask");
Sprite[2].SetTexture("font1", "font1_mask");
CTxdStore::PopCurrentTxd(); CTxdStore::PopCurrentTxd();
} }
LanguageSet = set; LanguageSet = set;
@ -579,7 +576,7 @@ CFont::PrintChar(float x, float y, wchar c)
xoff / 16.0f, (yoff + 1.0f) / 12.8f - 0.009f, xoff / 16.0f, (yoff + 1.0f) / 12.8f - 0.009f,
(xoff + 1.0f) / 16.0f - 0.001f, (yoff + 1.0f) / 12.8f - 0.0021f + 0.01f); (xoff + 1.0f) / 16.0f - 0.001f, (yoff + 1.0f) / 12.8f - 0.0021f + 0.01f);
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
}else if (IsJapaneseFont()) { /*}else if (IsJapaneseFont()) {
if (Details.dropShadowPosition != 0) { if (Details.dropShadowPosition != 0) {
CSprite2d::AddSpriteToBank(Details.bank + Details.style, // BUG: game doesn't add bank CSprite2d::AddSpriteToBank(Details.bank + Details.style, // BUG: game doesn't add bank
CRect(x + SCREEN_SCALE_X(Details.dropShadowPosition), CRect(x + SCREEN_SCALE_X(Details.dropShadowPosition),
@ -600,7 +597,7 @@ CFont::PrintChar(float x, float y, wchar c)
xoff * w / 1024.0f, yoff / 25.6f, xoff * w / 1024.0f, yoff / 25.6f,
xoff * w / 1024.0f + (1.0f / 48.0f) - 0.001f, yoff / 25.6f, xoff * w / 1024.0f + (1.0f / 48.0f) - 0.001f, yoff / 25.6f,
xoff * w / 1024.0f, (yoff + 1.0f) / 25.6f - 0.002f, xoff * w / 1024.0f, (yoff + 1.0f) / 25.6f - 0.002f,
xoff * w / 1024.0f + (1.0f / 48.0f) - 0.001f, (yoff + 1.0f) / 25.6f - 0.0001f); xoff * w / 1024.0f + (1.0f / 48.0f) - 0.001f, (yoff + 1.0f) / 25.6f - 0.0001f);*/
#endif #endif
} else { } else {
if (bDontPrint) return; if (bDontPrint) return;
@ -722,7 +719,7 @@ CFont::RenderFontBuffer()
FontRenderStatePointer.pRenderState = (CFontRenderState*)FontRenderStateBuf; FontRenderStatePointer.pRenderState = (CFontRenderState*)FontRenderStateBuf;
} }
#ifdef MORE_LANGUAGES #if 0 //def MORE_LANGUAGES
bool bool
CFont::PrintString(float x, float y, wchar *start, wchar *&end, float spwidth, float japX) CFont::PrintString(float x, float y, wchar *start, wchar *&end, float spwidth, float japX)
{ {
@ -899,7 +896,7 @@ CFont::PrintString(float xstart, float ystart, wchar *s)
float xleft = Details.centre ? xstart - x/2 : float xleft = Details.centre ? xstart - x/2 :
Details.rightJustify ? xstart - x : Details.rightJustify ? xstart - x :
xstart; xstart;
#ifdef MORE_LANGUAGES #if 0//def MORE_LANGUAGES
PrintString(xleft, y, start, s, spaceWidth, xstart); PrintString(xleft, y, start, s, spaceWidth, xstart);
#else #else
PrintString(xleft, y, Details.anonymous_25, start, s, spaceWidth); PrintString(xleft, y, Details.anonymous_25, start, s, spaceWidth);
@ -937,7 +934,7 @@ CFont::PrintString(float xstart, float ystart, wchar *s)
#endif #endif
lineLength = x; lineLength = x;
s = t+1; s = t+1;
#ifdef MORE_LANGUAGES #if 0 //def MORE_LANGUAGES
if (IsJapaneseFont() && !*s) { if (IsJapaneseFont() && !*s) {
x += GetStringWidth(s); x += GetStringWidth(s);
if (IsAnsiCharacter(s)) if (IsAnsiCharacter(s))
@ -969,7 +966,7 @@ CFont::PrintString(float xstart, float ystart, wchar *s)
float xleft = Details.centre ? xstart - x/2 : float xleft = Details.centre ? xstart - x/2 :
Details.rightJustify ? xstart - x : Details.rightJustify ? xstart - x :
xstart; xstart;
#ifdef MORE_LANGUAGES #if 0 //def MORE_LANGUAGES
if (PrintString(xleft, y, start, s, 0.0f, xstart) && IsJapaneseFont()) { if (PrintString(xleft, y, start, s, 0.0f, xstart) && IsJapaneseFont()) {
start = s; start = s;
if (!Details.centre && !Details.rightJustify) if (!Details.centre && !Details.rightJustify)
@ -995,7 +992,7 @@ CFont::GetNumberLines(float xstart, float ystart, wchar *s)
wchar *t; wchar *t;
n = 0; n = 0;
#ifdef MORE_LANGUAGES #if 0//def MORE_LANGUAGES
bool bSomeJapBool = false; bool bSomeJapBool = false;
if (IsJapanese()) { if (IsJapanese()) {
@ -1198,37 +1195,33 @@ CFont::GetCharacterWidth(wchar c)
{ {
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
if (IsJapanese()) { if (IsJapanese()) {
if (!Details.proportional) if (!RenderState.proportional)
return Size[0][Details.style][192]; return Size[0][Details.style][192];
if (c <= 94 || Details.style == FONT_HEADING || Details.style == FONT_BANK) { if (c <= 94 || Details.style == FONT_HEADING || RenderState.style == FONT_BANK) {
switch (Details.style) switch (RenderState.style)
{ {
case FONT_JAPANESE: case FONT_JAPANESE:
return Size_jp[c]; return Size_jp[c];
default: default:
return Size[0][Details.style][c]; return Size[0][RenderState.style][c];
} }
} }
if (c < 254 && Details.style == FONT_PAGER)
return 29.4f;
switch (Details.style) switch (RenderState.style)
{ {
case FONT_JAPANESE: case FONT_JAPANESE:
return 29.4f; return 29.4f;
case FONT_BANK: case FONT_BANK:
return 10.0f; return 10.0f;
case FONT_PAGER:
return 31.5f;
default: default:
return Size[0][Details.style][c]; return Size[0][RenderState.style][c];
} }
} }
else if (Details.proportional) else if (RenderState.proportional)
return Size[LanguageSet][Details.style][c]; return Size[LanguageSet][RenderState.style][c];
else else
return Size[LanguageSet][Details.style][192]; return Size[LanguageSet][RenderState.style][209];
#else #else
if (RenderState.proportional) if (RenderState.proportional)
@ -1256,8 +1249,6 @@ CFont::GetCharacterSize(wchar c)
return Size[0][Details.style][c] * Details.scaleX; return Size[0][Details.style][c] * Details.scaleX;
} }
} }
if (c < 254 && (Details.style == FONT_PAGER))
return 29.4f * Details.scaleX;
switch (Details.style) switch (Details.style)
{ {
@ -1265,16 +1256,20 @@ CFont::GetCharacterSize(wchar c)
return 29.4f * Details.scaleX; return 29.4f * Details.scaleX;
case FONT_BANK: case FONT_BANK:
return 10.0f * Details.scaleX; return 10.0f * Details.scaleX;
case FONT_PAGER:
return 31.5f * Details.scaleX;
default: default:
return Size[0][Details.style][c] * Details.scaleX; return Size[0][Details.style][c] * Details.scaleX;
} }
} }
else if(Details.proportional)
return Size[LanguageSet][Details.style][c] * Details.scaleX;
else else
return Size[LanguageSet][Details.style][209] * Details.scaleX; {
if (!Details.bFontHalfTexture && c == 30) c = 61; // wanted star
if (Details.bFontHalfTexture)
c = FindNewCharacter(c);
if (Details.proportional)
return Size[LanguageSet][Details.style][c] * Details.scaleX;
else
return Size[LanguageSet][Details.style][209] * Details.scaleX;
}
#else #else
#ifdef FIX_BUGS #ifdef FIX_BUGS
@ -1546,7 +1541,7 @@ CFont::ParseToken(wchar* str, CRGBA &color, bool &flash, bool &bold)
return s; return s;
} }
#ifdef MORE_LANGUAGES #if 0//def MORE_LANGUAGES
wchar* wchar*
CFont::ParseToken(wchar *s, bool japShit) CFont::ParseToken(wchar *s, bool japShit)
{ {

View file

@ -123,7 +123,7 @@ enum
class CFont class CFont
{ {
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
static int16 Size[LANGSET_MAX][MAX_FONTS][193]; static int16 Size[LANGSET_MAX][MAX_FONTS][210];
static uint8 LanguageSet; static uint8 LanguageSet;
static int32 Slot; static int32 Slot;
#else #else
@ -156,11 +156,11 @@ public:
#endif #endif
static int GetNumberLines(float xstart, float ystart, wchar *s); static int GetNumberLines(float xstart, float ystart, wchar *s);
static void GetTextRect(CRect *rect, float xstart, float ystart, wchar *s); static void GetTextRect(CRect *rect, float xstart, float ystart, wchar *s);
#ifdef MORE_LANGUAGES //#ifdef MORE_LANGUAGES
static bool PrintString(float x, float y, wchar *start, wchar* &end, float spwidth, float japX); // static bool PrintString(float x, float y, wchar *start, wchar* &end, float spwidth, float japX);
#else //#else
static void PrintString(float x, float y, uint32, wchar *start, wchar *end, float spwidth); static void PrintString(float x, float y, uint32, wchar *start, wchar *end, float spwidth);
#endif //#endif
static void PrintStringFromBottom(float x, float y, wchar *str); static void PrintStringFromBottom(float x, float y, wchar *str);
static float GetCharacterWidth(wchar c); static float GetCharacterWidth(wchar c);
static float GetCharacterSize(wchar c); static float GetCharacterSize(wchar c);
@ -169,12 +169,12 @@ public:
static float GetStringWidth_Jap(wchar* s); static float GetStringWidth_Jap(wchar* s);
#endif #endif
static uint16 *GetNextSpace(wchar *s); static uint16 *GetNextSpace(wchar *s);
#ifdef MORE_LANGUAGES //#ifdef MORE_LANGUAGES
static uint16 *ParseToken(wchar *s, bool japShit = false); // static uint16 *ParseToken(wchar *s, bool japShit = false);
#else //#else
static uint16 *ParseToken(wchar *s); static uint16 *ParseToken(wchar *s);
static uint16 *ParseToken(wchar *s, CRGBA &color, bool &flash, bool &bold); static uint16 *ParseToken(wchar *s, CRGBA &color, bool &flash, bool &bold);
#endif //#endif
static void DrawFonts(void); static void DrawFonts(void);
static void RenderFontBuffer(void); static void RenderFontBuffer(void);
static uint16 character_code(uint8 c); static uint16 character_code(uint8 c);
@ -212,6 +212,6 @@ public:
static bool IsAnsiCharacter(wchar* s); static bool IsAnsiCharacter(wchar* s);
static bool IsJapanesePunctuation(wchar* str); static bool IsJapanesePunctuation(wchar* str);
static bool IsJapanese() { return LanguageSet == FONT_LANGSET_JAPANESE; } static bool IsJapanese() { return LanguageSet == FONT_LANGSET_JAPANESE; }
static bool IsJapaneseFont() { return IsJapanese() && (Details.style == FONT_JAPANESE || Details.style == FONT_PAGER); } static bool IsJapaneseFont() { return IsJapanese() && (Details.style == FONT_JAPANESE); }
#endif #endif
}; };

View file

@ -276,6 +276,8 @@ CGlass::Render(void)
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void *)rwBLENDONE); RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void *)rwBLENDONE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)TRUE);
PUSH_RENDERGROUP("CGlass::Render");
for ( int32 i = 0; i < NUM_GLASSPANES; i++ ) for ( int32 i = 0; i < NUM_GLASSPANES; i++ )
{ {
if ( aGlassPanes[i].m_bActive ) if ( aGlassPanes[i].m_bActive )
@ -285,6 +287,8 @@ CGlass::Render(void)
for ( uint32 i = 0; i < NumGlassEntities; i++ ) for ( uint32 i = 0; i < NumGlassEntities; i++ )
RenderEntityInGlass(apEntitiesToBeRendered[i]); RenderEntityInGlass(apEntitiesToBeRendered[i]);
POP_RENDERGROUP();
NumGlassEntities = 0; NumGlassEntities = 0;
RenderHiLightPolys(); RenderHiLightPolys();

View file

@ -6,6 +6,7 @@
#include <d3d8caps.h> #include <d3d8caps.h>
#endif #endif
#include "main.h"
#include "General.h" #include "General.h"
#include "RwHelper.h" #include "RwHelper.h"
#include "Camera.h" #include "Camera.h"
@ -333,6 +334,7 @@ CMBlur::MotionBlurRender(RwCamera *cam, uint32 red, uint32 green, uint32 blue, u
#ifdef EXTENDED_COLOURFILTER #ifdef EXTENDED_COLOURFILTER
CPostFX::Render(cam, red, green, blue, blur, type, bluralpha); CPostFX::Render(cam, red, green, blue, blur, type, bluralpha);
#else #else
PUSH_RENDERGROUP("CMBlur::MotionBlurRender");
RwRGBA color = { (RwUInt8)red, (RwUInt8)green, (RwUInt8)blue, (RwUInt8)blur }; RwRGBA color = { (RwUInt8)red, (RwUInt8)green, (RwUInt8)blue, (RwUInt8)blur };
#ifdef GTA_PS2 #ifdef GTA_PS2
if( pFrontBuffer ) if( pFrontBuffer )
@ -348,6 +350,7 @@ CMBlur::MotionBlurRender(RwCamera *cam, uint32 red, uint32 green, uint32 blue, u
RwRasterPopContext(); RwRasterPopContext();
} }
#endif #endif
POP_RENDERGROUP();
#endif #endif
} }

View file

@ -1,5 +1,6 @@
#include "common.h" #include "common.h"
#include "main.h"
#include "General.h" #include "General.h"
#include "Timer.h" #include "Timer.h"
#include "TxdStore.h" #include "TxdStore.h"
@ -1785,6 +1786,8 @@ void CParticle::Update()
void CParticle::Render() void CParticle::Render()
{ {
PUSH_RENDERGROUP("CParticle::Render");
RwRenderStateSet(rwRENDERSTATETEXTUREADDRESS, (void *)rwTEXTUREADDRESSWRAP); RwRenderStateSet(rwRENDERSTATETEXTUREADDRESS, (void *)rwTEXTUREADDRESSWRAP);
RwRenderStateSet(rwRENDERSTATETEXTUREPERSPECTIVE, (void *)TRUE); RwRenderStateSet(rwRENDERSTATETEXTUREPERSPECTIVE, (void *)TRUE);
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void *)FALSE); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void *)FALSE);
@ -2282,6 +2285,8 @@ void CParticle::Render()
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void *)TRUE); RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void *)TRUE);
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void *)rwBLENDSRCALPHA); RwRenderStateSet(rwRENDERSTATESRCBLEND, (void *)rwBLENDSRCALPHA);
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void *)rwBLENDINVSRCALPHA); RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void *)rwBLENDINVSRCALPHA);
POP_RENDERGROUP();
} }
void CParticle::RemovePSystem(tParticleType type) void CParticle::RemovePSystem(tParticleType type)

View file

@ -159,6 +159,8 @@ CPointLights::RenderFogEffect(void)
if(CCutsceneMgr::IsRunning()) if(CCutsceneMgr::IsRunning())
return; return;
PUSH_RENDERGROUP("CPointLights::RenderFogEffect");
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDONE); RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDONE);
@ -302,6 +304,8 @@ CPointLights::RenderFogEffect(void)
} }
CSprite::FlushSpriteBuffer(); CSprite::FlushSpriteBuffer();
POP_RENDERGROUP();
} }
bool bool

View file

@ -130,8 +130,13 @@ CRenderer::RenderOneRoad(CEntity *e)
return; return;
if(gbShowCollisionPolys) if(gbShowCollisionPolys)
CCollision::DrawColModel_Coloured(e->GetMatrix(), *CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel(), e->GetModelIndex()); CCollision::DrawColModel_Coloured(e->GetMatrix(), *CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel(), e->GetModelIndex());
else else{
PUSH_RENDERGROUP(CModelInfo::GetModelInfo(e->GetModelIndex())->GetModelName());
e->Render(); e->Render();
POP_RENDERGROUP();
}
} }
void void
@ -178,6 +183,8 @@ CRenderer::RenderOneNonRoad(CEntity *e)
} }
#endif #endif
PUSH_RENDERGROUP(CModelInfo::GetModelInfo(e->GetModelIndex())->GetModelName());
resetLights = e->SetupLighting(); resetLights = e->SetupLighting();
if(e->IsVehicle()){ if(e->IsVehicle()){
@ -206,6 +213,8 @@ CRenderer::RenderOneNonRoad(CEntity *e)
} }
e->RemoveLighting(resetLights); e->RemoveLighting(resetLights);
POP_RENDERGROUP();
} }
void void
@ -231,6 +240,7 @@ CRenderer::RenderRoads(void)
int i; int i;
CEntity *e; CEntity *e;
PUSH_RENDERGROUP("CRenderer::RenderRoads");
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
SetCullMode(rwCULLMODECULLBACK); SetCullMode(rwCULLMODECULLBACK);
@ -242,6 +252,7 @@ CRenderer::RenderRoads(void)
if(IsRoad(e)) if(IsRoad(e))
RenderOneRoad(e); RenderOneRoad(e);
} }
POP_RENDERGROUP();
} }
inline bool PutIntoSortedVehicleList(CVehicle *veh) inline bool PutIntoSortedVehicleList(CVehicle *veh)
@ -264,6 +275,7 @@ CRenderer::RenderEverythingBarRoads(void)
CEntity *e; CEntity *e;
EntityInfo ei; EntityInfo ei;
PUSH_RENDERGROUP("CRenderer::RenderEverythingBarRoads");
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
SetCullMode(rwCULLMODECULLBACK); SetCullMode(rwCULLMODECULLBACK);
@ -295,6 +307,7 @@ CRenderer::RenderEverythingBarRoads(void)
}else }else
RenderOneNonRoad(e); RenderOneNonRoad(e);
} }
POP_RENDERGROUP();
} }
void void
@ -302,6 +315,7 @@ CRenderer::RenderBoats(void)
{ {
CLink<EntityInfo> *node; CLink<EntityInfo> *node;
PUSH_RENDERGROUP("CRenderer::RenderBoats");
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
SetCullMode(rwCULLMODECULLBACK); SetCullMode(rwCULLMODECULLBACK);
@ -330,6 +344,7 @@ CRenderer::RenderBoats(void)
CVehicle *v = (CVehicle*)node->item.ent; CVehicle *v = (CVehicle*)node->item.ent;
RenderOneNonRoad(v); RenderOneNonRoad(v);
} }
POP_RENDERGROUP();
} }
#ifdef NEW_RENDERER #ifdef NEW_RENDERER
@ -433,6 +448,7 @@ CRenderer::RenderWorld(int pass)
switch(pass){ switch(pass){
case 0: case 0:
// Roads // Roads
PUSH_RENDERGROUP("CRenderer::RenderWorld - Roads");
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
for(i = 0; i < ms_nNoOfVisibleBuildings; i++){ for(i = 0; i < ms_nNoOfVisibleBuildings; i++){
e = ms_aVisibleBuildingPtrs[i]; e = ms_aVisibleBuildingPtrs[i];
@ -446,9 +462,11 @@ CRenderer::RenderWorld(int pass)
if(e->bIsBIGBuilding || IsRoad(e)) if(e->bIsBIGBuilding || IsRoad(e))
RenderOneBuilding(e, node->item.sort); RenderOneBuilding(e, node->item.sort);
} }
POP_RENDERGROUP();
break; break;
case 1: case 1:
// Opaque // Opaque
PUSH_RENDERGROUP("CRenderer::RenderWorld - Opaque");
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
for(i = 0; i < ms_nNoOfVisibleBuildings; i++){ for(i = 0; i < ms_nNoOfVisibleBuildings; i++){
e = ms_aVisibleBuildingPtrs[i]; e = ms_aVisibleBuildingPtrs[i];
@ -469,14 +487,17 @@ CRenderer::RenderWorld(int pass)
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, FALSE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, FALSE);
WorldRender::RenderBlendPass(PASS_NOZ); WorldRender::RenderBlendPass(PASS_NOZ);
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
POP_RENDERGROUP();
break; break;
case 2: case 2:
// Transparent // Transparent
PUSH_RENDERGROUP("CRenderer::RenderWorld - Transparent");
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDONE); RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDONE);
WorldRender::RenderBlendPass(PASS_ADD); WorldRender::RenderBlendPass(PASS_ADD);
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA); RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA);
WorldRender::RenderBlendPass(PASS_BLEND); WorldRender::RenderBlendPass(PASS_BLEND);
POP_RENDERGROUP();
break; break;
} }
} }
@ -487,11 +508,13 @@ CRenderer::RenderPeds(void)
int i; int i;
CEntity *e; CEntity *e;
PUSH_RENDERGROUP("CRenderer::RenderPeds");
for(i = 0; i < ms_nNoOfVisibleVehicles; i++){ for(i = 0; i < ms_nNoOfVisibleVehicles; i++){
e = ms_aVisibleVehiclePtrs[i]; e = ms_aVisibleVehiclePtrs[i];
if(e->IsPed()) if(e->IsPed())
RenderOneNonRoad(e); RenderOneNonRoad(e);
} }
POP_RENDERGROUP();
} }
void void
@ -502,6 +525,7 @@ CRenderer::RenderVehicles(void)
EntityInfo ei; EntityInfo ei;
CLink<EntityInfo> *node; CLink<EntityInfo> *node;
PUSH_RENDERGROUP("CRenderer::RenderVehicles");
// not the real thing // not the real thing
for(i = 0; i < ms_nNoOfVisibleVehicles; i++){ for(i = 0; i < ms_nNoOfVisibleVehicles; i++){
e = ms_aVisibleVehiclePtrs[i]; e = ms_aVisibleVehiclePtrs[i];
@ -518,6 +542,7 @@ CRenderer::RenderVehicles(void)
node != &gSortedVehiclesAndPeds.head; node != &gSortedVehiclesAndPeds.head;
node = node->prev) node = node->prev)
RenderOneNonRoad(node->item.ent); RenderOneNonRoad(node->item.ent);
POP_RENDERGROUP();
} }
void void
@ -526,6 +551,7 @@ CRenderer::RenderTransparentWater(void)
int i; int i;
CEntity *e; CEntity *e;
PUSH_RENDERGROUP("CRenderer::RenderTransparentWater");
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, nil); RwRenderStateSet(rwRENDERSTATETEXTURERASTER, nil);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)FALSE);
@ -549,6 +575,7 @@ CRenderer::RenderTransparentWater(void)
CWaterLevel::RenderTransparentWater(); CWaterLevel::RenderTransparentWater();
SetStencilState(0); SetStencilState(0);
POP_RENDERGROUP();
} }
void void
@ -569,20 +596,24 @@ CRenderer::ClearForFrame(void)
void void
CRenderer::RenderFadingInEntities(void) CRenderer::RenderFadingInEntities(void)
{ {
PUSH_RENDERGROUP("CRenderer::RenderFadingInEntities");
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
SetCullMode(rwCULLMODECULLBACK); SetCullMode(rwCULLMODECULLBACK);
DeActivateDirectional(); DeActivateDirectional();
SetAmbientColours(); SetAmbientColours();
CVisibilityPlugins::RenderFadingEntities(); CVisibilityPlugins::RenderFadingEntities();
POP_RENDERGROUP();
} }
void void
CRenderer::RenderFadingInUnderwaterEntities(void) CRenderer::RenderFadingInUnderwaterEntities(void)
{ {
PUSH_RENDERGROUP("CRenderer::RenderFadingInUnderwaterEntities");
DeActivateDirectional(); DeActivateDirectional();
SetAmbientColours(); SetAmbientColours();
CVisibilityPlugins::RenderFadingUnderwaterEntities(); CVisibilityPlugins::RenderFadingUnderwaterEntities();
POP_RENDERGROUP();
} }
void void

View file

@ -54,6 +54,8 @@ CRubbish::Render(void)
if(RubbishVisibility == 0) if(RubbishVisibility == 0)
return; return;
PUSH_RENDERGROUP("CRubbish::Render");
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
@ -150,6 +152,8 @@ CRubbish::Render(void)
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
POP_RENDERGROUP();
} }
void void

View file

@ -1068,6 +1068,8 @@ CShadows::SetRenderModeForShadowType(uint8 ShadowType)
void void
CShadows::RenderStoredShadows(void) CShadows::RenderStoredShadows(void)
{ {
PUSH_RENDERGROUP("CShadows::RenderStoredShadows");
RenderBuffer::ClearRenderBuffer(); RenderBuffer::ClearRenderBuffer();
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)FALSE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)FALSE);
@ -1241,12 +1243,16 @@ CShadows::RenderStoredShadows(void)
RwRenderStateSet(rwRENDERSTATETEXTUREADDRESS, (void *)rwTEXTUREADDRESSWRAP); RwRenderStateSet(rwRENDERSTATETEXTUREADDRESS, (void *)rwTEXTUREADDRESSWRAP);
ShadowsStoredToBeRendered = 0; ShadowsStoredToBeRendered = 0;
POP_RENDERGROUP();
} }
void void
CShadows::RenderStaticShadows(void) CShadows::RenderStaticShadows(void)
{ {
PUSH_RENDERGROUP("CShadows::RenderStaticShadows");
RenderBuffer::ClearRenderBuffer(); RenderBuffer::ClearRenderBuffer();
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)FALSE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)FALSE);
@ -1313,6 +1319,8 @@ CShadows::RenderStaticShadows(void)
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)FALSE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)FALSE);
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)TRUE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)TRUE);
POP_RENDERGROUP();
} }

View file

@ -96,6 +96,8 @@ CSkidmarks::Render(void)
{ {
int i, j; int i, j;
PUSH_RENDERGROUP("CSkidmarks::Render");
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA); RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA);
@ -152,6 +154,8 @@ CSkidmarks::Render(void)
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE);
POP_RENDERGROUP();
} }
void void

View file

@ -164,6 +164,7 @@ CSpecialFX::Shutdown(void)
void void
CSpecialFX::Render(void) CSpecialFX::Render(void)
{ {
PUSH_RENDERGROUP("CSpecialFX::Render");
CMotionBlurStreaks::Render(); CMotionBlurStreaks::Render();
CBulletTraces::Render(); CBulletTraces::Render();
CBrightLights::Render(); CBrightLights::Render();
@ -173,6 +174,7 @@ CSpecialFX::Render(void)
if(!(gbNewRenderer && FredIsInFirstPersonCam())) if(!(gbNewRenderer && FredIsInFirstPersonCam()))
#endif #endif
C3dMarkers::Render(); C3dMarkers::Render();
POP_RENDERGROUP();
} }
void void

View file

@ -307,9 +307,11 @@ void CWaterCannons::Update(void)
void CWaterCannons::Render(void) void CWaterCannons::Render(void)
{ {
PUSH_RENDERGROUP("CWaterCannons::Render");
for ( int32 i = 0; i < NUM_WATERCANNONS; i++ ) for ( int32 i = 0; i < NUM_WATERCANNONS; i++ )
{ {
if ( aCannons[i].m_nId != 0 ) if ( aCannons[i].m_nId != 0 )
aCannons[i].Render(); aCannons[i].Render();
} }
POP_RENDERGROUP();
} }

View file

@ -1202,6 +1202,8 @@ CWaterLevel::RenderTransparentWater(void)
if ( !CGame::CanSeeWaterFromCurrArea() ) if ( !CGame::CanSeeWaterFromCurrArea() )
return; return;
PUSH_RENDERGROUP("CWaterLevel::RenderTransparentWater");
float fWaterDrawDist = _GetWavyDrawDist(); float fWaterDrawDist = _GetWavyDrawDist();
float fWaterDrawDistLarge = fWaterDrawDist + 90.0f; float fWaterDrawDistLarge = fWaterDrawDist + 90.0f;
float fWavySectorMaxRenderDistSqr = SQR(fWaterDrawDist); float fWavySectorMaxRenderDistSqr = SQR(fWaterDrawDist);
@ -1485,6 +1487,8 @@ CWaterLevel::RenderTransparentWater(void)
DefinedState(); DefinedState();
#endif #endif
POP_RENDERGROUP();
} }
void CWaterLevel::RenderOneFlatSmallWaterPoly(float fX, float fY, float fZ, RwRGBA const &color) void CWaterLevel::RenderOneFlatSmallWaterPoly(float fX, float fY, float fZ, RwRGBA const &color)

View file

@ -102,6 +102,32 @@ SetCullMode(uint32 mode)
RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE); RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE);
} }
#ifndef FINAL
void
PushRendergroup(const char *name)
{
#if defined(RW_OPENGL)
if(GLAD_GL_KHR_debug)
glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, name);
#elif defined(RW_D3D9)
static WCHAR tmp[256];
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, name, -1, tmp, sizeof(tmp));
D3DPERF_BeginEvent(0xFFFFFFFF, tmp);
#endif
}
void
PopRendergroup(void)
{
#if defined(RW_OPENGL)
if(GLAD_GL_KHR_debug)
glPopDebugGroup();
#elif defined(RW_D3D9)
D3DPERF_EndEvent();
#endif
}
#endif
RwFrame* RwFrame*
GetFirstFrameCallback(RwFrame *child, void *data) GetFirstFrameCallback(RwFrame *child, void *data)
{ {

View file

@ -233,7 +233,9 @@ CVisibilityPlugins::RenderFadingEntities(CLinkList<AlphaObjectInfo> &list)
DeActivateDirectional(); DeActivateDirectional();
SetAmbientColours(); SetAmbientColours();
e->bImBeingRendered = true; e->bImBeingRendered = true;
PUSH_RENDERGROUP(mi->GetModelName());
RenderFadingAtomic((RpAtomic*)e->m_rwObject, node->item.sort); RenderFadingAtomic((RpAtomic*)e->m_rwObject, node->item.sort);
POP_RENDERGROUP();
e->bImBeingRendered = false; e->bImBeingRendered = false;
}else }else
CRenderer::RenderOneNonRoad(e); CRenderer::RenderOneNonRoad(e);

View file

@ -2273,7 +2273,7 @@ WinMain(HINSTANCE instance,
case GS_START_UP: case GS_START_UP:
{ {
#ifdef NO_MOVIES #ifdef NO_MOVIES
gGameState = GS_INIT_ONCE; gGameState = gbNoMovies ? GS_INIT_ONCE : GS_INIT_LOGO_MPEG;
#else #else
gGameState = GS_INIT_LOGO_MPEG; gGameState = GS_INIT_LOGO_MPEG;
#endif #endif
@ -2314,8 +2314,11 @@ WinMain(HINSTANCE instance,
case GS_INIT_INTRO_MPEG: case GS_INIT_INTRO_MPEG:
{ {
#ifndef NO_MOVIES #ifdef NO_MOVIES
if (!gbNoMovies)
#endif
CloseClip(); CloseClip();
#ifndef FIX_BUGS
CoUninitialize(); CoUninitialize();
#endif #endif
@ -2353,8 +2356,11 @@ WinMain(HINSTANCE instance,
case GS_INIT_ONCE: case GS_INIT_ONCE:
{ {
#ifndef NO_MOVIES #ifdef NO_MOVIES
if (!gbNoMovies)
#endif
CloseClip(); CloseClip();
#ifndef FIX_BUGS
CoUninitialize(); CoUninitialize();
#endif #endif

View file

@ -258,13 +258,13 @@ CText::LoadMissionText(char *MissionTableName)
sprintf(filename, "SPANISH.GXT"); sprintf(filename, "SPANISH.GXT");
break; break;
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
case LANGUAGE_POLISH: case CMenuManager::LANGUAGE_POLISH:
sprintf(filename, "POLISH.GXT"); sprintf(filename, "POLISH.GXT");
break; break;
case LANGUAGE_RUSSIAN: case CMenuManager::LANGUAGE_RUSSIAN:
sprintf(filename, "RUSSIAN.GXT"); sprintf(filename, "RUSSIAN.GXT");
break; break;
case LANGUAGE_JAPANESE: case CMenuManager::LANGUAGE_JAPANESE:
sprintf(filename, "JAPANESE.GXT"); sprintf(filename, "JAPANESE.GXT");
break; break;
#endif #endif

View file

@ -1,5 +1,6 @@
#include "common.h" #include "common.h"
#include "main.h"
#include "WeaponEffects.h" #include "WeaponEffects.h"
#include "TxdStore.h" #include "TxdStore.h"
#include "Sprite.h" #include "Sprite.h"
@ -103,6 +104,8 @@ CWeaponEffects::Render(void)
float w, h; float w, h;
if ( CSprite::CalcScreenCoors(gCrossHair.m_vecPos, &pos, &w, &h, true) ) if ( CSprite::CalcScreenCoors(gCrossHair.m_vecPos, &pos, &w, &h, true) )
{ {
PUSH_RENDERGROUP("CWeaponEffects::Render");
float recipz = 1.0f / pos.z; float recipz = 1.0f / pos.z;
CSprite::RenderOneXLUSprite_Rotate_Aspect(pos.x, pos.y, pos.z, CSprite::RenderOneXLUSprite_Rotate_Aspect(pos.x, pos.y, pos.z,
w, h, w, h,
@ -119,6 +122,8 @@ CWeaponEffects::Render(void)
gCrossHair.m_fRotation += 0.02f; gCrossHair.m_fRotation += 0.02f;
if ( gCrossHair.m_fRotation > TWOPI ) if ( gCrossHair.m_fRotation > TWOPI )
gCrossHair.m_fRotation = 0.0; gCrossHair.m_fRotation = 0.0;
POP_RENDERGROUP();
} }
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)FALSE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)FALSE);

2
vendor/librw vendored

@ -1 +1 @@
Subproject commit a60b7a9a57e3106efaa435eba20aec3af2ac26fe Subproject commit cc550ff69c06ec03aae9ac7ac1f634703800660f