1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-11-14 04:19:16 +00:00

Radar, WaterCannon, win/glfw skels

This commit is contained in:
eray orçunus 2020-10-14 18:07:05 +03:00
parent 7bf2373fed
commit b98864d134
12 changed files with 622 additions and 350 deletions

View file

@ -332,14 +332,12 @@ project "reVC"
links { "rw" } links { "rw" }
filter "platforms:*d3d9*" filter "platforms:*d3d9*"
defines { "USE_D3D9" }
links { "d3d9" } links { "d3d9" }
filter "platforms:*x86*d3d*" filter "platforms:*x86*d3d*"
includedirs { "sdk/dx8sdk/include" } includedirs { "sdk/dx8sdk/include" }
libdirs { "sdk/dx8sdk/lib" } libdirs { "sdk/dx8sdk/lib" }
filter "platforms:*amd64*d3d9*"
defines { "USE_D3D9" }
filter "platforms:win-x86*gl3_glfw*" filter "platforms:win-x86*gl3_glfw*"
libdirs { path.join(_OPTIONS["glewdir"], "lib/Release/Win32") } libdirs { path.join(_OPTIONS["glewdir"], "lib/Release/Win32") }

View file

@ -288,8 +288,8 @@ class CTheScripts
static uint16 ScriptsUpdated; static uint16 ScriptsUpdated;
static uint32 LastMissionPassedTime; static uint32 LastMissionPassedTime;
static uint16 NumberOfExclusiveMissionScripts; static uint16 NumberOfExclusiveMissionScripts;
static bool bPlayerIsInTheStatium;
public: public:
static bool bPlayerIsInTheStatium;
static uint8 RiotIntensity; static uint8 RiotIntensity;
static bool bPlayerHasMetDebbieHarry; static bool bPlayerHasMetDebbieHarry;
public: public:
@ -562,4 +562,4 @@ void RetryMission(int, int);
#ifdef USE_DEBUG_SCRIPT_LOADER #ifdef USE_DEBUG_SCRIPT_LOADER
extern int scriptToLoad; extern int scriptToLoad;
#endif #endif

View file

@ -4578,19 +4578,13 @@ CMenuManager::UnloadTextures()
CUserDisplay::PlaceName.ProcessAfterFrontEndShutDown(); CUserDisplay::PlaceName.ProcessAfterFrontEndShutDown();
} }
// --MIAMI: Done
void void
CMenuManager::WaitForUserCD() CMenuManager::WaitForUserCD()
{ {
CSprite2d *splash; CSprite2d *splash;
char *splashscreen = nil; char *splashscreen = nil;
#if (!(defined RANDOMSPLASH) && !(defined GTA3_1_1_PATCH))
if (CGame::frenchGame || CGame::germanGame || !CGame::nastyGame)
splashscreen = "mainsc2";
else
splashscreen = "mainsc1";
#endif
splash = LoadSplash(splashscreen); splash = LoadSplash(splashscreen);
if (RsGlobal.quit) if (RsGlobal.quit)
@ -4742,6 +4736,53 @@ CMenuManager::PrintMap(void)
} }
CRadar::DrawBlips(); CRadar::DrawBlips();
if (m_PrefsShowLegends) {
CFont::SetWrapx(SCREEN_SCALE_FROM_RIGHT(40.0f));
CFont::SetRightJustifyWrap(SCREEN_SCALE_X(84.0f));
CFont::SetBackGroundOnlyTextOff();
CFont::SetColor(CRGBA(255, 150, 225, FadeIn(255)));
CFont::SetDropShadowPosition(2);
CFont::SetDropColor(CRGBA(0, 0, 0, FadeIn(255)));
CFont::SetCentreOn();
CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
CFont::SetScale(SCREEN_SCALE_X(0.65f), SCREEN_SCALE_Y(0.95f));
int secondColumnStart = (CRadar::MapLegendCounter - 1) / 2;
int boxBottom = MENU_Y(100.0f);
// + 3, because we want 19*3 px padding
for (int i = 0; i < secondColumnStart + 3; i++) {
boxBottom += MENU_Y(19.f);
}
CSprite2d::DrawRect(CRect(MENU_X_LEFT_ALIGNED(95.0f), MENU_Y(100.0f), MENU_X_LEFT_ALIGNED(555.f), boxBottom),
CRGBA(0, 0, 0, FadeIn(190)));
CFont::PrintString(MENU_X_LEFT_ALIGNED(320.0f), MENU_Y(102.0f), TheText.Get("FE_MLG"));
CFont::SetRightJustifyOff();
CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD));
if (m_PrefsLanguage == LANGUAGE_AMERICAN)
CFont::SetScale(SCREEN_SCALE_X(0.55f), SCREEN_SCALE_Y(0.55f));
else
CFont::SetScale(SCREEN_SCALE_X(0.45f), SCREEN_SCALE_Y(0.55f));
CFont::SetColor(CRGBA(225, 225, 225, FadeIn(255)));
CFont::SetDropShadowPosition(0);
int y = MENU_Y(127.0f);
int x = MENU_X_LEFT_ALIGNED(160.0f);
for (int16 i = 0; i < CRadar::MapLegendCounter; i++) {
CRadar::DrawLegend(x, y, CRadar::MapLegendList[i]);
if (i == secondColumnStart) {
x = MENU_X_LEFT_ALIGNED(350.0f);
y = MENU_Y(127.0f);
} else {
y += MENU_Y(19.0f);
}
}
}
#ifdef CUSTOM_MAP #ifdef CUSTOM_MAP
CVector2D mapPoint; CVector2D mapPoint;
@ -4820,7 +4861,7 @@ CMenuManager::PrintMap(void)
#endif #endif
m_bMenuMapActive = false; m_bMenuMapActive = false;
CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(5.0f)); CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(10.0f));
CFont::SetRightJustifyWrap(SCREEN_SCALE_X(10.0f)); CFont::SetRightJustifyWrap(SCREEN_SCALE_X(10.0f));
DisplayHelperText("FEH_MPH"); DisplayHelperText("FEH_MPH");
} }

