Squeeze performance option, minor fixes

Fixes are already in miami
This commit is contained in:
eray orçunus
2020-08-03 04:00:12 +03:00
parent a786dd45a4
commit e14252914e
21 changed files with 181 additions and 12 deletions

View File

@ -53,6 +53,10 @@ CAccidentManager::ReportAccident(CPed *ped)
void
CAccidentManager::Update()
{
#ifdef SQUEEZE_PERFORMANCE
// Handled after injury registered.
return;
#endif
int32 e;
if (CEventList::GetEvent(EVENT_INJURED_PED, &e)) {
CPed *ped = CPools::GetPed(gaEvent[e].entityRef);

View File

@ -1,5 +1,4 @@
#pragma once
#include "common.h"
#include "config.h"
class CPed;

View File

@ -4,7 +4,7 @@
#include "Game.h" // for eLevelName
// If you spawn many tanks at once, you will see that collisions of two entity exceeds 32.
#ifdef FIX_BUGS
#if defined(FIX_BUGS) && !defined(SQUEEZE_PERFORMANCE)
#define MAX_COLLISION_POINTS 64
#else
#define MAX_COLLISION_POINTS 32

View File

@ -8,6 +8,7 @@
#include "Messages.h"
#include "Text.h"
#include "main.h"
#include "Accident.h"
int32 CEventList::ms_nFirstFreeSlotIndex;
CEvent gaEvent[NUMEVENTS];
@ -63,6 +64,13 @@ CEventList::RegisterEvent(eEventType type, eEventEntity entityType, CEntity *ent
int ref;
bool copsDontCare;
#ifdef SQUEEZE_PERFORMANCE
if (type == EVENT_INJURED_PED) {
gAccidentManager.ReportAccident((CPed*)ent);
return;
}
#endif
copsDontCare = false;
switch(entityType){
case EVENT_ENTITY_PED:

View File

@ -106,6 +106,7 @@ int gameTxdSlot;
bool DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha);
void DoRWStuffEndOfFrame(void);
#ifdef PS2_MENU
void MessageScreen(char *msg)
{
//TODO: stretch_screen
@ -139,6 +140,7 @@ void MessageScreen(char *msg)
DoRWStuffEndOfFrame();
}
#endif
bool
CGame::InitialiseOnceBeforeRW(void)
@ -431,6 +433,7 @@ bool CGame::Initialise(const char* datFile)
if ( !TheMemoryCard.m_bWantToLoad )
{
#endif
LoadingScreen("Loading the Game", "Start script", nil);
CTheScripts::StartTestScript();
CTheScripts::Process();
TheCamera.Process();

View File

@ -1104,7 +1104,9 @@ void CPad::UpdatePads(void)
if ( bUpdate )
{
GetPad(0)->Update(0);
#ifndef SQUEEZE_PERFORMANCE
GetPad(1)->Update(0);
#endif
}
#if defined(MASTER) && !defined(XINPUT)

View File

@ -1941,6 +1941,11 @@ CWorld::Process(void)
} else {
for(CPtrNode *node = ms_listMovingEntityPtrs.first; node; node = node->next) {
CEntity *movingEnt = (CEntity *)node->item;
#ifdef SQUEEZE_PERFORMANCE
if (movingEnt->bRemoveFromWorld) {
RemoveEntityInsteadOfProcessingIt(movingEnt);
} else
#endif
if(movingEnt->m_rwObject && RwObjectGetType(movingEnt->m_rwObject) == rpCLUMP &&
RpAnimBlendClumpGetFirstAssociation(movingEnt->GetClump())) {
RpAnimBlendClumpUpdateAnimations(movingEnt->GetClump(),

View File

@ -7,6 +7,7 @@
#include "Clock.h"
#include "Text.h"
#include "World.h"
#include "Timer.h"
eLevelName CTheZones::m_CurrLevel;
CZone *CTheZones::m_pPlayersZone;
@ -122,6 +123,10 @@ CTheZones::Init(void)
void
CTheZones::Update(void)
{
#ifdef SQUEEZE_PERFORMANCE
if (CTimer::GetFrameCounter() % 5 != 0)
return;
#endif
CVector pos;
pos = FindPlayerCoors();
m_pPlayersZone = FindSmallestZonePosition(&pos);

View File

@ -282,4 +282,13 @@ enum Config {
#ifndef AUDIO_OAL // is not working yet for openal
#define AUDIO_CACHE // cache sound lengths to speed up the cold boot
#endif
//#define PS2_AUDIO // changes audio paths for cutscenes and radio to PS2 paths, needs vbdec to support VB with MSS
//#define PS2_AUDIO // changes audio paths for cutscenes and radio to PS2 paths, needs vbdec to support VB with MSS
//#define SQUEEZE_PERFORMANCE
#ifdef SQUEEZE_PERFORMANCE
#undef PS2_ALPHA_TEST
#undef NO_ISLAND_LOADING
#define PC_PARTICLE
#define VC_PED_PORTS // To not process collisions always. But should be tested if that's really beneficial
#endif

View File

@ -816,7 +816,9 @@ RenderScene(void)
DefinedState();
CWaterLevel::RenderWater();
CRenderer::RenderFadingInEntities();
#ifndef SQUEEZE_PERFORMANCE
CRenderer::RenderVehiclesButNotBoats();
#endif
CWeather::RenderRainStreaks();
}