File diff suppressed because it is too large Load diff

View file

@ -96,6 +96,17 @@ enum eRadarSprite
RADAR_SPRITE_COUNT RADAR_SPRITE_COUNT
}; };
enum
{
RADAR_TRACE_RED,
RADAR_TRACE_GREEN,
RADAR_TRACE_LIGHT_BLUE,
RADAR_TRACE_GRAY,
RADAR_TRACE_YELLOW,
RADAR_TRACE_MAGENTA,
RADAR_TRACE_CYAN
};
enum enum
{ {
BLIP_MODE_TRIANGULAR_UP = 0, BLIP_MODE_TRIANGULAR_UP = 0,
@ -104,6 +115,26 @@ enum
}; };
struct sRadarTrace struct sRadarTrace
{
uint32 m_nColor;
uint32 m_eBlipType; // eBlipType
int32 m_nEntityHandle;
CVector m_vec2DPos;
CVector m_vecPos;
uint16 m_BlipIndex;
bool m_bDim;
bool m_bInUse;
bool m_bShortRange;
bool m_unused;
float m_Radius;
int16 m_wScale;
uint16 m_eBlipDisplay; // eBlipDisplay
uint16 m_eRadarSprite; // eRadarSprite
};
// Either that was a thing while saving/loading blips, or they added sizes of each field one by one. I want to do the former.
#pragma pack(push,1)
struct sRadarTraceSave
{ {
uint32 m_nColor; uint32 m_nColor;
uint32 m_eBlipType; // eBlipType uint32 m_eBlipType; // eBlipType
@ -114,11 +145,13 @@ struct sRadarTrace
bool m_bDim; bool m_bDim;
bool m_bInUse; bool m_bInUse;
bool m_bShortRange; bool m_bShortRange;
bool m_unused;
float m_Radius; float m_Radius;
int16 m_wScale; int16 m_wScale;
uint16 m_eBlipDisplay; // eBlipDisplay uint16 m_eBlipDisplay; // eBlipDisplay
uint16 m_eRadarSprite; // eRadarSprite uint16 m_eRadarSprite; // eRadarSprite
}; };
#pragma pack(pop)
// Values for screen space // Values for screen space
#define RADAR_LEFT (40.0f) #define RADAR_LEFT (40.0f)
@ -176,7 +209,7 @@ public:
static CRGBA ArrowBlipColour1; static CRGBA ArrowBlipColour1;
static CRGBA ArrowBlipColour2; static CRGBA ArrowBlipColour2;
static int16 MapLegendList[NUM_MAP_LEGENDS]; static int16 MapLegendList[NUM_MAP_LEGENDS];
static uint16 MapLegendCounter; static int16 MapLegendCounter;
#ifdef MAP_ENHANCEMENTS #ifdef MAP_ENHANCEMENTS
static int TargetMarkerId; static int TargetMarkerId;
@ -215,9 +248,9 @@ public:
static void RemoveRadarSections(); static void RemoveRadarSections();
static void SaveAllRadarBlips(uint8*, uint32*); static void SaveAllRadarBlips(uint8*, uint32*);
static void SetBlipSprite(int32 i, int32 icon); static void SetBlipSprite(int32 i, int32 icon);
static int32 SetCoordBlip(eBlipType type, CVector pos, int32, eBlipDisplay); static int32 SetCoordBlip(eBlipType type, CVector pos, uint32, eBlipDisplay);
static int32 SetEntityBlip(eBlipType type, int32, int32, eBlipDisplay); static int32 SetEntityBlip(eBlipType type, int32, uint32, eBlipDisplay);
static int32 SetShortRangeCoordBlip(eBlipType type, CVector pos, int32, eBlipDisplay); static int32 SetShortRangeCoordBlip(eBlipType type, CVector pos, uint32, eBlipDisplay);
static void SetRadarMarkerState(int32 i, bool flag); static void SetRadarMarkerState(int32 i, bool flag);
static void ShowRadarMarker(CVector pos, uint32 color, float radius); static void ShowRadarMarker(CVector pos, uint32 color, float radius);
static void ShowRadarTrace(float x, float y, uint32 size, uint8 red, uint8 green, uint8 blue, uint8 alpha); static void ShowRadarTrace(float x, float y, uint32 size, uint8 red, uint8 green, uint8 blue, uint8 alpha);
@ -229,7 +262,8 @@ public:
static void TransformRadarPointToRealWorldSpace(CVector2D &out, const CVector2D &in); static void TransformRadarPointToRealWorldSpace(CVector2D &out, const CVector2D &in);
static void TransformRadarPointToScreenSpace(CVector2D &out, const CVector2D &in); static void TransformRadarPointToScreenSpace(CVector2D &out, const CVector2D &in);
static void TransformRealWorldPointToRadarSpace(CVector2D &out, const CVector2D &in); static void TransformRealWorldPointToRadarSpace(CVector2D &out, const CVector2D &in);
// no in CRadar in the game:
static void CalculateCachedSinCos(); static void CalculateCachedSinCos();
static void DrawEntityBlip(int32 blipId);
static void DrawCoordBlip(int32 blipId);
static void DrawLegend(int32, int32, int32);
}; };

View file

@ -172,7 +172,6 @@ enum Config {
# define RANDOMSPLASH # define RANDOMSPLASH
# define VU_COLLISION # define VU_COLLISION
#elif defined GTA_PC #elif defined GTA_PC
# define GTA3_1_1_PATCH
//# define GTA3_STEAM_PATCH //# define GTA3_STEAM_PATCH
//# define GTAVC_JP_PATCH //# define GTAVC_JP_PATCH
# ifdef GTA_PS2_STUFF # ifdef GTA_PS2_STUFF
@ -263,7 +262,6 @@ enum Config {
// Hud, frontend and radar // Hud, frontend and radar
//#define BETA_SLIDING_TEXT //#define BETA_SLIDING_TEXT
#define TRIANGULAR_BLIPS // height indicating triangular radar blips, as in VC
#define PC_MENU #define PC_MENU
#ifndef PC_MENU #ifndef PC_MENU

View file

@ -88,14 +88,10 @@ public:
if(type == EFFECT_LIGHT){ if(type == EFFECT_LIGHT){
if(light.corona) if(light.corona)
RwTextureDestroy(light.corona); RwTextureDestroy(light.corona);
#ifdef GTA3_1_1_PATCH
light.corona = nil; light.corona = nil;
#endif
if(light.shadow) if(light.shadow)
RwTextureDestroy(light.shadow); RwTextureDestroy(light.shadow);
#ifdef GTA3_1_1_PATCH
light.shadow = nil; light.shadow = nil;
#endif
} }
} }
}; };

View file

@ -11,6 +11,9 @@
#include "Fire.h" #include "Fire.h"
#include "WaterLevel.h" #include "WaterLevel.h"
#include "Camera.h" #include "Camera.h"
#include "Particle.h"
// --MIAMI: file done
#define WATERCANNONVERTS 4 #define WATERCANNONVERTS 4
#define WATERCANNONINDEXES 12 #define WATERCANNONINDEXES 12
@ -64,7 +67,7 @@ void CWaterCannon::Update_OncePerFrame(int16 index)
if (CTimer::GetTimeInMilliseconds() > m_nTimeCreated + WATERCANNON_LIFETIME ) if (CTimer::GetTimeInMilliseconds() > m_nTimeCreated + WATERCANNON_LIFETIME )
{ {
m_nCur = (m_nCur + 1) % -NUM_SEGMENTPOINTS; m_nCur = (m_nCur + 1) % NUM_SEGMENTPOINTS;
m_abUsed[m_nCur] = false; m_abUsed[m_nCur] = false;
} }
@ -128,7 +131,7 @@ void CWaterCannon::Render(void)
RwIm3DVertexSetV(&WaterCannonVertices[2], v); RwIm3DVertexSetV(&WaterCannonVertices[2], v);
RwIm3DVertexSetV(&WaterCannonVertices[3], v); RwIm3DVertexSetV(&WaterCannonVertices[3], v);
int16 pointA = m_nCur % -NUM_SEGMENTPOINTS; int16 pointA = m_nCur % NUM_SEGMENTPOINTS;
int16 pointB = pointA - 1; int16 pointB = pointA - 1;
if ( (pointA - 1) < 0 ) if ( (pointA - 1) < 0 )
@ -235,11 +238,16 @@ void CWaterCannon::PushPeds(void)
ped->m_vecMoveSpeed.x = (0.6f * m_avecVelocity[j].x + ped->m_vecMoveSpeed.x) * 0.5f; ped->m_vecMoveSpeed.x = (0.6f * m_avecVelocity[j].x + ped->m_vecMoveSpeed.x) * 0.5f;
ped->m_vecMoveSpeed.y = (0.6f * m_avecVelocity[j].y + ped->m_vecMoveSpeed.y) * 0.5f; ped->m_vecMoveSpeed.y = (0.6f * m_avecVelocity[j].y + ped->m_vecMoveSpeed.y) * 0.5f;
ped->SetFall(2000, AnimationId(ANIM_KO_SKID_FRONT + localDir), 0); float pedSpeed2D = ped->m_vecMoveSpeed.Magnitude2D();
CFire *fire = ped->m_pFire; if ( pedSpeed2D > 0.2f ) {
if ( fire ) ped->m_vecMoveSpeed.x *= (0.2f / pedSpeed2D);
fire->Extinguish(); ped->m_vecMoveSpeed.y *= (0.2f / pedSpeed2D);
}
ped->SetFall(2000, (AnimationId)(localDir + ANIM_KO_SKID_FRONT), 0);
CParticle::AddParticle(PARTICLE_STEAM_NY_SLOWMOTION, ped->GetPosition(), ped->m_vecMoveSpeed * 0.3f, 0, 0.5f);
CParticle::AddParticle(PARTICLE_CAR_SPLASH, ped->GetPosition(), ped->m_vecMoveSpeed * -0.3f + CVector(0.f, 0.f, 0.5f), 0, 0.5f,
CGeneral::GetRandomNumberInRange(0.f, 10.f), CGeneral::GetRandomNumberInRange(0.f, 90.f), 1);
j = NUM_SEGMENTPOINTS; j = NUM_SEGMENTPOINTS;
} }

View file

@ -534,12 +534,13 @@ CameraSize(RwCamera * camera, RwRect * rect,
} }
} }
// BUG: game just changes camera raster's sizes, but this is a hack if (( origSize.w != rect->w ) || ( origSize.h != rect->h ))
if (( origSize.w != rect->w ) && ( origSize.h != rect->h ))
{ {
RwRaster *raster; RwRaster *raster;
RwRaster *zRaster; RwRaster *zRaster;
// BUG: game just changes camera raster's sizes, but this is a hack
#ifdef FIX_BUGS
/* /*
* Destroy rasters... * Destroy rasters...
*/ */
@ -597,6 +598,13 @@ CameraSize(RwCamera * camera, RwRect * rect,
RwCameraSetRaster(camera, raster); RwCameraSetRaster(camera, raster);
RwCameraSetZRaster(camera, zRaster); RwCameraSetZRaster(camera, zRaster);
} }
#else
raster = RwCameraGetRaster(camera);
zRaster = RwCameraGetZRaster(camera);
raster->width = zRaster->width = rect->w;
raster->height = zRaster->height = rect->h;
#endif
} }
/* Figure out the view window */ /* Figure out the view window */

View file

@ -152,7 +152,7 @@ const char *_psGetUserFilesFolder()
&KeycbData) == ERROR_SUCCESS ) &KeycbData) == ERROR_SUCCESS )
{ {
RegCloseKey(hKey); RegCloseKey(hKey);
strcat(szUserFiles, "\\GTA3 User Files"); strcat(szUserFiles, "\\GTA Vice City User Files");
_psCreateFolder(szUserFiles); _psCreateFolder(szUserFiles);
return szUserFiles; return szUserFiles;
} }
@ -386,10 +386,6 @@ psInitialize(void)
InitialiseLanguage(); InitialiseLanguage();
#ifndef GTA3_1_1_PATCH
FrontEndMenuManager.LoadSettings();
#endif
#endif #endif
gGameState = GS_START_UP; gGameState = GS_START_UP;
@ -422,7 +418,7 @@ psInitialize(void)
} }
else if ( verInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ) else if ( verInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS )
{ {
if ( verInfo.dwMajorVersion > 4 || verInfo.dwMajorVersion == 4 && verInfo.dwMinorVersion == 1 ) if ( verInfo.dwMajorVersion > 4 || verInfo.dwMajorVersion == 4 && verInfo.dwMinorVersion != 0 )
{ {
debug("Operating System is Win98\n"); debug("Operating System is Win98\n");
_dwOperatingSystemVersion = OS_WIN98; _dwOperatingSystemVersion = OS_WIN98;
@ -439,13 +435,9 @@ psInitialize(void)
#ifndef PS2_MENU #ifndef PS2_MENU
#ifdef GTA3_1_1_PATCH
FrontEndMenuManager.LoadSettings(); FrontEndMenuManager.LoadSettings();
#endif #endif
#endif
#ifdef _WIN32 #ifdef _WIN32
MEMORYSTATUS memstats; MEMORYSTATUS memstats;
@ -1250,14 +1242,17 @@ void resizeCB(GLFWwindow* window, int width, int height) {
* memory things don't work. * memory things don't work.
*/ */
/* redraw window */ /* redraw window */
if (RwInitialised && (gGameState == GS_PLAYING_GAME
#ifndef MASTER #ifndef MASTER
|| gGameState == GS_ANIMVIEWER if (RwInitialised && (gGameState == GS_PLAYING_GAME || gGameState == GS_ANIMVIEWER))
#endif
))
{ {
RsEventHandler((gGameState == GS_PLAYING_GAME ? rsIDLE : rsANIMVIEWER), (void*)TRUE); RsEventHandler((gGameState == GS_PLAYING_GAME ? rsIDLE : rsANIMVIEWER), (void *)TRUE);
} }
#else
if (RwInitialised && gGameState == GS_PLAYING_GAME)
{
RsEventHandler(rsIDLE, (void *)TRUE);
}
#endif
if (RwInitialised && height > 0 && width > 0) { if (RwInitialised && height > 0 && width > 0) {
RwRect r; RwRect r;
@ -1765,6 +1760,7 @@ main(int argc, char *argv[])
printf("Into TheGame!!!\n"); printf("Into TheGame!!!\n");
#else #else
LoadingScreen(nil, nil, "loadsc0"); LoadingScreen(nil, nil, "loadsc0");
// LoadingScreen(nil, nil, "loadsc0"); // duplicate
#endif #endif
if ( !CGame::InitialiseOnceAfterRW() ) if ( !CGame::InitialiseOnceAfterRW() )
RsGlobal.quit = TRUE; RsGlobal.quit = TRUE;
@ -1781,6 +1777,7 @@ main(int argc, char *argv[])
case GS_INIT_FRONTEND: case GS_INIT_FRONTEND:
{ {
LoadingScreen(nil, nil, "loadsc0"); LoadingScreen(nil, nil, "loadsc0");
// LoadingScreen(nil, nil, "loadsc0"); // duplicate
FrontEndMenuManager.m_bGameNotLoaded = true; FrontEndMenuManager.m_bGameNotLoaded = true;

View file

@ -8,7 +8,7 @@
#define IDEXIT 1002 #define IDEXIT 1002
#define IDC_SELECTDEVICE 1005 #define IDC_SELECTDEVICE 1005
#define IDI_MAIN_ICON 1042 #define IDI_MAIN_ICON 100
// Next default values for new objects // Next default values for new objects
// //
#ifdef APSTUDIO_INVOKED #ifdef APSTUDIO_INVOKED

View file

@ -189,7 +189,7 @@ const char *_psGetUserFilesFolder()
&KeycbData) == ERROR_SUCCESS ) &KeycbData) == ERROR_SUCCESS )
{ {
RegCloseKey(hKey); RegCloseKey(hKey);
strcat(szUserFiles, "\\GTA3 User Files"); strcat(szUserFiles, "\\GTA Vice City User Files");
_psCreateFolder(szUserFiles); _psCreateFolder(szUserFiles);
return szUserFiles; return szUserFiles;
} }
@ -650,10 +650,6 @@ psInitialize(void)
C_PcSave::SetSaveDirectory(_psGetUserFilesFolder()); C_PcSave::SetSaveDirectory(_psGetUserFilesFolder());
InitialiseLanguage(); InitialiseLanguage();
#ifndef GTA3_1_1_PATCH
FrontEndMenuManager.LoadSettings();
#endif
#endif #endif
gGameState = GS_START_UP; gGameState = GS_START_UP;
@ -688,7 +684,7 @@ psInitialize(void)
} }
else if ( verInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ) else if ( verInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS )
{ {
if ( verInfo.dwMajorVersion > 4 || verInfo.dwMajorVersion == 4 && verInfo.dwMinorVersion == 1 ) if ( verInfo.dwMajorVersion > 4 || verInfo.dwMajorVersion == 4 && verInfo.dwMinorVersion != 0 )
{ {
debug("Operating System is Win98\n"); debug("Operating System is Win98\n");
_dwOperatingSystemVersion = OS_WIN98; _dwOperatingSystemVersion = OS_WIN98;
@ -701,11 +697,7 @@ psInitialize(void)
} }
#ifndef PS2_MENU #ifndef PS2_MENU
#ifdef GTA3_1_1_PATCH
FrontEndMenuManager.LoadSettings(); FrontEndMenuManager.LoadSettings();
#endif
#endif #endif
dwDXVersion = GetDXVersion(); dwDXVersion = GetDXVersion();
@ -945,8 +937,7 @@ void HandleGraphEvent(void)
/* /*
***************************************************************************** *****************************************************************************
*/ */
LRESULT CALLBACK LRESULT CALLBACK
MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam) MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
{ {
@ -1016,10 +1007,17 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
RECT rect; RECT rect;
/* redraw window */ /* redraw window */
#ifndef MASTER
if (RwInitialised && (gGameState == GS_PLAYING_GAME || gGameState == GS_ANIMVIEWER)) if (RwInitialised && (gGameState == GS_PLAYING_GAME || gGameState == GS_ANIMVIEWER))
{ {
RsEventHandler((gGameState == GS_PLAYING_GAME ? rsIDLE : rsANIMVIEWER), (void *)TRUE); RsEventHandler((gGameState == GS_PLAYING_GAME ? rsIDLE : rsANIMVIEWER), (void *)TRUE);
} }
#else
if (RwInitialised && gGameState == GS_PLAYING_GAME)
{
RsEventHandler(rsIDLE, (void *)TRUE);
}
#endif
/* Manually resize window */ /* Manually resize window */
rect.left = rect.top = 0; rect.left = rect.top = 0;
@ -1327,7 +1325,7 @@ InitApplication(HANDLE instance)
windowClass.cbClsExtra = 0; windowClass.cbClsExtra = 0;
windowClass.cbWndExtra = 0; windowClass.cbWndExtra = 0;
windowClass.hInstance = (HINSTANCE)instance; windowClass.hInstance = (HINSTANCE)instance;
windowClass.hIcon = nil; windowClass.hIcon = LoadIcon((HINSTANCE)instance, (LPCSTR)IDI_MAIN_ICON);
windowClass.hCursor = LoadCursor(nil, IDC_ARROW); windowClass.hCursor = LoadCursor(nil, IDC_ARROW);
windowClass.hbrBackground = nil; windowClass.hbrBackground = nil;
windowClass.lpszMenuName = NULL; windowClass.lpszMenuName = NULL;
@ -1382,17 +1380,17 @@ UINT GetBestRefreshRate(UINT width, UINT height, UINT depth)
#endif #endif
if ( mode.Width == width && mode.Height == height && mode.Format == format ) if ( mode.Width == width && mode.Height == height && mode.Format == format )
{ {
if ( mode.RefreshRate == 0 ) if ( mode.RefreshRate == 0 ) {
d3d->Release();
return 0; return 0;
}
if ( mode.RefreshRate < refreshRate && mode.RefreshRate >= 60 ) if ( mode.RefreshRate < refreshRate && mode.RefreshRate >= 60 )
refreshRate = mode.RefreshRate; refreshRate = mode.RefreshRate;
} }
} }
#ifdef FIX_BUGS
d3d->Release(); d3d->Release();
#endif
if ( refreshRate == -1 ) if ( refreshRate == -1 )
return -1; return -1;
@ -2255,6 +2253,8 @@ WinMain(HINSTANCE instance,
if ( startupDeactivate || ControlsManager.GetJoyButtonJustDown() != 0 ) if ( startupDeactivate || ControlsManager.GetJoyButtonJustDown() != 0 )
++gGameState; ++gGameState;
else if ( CPad::GetPad(0)->NewState.CheckForInput() )
++gGameState;
else if ( CPad::GetPad(0)->GetLeftMouseJustDown() ) else if ( CPad::GetPad(0)->GetLeftMouseJustDown() )
++gGameState; ++gGameState;
else if ( CPad::GetPad(0)->GetEnterJustDown() ) else if ( CPad::GetPad(0)->GetEnterJustDown() )
@ -2292,6 +2292,8 @@ WinMain(HINSTANCE instance,
if ( startupDeactivate || ControlsManager.GetJoyButtonJustDown() != 0 ) if ( startupDeactivate || ControlsManager.GetJoyButtonJustDown() != 0 )
++gGameState; ++gGameState;
else if ( CPad::GetPad(0)->NewState.CheckForInput() )
++gGameState;
else if ( CPad::GetPad(0)->GetLeftMouseJustDown() ) else if ( CPad::GetPad(0)->GetLeftMouseJustDown() )
++gGameState; ++gGameState;
else if ( CPad::GetPad(0)->GetEnterJustDown() ) else if ( CPad::GetPad(0)->GetEnterJustDown() )
@ -2328,6 +2330,7 @@ WinMain(HINSTANCE instance,
printf("Into TheGame!!!\n"); printf("Into TheGame!!!\n");
#else #else
LoadingScreen(nil, nil, "loadsc0"); LoadingScreen(nil, nil, "loadsc0");
// LoadingScreen(nil, nil, "loadsc0"); // duplicate
#endif #endif
if ( !CGame::InitialiseOnceAfterRW() ) if ( !CGame::InitialiseOnceAfterRW() )
RsGlobal.quit = TRUE; RsGlobal.quit = TRUE;
@ -2345,6 +2348,7 @@ WinMain(HINSTANCE instance,
case GS_INIT_FRONTEND: case GS_INIT_FRONTEND:
{ {
LoadingScreen(nil, nil, "loadsc0"); LoadingScreen(nil, nil, "loadsc0");
// LoadingScreen(nil, nil, "loadsc0"); // duplicate
FrontEndMenuManager.m_bGameNotLoaded = true; FrontEndMenuManager.m_bGameNotLoaded = true;