diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/AnimViewer.cpp | 2 | ||||
-rw-r--r-- | src/core/Cam.cpp | 4 | ||||
-rw-r--r-- | src/core/Camera.cpp | 8 | ||||
-rw-r--r-- | src/core/Camera.h | 1 | ||||
-rw-r--r-- | src/core/Clock.cpp | 9 | ||||
-rw-r--r-- | src/core/Clock.h | 3 | ||||
-rw-r--r-- | src/core/FileLoader.cpp | 119 | ||||
-rw-r--r-- | src/core/FileLoader.h | 1 | ||||
-rw-r--r-- | src/core/Frontend.cpp | 126 | ||||
-rw-r--r-- | src/core/Game.cpp | 38 | ||||
-rw-r--r-- | src/core/Game.h | 8 | ||||
-rw-r--r-- | src/core/IniFile.cpp | 4 | ||||
-rw-r--r-- | src/core/KeyGen.cpp | 106 | ||||
-rw-r--r-- | src/core/KeyGen.h | 11 | ||||
-rw-r--r-- | src/core/Leeds.cpp | 14 | ||||
-rw-r--r-- | src/core/Leeds.h | 36 | ||||
-rw-r--r-- | src/core/Pad.cpp | 13 | ||||
-rw-r--r-- | src/core/Pad.h | 12 | ||||
-rw-r--r-- | src/core/PlayerInfo.cpp | 6 | ||||
-rw-r--r-- | src/core/Radar.cpp | 156 | ||||
-rw-r--r-- | src/core/Radar.h | 83 | ||||
-rw-r--r-- | src/core/Streaming.cpp | 255 | ||||
-rw-r--r-- | src/core/Streaming.h | 22 | ||||
-rw-r--r-- | src/core/World.cpp | 114 | ||||
-rw-r--r-- | src/core/World.h | 15 | ||||
-rw-r--r-- | src/core/Zones.cpp | 12 | ||||
-rw-r--r-- | src/core/common.h | 14 | ||||
-rw-r--r-- | src/core/config.h | 60 | ||||
-rw-r--r-- | src/core/main.cpp | 67 | ||||
-rw-r--r-- | src/core/main.h | 10 | ||||
-rw-r--r-- | src/core/re3.cpp | 133 |
31 files changed, 1039 insertions, 423 deletions
diff --git a/src/core/AnimViewer.cpp b/src/core/AnimViewer.cpp index 562b9c15..dc9b44cb 100644 --- a/src/core/AnimViewer.cpp +++ b/src/core/AnimViewer.cpp @@ -81,7 +81,7 @@ CAnimViewer::Initialise(void) { CCollision::Init(); CWorld::Initialise(); mod_HandlingManager.Initialise(); - CTempColModels::Initialise(); + gpTempColModels->Initialise(); CAnimManager::Initialise(); CModelInfo::Initialise(); CParticle::Initialise(); diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp index ad315029..56409af4 100644 --- a/src/core/Cam.cpp +++ b/src/core/Cam.cpp @@ -121,6 +121,7 @@ CCam::Process(void) else TargetOrientation = CGeneral::GetATanOfXY(CamTargetEntity->GetForward().x, CamTargetEntity->GetForward().y); +/* LCS: removed CVector Fwd(0.0f, 0.0f, 0.0f); Fwd.x = CamTargetEntity->GetForward().x; Fwd.y = CamTargetEntity->GetForward().y; @@ -138,6 +139,9 @@ CCam::Process(void) else TargetSpeedVar = -Min(Sqrt(SQR(FwdSpeedX) + SQR(FwdSpeedY))/1.8f, 0.5f); SpeedVar = 0.895f*SpeedVar + 0.105*TargetSpeedVar; +*/ + SpeedVar = 0.0f; + TargetSpeedVar = 0.0f; }else{ if(CamTargetEntity == FindPlayerPed()){ // Some fancy smoothing of player position and speed diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp index d94efb03..987efe04 100644 --- a/src/core/Camera.cpp +++ b/src/core/Camera.cpp @@ -114,6 +114,7 @@ CCamera::Init(void) m_1rstPersonRunCloseToAWall = false; m_fPositionAlongSpline = 0.0f; m_bCameraJustRestored = false; + m_bFreezePedZoomSwitch = false; Cams[0].Init(); Cams[1].Init(); Cams[2].Init(); @@ -985,7 +986,7 @@ CCamera::CamControl(void) // Change user selected mode if(CPad::GetPad(0)->CycleCameraModeUpJustDown() && !CReplay::IsPlayingBack() && (m_bLookingAtPlayer || WhoIsInControlOfTheCamera == CAMCONTROL_OBBE) && - !m_WideScreenOn && !m_bFailedCullZoneTestPreviously && !m_bFirstPersonBeingUsed){ + !m_WideScreenOn && !m_bFailedCullZoneTestPreviously && !m_bFirstPersonBeingUsed && !m_bFreezePedZoomSwitch){ if(FrontEndMenuManager.m_ControlMethod == CONTROL_STANDARD){ if(PedZoomIndicator == CAM_ZOOM_3) PedZoomIndicator = CAM_ZOOM_1; @@ -3863,7 +3864,7 @@ CCamera::GetScreenFadeStatus(void) } - +//--LCS: TODO void CCamera::RenderMotionBlur(void) { @@ -3872,7 +3873,8 @@ CCamera::RenderMotionBlur(void) CMBlur::MotionBlurRender(m_pRwCamera, m_BlurRed, m_BlurGreen, m_BlurBlue, - m_motionBlur, m_BlurType, m_imotionBlurAddAlpha); +// m_motionBlur, m_BlurType, m_imotionBlurAddAlpha); + m_motionBlur, m_BlurType, 32); // hack hack } void diff --git a/src/core/Camera.h b/src/core/Camera.h index 39ecb760..66a89f21 100644 --- a/src/core/Camera.h +++ b/src/core/Camera.h @@ -368,6 +368,7 @@ public: bool m_bVehicleSuspenHigh; bool m_bEnable1rstPersonCamCntrlsScript; bool m_bAllow1rstPersonWeaponsCamera; + bool m_bFreezePedZoomSwitch; bool m_bFailedCullZoneTestPreviously; bool m_FadeTargetIsSplashScreen; diff --git a/src/core/Clock.cpp b/src/core/Clock.cpp index a3298343..0aa841ae 100644 --- a/src/core/Clock.cpp +++ b/src/core/Clock.cpp @@ -18,6 +18,7 @@ uint16 CClock::ms_Stored_nGameClockSeconds; uint32 CClock::ms_nMillisecondsPerGameMinute; uint32 CClock::ms_nLastClockTick; bool CClock::ms_bClockHasBeenStored; +float CClock::ms_EnvMapTimeMultiplicator; #ifndef MASTER bool gbFreezeTime; @@ -33,6 +34,7 @@ CClock::Initialise(uint32 scale) ms_nMillisecondsPerGameMinute = scale; ms_nLastClockTick = CTimer::GetTimeInMilliseconds(); ms_bClockHasBeenStored = false; + ms_EnvMapTimeMultiplicator = 1.0f; debug("CClock ready\n"); #ifndef MASTER VarConsole.Add("Time (hour of day)", &ms_nGameClockHours, 1, 0, 23, true); @@ -134,3 +136,10 @@ CClock::RestoreClock(void) ms_nGameClockMinutes = ms_Stored_nGameClockMinutes; ms_nGameClockSeconds = ms_Stored_nGameClockSeconds; } + +void +CClock::CalcEnvMapTimeMultiplicator(void) +{ + float nightness = Abs(ms_nGameClockHours/24.0f - 0.5f); + ms_EnvMapTimeMultiplicator = SQR(1.0f - nightness);; +} diff --git a/src/core/Clock.h b/src/core/Clock.h index a611cd50..808e61f4 100644 --- a/src/core/Clock.h +++ b/src/core/Clock.h @@ -12,6 +12,7 @@ public: static uint32 ms_nMillisecondsPerGameMinute; static uint32 ms_nLastClockTick; static bool ms_bClockHasBeenStored; + static float ms_EnvMapTimeMultiplicator; static void Initialise(uint32 scale); static void Update(void); @@ -21,6 +22,8 @@ public: static void StoreClock(void); static void RestoreClock(void); + static void CalcEnvMapTimeMultiplicator(void); + static uint8 GetHours(void) { return ms_nGameClockHours; } static uint8 GetMinutes(void) { return ms_nGameClockMinutes; } static int16 GetSeconds(void) { return ms_nGameClockSeconds; } diff --git a/src/core/FileLoader.cpp b/src/core/FileLoader.cpp index 4ad53572..d57bdd92 100644 --- a/src/core/FileLoader.cpp +++ b/src/core/FileLoader.cpp @@ -291,7 +291,7 @@ CFileLoader::LoadCollisionModel(uint8 *buf, CColModel &model, char *modelname) { int i; - model.boundingSphere.radius = *(float*)(buf); + model.boundingSphere.radius = Max(*(float*)(buf), 0.1f); model.boundingSphere.center.x = *(float*)(buf+4); model.boundingSphere.center.y = *(float*)(buf+8); model.boundingSphere.center.z = *(float*)(buf+12); @@ -304,10 +304,13 @@ CFileLoader::LoadCollisionModel(uint8 *buf, CColModel &model, char *modelname) model.numSpheres = *(int16*)(buf+40); buf += 44; if(model.numSpheres > 0){ - model.spheres = (CColSphere*)RwMalloc(model.numSpheres*sizeof(CColSphere)); + model.spheres = new CColSphere[model.numSpheres]; REGISTER_MEMPTR(&model.spheres); for(i = 0; i < model.numSpheres; i++){ - model.spheres[i].Set(*(float*)buf, *(CVector*)(buf+4), buf[16], buf[17]); + float radius = *(float*)buf; + if(radius > model.boundingSphere.radius) + model.boundingSphere.radius = radius + 0.01f; + model.spheres[i].Set(radius, *(CVector*)(buf+4), buf[16], buf[17]); buf += 20; } }else @@ -316,7 +319,7 @@ CFileLoader::LoadCollisionModel(uint8 *buf, CColModel &model, char *modelname) model.numLines = *(int16*)buf; buf += 4; if(model.numLines > 0){ - //model.lines = (CColLine*)RwMalloc(model.numLines*sizeof(CColLine)); + //model.lines = new CColLine[model.numLines];; REGISTER_MEMPTR(&model.lines); for(i = 0; i < model.numLines; i++){ //model.lines[i].Set(*(CVector*)buf, *(CVector*)(buf+12)); @@ -330,7 +333,7 @@ CFileLoader::LoadCollisionModel(uint8 *buf, CColModel &model, char *modelname) model.numBoxes = *(int16*)buf; buf += 4; if(model.numBoxes > 0){ - model.boxes = (CColBox*)RwMalloc(model.numBoxes*sizeof(CColBox)); + model.boxes = new CColBox[model.numBoxes]; REGISTER_MEMPTR(&model.boxes); for(i = 0; i < model.numBoxes; i++){ model.boxes[i].Set(*(CVector*)buf, *(CVector*)(buf+12), buf[24], buf[25]); @@ -342,7 +345,7 @@ CFileLoader::LoadCollisionModel(uint8 *buf, CColModel &model, char *modelname) int32 numVertices = *(int16*)buf; buf += 4; if(numVertices > 0){ - model.vertices = (CompressedVector*)RwMalloc(numVertices*sizeof(CompressedVector)); + model.vertices = new CompressedVector[numVertices]; REGISTER_MEMPTR(&model.vertices); for(i = 0; i < numVertices; i++){ model.vertices[i].Set(*(float*)buf, *(float*)(buf+4), *(float*)(buf+8)); @@ -360,14 +363,64 @@ CFileLoader::LoadCollisionModel(uint8 *buf, CColModel &model, char *modelname) model.numTriangles = *(int16*)buf; buf += 4; if(model.numTriangles > 0){ - model.triangles = (CColTriangle*)RwMalloc(model.numTriangles*sizeof(CColTriangle)); + model.triangles = new CColTriangle[model.numTriangles]; REGISTER_MEMPTR(&model.triangles); for(i = 0; i < model.numTriangles; i++){ model.triangles[i].Set(*(int32*)buf, *(int32*)(buf+4), *(int32*)(buf+8), buf[12]); buf += 16; + + // skip small triangles + CVector vA = model.vertices[model.triangles[i].a].Get(); + CVector vB = model.vertices[model.triangles[i].b].Get(); + CVector vC = model.vertices[model.triangles[i].c].Get(); + float area = CrossProduct(vA - vB, vA - vC).Magnitude(); + if(area < 0.001f || vA == vB || vA == vC || vB == vC){ + i--; + model.numTriangles--; + } } }else model.triangles = nil; + + SplitColTrianglesIntoSections(model); +} + +void +CFileLoader::SplitColTrianglesIntoSections(CColModel &model) +{ + if(model.triangles == nil || model.numTriangles == 0) + return; + + model.numTriBBoxes = 1; + model.triBBoxes = new CColTriBBox[1]; + model.triBBoxes[0].first = 0; + model.triBBoxes[0].last = model.numTriangles-1; + CVector v = model.vertices[model.triangles[0].a].Get(); + model.triBBoxes[0].Set(v, v); + + for(int i = 0; i < model.numTriangles; i++){ + CVector vA = model.vertices[model.triangles[i].a].Get(); + CVector vB = model.vertices[model.triangles[i].b].Get(); + CVector vC = model.vertices[model.triangles[i].c].Get(); + model.triBBoxes[0].min.x = Min(vA.x, model.triBBoxes[0].min.x); + model.triBBoxes[0].min.y = Min(vA.y, model.triBBoxes[0].min.y); + model.triBBoxes[0].min.z = Min(vA.z, model.triBBoxes[0].min.z); + model.triBBoxes[0].min.x = Min(vB.x, model.triBBoxes[0].min.x); + model.triBBoxes[0].min.y = Min(vB.y, model.triBBoxes[0].min.y); + model.triBBoxes[0].min.z = Min(vB.z, model.triBBoxes[0].min.z); + model.triBBoxes[0].min.x = Min(vC.x, model.triBBoxes[0].min.x); + model.triBBoxes[0].min.y = Min(vC.y, model.triBBoxes[0].min.y); + model.triBBoxes[0].min.z = Min(vC.z, model.triBBoxes[0].min.z); + model.triBBoxes[0].max.x = Max(vA.x, model.triBBoxes[0].max.x); + model.triBBoxes[0].max.y = Max(vA.y, model.triBBoxes[0].max.y); + model.triBBoxes[0].max.z = Max(vA.z, model.triBBoxes[0].max.z); + model.triBBoxes[0].max.x = Max(vB.x, model.triBBoxes[0].max.x); + model.triBBoxes[0].max.y = Max(vB.y, model.triBBoxes[0].max.y); + model.triBBoxes[0].max.z = Max(vB.z, model.triBBoxes[0].max.z); + model.triBBoxes[0].max.x = Max(vC.x, model.triBBoxes[0].max.x); + model.triBBoxes[0].max.y = Max(vC.y, model.triBBoxes[0].max.y); + model.triBBoxes[0].max.z = Max(vC.z, model.triBBoxes[0].max.z); + } } static void @@ -608,11 +661,14 @@ CFileLoader::LoadObjectTypes(const char *filename) int section; int pathIndex; int id, pathType; - int minID, maxID; + //int minID, maxID; + + for(int i = 0; i < ARRAY_SIZE(m_sTempIdeData); i++) + m_sTempIdeData[i].id = -1; section = NONE; - minID = INT32_MAX; - maxID = -1; + //minID = INT32_MAX; + //maxID = -1; pathIndex = -1; debug("Loading object types from %s...\n", filename); @@ -636,13 +692,13 @@ CFileLoader::LoadObjectTypes(const char *filename) }else switch(section){ case OBJS: id = LoadObject(line); - if(id > maxID) maxID = id; - if(id < minID) minID = id; + //if(id > maxID) maxID = id; + //if(id < minID) minID = id; break; case TOBJ: id = LoadTimeObject(line); - if(id > maxID) maxID = id; - if(id < minID) minID = id; + //if(id > maxID) maxID = id; + //if(id < minID) minID = id; break; case WEAP: LoadWeaponObject(line); @@ -679,10 +735,10 @@ CFileLoader::LoadObjectTypes(const char *filename) } CFileMgr::CloseFile(fd); - for(id = minID; id <= maxID; id++){ + for(id = 0; id < MODELINFOSIZE; id++){ CSimpleModelInfo *mi = (CSimpleModelInfo*)CModelInfo::GetModelInfo(id); if(mi && mi->IsBuilding()) - mi->SetupBigBuilding(minID, maxID); + mi->SetupBigBuilding(); } } @@ -715,6 +771,13 @@ CFileLoader::LoadObject(const char *line) if(sscanf(line, "%d %s %s %d", &id, model, txd, &numObjs) != 4) return 0; // game returns return value + for(int i = 0; i < ARRAY_SIZE(m_sTempIdeData); i++) + if(m_sTempIdeData[i].id == -1){ + m_sTempIdeData[i].id = id; + strcpy(m_sTempIdeData[i].name, model); + break; + } + switch(numObjs){ case 1: sscanf(line, "%d %s %s %d %f %d", @@ -763,6 +826,13 @@ CFileLoader::LoadTimeObject(const char *line) if(sscanf(line, "%d %s %s %d", &id, model, txd, &numObjs) != 4) return 0; // game returns return value + for(int i = 0; i < ARRAY_SIZE(m_sTempIdeData); i++) + if(m_sTempIdeData[i].id < 0){ + m_sTempIdeData[i].id = id; + strcpy(m_sTempIdeData[i].name, model); + break; + } + switch(numObjs){ case 1: sscanf(line, "%d %s %s %d %f %d %d %d", @@ -793,7 +863,7 @@ CFileLoader::LoadTimeObject(const char *line) mi->m_firstDamaged = damaged; mi->SetTimes(timeOn, timeOff); mi->SetTexDictionary(txd); - other = mi->FindOtherTimeModel(); + other = mi->FindOtherTimeModel(model); if(other) other->SetOtherTimeModel(id); MatchModelString(model, id); @@ -817,7 +887,7 @@ CFileLoader::LoadWeaponObject(const char *line) mi->m_lodDistances[0] = dist; mi->SetTexDictionary(txd); mi->SetAnimFile(animFile); - mi->SetColModel(&CTempColModels::ms_colModelWeapon); + mi->SetColModel(&gpTempColModels->ms_colModelWeapon); MatchModelString(model, id); return id; } @@ -833,7 +903,7 @@ CFileLoader::LoadClumpObject(const char *line) mi = CModelInfo::AddClumpModel(id); mi->SetModelName(model); mi->SetTexDictionary(txd); - mi->SetColModel(&CTempColModels::ms_colModelBBox); + mi->SetColModel(&gpTempColModels->ms_colModelBBox); } } @@ -845,14 +915,15 @@ CFileLoader::LoadVehicleObject(const char *line) char type[8], handlingId[16], gamename[32], animFile[16], vehclass[12]; uint32 frequency, comprules; int32 level, misc; - float wheelScale; + float wheelScale, normalSplay; CVehicleModelInfo *mi; char *p; - sscanf(line, "%d %s %s %s %s %s %s %s %d %d %x %d %f", + sscanf(line, "%d %s %s %s %s %s %s %s %d %d %x %d %f %f", &id, model, txd, type, handlingId, gamename, animFile, vehclass, - &frequency, &level, &comprules, &misc, &wheelScale); + &frequency, &level, &comprules, &misc, &wheelScale, + &normalSplay); mi = CModelInfo::AddVehicleModel(id); mi->SetModelName(model); @@ -872,6 +943,8 @@ CFileLoader::LoadVehicleObject(const char *line) mi->m_vehicleType = VEHICLE_TYPE_BOAT; }else if(strcmp(type, "train") == 0){ mi->m_vehicleType = VEHICLE_TYPE_TRAIN; + }else if(strcmp(type, "ferry") == 0){ + mi->m_vehicleType = VEHICLE_TYPE_FERRY; }else if(strcmp(type, "heli") == 0){ mi->m_vehicleType = VEHICLE_TYPE_HELI; }else if(strcmp(type, "plane") == 0){ @@ -937,7 +1010,7 @@ CFileLoader::LoadPedObject(const char *line) mi->SetModelName(model); mi->SetTexDictionary(txd); mi->SetAnimFile(animFile); - mi->SetColModel(&CTempColModels::ms_colModelPed1); + mi->SetColModel(&gpTempColModels->ms_colModelPed1); mi->m_pedType = CPedType::FindPedType(pedType); mi->m_pedStatType = CPedStats::GetPedStatType(pedStats); for(animGroupId = 0; animGroupId < NUM_ANIM_ASSOC_GROUPS; animGroupId++) diff --git a/src/core/FileLoader.h b/src/core/FileLoader.h index 077e7bdd..3a7d43a7 100644 --- a/src/core/FileLoader.h +++ b/src/core/FileLoader.h @@ -11,6 +11,7 @@ public: static bool LoadCollisionFileFirstTime(uint8 *buffer, uint32 size, uint8 colSlot); static bool LoadCollisionFile(uint8 *buffer, uint32 size, uint8 colSlot); static void LoadCollisionModel(uint8 *buf, struct CColModel &model, char *name); + static void SplitColTrianglesIntoSections(CColModel &model); static void LoadModelFile(const char *filename); static RpAtomic *FindRelatedModelInfoCB(RpAtomic *atomic, void *data); static void LoadClumpFile(const char *filename); diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index 7491b7e2..3bf05836 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -36,15 +36,16 @@ #include "User.h" #include "sampman.h" +// --LCS: changed a bit to have lcs feel, needs more work // Similar story to Hud.cpp: // Game has colors inlined in code. // For easier modification we collect them here: -const CRGBA LABEL_COLOR(255, 150, 225, 255); +const CRGBA LABEL_COLOR(115, 173, 216, 255); const CRGBA SELECTIONBORDER_COLOR(25, 130, 70, 255); const CRGBA MENUOPTION_COLOR = LABEL_COLOR; -const CRGBA SELECTEDMENUOPTION_COLOR = LABEL_COLOR; -const CRGBA HEADER_COLOR = LABEL_COLOR; -const CRGBA DARKMENUOPTION_COLOR(195, 90, 165, 255); +const CRGBA SELECTEDMENUOPTION_COLOR(255, 255, 255, 255); +const CRGBA HEADER_COLOR(197, 0, 0, 255); +const CRGBA DARKMENUOPTION_COLOR(115/2, 173/2, 216 / 2, 255); const CRGBA SLIDERON_COLOR(97, 194, 247, 255); const CRGBA SLIDEROFF_COLOR(27, 89, 130, 255); const CRGBA LIST_BACKGROUND_COLOR(49, 101, 148, 130); @@ -53,6 +54,19 @@ const CRGBA RADIO_SELECTOR_COLOR = SLIDEROFF_COLOR; const CRGBA INACTIVE_RADIO_COLOR(100, 100, 255, 100); const CRGBA SCROLLBAR_COLOR = LABEL_COLOR; +#if 0 +// Mobile +#define DEFAULT_BRIGHTNESS 0x150 +#define MIN_BRIGHTNESS 180 +#define MAX_BRIGHTNESS 700 +#else +// PS2, also PSP probably +// 8 bars (32 step) +#define DEFAULT_BRIGHTNESS 0x120 +#define MIN_BRIGHTNESS 0x80 +#define MAX_BRIGHTNESS 0x180 +#endif + #define MAP_MIN_SIZE 162.f #define MAP_SIZE_TO_ALLOW_X_MOVE 297.f @@ -187,7 +201,7 @@ wchar* CMenuManager::m_pDialogText = nil; #endif #define SET_FONT_FOR_MENU_HEADER \ - CFont::SetRightJustifyOn(); \ + CFont::SetRightJustifyOff(); \ CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING)); \ CFont::SetScale(MENU_X(MENUHEADER_WIDTH), MENU_Y(MENUHEADER_HEIGHT)); \ CFont::SetDropShadowPosition(0); @@ -471,7 +485,7 @@ CMenuManager::CMenuManager() m_PrefsMusicVolume = 49; m_PrefsRadioStation = 0; m_PrefsStereoMono = 1; - m_PrefsBrightness = 256; + m_PrefsBrightness = DEFAULT_BRIGHTNESS; m_PrefsLOD = CRenderer::ms_lodDistScale; m_KeyPressedCode = -1; m_bFrontEnd_ReloadObrTxtGxt = false; @@ -696,8 +710,8 @@ CMenuManager::CheckSliderMovement(int value) { switch (aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action) { case MENUACTION_BRIGHTNESS: - m_PrefsBrightness += value * 24.19f; - m_PrefsBrightness = clamp(m_PrefsBrightness, 0, 384); + m_PrefsBrightness += value * 32.0f; + m_PrefsBrightness = clamp(m_PrefsBrightness, MIN_BRIGHTNESS, MAX_BRIGHTNESS); break; case MENUACTION_DRAWDIST: if(value > 0) @@ -917,14 +931,14 @@ CMenuManager::DrawStandardMenus(bool activeScreen) #endif switch (m_nCurrScreen) { - case MENUPAGE_CHOOSE_LOAD_SLOT: + /*case MENUPAGE_CHOOSE_LOAD_SLOT: case MENUPAGE_CHOOSE_DELETE_SLOT: case MENUPAGE_CHOOSE_SAVE_SLOT: CSprite2d::Draw2DPolygon(MENU_X_LEFT_ALIGNED(38.0f), MENU_Y(85.0f), MENU_X_LEFT_ALIGNED(615.0f), MENU_Y(75.0f), MENU_X_LEFT_ALIGNED(30.0f), MENU_Y(320.0f), MENU_X_LEFT_ALIGNED(605.0f), MENU_Y(330.0f), CRGBA(LIST_BACKGROUND_COLOR.r, LIST_BACKGROUND_COLOR.g, LIST_BACKGROUND_COLOR.b, FadeIn(LIST_BACKGROUND_COLOR.a))); - break; + break;*/ case MENUPAGE_SOUND_SETTINGS: PrintRadioSelector(); break; @@ -940,11 +954,11 @@ CMenuManager::DrawStandardMenus(bool activeScreen) if (aScreens[m_nCurrScreen].m_ScreenName[0] != '\0') { SET_FONT_FOR_MENU_HEADER - CFont::SetColor(CRGBA(30, 30, 30, FadeIn(255))); - CFont::PrintString(SCREEN_STRETCH_FROM_RIGHT(MENUHEADER_POS_X) - MENU_X(7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName)); + //CFont::SetColor(CRGBA(30, 30, 30, FadeIn(255))); + //CFont::PrintString(SCREEN_STRETCH_X(MENUHEADER_POS_X) - MENU_X(7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName)); CFont::SetColor(CRGBA(HEADER_COLOR.r, HEADER_COLOR.g, HEADER_COLOR.b, FadeIn(255))); - CFont::PrintString(SCREEN_STRETCH_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName)); + CFont::PrintString(SCREEN_STRETCH_X(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName)); } // Label @@ -1020,18 +1034,21 @@ CMenuManager::DrawStandardMenus(bool activeScreen) #endif wchar* rightText = nil; wchar* leftText; - if (aScreens[m_nCurrScreen].m_aEntries[i].m_SaveSlot >= SAVESLOT_1 && aScreens[m_nCurrScreen].m_aEntries[i].m_SaveSlot <= SAVESLOT_8) { + /*if (aScreens[m_nCurrScreen].m_aEntries[i].m_SaveSlot >= SAVESLOT_1 && aScreens[m_nCurrScreen].m_aEntries[i].m_SaveSlot <= SAVESLOT_8) { CFont::SetColor(CRGBA(0, 0, 0, FadeIn(255))); CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD)); CFont::SetScale(MENU_X(MEDIUMTEXT_X_SCALE), MENU_Y(MEDIUMTEXT_Y_SCALE)); CFont::SetDropShadowPosition(0); - } else { - CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING)); + } else {*/ + CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD)); CFont::SetScale(MENU_X(BIGTEXT_X_SCALE), MENU_Y(BIGTEXT_Y_SCALE)); CFont::SetDropShadowPosition(2); CFont::SetDropColor(CRGBA(0, 0, 0, FadeIn(255))); - CFont::SetColor(CRGBA(MENUOPTION_COLOR.r, MENUOPTION_COLOR.g, MENUOPTION_COLOR.b, FadeIn(255))); - } + if (i == m_nCurrOption && itemsAreSelectable) + CFont::SetColor(CRGBA(SELECTEDMENUOPTION_COLOR.r, SELECTEDMENUOPTION_COLOR.g, SELECTEDMENUOPTION_COLOR.b, FadeIn(255))); + else + CFont::SetColor(CRGBA(MENUOPTION_COLOR.r, MENUOPTION_COLOR.g, MENUOPTION_COLOR.b, FadeIn(255))); + //} if (aScreens[m_nCurrScreen].m_aEntries[i].m_Align == MENUALIGN_LEFT) { CFont::SetCentreOff(); CFont::SetRightJustifyOff(); @@ -1387,7 +1404,7 @@ CMenuManager::DrawStandardMenus(bool activeScreen) // Actually bottomRight and bottomLeft should be exchanged here(although this is original code). // So this shows us either R* didn't use same struct for menu BG and highlight, or they just kept fields as x1,y1 etc. Yikes. - if (m_nOptionHighlightTransitionBlend == 0) { + /*if (m_nOptionHighlightTransitionBlend == 0) { if (m_firstStartCounter == 255 && m_nMenuFadeAlpha == 255 && !bMenuChangeOngoing) { CSprite2d::Draw2DPolygon(MENU_X_LEFT_ALIGNED(menuOptionHighlight.topLeft_x), MENU_Y(menuOptionHighlight.topLeft_y), MENU_X_LEFT_ALIGNED(menuOptionHighlight.topRight_x), MENU_Y(menuOptionHighlight.topRight_y), @@ -1423,7 +1440,7 @@ CMenuManager::DrawStandardMenus(bool activeScreen) MENU_X_LEFT_ALIGNED(menuOptionHighlight.bottomRight_x), MENU_Y(menuOptionHighlight.bottomRight_y), MENU_X_LEFT_ALIGNED(menuOptionHighlight.bottomLeft_x), MENU_Y(menuOptionHighlight.bottomLeft_y), SELECTIONBORDER_COLOR); } - } + }*/ static uint32 lastBlendChange = 0; if (m_nOptionHighlightTransitionBlend <= 255) { @@ -1455,7 +1472,7 @@ CMenuManager::DrawStandardMenus(bool activeScreen) CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD)); CFont::SetScale(MENU_X(MEDIUMTEXT_X_SCALE), MENU_Y(MEDIUMTEXT_Y_SCALE)); } else { - CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING)); + CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD)); CFont::SetScale(MENU_X(BIGTEXT_X_SCALE), MENU_Y(BIGTEXT_Y_SCALE)); } CFont::PrintString(MENU_X_LEFT_ALIGNED(DEFAULT_SCREEN_WIDTH - RIGHT_ALIGNED_TEXT_RIGHT_MARGIN(xMargin)), MENU_Y(aScreens[m_nCurrScreen].m_aEntries[i].m_Y MINUS_SCROLL_OFFSET), rightText); @@ -1506,7 +1523,7 @@ CMenuManager::DrawStandardMenus(bool activeScreen) int lastActiveBarX; switch (aScreens[m_nCurrScreen].m_aEntries[i].m_Action) { case MENUACTION_BRIGHTNESS: - ProcessSlider(m_PrefsBrightness / 384.0f, 70.0f, HOVEROPTION_INCREASE_BRIGHTNESS, HOVEROPTION_DECREASE_BRIGHTNESS, SCREEN_WIDTH, true); + ProcessSlider((float)(m_PrefsBrightness - MIN_BRIGHTNESS) / (MAX_BRIGHTNESS - MIN_BRIGHTNESS), 70.0f, HOVEROPTION_INCREASE_BRIGHTNESS, HOVEROPTION_DECREASE_BRIGHTNESS, SCREEN_WIDTH, true); break; case MENUACTION_DRAWDIST: ProcessSlider((m_PrefsLOD - 0.925f) / 0.875f, 99.0f, HOVEROPTION_INCREASE_DRAWDIST, HOVEROPTION_DECREASE_DRAWDIST, SCREEN_WIDTH, true); @@ -2038,18 +2055,18 @@ CMenuManager::DrawControllerSetupScreen() // Shadow CFont::SetColor(CRGBA(30, 30, 30, FadeIn(255))); - if (m_ControlMethod == CONTROL_STANDARD) - CFont::PrintString(SCREEN_STRETCH_FROM_RIGHT(MENUHEADER_POS_X) - MENU_X(7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f), TheText.Get("FET_STI")); - else if (m_ControlMethod == CONTROL_CLASSIC) - CFont::PrintString(SCREEN_STRETCH_FROM_RIGHT(MENUHEADER_POS_X) - MENU_X(7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f), TheText.Get("FET_CTI")); + //if (m_ControlMethod == CONTROL_STANDARD) + // CFont::PrintString(SCREEN_STRETCH_X(MENUHEADER_POS_X) - MENU_X(7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f), TheText.Get("FET_STI")); + //else if (m_ControlMethod == CONTROL_CLASSIC) + // CFont::PrintString(SCREEN_STRETCH_X(MENUHEADER_POS_X) - MENU_X(7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f), TheText.Get("FET_CTI")); // Real header CFont::SetColor(CRGBA(HEADER_COLOR.r, HEADER_COLOR.g, HEADER_COLOR.b, FadeIn(255))); if (m_ControlMethod == CONTROL_STANDARD) - CFont::PrintString(SCREEN_STRETCH_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y), TheText.Get("FET_STI")); + CFont::PrintString(SCREEN_STRETCH_X(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y), TheText.Get("FET_STI")); else if (m_ControlMethod == CONTROL_CLASSIC) - CFont::PrintString(SCREEN_STRETCH_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y), TheText.Get("FET_CTI")); + CFont::PrintString(SCREEN_STRETCH_X(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y), TheText.Get("FET_CTI")); wchar *actionTexts[33]; actionTexts[0] = TheText.Get("FEC_FIR"); @@ -2202,7 +2219,7 @@ CMenuManager::DrawControllerSetupScreen() } // Back button and it's shadow - CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING)); + CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD)); CFont::SetScale(MENU_X(BIGTEXT_X_SCALE), MENU_Y(BIGTEXT_Y_SCALE)); CFont::SetRightJustifyOn(); CFont::SetDropShadowPosition(2); @@ -2261,7 +2278,7 @@ CMenuManager::DrawBackground(bool transitionCall) PrintMap(); // Left border - CSprite2d::Draw2DPolygon(SCREEN_STRETCH_X(menuBg.bottomLeft_x), SCREEN_STRETCH_Y(menuBg.bottomLeft_y), 0.0f, SCREEN_HEIGHT, + /*CSprite2d::Draw2DPolygon(SCREEN_STRETCH_X(menuBg.bottomLeft_x), SCREEN_STRETCH_Y(menuBg.bottomLeft_y), 0.0f, SCREEN_HEIGHT, SCREEN_STRETCH_X(menuBg.topLeft_x), SCREEN_STRETCH_Y(menuBg.topLeft_y), 0.0f, 0.0f, CRGBA(0, 0, 0, 255)); // Top border @@ -2274,7 +2291,7 @@ CMenuManager::DrawBackground(bool transitionCall) // Right border CSprite2d::Draw2DPolygon(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_STRETCH_X(menuBg.bottomRight_x), SCREEN_STRETCH_Y(menuBg.bottomRight_y), - SCREEN_WIDTH, 0.0f, SCREEN_STRETCH_X(menuBg.topRight_x), SCREEN_STRETCH_Y(menuBg.topRight_y), CRGBA(0, 0, 0, 255)); + SCREEN_WIDTH, 0.0f, SCREEN_STRETCH_X(menuBg.topRight_x), SCREEN_STRETCH_Y(menuBg.topRight_y), CRGBA(0, 0, 0, 255));*/ } else { m_nMenuFadeAlpha = 255; m_firstStartCounter = 255; @@ -2283,7 +2300,7 @@ CMenuManager::DrawBackground(bool transitionCall) PrintMap(); // Left border - CSprite2d::Draw2DPolygon(SCREEN_STRETCH_X(menuBg.bottomLeft_x), SCREEN_STRETCH_Y(menuBg.bottomLeft_y), 0.0f, SCREEN_HEIGHT, + /*CSprite2d::Draw2DPolygon(SCREEN_STRETCH_X(menuBg.bottomLeft_x), SCREEN_STRETCH_Y(menuBg.bottomLeft_y), 0.0f, SCREEN_HEIGHT, SCREEN_STRETCH_X(menuBg.topLeft_x), SCREEN_STRETCH_Y(menuBg.topLeft_y), 0.0f, 0.0f, CRGBA(0, 0, 0, 255)); // Top border @@ -2296,7 +2313,7 @@ CMenuManager::DrawBackground(bool transitionCall) // Right border CSprite2d::Draw2DPolygon(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_STRETCH_X(menuBg.bottomRight_x), SCREEN_STRETCH_Y(menuBg.bottomRight_y), - SCREEN_WIDTH, 0.0f, SCREEN_STRETCH_X(menuBg.topRight_x), SCREEN_STRETCH_Y(menuBg.topRight_y), CRGBA(0, 0, 0, 255)); + SCREEN_WIDTH, 0.0f, SCREEN_STRETCH_X(menuBg.topRight_x), SCREEN_STRETCH_Y(menuBg.topRight_y), CRGBA(0, 0, 0, 255));*/ } } else { menuBg.SaveCurrentCoors(); @@ -2386,9 +2403,9 @@ CMenuManager::DrawBackground(bool transitionCall) if (CTimer::GetTimeInMillisecondsPauseMode() - LastFade > 30 || forceFadeInCounter > 30 ) { - m_nMenuFadeAlpha += 20; + m_nMenuFadeAlpha += 50; if (m_firstStartCounter < 255) { - m_firstStartCounter = Min(m_firstStartCounter + 20, 255); + m_firstStartCounter = Min(m_firstStartCounter + 50, 255); } LastFade = CTimer::GetTimeInMillisecondsPauseMode(); #ifdef FIX_BUGS @@ -2447,12 +2464,12 @@ CMenuManager::DrawBackground(bool transitionCall) CFont::DrawFonts(); SetFrontEndRenderStates(); - if (m_nCurrScreen != MENUPAGE_OUTRO) - if (m_firstStartCounter == 255) { - m_aFrontEndSprites[MENUSPRITE_VCLOGO].Draw(CRect(SCREEN_STRETCH_X(27.0f), MENU_Y(8.0f), SCREEN_STRETCH_X(27.0f) + MENU_X(130.f), MENU_Y(138.0f)), CRGBA(255, 255, 255, 255)); - } else { - m_aFrontEndSprites[MENUSPRITE_VCLOGO].Draw(CRect(SCREEN_STRETCH_X(27.0f), MENU_Y(8.0f), SCREEN_STRETCH_X(27.0f) + MENU_X(130.f), MENU_Y(138.0f)), CRGBA(255, 255, 255, FadeIn(255))); - } + //if (m_nCurrScreen != MENUPAGE_OUTRO) + // if (m_firstStartCounter == 255) { + // m_aFrontEndSprites[MENUSPRITE_VCLOGO].Draw(CRect(SCREEN_STRETCH_X(27.0f), MENU_Y(8.0f), SCREEN_STRETCH_X(27.0f) + MENU_X(130.f), MENU_Y(138.0f)), CRGBA(255, 255, 255, 255)); + // } else { + // m_aFrontEndSprites[MENUSPRITE_VCLOGO].Draw(CRect(SCREEN_STRETCH_X(27.0f), MENU_Y(8.0f), SCREEN_STRETCH_X(27.0f) + MENU_X(130.f), MENU_Y(138.0f)), CRGBA(255, 255, 255, FadeIn(255))); + // } if (m_ShowEmptyBindingError) { static uint32 lastBindingError = CTimer::GetTimeInMillisecondsPauseMode(); @@ -2571,11 +2588,11 @@ CMenuManager::DrawPlayerSetupScreen(bool activeScreen) MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT), SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM)), CRGBA(LIST_BACKGROUND_COLOR.r, LIST_BACKGROUND_COLOR.g, LIST_BACKGROUND_COLOR.b, FadeIn(LIST_BACKGROUND_COLOR.a))); SET_FONT_FOR_MENU_HEADER - CFont::SetColor(CRGBA(30, 30, 30, FadeIn(255))); - CFont::PrintString(SCREEN_STRETCH_FROM_RIGHT(MENUHEADER_POS_X) - MENU_X(7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f), TheText.Get("FET_PS")); + //CFont::SetColor(CRGBA(30, 30, 30, FadeIn(255))); + //CFont::PrintString(SCREEN_STRETCH_X(MENUHEADER_POS_X) - MENU_X(7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f), TheText.Get("FET_PS")); CFont::SetColor(CRGBA(HEADER_COLOR.r, HEADER_COLOR.g, HEADER_COLOR.b, FadeIn(255))); - CFont::PrintString(SCREEN_STRETCH_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y), TheText.Get("FET_PS")); + CFont::PrintString(SCREEN_STRETCH_X(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y), TheText.Get("FET_PS")); // Header (Skin - Date) if (m_nCurrExLayer == HOVEROPTION_LIST) { @@ -2755,7 +2772,7 @@ CMenuManager::DrawPlayerSetupScreen(bool activeScreen) // Big apply button if (strcmp(m_aSkinName, m_PrefsSkinFile) != 0) { - CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING)); + CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD)); switch (m_PrefsLanguage) { case LANGUAGE_FRENCH: CFont::SetScale(MENU_X(1.1f), MENU_Y(1.9f)); @@ -2775,7 +2792,7 @@ CMenuManager::DrawPlayerSetupScreen(bool activeScreen) CFont::SetRightJustifyOff(); CFont::PrintString(MENU_X_LEFT_ALIGNED(24.0f), MENU_Y(220.0f), TheText.Get("FET_APP")); } - CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING)); + CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD)); CFont::SetScale(MENU_X(BIGTEXT_X_SCALE), MENU_Y(BIGTEXT_Y_SCALE)); @@ -2847,7 +2864,7 @@ CMenuManager::DrawPlayerSetupScreen(bool activeScreen) m_nHoverOption = HOVEROPTION_NOT_HOVERING; } } - CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING)); + CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD)); CFont::SetScale(MENU_X(BIGTEXT_X_SCALE), MENU_Y(BIGTEXT_Y_SCALE)); CFont::SetRightJustifyOn(); CFont::SetColor(CRGBA(MENUOPTION_COLOR.r, MENUOPTION_COLOR.g, MENUOPTION_COLOR.b, FadeIn(255))); @@ -3286,7 +3303,7 @@ CMenuManager::SmallMessageScreen(const char* text) void CMenuManager::PrintBriefs() { - CFont::SetColor(CRGBA(0, 0, 0, FadeIn(255))); + CFont::SetColor(CRGBA(255, 255, 255, FadeIn(255))); CFont::SetRightJustifyOff(); CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD)); CFont::SetScale(MENU_X(MEDIUMTEXT_X_SCALE), MENU_Y(MEDIUMTEXT_Y_SCALE)); @@ -3442,9 +3459,9 @@ CMenuManager::Process(void) #ifdef XBOX_MESSAGE_SCREEN ProcessDialogTimer(); #endif - - if (TheCamera.GetScreenFadeStatus() != FADE_0) - return; + // tmp hack to get saving to work + //if (TheCamera.GetScreenFadeStatus() != FADE_0) + // return; InitialiseChangedLanguageSettings(); @@ -4751,7 +4768,8 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u break; case MENUACTION_CANCELGAME: DMAudio.Service(); - SwitchToNewScreen(MENUPAGE_OUTRO); + RsEventHandler(rsQUITAPP, nil); + //SwitchToNewScreen(MENUPAGE_OUTRO); break; case MENUACTION_RESUME: #ifdef LEGACY_MENU_OPTIONS @@ -4823,7 +4841,7 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE); SaveSettings(); } else if (m_nCurrScreen == MENUPAGE_DISPLAY_SETTINGS) { - m_PrefsBrightness = 256; + m_PrefsBrightness = DEFAULT_BRIGHTNESS; m_PrefsLOD = 1.2f; #ifdef LEGACY_MENU_OPTIONS m_PrefsVsync = true; @@ -5681,7 +5699,7 @@ CMenuManager::DrawQuitGameScreen(void) static CSprite2d *splash = nil; if (splash == nil) - splash = LoadSplash("OUTRO"); + splash = LoadSplash("sceelee"); m_aFrontEndSprites[MENUSPRITE_VCLOGO].Draw(CRect(SCREEN_STRETCH_X(28.0f), MENU_Y(8.0f), SCREEN_STRETCH_X(27.0f) + MENU_X(130.f), MENU_Y(138.0f)), CRGBA(255, 255, 255, 255 - alpha)); diff --git a/src/core/Game.cpp b/src/core/Game.cpp index c5e5224d..49e9c0da 100644 --- a/src/core/Game.cpp +++ b/src/core/Game.cpp @@ -322,7 +322,7 @@ bool CGame::InitialiseOnceAfterRW(void) { TheText.Load(); CTimer::Initialise(); - CTempColModels::Initialise(); + gpTempColModels->Initialise(); mod_HandlingManager.Initialise(); CSurfaceTable::Initialise("DATA\\SURFACE.DAT"); CPedStats::Initialise(); @@ -372,13 +372,16 @@ bool CGame::Initialise(const char* datFile) CPools::Initialise(); + if(gMakeResources) + CVehicleModelInfo::Load(nil); + #ifndef GTA_PS2 CIniFile::LoadIniFile(); #endif #ifdef USE_TEXTURE_POOL _TexturePoolsUnknown(false); #endif - currLevel = LEVEL_BEACH; + currLevel = LEVEL_INDUSTRIAL; currArea = AREA_MAIN_MAP; PUSH_MEMID(MEMID_TEXTURES); @@ -449,7 +452,7 @@ bool CGame::Initialise(const char* datFile) CdStreamAddImage("MODELS\\GTA3.IMG"); - CFileLoader::LoadLevel("DATA\\DEFAULT.DAT"); +// CFileLoader::LoadLevel("DATA\\DEFAULT.DAT"); CFileLoader::LoadLevel(datFile); LoadingScreen("Loading the Game", "Add Particles", nil); @@ -592,7 +595,7 @@ bool CGame::ShutDown(void) CPlane::Shutdown(); CTrain::Shutdown(); CScriptPaths::Shutdown(); - CWaterCreatures::RemoveAll(); + //CWaterCreatures::RemoveAll(); CSpecialFX::Shutdown(); CGarages::Shutdown(); CMovingThings::Shutdown(); @@ -666,8 +669,9 @@ void CGame::ReInitGameObjectVariables(void) CDraw::SetFOV(120.0f); CDraw::ms_fLODDistance = 500.0f; CStreaming::RequestBigBuildings(LEVEL_GENERIC); - CStreaming::RemoveIslandsNotUsed(LEVEL_BEACH); - CStreaming::RemoveIslandsNotUsed(LEVEL_MAINLAND); + CStreaming::RemoveIslandsNotUsed(LEVEL_INDUSTRIAL); + CStreaming::RemoveIslandsNotUsed(LEVEL_COMMERCIAL); + CStreaming::RemoveIslandsNotUsed(LEVEL_SUBURBAN); CStreaming::LoadAllRequestedModels(false); currArea = AREA_MAIN_MAP; CPed::Initialise(); @@ -753,7 +757,7 @@ void CGame::ShutDownForRestart(void) CRadar::RemoveRadarSections(); FrontEndMenuManager.UnloadTextures(); CParticleObject::RemoveAllExpireableParticleObjects(); - CWaterCreatures::RemoveAll(); + //CWaterCreatures::RemoveAll(); CSetPieces::Init(); CPedType::Shutdown(); CSpecialFX::Shutdown(); @@ -858,9 +862,9 @@ void CGame::Process(void) gameProcessPirateCheck = 2; } #endif - uint32 startTime = CTimer::GetCurrentTimeInCycles() / CTimer::GetCyclesPerMillisecond(); + //uint32 startTime = CTimer::GetCurrentTimeInCycles() / CTimer::GetCyclesPerMillisecond(); CStreaming::Update(); - uint32 processTime = CTimer::GetCurrentTimeInCycles() / CTimer::GetCyclesPerMillisecond() - startTime; + //uint32 processTime = CTimer::GetCurrentTimeInCycles() / CTimer::GetCyclesPerMillisecond() - startTime; CWindModifiers::Number = 0; if (!CTimer::GetIsPaused()) { @@ -899,20 +903,20 @@ void CGame::Process(void) CEventList::Update(); CParticle::Update(); gFireManager.Update(); - if (processTime >= 2) { - CPopulation::Update(false); - } else { - uint32 startTime = CTimer::GetCurrentTimeInCycles() / CTimer::GetCyclesPerMillisecond(); + //if (processTime >= 2) { + // CPopulation::Update(false); + //} else { + // uint32 startTime = CTimer::GetCurrentTimeInCycles() / CTimer::GetCyclesPerMillisecond(); CPopulation::Update(true); - processTime = CTimer::GetCurrentTimeInCycles() / CTimer::GetCyclesPerMillisecond() - startTime; - } + // processTime = CTimer::GetCurrentTimeInCycles() / CTimer::GetCyclesPerMillisecond() - startTime; + //} CWeapon::UpdateWeapons(); if (!CCutsceneMgr::IsRunning()) CTheCarGenerators::Process(); if (!CReplay::IsPlayingBack()) CCranes::UpdateCranes(); CClouds::Update(); - CMovingThings::Update(); + //CMovingThings::Update(); // TODO CWaterCannons::Update(); CUserDisplay::Process(); CReplay::Update(); @@ -943,7 +947,7 @@ void CGame::Process(void) if (!CReplay::IsPlayingBack()) { PUSH_MEMID(MEMID_CARS); - if (processTime < 2) + //if (processTime < 2) CCarCtrl::GenerateRandomCars(); CRoadBlocks::GenerateRoadBlocks(); CCarCtrl::RemoveDistantCars(); diff --git a/src/core/Game.h b/src/core/Game.h index 4052eb00..dd14278a 100644 --- a/src/core/Game.h +++ b/src/core/Game.h @@ -3,8 +3,10 @@ enum eLevelName { LEVEL_IGNORE = -1, // beware, this is only used in CPhysical's m_nZoneLevel LEVEL_GENERIC = 0, - LEVEL_BEACH, - LEVEL_MAINLAND, + LEVEL_INDUSTRIAL, + LEVEL_COMMERCIAL, + LEVEL_SUBURBAN, + LEVEL_UNDERGROUND, NUM_LEVELS }; @@ -78,4 +80,4 @@ public: static void ProcessTidyUpMemory(void); }; -inline bool IsAreaVisible(int area) { return area == CGame::currArea || area == AREA_EVERYWHERE; } +inline bool IsAreaVisible(int area) { return true; } diff --git a/src/core/IniFile.cpp b/src/core/IniFile.cpp index b9033530..3dd98865 100644 --- a/src/core/IniFile.cpp +++ b/src/core/IniFile.cpp @@ -8,7 +8,7 @@ #include "Population.h" float CIniFile::PedNumberMultiplier = 0.6f; -float CIniFile::CarNumberMultiplier = 0.6f; +float CIniFile::CarNumberMultiplier = 0.8f; void CIniFile::LoadIniFile() { @@ -25,5 +25,5 @@ void CIniFile::LoadIniFile() } CPopulation::MaxNumberOfPedsInUse = 25.0f * PedNumberMultiplier; CPopulation::MaxNumberOfPedsInUseInterior = 40.0f * PedNumberMultiplier; - CCarCtrl::MaxNumberOfCarsInUse = 12.0f * CarNumberMultiplier; + CCarCtrl::MaxNumberOfCarsInUse = 30.0f * CarNumberMultiplier; }
\ No newline at end of file diff --git a/src/core/KeyGen.cpp b/src/core/KeyGen.cpp new file mode 100644 index 00000000..c95ab4b1 --- /dev/null +++ b/src/core/KeyGen.cpp @@ -0,0 +1,106 @@ +#include "common.h" +#include "KeyGen.h" +#include <ctype.h> + +uint32 CKeyGen::keyTable[256] = +{ + 0, 0x77073096, 0xEE0E612C, 0x990951BA, + 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, + 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, + 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, + 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, + 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, + 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, + 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, + 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, + 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, + 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, + 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, + 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, + 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, + 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, + 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, + 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, + 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, + 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, + 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, + 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, + 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, + 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, + 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, + 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, + 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, + 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, + 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, + 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, + 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, + 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, + 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, + 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, + 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, + 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, + 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, + 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, + 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, + 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, + 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, + 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, + 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, + 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, + 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, + 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, + 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, + 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, + 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, + 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, + 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, + 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, + 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, + 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, + 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, + 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, + 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, + 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, + 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D +}; + +uint32 +CKeyGen::GetKey(const char *str, int size) +{ + uint32 key = 0xffffffff; + for (int i = 0; i < size; i++) + key = keyTable[(key ^ str[i]) & 0xFF] ^ (key >> 8); + return key; +} + +uint32 +CKeyGen::GetKey(const char *str) +{ + uint32 key = 0xffffffff; + while(*str != '\0') + key = keyTable[(key ^ *(str++)) & 0xFF] ^ (key >> 8); + return key; +} + +uint32 +CKeyGen::GetUppercaseKey(const char *str) +{ + uint32 key = 0xffffffff; + while (*str != '\0') + key = keyTable[(key ^ toupper(*(str++))) & 0xFF] ^ (key >> 8); + return key; +} + +uint32 +CKeyGen::AppendStringToKey(uint32 key, const char *str) +{ + while (*str != '\0') + key = keyTable[(key ^ *(str++)) & 0xFF] ^ (key >> 8); + return key; +}
\ No newline at end of file diff --git a/src/core/KeyGen.h b/src/core/KeyGen.h new file mode 100644 index 00000000..129859ce --- /dev/null +++ b/src/core/KeyGen.h @@ -0,0 +1,11 @@ +#pragma once + +class CKeyGen +{ + static uint32 keyTable[256]; +public: + static uint32 GetKey(const char *str, int size); + static uint32 GetKey(const char *str); + static uint32 GetUppercaseKey(const char *str); + static uint32 AppendStringToKey(uint32 key, const char *str); +};
\ No newline at end of file diff --git a/src/core/Leeds.cpp b/src/core/Leeds.cpp new file mode 100644 index 00000000..cda50605 --- /dev/null +++ b/src/core/Leeds.cpp @@ -0,0 +1,14 @@ +#include "common.h" +#include "Leeds.h" + +void LoadResource(RpAtomic *atomic) {} +void LoadResource(RpClump *clump) {} + + +void SaveResource(RwTexture *tex, base::cRelocatableChunkWriter &writer) {} +void SaveResource(RwTexDictionary *txd, base::cRelocatableChunkWriter &writer) {} +void SaveResource(RpMaterial *mat, base::cRelocatableChunkWriter &writer) {} +void SaveResource(RpMaterialList *matlist, base::cRelocatableChunkWriter &writer) {} +void SaveResource(RpGeometry *geo, base::cRelocatableChunkWriter &writer) {} +void SaveResource(RpAtomic *atomic, base::cRelocatableChunkWriter &writer) {} +void SaveResource(RpClump *clump, base::cRelocatableChunkWriter &writer) {} diff --git a/src/core/Leeds.h b/src/core/Leeds.h new file mode 100644 index 00000000..bf71d7e0 --- /dev/null +++ b/src/core/Leeds.h @@ -0,0 +1,36 @@ +#pragma once + +/* +PatchElementModelInfo(RslElement *,void *) +ChunkName(char const*) +DestroyAndFreeResourceImage(void) +WriteOrder(char const*) +UnpatchTextures(void) +IsChunked(int) +SaveResourceImage(void) +LoadResourceImage(void) +SaveResource(RslNode *,base::cRelocatableChunkWriter &) +SaveResource(RslTAnimTree *,base::cRelocatableChunkWriter &) +SaveResource(RslSkin *,base::cRelocatableChunkWriter &) +SaveResource(CAnimBlendTree *,base::cRelocatableChunkWriter &) +PatchElementTextures(RslElement *) +PatchElementGroupTextures(RslElementGroup *) +*/ + +void LoadResource(RpAtomic *atomic); +void LoadResource(RpClump *clump); + +/* +cRelocatableChunkWriterGTA::Save(char const*,uint,uint,bool) +cRelocatableChunkGTA::cRelocatableChunkGTA(char const*,uint,uint,bool) +SaveAnimBlock(int) +SaveModel(int,bool) +*/ + +void SaveResource(RwTexture *tex, base::cRelocatableChunkWriter &writer); +void SaveResource(RwTexDictionary *txd, base::cRelocatableChunkWriter &writer); +void SaveResource(RpMaterial *mat, base::cRelocatableChunkWriter &writer); +void SaveResource(RpMaterialList *matlist, base::cRelocatableChunkWriter &writer); +void SaveResource(RpGeometry *geo, base::cRelocatableChunkWriter &writer); +void SaveResource(RpAtomic *atomic, base::cRelocatableChunkWriter &writer); +void SaveResource(RpClump *clump, base::cRelocatableChunkWriter &writer); diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index e75510e5..86c218fa 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -88,6 +88,7 @@ extern bool gbFastTime; extern bool gGravityCheat; #endif +/* LCS: removed void SpecialCarCheats() { if ( !CVehicle::bCheat9 ) @@ -136,6 +137,7 @@ void SpecialCarCheats() CPad::bHasPlayerCheated = true; } } +*/ void PickUpChicksCheat() { @@ -361,7 +363,7 @@ void ChangePlayerCheat() do { do { - modelId = CGeneral::GetRandomNumberInRange(0, MI_PGA); + modelId = CGeneral::GetRandomNumberInRange(0, MI_GANG18); anotherModelId = modelId+1; } while (!CModelInfo::GetModelInfo(anotherModelId)); } while (anotherModelId >= MI_SPECIAL01 && anotherModelId <= MI_SPECIAL04 || modelId == MI_TAXI_D); @@ -580,16 +582,18 @@ void SuicideCheat(void) { } void DoChicksWithGunsCheat(void) { +/* // broken in LCS CHud::SetHelpMessage(TheText.Get("CHEAT1"), true); CStreaming::SetModelIsDeletable(CGangs::GetGangPedModel1(GANG_PLAYER)); CStreaming::SetModelIsDeletable(CGangs::GetGangPedModel2(GANG_PLAYER)); CStreaming::SetModelTxdIsDeletable(CGangs::GetGangPedModel1(GANG_PLAYER)); CStreaming::SetModelTxdIsDeletable(CGangs::GetGangPedModel2(GANG_PLAYER)); CStreaming::RemoveCurrentZonesModels(); - CGangs::SetGangPedModels(GANG_PLAYER, MI_HFYBE, MI_WFYBE); + CGangs::SetGangPedModels(GANG_PLAYER, MI_CAS_WOM, MI_HOS_WOM); CGangs::SetGangWeapons(GANG_PLAYER, WEAPONTYPE_M4, WEAPONTYPE_M4); CStats::CheatedCount += 1000; CPad::bHasPlayerCheated = true; +*/ } ////////////////////////////////////////////////////////////////////////// @@ -1411,6 +1415,8 @@ void CPad::AddToPCCheatString(char c) KeyBoardCheatString[0] = ' '; BlackCarsCheat(); } +/* + // LCS: removed for now // "TRAVELINSTYLE" else if (!Cheat_strncmp(KeyBoardCheatString, "HQ`U`iLSFaNZ[")) { KeyBoardCheatString[0] = ' '; @@ -1506,6 +1512,7 @@ void CPad::AddToPCCheatString(char c) KeyBoardCheatString[0] = ' '; ChangePlayerModel("igdiaz"); } +*/ // DEEPFRIEDMARSBARS else if (!Cheat_strncmp(KeyBoardCheatString, "VWHC`mDTEPVZMpRK")) { KeyBoardCheatString[0] = ' '; @@ -1521,11 +1528,13 @@ void CPad::AddToPCCheatString(char c) KeyBoardCheatString[0] = ' '; BackToTheFuture(); } +/* LCS: removed // LOADSOFLITTLETHINGS else if (!Cheat_strncmp(KeyBoardCheatString, "VLUJUoHSU_VTMo`J]bV")) { KeyBoardCheatString[0] = ' '; SpecialCarCheats(); } +*/ // HOPINGIRL else if (!Cheat_strncmp(KeyBoardCheatString, "OWPH[dSVI")) { KeyBoardCheatString[0] = ' '; diff --git a/src/core/Pad.h b/src/core/Pad.h index f141ed6c..748482e7 100644 --- a/src/core/Pad.h +++ b/src/core/Pad.h @@ -164,6 +164,8 @@ public: int32 LastTimeTouched; int32 AverageWeapon; int32 AverageEntries; + float unk_B4; + float unk_B8; #ifdef DETECT_PAD_INPUT_SWITCH static bool IsAffectedByController; @@ -275,6 +277,16 @@ public: uint32 InputHowLongAgo(void); void SetDrunkInputDelay(int32 delay) { DrunkDrivingBufferUsed = delay; } + // TODO(LCS): properly, this is just to get some estimation for script + int16 GetOddJobTrigger() { return GetRightShockJustDown(); } + int16 GuiLeft() { return GetAnaloguePadLeft() || GetDPadLeftJustDown(); } + int16 GuiRight() { return GetAnaloguePadRight() || GetDPadRightJustDown(); } + int16 GuiUp() { return GetAnaloguePadUp() || GetDPadUpJustDown(); } + int16 GuiDown() { return GetAnaloguePadDown() || GetDPadDownJustDown(); } + int16 GuiSelect() { return GetCrossJustDown(); } + int16 GuiBack() { return GetTriangleJustDown(); } + int16 GetSkipCutscene() { return GetCrossJustDown(); } + #ifdef XINPUT static int XInputJoy1; static int XInputJoy2; diff --git a/src/core/PlayerInfo.cpp b/src/core/PlayerInfo.cpp index a64d4cca..337d631c 100644 --- a/src/core/PlayerInfo.cpp +++ b/src/core/PlayerInfo.cpp @@ -418,8 +418,10 @@ CPlayerInfo::Process(void) CTimer::Update(); } m_bInRemoteMode = false; - CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle->bRemoveFromWorld = true; - CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle = nil; + if (CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle) { + CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle->bRemoveFromWorld = true; + CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle = nil; + } if (FindPlayerVehicle()) { FindPlayerVehicle()->SetStatus(STATUS_PLAYER); } diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp index f58f4687..5c92206f 100644 --- a/src/core/Radar.cpp +++ b/src/core/Radar.cpp @@ -56,7 +56,7 @@ CSprite2d CRadar::SpraySprite; CSprite2d CRadar::TShirtSprite; CSprite2d CRadar::TommySprite; CSprite2d CRadar::PhoneSprite; -CSprite2d CRadar::RadioWildstyleSprite; +/*CSprite2d CRadar::RadioWildstyleSprite; CSprite2d CRadar::RadioFlashSprite; CSprite2d CRadar::RadioKChatSprite; CSprite2d CRadar::RadioFeverSprite; @@ -64,7 +64,39 @@ CSprite2d CRadar::RadioVRockSprite; CSprite2d CRadar::RadioVCPRSprite; CSprite2d CRadar::RadioEspantosoSprite; CSprite2d CRadar::RadioEmotionSprite; -CSprite2d CRadar::RadioWaveSprite; +CSprite2d CRadar::RadioWaveSprite;*/ +CSprite2d CRadar::EightBallSprite; +CSprite2d CRadar::BurnerSprite; +CSprite2d CRadar::CiprianiSprite; +CSprite2d CRadar::DonaldSprite; +CSprite2d CRadar::JosephSprite; +CSprite2d CRadar::LeoneSprite; +CSprite2d CRadar::MariaSprite; +CSprite2d CRadar::McraySprite; +CSprite2d CRadar::ToshikoSprite; +CSprite2d CRadar::VincenzoSprite; +CSprite2d CRadar::BombSprite; +CSprite2d CRadar::ClothesShopSprite; +CSprite2d CRadar::PropertyRedSprite; +CSprite2d CRadar::PhilCassidySprite; +CSprite2d CRadar::PowerupSprite; +CSprite2d CRadar::MPBase; +CSprite2d CRadar::MPCheckPoint; +CSprite2d CRadar::MPPlayer; +CSprite2d CRadar::MPObjective; +CSprite2d CRadar::MPCar; +CSprite2d CRadar::MPTank; +CSprite2d CRadar::MPCarLockup; +CSprite2d CRadar::MPTargetPlayer; +CSprite2d CRadar::MapHereSprite0; +CSprite2d CRadar::MapHereSprite1; +CSprite2d CRadar::MapHereSprite2; +CSprite2d CRadar::MapHereSprite3; +CSprite2d CRadar::MapHereSprite4; +CSprite2d CRadar::MapHereSprite5; +CSprite2d CRadar::MapHereSprite6; +CSprite2d CRadar::MapHereSprite7; +CSprite2d CRadar::MapWayPoint; CSprite2d *CRadar::RadarSprites[RADAR_SPRITE_COUNT] = { nil, @@ -98,15 +130,38 @@ CSprite2d *CRadar::RadarSprites[RADAR_SPRITE_COUNT] = { &TShirtSprite, &TommySprite, &PhoneSprite, - &RadioWildstyleSprite, - &RadioFlashSprite, - &RadioKChatSprite, - &RadioFeverSprite, - &RadioVRockSprite, - &RadioVCPRSprite, - &RadioEspantosoSprite, - &RadioEmotionSprite, - &RadioWaveSprite + &EightBallSprite, + &BurnerSprite, + &CiprianiSprite, + &DonaldSprite, + &JosephSprite, + &LeoneSprite, + &MariaSprite, + &McraySprite, + &ToshikoSprite, + &VincenzoSprite, + &BombSprite, + &ClothesShopSprite, + &PropertyRedSprite, + &PhilCassidySprite, + &PowerupSprite, + &MPBase, + &MPCheckPoint, + &MPPlayer, + &MPObjective, + &MPCar, + &MPTank, + &MPCarLockup, + &MPTargetPlayer, + &MapHereSprite0, + &MapHereSprite1, + &MapHereSprite2, + &MapHereSprite3, + &MapHereSprite4, + &MapHereSprite5, + &MapHereSprite6, + &MapHereSprite7, + &MapWayPoint, }; // Why this doesn't coincide with world coordinates i don't know @@ -1067,7 +1122,7 @@ CRadar::LoadTextures() TShirtSprite.SetTexture("tshirt"); TommySprite.SetTexture("tommy"); PhoneSprite.SetTexture("phone"); - RadioWildstyleSprite.SetTexture("RWildstyle"); + /*RadioWildstyleSprite.SetTexture("RWildstyle"); RadioFlashSprite.SetTexture("RFlash"); RadioKChatSprite.SetTexture("RKchat"); RadioFeverSprite.SetTexture("RFever"); @@ -1075,7 +1130,39 @@ CRadar::LoadTextures() RadioVCPRSprite.SetTexture("RVCPR"); RadioEspantosoSprite.SetTexture("REspantoso"); RadioEmotionSprite.SetTexture("REmotion"); - RadioWaveSprite.SetTexture("RWave"); + RadioWaveSprite.SetTexture("RWave");*/ + EightBallSprite.SetTexture("radar_8Ball"); + BurnerSprite.SetTexture("radar_Burner"); + CiprianiSprite.SetTexture("radar_Cipriani"); + DonaldSprite.SetTexture("radar_Donald"); + JosephSprite.SetTexture("radar_Joseph"); + LeoneSprite.SetTexture("radar_Leone"); + MariaSprite.SetTexture("radar_Maria"); + McraySprite.SetTexture("radar_McRay"); + ToshikoSprite.SetTexture("radar_Toshiko"); + VincenzoSprite.SetTexture("radar_Vincenzo"); + BombSprite.SetTexture("radar_Bomb"); + ClothesShopSprite.SetTexture("radar_cShop"); + PropertyRedSprite.SetTexture("radar_propertyR"); + PhilCassidySprite.SetTexture("radar_flag"); + PowerupSprite.SetTexture("radar_powerup"); + MPBase.SetTexture("mp_base"); + MPCheckPoint.SetTexture("radar_mp_checkpoint"); + MPPlayer.SetTexture("mp_player"); + MPObjective.SetTexture("mp_objective"); + MPCar.SetTexture("mp_car"); + MPTank.SetTexture("mp_tank"); + MPCarLockup.SetTexture("mp_carlockup"); + MPTargetPlayer.SetTexture("mp_targetplayer"); + MapHereSprite0.SetTexture("radar_arrow"); + MapHereSprite1.SetTexture("radar_arrow_01"); + MapHereSprite2.SetTexture("radar_arrow_02"); + MapHereSprite3.SetTexture("radar_arrow_03"); + MapHereSprite4.SetTexture("radar_arrow_04"); + MapHereSprite5.SetTexture("radar_arrow_05"); + MapHereSprite6.SetTexture("radar_arrow_06"); + MapHereSprite7.SetTexture("radar_arrow_07"); + MapWayPoint.SetTexture("radar_player_target"); CTxdStore::PopCurrentTxd(); } @@ -1175,6 +1262,7 @@ void CRadar::SetRadarMarkerState(int32 counter, bool flag) } void CRadar::ShowRadarMarker(CVector pos, uint32 color, float radius) { + /* float f1 = radius * 1.4f; float f2 = radius * 0.5f; CVector p1, p2; @@ -1194,6 +1282,7 @@ void CRadar::ShowRadarMarker(CVector pos, uint32 color, float radius) { p1 = pos - TheCamera.GetRight()*f1; p2 = pos - TheCamera.GetRight()*f2; CTheScripts::ScriptDebugLine3D(p1.x, p1.y, p1.z, p2.x, p2.y, p2.z, color, color); + */ } void CRadar::ShowRadarTrace(float x, float y, uint32 size, uint8 red, uint8 green, uint8 blue, uint8 alpha) @@ -1261,7 +1350,39 @@ void CRadar::Shutdown() TShirtSprite.Delete(); TommySprite.Delete(); PhoneSprite.Delete(); - RadioWildstyleSprite.Delete(); + EightBallSprite.Delete(); + BurnerSprite.Delete(); + CiprianiSprite.Delete(); + DonaldSprite.Delete(); + JosephSprite.Delete(); + LeoneSprite.Delete(); + MariaSprite.Delete(); + McraySprite.Delete(); + ToshikoSprite.Delete(); + VincenzoSprite.Delete(); + BombSprite.Delete(); + ClothesShopSprite.Delete(); + PropertyRedSprite.Delete(); + PhilCassidySprite.Delete(); + PowerupSprite.Delete(); + MPBase.Delete(); + MPCheckPoint.Delete(); + MPPlayer.Delete(); + MPObjective.Delete(); + MPCar.Delete(); + MPTank.Delete(); + MPCarLockup.Delete(); + MPTargetPlayer.Delete(); + MapHereSprite0.Delete(); + MapHereSprite1.Delete(); + MapHereSprite2.Delete(); + MapHereSprite3.Delete(); + MapHereSprite4.Delete(); + MapHereSprite5.Delete(); + MapHereSprite6.Delete(); + MapHereSprite7.Delete(); + MapWayPoint.Delete(); + /*RadioWildstyleSprite.Delete(); RadioFlashSprite.Delete(); RadioKChatSprite.Delete(); RadioFeverSprite.Delete(); @@ -1269,7 +1390,7 @@ void CRadar::Shutdown() RadioVCPRSprite.Delete(); RadioEspantosoSprite.Delete(); RadioEmotionSprite.Delete(); - RadioWaveSprite.Delete(); + RadioWaveSprite.Delete();*/ RemoveRadarSections(); } @@ -1712,7 +1833,7 @@ CRadar::DrawLegend(int32 x, int32 y, int32 sprite) case RADAR_SPRITE_PHONE: text = TheText.Get("LG_25"); break; - case RADAR_SPRITE_RADIO_WILDSTYLE: + /*case RADAR_SPRITE_RADIO_WILDSTYLE: text = TheText.Get("LG_26"); break; case RADAR_SPRITE_RADIO_FLASH: @@ -1738,8 +1859,9 @@ CRadar::DrawLegend(int32 x, int32 y, int32 sprite) break; case RADAR_SPRITE_RADIO_WAVE: text = TheText.Get("LG_34"); - break; + break;*/ default: + text = TheText.Get("LG_34"); // tmp hack break; } CFont::PrintString(SCREEN_SCALE_X(20.f) + x, SCREEN_SCALE_Y(3.0f) + y, text); diff --git a/src/core/Radar.h b/src/core/Radar.h index 0829dda6..3e61f8db 100644 --- a/src/core/Radar.h +++ b/src/core/Radar.h @@ -16,9 +16,9 @@ #define OBJECTBLIP_MARKER_COLOR_B 242 #define OBJECTBLIP_MARKER_COLOR_A 255 -#define COORDBLIP_MARKER_COLOR_R 252 -#define COORDBLIP_MARKER_COLOR_G 138 -#define COORDBLIP_MARKER_COLOR_B 242 +#define COORDBLIP_MARKER_COLOR_R 255 +#define COORDBLIP_MARKER_COLOR_G 255 +#define COORDBLIP_MARKER_COLOR_B 128 #define COORDBLIP_MARKER_COLOR_A 228 #define NUM_MAP_LEGENDS 75 @@ -83,15 +83,38 @@ enum eRadarSprite RADAR_SPRITE_TSHIRT, RADAR_SPRITE_TOMMY, RADAR_SPRITE_PHONE, - RADAR_SPRITE_RADIO_WILDSTYLE, - RADAR_SPRITE_RADIO_FLASH, - RADAR_SPRITE_RADIO_KCHAT, - RADAR_SPRITE_RADIO_FEVER, - RADAR_SPRITE_RADIO_VROCK, - RADAR_SPRITE_RADIO_VCPR, - RADAR_SPRITE_RADIO_ESPANTOSO, - RADAR_SPRITE_RADIO_EMOTION, - RADAR_SPRITE_RADIO_WAVE, + RADAR_SPRITE_EIGHTBALL, + RADAR_SPRITE_BURNER, + RADAR_SPRITE_CIPRIANI, + RADAR_SPRITE_DONALD, + RADAR_SPRITE_JOSEPH, + RADAR_SPRITE_LEONE, + RADAR_SPRITE_MARIA, + RADAR_SPRITE_MCRAY, + RADAR_SPRITE_TOSHIKO, + RADAR_SPRITE_VINCENZO, // tmp + RADAR_SPRITE_BOMB, + RADAR_SPRITE_CLOTHES, + RADAR_SPRITE_PROPERTY_RED, + RADAR_SPRITE_PHIL_CASSIDY, + RADAR_SPRITE_POWERUP, + RADAR_SPRITE_MPBASE, + RADAR_SPRITE_MPCHECKPOINT, + RADAR_SPRITE_MPPLAYER, + RADAR_SPRITE_MPOBJECTIVE, + RADAR_SPRITE_MPCAR, + RADAR_SPRITE_MPTANK, + RADAR_SPRITE_MPCARLOCKUP, + RADAR_SPRITE_MPTARGETPLAYER, + RADAR_SPRITE_MAPHERE0, + RADAR_SPRITE_MAPHERE1, + RADAR_SPRITE_MAPHERE2, + RADAR_SPRITE_MAPHERE3, + RADAR_SPRITE_MAPHERE4, + RADAR_SPRITE_MAPHERE5, + RADAR_SPRITE_MAPHERE6, + RADAR_SPRITE_MAPHERE7, + RADAR_SPRITE_MAPWAYPOINT, RADAR_SPRITE_COUNT }; @@ -214,7 +237,7 @@ public: static CSprite2d TShirtSprite; static CSprite2d TommySprite; static CSprite2d PhoneSprite; - static CSprite2d RadioWildstyleSprite; +/* static CSprite2d RadioWildstyleSprite; static CSprite2d RadioFlashSprite; static CSprite2d RadioKChatSprite; static CSprite2d RadioFeverSprite; @@ -222,7 +245,39 @@ public: static CSprite2d RadioVCPRSprite; static CSprite2d RadioEspantosoSprite; static CSprite2d RadioEmotionSprite; - static CSprite2d RadioWaveSprite; + static CSprite2d RadioWaveSprite;*/ + static CSprite2d EightBallSprite; + static CSprite2d BurnerSprite; + static CSprite2d CiprianiSprite; + static CSprite2d DonaldSprite; + static CSprite2d JosephSprite; + static CSprite2d LeoneSprite; + static CSprite2d MariaSprite; + static CSprite2d McraySprite; + static CSprite2d ToshikoSprite; + static CSprite2d VincenzoSprite; + static CSprite2d BombSprite; + static CSprite2d ClothesShopSprite; + static CSprite2d PropertyRedSprite; + static CSprite2d PhilCassidySprite; + static CSprite2d PowerupSprite; + static CSprite2d MPBase; + static CSprite2d MPCheckPoint; + static CSprite2d MPPlayer; + static CSprite2d MPObjective; + static CSprite2d MPCar; + static CSprite2d MPTank; + static CSprite2d MPCarLockup; + static CSprite2d MPTargetPlayer; + static CSprite2d MapHereSprite0; + static CSprite2d MapHereSprite1; + static CSprite2d MapHereSprite2; + static CSprite2d MapHereSprite3; + static CSprite2d MapHereSprite4; + static CSprite2d MapHereSprite5; + static CSprite2d MapHereSprite6; + static CSprite2d MapHereSprite7; + static CSprite2d MapWayPoint; static CSprite2d *RadarSprites[RADAR_SPRITE_COUNT]; static float cachedCos; static float cachedSin; diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp index 6d980e18..03b78392 100644 --- a/src/core/Streaming.cpp +++ b/src/core/Streaming.cpp @@ -37,6 +37,7 @@ #include "Font.h" #include "Frontend.h" #include "VarConsole.h" +#include "KeyGen.h" bool CStreaming::ms_disableStreaming; bool CStreaming::ms_bLoadingBigModel; @@ -76,10 +77,16 @@ size_t CStreaming::ms_memoryAvailable; int32 desiredNumVehiclesLoaded = 12; -CEntity *pIslandLODmainlandEntity; -CEntity *pIslandLODbeachEntity; -int32 islandLODmainland; -int32 islandLODbeach; +CEntity *pIslandLODindustEntity; +CEntity *pIslandLODcomIndEntity; +CEntity *pIslandLODcomSubEntity; +CEntity *pIslandLODsubIndEntity; +CEntity *pIslandLODsubComEntity; +int32 islandLODindust; +int32 islandLODcomInd; +int32 islandLODcomSub; +int32 islandLODsubInd; +int32 islandLODsubCom; #ifndef MASTER bool gbPrintStats; @@ -242,12 +249,21 @@ CStreaming::Init2(void) // find island LODs - pIslandLODmainlandEntity = nil; - pIslandLODbeachEntity = nil; - islandLODmainland = -1; - islandLODbeach = -1; - CModelInfo::GetModelInfo("IslandLODmainland", &islandLODmainland); - CModelInfo::GetModelInfo("IslandLODbeach", &islandLODbeach); + pIslandLODindustEntity = nil; + pIslandLODcomIndEntity = nil; + pIslandLODcomSubEntity = nil; + pIslandLODsubIndEntity = nil; + pIslandLODsubComEntity = nil; + islandLODindust = -1; + islandLODcomInd = -1; + islandLODcomSub = -1; + islandLODsubInd = -1; + islandLODsubCom = -1; + CModelInfo::GetModelInfo("IslandLODInd", &islandLODindust); + CModelInfo::GetModelInfo("IslandLODcomIND", &islandLODcomInd); + CModelInfo::GetModelInfo("IslandLODcomSUB", &islandLODcomSub); + CModelInfo::GetModelInfo("IslandLODsubIND", &islandLODsubInd); + CModelInfo::GetModelInfo("IslandLODsubCOM", &islandLODsubCom); #ifndef MASTER VarConsole.Add("Streaming Debug", &gbPrintStats, true); @@ -919,65 +935,61 @@ CStreaming::RequestIslands(eLevelName level) { ISLAND_LOADING_ISNT(HIGH) switch(level){ - case LEVEL_MAINLAND: - if(islandLODbeach != -1) - RequestModel(islandLODbeach, BIGBUILDINGFLAGS); + case LEVEL_INDUSTRIAL: + RequestModel(islandLODcomInd, BIGBUILDINGFLAGS); + RequestModel(islandLODsubInd, BIGBUILDINGFLAGS); break; - case LEVEL_BEACH: - if(islandLODmainland != -1) - RequestModel(islandLODmainland, BIGBUILDINGFLAGS); + case LEVEL_COMMERCIAL: + RequestModel(islandLODindust, BIGBUILDINGFLAGS); + RequestModel(islandLODsubCom, BIGBUILDINGFLAGS); + break; + case LEVEL_SUBURBAN: + RequestModel(islandLODindust, BIGBUILDINGFLAGS); + RequestModel(islandLODcomSub, BIGBUILDINGFLAGS); break; default: break; } } -static char *IGnames[] = { - "player", - "player2", - "player3", - "player4", - "player5", - "player6", - "player7", - "player8", - "player9", - "play10", - "play11", - "igken", - "igcandy", - "igsonny", - "igbuddy", - "igjezz", - "ighlary", - "igphil", - "igmerc", - "igdick", - "igdiaz", +const char *csPlayerNames[] = +{ + "csplr", + "csplr2", + "csplr3", + "csplr4", + "csplr5", + "csplr6", + "csplr7", + "csplr8", + "csplr9", + "csplr10", + "csplr11", + "csplr12", + "csplr13", + "csplr14", + "csplr15", + "csplr16", "" }; -static char *CSnames[] = { - "csplay", - "csplay2", - "csplay3", - "csplay4", - "csplay5", - "csplay6", - "csplay7", - "csplay8", - "csplay9", - "csplay10", - "csplay11", - "csken", - "cscandy", - "cssonny", - "csbuddy", - "csjezz", - "cshlary", - "csphil", - "csmerc", - "csdick", - "csdiaz", +const char* playerNames[] = +{ + "plr", + "plr2", + "plr3", + "plr4", + "plr5", + "plr6", + "plr7", + "plr8", + "plr9", + "plr10", + "plr11", + "plr12", + "plr13", + "plr14", + "plr15", + "plr16", "" }; @@ -991,15 +1003,17 @@ CStreaming::RequestSpecialModel(int32 modelId, const char *modelName, int32 flag int i, n; mi = CModelInfo::GetModelInfo(modelId); - if(strncasecmp("CSPlay", modelName, 6) == 0){ - char *curname = CModelInfo::GetModelInfo(MI_PLAYER)->GetModelName(); - for(int i = 0; CSnames[i][0]; i++){ - if(strcasecmp(curname, IGnames[i]) == 0){ - modelName = CSnames[i]; + if (CKeyGen::GetUppercaseKey(modelName) == CKeyGen::GetUppercaseKey("cstoni_a")) { + i = 0; + while (csPlayerNames[i][0] != '\0') { + if (CModelInfo::GetModelInfo(0)->GetNameHashKey() == CKeyGen::GetUppercaseKey(playerNames[i])) { + modelName = csPlayerNames[i]; break; } + i++; } } + if(!CGeneral::faststrcmp(mi->GetModelName(), modelName)){ // Already have the correct name, just request it RequestModel(modelId, flags); @@ -1134,10 +1148,9 @@ CStreaming::RemoveModel(int32 id) void CStreaming::RemoveUnusedBuildings(eLevelName level) { - if(level != LEVEL_BEACH) - RemoveBuildings(LEVEL_BEACH); - if(level != LEVEL_MAINLAND) - RemoveBuildings(LEVEL_MAINLAND); + for(int i = LEVEL_INDUSTRIAL; i < NUM_LEVELS; i++) + if(level != i) + RemoveBuildings((eLevelName)i); } void @@ -1260,10 +1273,9 @@ CStreaming::RemoveUnusedBigBuildings(eLevelName level) { ISLAND_LOADING_IS(LOW) { - if(level != LEVEL_BEACH) - RemoveBigBuildings(LEVEL_BEACH); - if(level != LEVEL_MAINLAND) - RemoveBigBuildings(LEVEL_MAINLAND); + for(int i = LEVEL_INDUSTRIAL; i < NUM_LEVELS; i++) + if(level != i) + RemoveBuildings((eLevelName)i); } RemoveIslandsNotUsed(level); } @@ -1285,29 +1297,53 @@ void CStreaming::RemoveIslandsNotUsed(eLevelName level) { int i; - if(pIslandLODmainlandEntity == nil) + if(pIslandLODindustEntity == nil) for(i = CPools::GetBuildingPool()->GetSize()-1; i >= 0; i--){ CBuilding *building = CPools::GetBuildingPool()->GetSlot(i); if(building == nil) continue; - if(building->GetModelIndex() == islandLODmainland) - pIslandLODmainlandEntity = building; - if(building->GetModelIndex() == islandLODbeach) - pIslandLODbeachEntity = building; + if(building->GetModelIndex() == islandLODindust) + pIslandLODindustEntity = building; + else if(building->GetModelIndex() == islandLODcomInd) + pIslandLODcomIndEntity = building; + else if(building->GetModelIndex() == islandLODcomSub) + pIslandLODcomSubEntity = building; + else if(building->GetModelIndex() == islandLODsubInd) + pIslandLODsubIndEntity = building; + else if(building->GetModelIndex() == islandLODsubCom) + pIslandLODsubComEntity = building; } #ifdef NO_ISLAND_LOADING if(FrontEndMenuManager.m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_HIGH) { - DeleteIsland(pIslandLODmainlandEntity); - DeleteIsland(pIslandLODbeachEntity); + DeleteIsland(pIslandLODindustEntity); + DeleteIsland(pIslandLODcomIndEntity); + DeleteIsland(pIslandLODcomSubEntity); + DeleteIsland(pIslandLODsubIndEntity); + DeleteIsland(pIslandLODsubComEntity); } else #endif switch(level){ - case LEVEL_MAINLAND: - DeleteIsland(pIslandLODmainlandEntity); + case LEVEL_INDUSTRIAL: + DeleteIsland(pIslandLODindustEntity); + DeleteIsland(pIslandLODcomSubEntity); + DeleteIsland(pIslandLODsubComEntity); break; - case LEVEL_BEACH: - DeleteIsland(pIslandLODbeachEntity); - + case LEVEL_COMMERCIAL: + DeleteIsland(pIslandLODcomIndEntity); + DeleteIsland(pIslandLODcomSubEntity); + DeleteIsland(pIslandLODsubIndEntity); + break; + case LEVEL_SUBURBAN: + DeleteIsland(pIslandLODsubIndEntity); + DeleteIsland(pIslandLODsubComEntity); + DeleteIsland(pIslandLODcomIndEntity); + break; + default: + DeleteIsland(pIslandLODindustEntity); + DeleteIsland(pIslandLODcomIndEntity); + DeleteIsland(pIslandLODcomSubEntity); + DeleteIsland(pIslandLODsubIndEntity); + DeleteIsland(pIslandLODsubComEntity); break; } } @@ -1569,6 +1605,7 @@ CStreaming::IsObjectInCdImage(int32 id) void CStreaming::SetModelIsDeletable(int32 id) { + assert(id >= 0); // guard against fake IDs ms_aInfoForModel[id].m_flags &= ~STREAMFLAGS_DONT_REMOVE; if ((id >= STREAM_OFFSET_TXD && id < STREAM_OFFSET_COL || CModelInfo::GetModelInfo(id)->GetModelType() != MITYPE_VEHICLE) && (ms_aInfoForModel[id].m_flags & STREAMFLAGS_SCRIPTOWNED) == 0){ @@ -1647,11 +1684,11 @@ CStreaming::StreamVehiclesAndPeds(void) } if(FindPlayerPed()->m_pWanted->AreFbiRequired()){ - RequestModel(MI_FBIRANCH, STREAMFLAGS_DONT_REMOVE); + RequestModel(MI_FBICAR, STREAMFLAGS_DONT_REMOVE); RequestModel(MI_FBI, STREAMFLAGS_DONT_REMOVE); }else{ - SetModelIsDeletable(MI_FBIRANCH); - if(!HasModelLoaded(MI_FBIRANCH)) + SetModelIsDeletable(MI_FBICAR); + if(!HasModelLoaded(MI_FBICAR)) SetModelIsDeletable(MI_FBI); } @@ -1671,6 +1708,7 @@ CStreaming::StreamVehiclesAndPeds(void) else SetModelIsDeletable(MI_CHOPPER); +/* LCS: removed if (FindPlayerPed()->m_pWanted->AreMiamiViceRequired()) { SetModelIsDeletable(MI_VICE1); SetModelIsDeletable(MI_VICE2); @@ -1712,6 +1750,7 @@ CStreaming::StreamVehiclesAndPeds(void) SetModelIsDeletable(MI_VICE7); SetModelIsDeletable(MI_VICE8); } +*/ if(timeBeforeNextLoad >= 0) timeBeforeNextLoad--; @@ -3146,6 +3185,46 @@ CStreaming::LoadSceneCollision(const CVector &pos) CStreaming::LoadAllRequestedModels(false); } +//--LCS: TODO PSP and PS2 +// some things commented out that might be Rsl3D dependent +void CStreaming::RegisterPointer(void *ptr, int, bool) {} +RpAtomic *CStreaming::RegisterAtomic(RpAtomic *atomic, void *) +{ + return atomic; +} +void CStreaming::RegisterClump(RpClump *clump) +{ + RpClumpForAllAtomics(clump, RegisterAtomic, nil); +} +RpAtomic *CStreaming::RegisterInstance(RpAtomic *atomic, void *) +{ +// RegisterPointer(&atomic->geometry, 2, true); + return atomic; +} +void CStreaming::RegisterInstance(RpClump *clump) +{ + RpClumpForAllAtomics(clump, RegisterInstance, nil); +} + +void CStreaming::UnregisterPointer(void *ptr, int) {} +RpAtomic *CStreaming::UnregisterAtomic(RpAtomic *atomic, void *) +{ + return atomic; +} +void CStreaming::UnregisterClump(RpClump *clump) +{ + RpClumpForAllAtomics(clump, UnregisterAtomic, nil); +} +RpAtomic *CStreaming::UnregisterInstance(RpAtomic *atomic, void *) +{ +// UnregisterPointer(&atomic->geometry, 2); + return atomic; +} +void CStreaming::UnregisterInstance(RpClump *clump) +{ + RpClumpForAllAtomics(clump, UnregisterInstance, nil); +} + void CStreaming::MemoryCardSave(uint8 *buf, uint32 *size) { diff --git a/src/core/Streaming.h b/src/core/Streaming.h index 4ddf0b3b..1ca43671 100644 --- a/src/core/Streaming.h +++ b/src/core/Streaming.h @@ -17,7 +17,10 @@ enum StreamFlags STREAMFLAGS_PRIORITY = 0x08, STREAMFLAGS_NOFADE = 0x10, STREAMFLAGS_20 = 0x20, // TODO(MIAMI): what's this + STREAMFLAGS_40 = 0x40, // TODO(LCS): what's this + STREAMFLAGS_AMBIENT_SCRIPT_OWNED = 0x80, + // TODO(LCS): STREAMFLAGS_AMBIENT_SCRIPT_OWNED in STREAMFLAGS_CANT_REMOVE? check CColStore STREAMFLAGS_CANT_REMOVE = STREAMFLAGS_DONT_REMOVE|STREAMFLAGS_SCRIPTOWNED, STREAMFLAGS_KEEP_IN_MEMORY = STREAMFLAGS_DONT_REMOVE|STREAMFLAGS_SCRIPTOWNED|STREAMFLAGS_DEPENDENCY, }; @@ -127,6 +130,7 @@ public: static bool HasColLoaded(int32 id) { return HasModelLoaded(id+STREAM_OFFSET_COL); } static bool HasAnimLoaded(int32 id) { return HasModelLoaded(id+STREAM_OFFSET_ANIM); } static bool CanRemoveModel(int32 id) { return (ms_aInfoForModel[id].m_flags & STREAMFLAGS_CANT_REMOVE) == 0; } + static bool IsScriptOwnedModel(int32 id) { return (ms_aInfoForModel[id].m_flags & STREAMFLAGS_SCRIPTOWNED); } static bool CanRemoveTxd(int32 id) { return CanRemoveModel(id+STREAM_OFFSET_TXD); } static bool CanRemoveCol(int32 id) { return CanRemoveModel(id+STREAM_OFFSET_COL); } static bool CanRemoveAnim(int32 id) { return CanRemoveModel(id+STREAM_OFFSET_ANIM); } @@ -210,6 +214,17 @@ public: static void LoadScene(const CVector &pos); static void LoadSceneCollision(const CVector &pos); + static void RegisterPointer(void *ptr, int, bool); + static RpAtomic *RegisterAtomic(RpAtomic *atomic, void *); + static void RegisterClump(RpClump *clump); + static RpAtomic *RegisterInstance(RpAtomic *atomic, void *); + static void RegisterInstance(RpClump *clump); + static void UnregisterPointer(void *ptr, int); + static RpAtomic *UnregisterAtomic(RpAtomic *atomic, void *); + static void UnregisterClump(RpClump *clump); + static RpAtomic *UnregisterInstance(RpAtomic *atomic, void *); + static void UnregisterInstance(RpClump *clump); + static void MemoryCardSave(uint8 *buffer, uint32 *length); static void MemoryCardLoad(uint8 *buffer, uint32 length); @@ -217,3 +232,10 @@ public: static void PrintStreamingBufferState(); }; + +// LCS(TODO): put them into CStreaming::mspInst +extern int32 islandLODindust; +extern int32 islandLODcomInd; +extern int32 islandLODcomSub; +extern int32 islandLODsubInd; +extern int32 islandLODsubCom; diff --git a/src/core/World.cpp b/src/core/World.cpp index 82f03541..9e2c4345 100644 --- a/src/core/World.cpp +++ b/src/core/World.cpp @@ -1788,56 +1788,35 @@ void CWorld::RepositionOneObject(CEntity *pEntity) { int16 modelId = pEntity->GetModelIndex(); - if (modelId == MI_PARKINGMETER || modelId == MI_PHONEBOOTH1 || modelId == MI_WASTEBIN || - modelId == MI_BIN || modelId == MI_POSTBOX1 || modelId == MI_NEWSSTAND || modelId == MI_TRAFFICCONE || - modelId == MI_DUMP1 || modelId == MI_ROADWORKBARRIER1 || modelId == MI_BUSSIGN1 || modelId == MI_NOPARKINGSIGN1 || - modelId == MI_PHONESIGN || modelId == MI_FIRE_HYDRANT || modelId == MI_BOLLARDLIGHT || - modelId == MI_PARKTABLE || modelId == MI_PARKINGMETER2 || modelId == MI_TELPOLE02 || - modelId == MI_PARKBENCH || modelId == MI_BARRIER1 || IsTreeModel(modelId) - ) { + if (IsLightThatNeedsRepositioning(modelId) || IsTreeModel(modelId) || modelId == MI_PARKINGMETER || + modelId == MI_PHONEBOOTH1 || modelId == MI_WASTEBIN || modelId == MI_BIN || modelId == MI_POSTBOX1 || + modelId == MI_NEWSSTAND || modelId == MI_TRAFFICCONE || modelId == MI_DUMP1 || + modelId == MI_ROADWORKBARRIER1 || modelId == MI_BUSSIGN1 || modelId == MI_NOPARKINGSIGN1 || + modelId == MI_PHONESIGN || modelId == MI_TAXISIGN || modelId == MI_FISHSTALL01 || + modelId == MI_FISHSTALL02 || modelId == MI_FISHSTALL03 || modelId == MI_FISHSTALL04 || + modelId == MI_BAGELSTAND2 || modelId == MI_FIRE_HYDRANT || modelId == MI_BOLLARDLIGHT || + modelId == MI_PARKTABLE) { CVector& position = pEntity->GetMatrix().GetPosition(); - CColModel* pColModel = pEntity->GetColModel(); - float fBoundingBoxMinZ = pColModel->boundingBox.min.z; - float fHeight = pColModel->boundingBox.max.z - pColModel->boundingBox.min.z; - if (fHeight < OBJECT_REPOSITION_OFFSET_Z) fHeight = OBJECT_REPOSITION_OFFSET_Z; + float fBoundingBoxMinZ = pEntity->GetColModel()->boundingBox.min.z; position.z = FindGroundZFor3DCoord(position.x, position.y, - position.z + fHeight, nil) - - fBoundingBoxMinZ; + position.z + OBJECT_REPOSITION_OFFSET_Z, nil) - + fBoundingBoxMinZ; pEntity->GetMatrix().UpdateRW(); pEntity->UpdateRwFrame(); - } else if(IsLightThatNeedsRepositioning(modelId)) { - CVector position = pEntity->GetMatrix().GetPosition(); - CColModel* pColModel = pEntity->GetColModel(); - float fBoundingBoxMinZ = pColModel->boundingBox.min.z; - float fHeight = pColModel->boundingBox.max.z - pColModel->boundingBox.min.z; - if (fHeight < OBJECT_REPOSITION_OFFSET_Z) fHeight = OBJECT_REPOSITION_OFFSET_Z; - if (pColModel->numBoxes == 1) - position = pEntity->GetMatrix() * CVector( - (pColModel->boxes[0].min.x + pColModel->boxes[0].max.x) / 2, - (pColModel->boxes[0].min.y + pColModel->boxes[0].max.y) / 2, - pColModel->boxes[0].min.z); - else if (pColModel->numSpheres > 0) { - position.z = 1000.0f; - for (int i = 0; i < pColModel->numSpheres; i++) { - if (pColModel->spheres[i].center.z < position.z) - position = pColModel->spheres[i].center; - } - if (position.z < 1000.0f) - position = pEntity->GetMatrix() * position; - } - pEntity->GetMatrix().GetPosition().z = FindGroundZFor3DCoord(position.x, position.y, pEntity->GetMatrix().GetPosition().z + fHeight, nil) - fBoundingBoxMinZ; - pEntity->GetMatrix().UpdateRW(); - pEntity->UpdateRwFrame(); - - } - if(modelId == MI_BUOY) { + } else if(modelId == MI_BUOY) { + float fWaterLevel = 0.0f; bool bFound = true; const CVector &position = pEntity->GetPosition(); float fGroundZ = FindGroundZFor3DCoord(position.x, position.y, position.z + OBJECT_REPOSITION_OFFSET_Z, &bFound); - CColModel *pColModel = pEntity->GetColModel(); - float fHeight = pColModel->boundingBox.max.z - pColModel->boundingBox.min.z; - pEntity->GetMatrix().GetPosition().z = 0.2f * fHeight + 6.0f - 0.5f * fHeight; + if(CWaterLevel::GetWaterLevelNoWaves(position.x, position.y, position.z + OBJECT_REPOSITION_OFFSET_Z, + &fWaterLevel)) { + if(!bFound || fWaterLevel > fGroundZ) { + CColModel *pColModel = pEntity->GetColModel(); + float fHeight = pColModel->boundingBox.max.z - pColModel->boundingBox.min.z; + pEntity->GetMatrix().GetPosition().z = 0.2f * fHeight + fWaterLevel - 0.5f * fHeight; + } + } } } @@ -1927,16 +1906,7 @@ CWorld::Process(void) for(int i = 0; i < NUMCUTSCENEOBJECTS; i++) { CCutsceneObject *csObj = CCutsceneMgr::GetCutsceneObject(i); if(csObj && csObj->m_entryInfoList.first) { - if(csObj->m_rwObject && RwObjectGetType(csObj->m_rwObject) == rpCLUMP && - RpAnimBlendClumpGetFirstAssociation(csObj->GetClump())) { - if (csObj->IsObject()) - RpAnimBlendClumpUpdateAnimations(csObj->GetClump(), CTimer::GetTimeStepNonClippedInSeconds()); - else { - if (!csObj->bOffscreen) - csObj->bOffscreen = !csObj->GetIsOnScreen(); - RpAnimBlendClumpUpdateAnimations(csObj->GetClump(), CTimer::GetTimeStepInSeconds(), !csObj->bOffscreen); - } - } + csObj->UpdateAnim(); csObj->ProcessControl(); csObj->ProcessCollision(); csObj->GetMatrix().UpdateRW(); @@ -1948,26 +1918,40 @@ CWorld::Process(void) } else { for(CPtrNode *node = ms_listMovingEntityPtrs.first; node; node = node->next) { CEntity *movingEnt = (CEntity *)node->item; - if(!movingEnt->bRemoveFromWorld && movingEnt->m_rwObject && RwObjectGetType(movingEnt->m_rwObject) == rpCLUMP && - RpAnimBlendClumpGetFirstAssociation(movingEnt->GetClump())) { - if (movingEnt->IsObject()) - RpAnimBlendClumpUpdateAnimations(movingEnt->GetClump(), CTimer::GetTimeStepNonClippedInSeconds()); - else { - if (!movingEnt->bOffscreen) - movingEnt->bOffscreen = !movingEnt->GetIsOnScreen(); - RpAnimBlendClumpUpdateAnimations(movingEnt->GetClump(), CTimer::GetTimeStepInSeconds(), !movingEnt->bOffscreen); - } - } + if(!movingEnt->bRemoveFromWorld) + movingEnt->UpdateAnim(); } for(CPtrNode *node = ms_listMovingEntityPtrs.first; node; node = node->next) { CPhysical *movingEnt = (CPhysical *)node->item; if(movingEnt->bRemoveFromWorld) { RemoveEntityInsteadOfProcessingIt(movingEnt); } else { - movingEnt->ProcessControl(); + if(!CCutsceneMgr::IsCutsceneProcessing() || movingEnt->UpdatesInCutscene()) + movingEnt->ProcessControl(); if(movingEnt->GetIsStatic()) { movingEnt->RemoveFromMovingList(); } } } + for(int y = 0; y < NUMSECTORS_Y; y++) + for(int x = 0; x < NUMSECTORS_X; x++){ + CPtrNode *node; + CSector *sect = CWorld::GetSector(x, y); + for(node = sect->m_lists[ENTITYLIST_PEDS].first; node; node = node->next) + ((CEntity*)node->item)->UpdateDistanceFade(); + for(node = sect->m_lists[ENTITYLIST_PEDS_OVERLAP].first; node; node = node->next) + ((CEntity*)node->item)->UpdateDistanceFade(); + for(node = sect->m_lists[ENTITYLIST_VEHICLES].first; node; node = node->next) + ((CEntity*)node->item)->UpdateDistanceFade(); + for(node = sect->m_lists[ENTITYLIST_VEHICLES_OVERLAP].first; node; node = node->next) + ((CEntity*)node->item)->UpdateDistanceFade(); + for(node = sect->m_lists[ENTITYLIST_OBJECTS].first; node; node = node->next) + ((CEntity*)node->item)->UpdateDistanceFade(); + for(node = sect->m_lists[ENTITYLIST_OBJECTS_OVERLAP].first; node; node = node->next) + ((CEntity*)node->item)->UpdateDistanceFade(); + for(node = sect->m_lists[ENTITYLIST_DUMMIES].first; node; node = node->next) + ((CEntity*)node->item)->UpdateDistanceFade(); + for(node = sect->m_lists[ENTITYLIST_DUMMIES_OVERLAP].first; node; node = node->next) + ((CEntity*)node->item)->UpdateDistanceFade(); + } bForceProcessControl = true; for(CPtrNode *node = ms_listMovingEntityPtrs.first; node; node = node->next) { CPhysical *movingEnt = (CPhysical *)node->item; @@ -2154,8 +2138,8 @@ CWorld::TriggerExplosionSectorList(CPtrList &list, const CVector &position, floa } else { CVector pos = pEntity->GetPosition(); pos.z -= 0.5f; - CParticleObject::AddObject(POBJECT_FIRE_HYDRANT, - pos, true); + CParticleObject::AddObject(POBJECT_FIRE_HYDRANT, pos, true); + CParticleObject::AddObject(POBJECT_FIRE_HYDRANT_STEAM, pos, true); pObject->bHasBeenDamaged = true; } } diff --git a/src/core/World.h b/src/core/World.h index 81eb5d4c..c90bb3a1 100644 --- a/src/core/World.h +++ b/src/core/World.h @@ -5,19 +5,19 @@ #include "PlayerInfo.h" #include "Collision.h" -/* Sectors span from -2400 to 1600 in x and -2000 to 2000 y. - * With 80x80 sectors, each is 50x50 units. */ +/* Sectors span from -2000 to 2000 in x and y. + * With 100x100 sectors, each is 40x40 units. */ -#define SECTOR_SIZE_X (50.0f) -#define SECTOR_SIZE_Y (50.0f) +#define SECTOR_SIZE_X (40.0f) +#define SECTOR_SIZE_Y (40.0f) -#define NUMSECTORS_X (80) -#define NUMSECTORS_Y (80) +#define NUMSECTORS_X (100) +#define NUMSECTORS_Y (100) #define WORLD_SIZE_X (NUMSECTORS_X * SECTOR_SIZE_X) #define WORLD_SIZE_Y (NUMSECTORS_Y * SECTOR_SIZE_Y) -#define WORLD_MIN_X (-2400.0f) +#define WORLD_MIN_X (-2000.0f) #define WORLD_MIN_Y (-2000.0f) #define WORLD_MAX_X (WORLD_MIN_X + WORLD_SIZE_X) @@ -29,6 +29,7 @@ enum { ENTITYLIST_BUILDINGS, ENTITYLIST_BUILDINGS_OVERLAP, + ENTITYLIST_UNKNOWN, ENTITYLIST_OBJECTS, ENTITYLIST_OBJECTS_OVERLAP, ENTITYLIST_VEHICLES, diff --git a/src/core/Zones.cpp b/src/core/Zones.cpp index 93eca199..5a53ee29 100644 --- a/src/core/Zones.cpp +++ b/src/core/Zones.cpp @@ -87,20 +87,20 @@ CTheZones::Init(void) TotalNumberOfInfoZones = 1; strcpy(InfoZoneArray[0].name, "CITYINF"); - InfoZoneArray[0].minx = -2400.0f; + InfoZoneArray[0].minx = -2000.0f; InfoZoneArray[0].miny = -2000.0f; InfoZoneArray[0].minz = -500.0f; - InfoZoneArray[0].maxx = 1600.0f; + InfoZoneArray[0].maxx = 2000.0f; InfoZoneArray[0].maxy = 2000.0f; InfoZoneArray[0].maxz = 500.0f; InfoZoneArray[0].level = LEVEL_GENERIC; InfoZoneArray[0].type = ZONE_INFO; strcpy(NavigationZoneArray[0].name, "VICE_C"); - NavigationZoneArray[0].minx = -2400.0f; + NavigationZoneArray[0].minx = -2000.0f; NavigationZoneArray[0].miny = -2000.0f; NavigationZoneArray[0].minz = -500.0f; - NavigationZoneArray[0].maxx = 1600.0f; + NavigationZoneArray[0].maxx = 2000.0f; NavigationZoneArray[0].maxy = 2000.0f; NavigationZoneArray[0].maxz = 500.0f; NavigationZoneArray[0].level = LEVEL_GENERIC; @@ -114,10 +114,10 @@ CTheZones::Init(void) } TotalNumberOfMapZones = 1; strcpy(MapZoneArray[0].name, "THEMAP"); - MapZoneArray[0].minx = -2400.0f; + MapZoneArray[0].minx = -2000.0f; MapZoneArray[0].miny = -2000.0f; MapZoneArray[0].minz = -500.0f; - MapZoneArray[0].maxx = 1600.0f; + MapZoneArray[0].maxx = 2000.0f; MapZoneArray[0].maxy = 2000.0f; MapZoneArray[0].maxz = 500.0f; MapZoneArray[0].level = LEVEL_GENERIC; diff --git a/src/core/common.h b/src/core/common.h index ca29ef5a..1f37d609 100644 --- a/src/core/common.h +++ b/src/core/common.h @@ -115,6 +115,8 @@ typedef ptrdiff_t ssize_t; #endif #include "config.h" +#include "memoryManager.h" +#include "relocatableChunk.h" #include <rphanim.h> #include <rpskin.h> @@ -212,6 +214,18 @@ inline uint32 ldb(uint32 p, uint32 s, uint32 w) #define SCALE_AND_CENTER_X(x) SCREEN_STRETCH_X(x) #endif +// these are temp marcos while we don't implement all PSP UI coordinates +#define PSP_DEFAULT_SCREEN_WIDTH (480) +#define PSP_DEFAULT_SCREEN_HEIGHT (272) + +#define PSP_SCALE_TO_PS2_X(a) ((float)a * ((float)DEFAULT_SCREEN_WIDTH / (float)PSP_DEFAULT_SCREEN_WIDTH)) +#define PSP_SCALE_TO_PS2_Y(a) ((float)a * ((float)DEFAULT_SCREEN_HEIGHT / (float)PSP_DEFAULT_SCREEN_HEIGHT)) + +#define PSP_SCREEN_SCALE_X(a) ((a) * (float) SCREEN_WIDTH / PSP_DEFAULT_SCREEN_WIDTH) +#define PSP_SCREEN_SCALE_Y(a) ((a) * (float) SCREEN_WIDTH / PSP_DEFAULT_SCREEN_WIDTH) +#define PSP_SCREEN_SCALE_FROM_RIGHT(a) (SCREEN_WIDTH - PSP_SCREEN_SCALE_X(a)) +#define PSP_SCREEN_SCALE_FROM_BOTTOM(a) (SCREEN_HEIGHT - PSP_SCREEN_SCALE_Y(a)) + #include "maths.h" #include "Vector.h" #ifdef GTA_PS2 diff --git a/src/core/config.h b/src/core/config.h index 4efe12f0..bb1e4dbe 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -10,15 +10,15 @@ enum Config { MAX_CDIMAGES = 8, // additional cdimages MAX_CDCHANNELS = 5, - MODELINFOSIZE = 6500, // 4900 on PS2 - TXDSTORESIZE = 1385, - COLSTORESIZE = 31, + MODELINFOSIZE = 4900, + TXDSTORESIZE = 1200, + COLSTORESIZE = 15, EXTRADIRSIZE = 256, CUTSCENEDIRSIZE = 512, SIMPLEMODELSIZE = 3885, TIMEMODELSIZE = 385, - CLUMPMODELSIZE = 5, + CLUMPMODELSIZE = 10, WEAPONMODELSIZE = 37, PEDMODELSIZE = 130, VEHICLEMODELSIZE = 110, @@ -29,19 +29,19 @@ enum Config { NUMOBJECTINFO = 210, // Pool sizes - NUMPTRNODES = 50000, - NUMENTRYINFOS = 3200, - NUMPEDS = 140, - NUMVEHICLES = 110, - NUMBUILDINGS = 7000, - NUMTREADABLES = 1, - NUMOBJECTS = 460, - NUMDUMMIES = 2340, + NUMPTRNODES = 50000, // only 30100 + NUMENTRYINFOS = 4000, + NUMPEDS = 140, // only 70 + NUMVEHICLES = 110, // only 70 + NUMBUILDINGS = 7000, // only 6757 + NUMTREADABLES = 1300, + NUMOBJECTS = 475, + NUMDUMMIES = 3000, NUMAUDIOSCRIPTOBJECTS = 192, NUMCOLMODELS = 4400, NUMCUTSCENEOBJECTS = 50, // not a pool in VC - NUMANIMBLOCKS = 35, + NUMANIMBLOCKS = 60, NUMANIMATIONS = 450, NUMTEMPOBJECTS = 40, @@ -61,20 +61,20 @@ enum Config { NUMREFERENCES = 800, // Zones - NUMAUDIOZONES = 14, + NUMAUDIOZONES = 36, NUMINFOZONES = 169, - NUMMAPZONES = 39, - NUMNAVIGZONES = 20, + NUMMAPZONES = 110, + NUMNAVIGZONES = 70, // Cull zones - NUMATTRIBZONES = 704, + NUMATTRIBZONES = 900, NUMOCCLUSIONVOLUMES = 350, NUMACTIVEOCCLUDERS = 48, PATHNODESIZE = 4500, - NUMWEATHERS = 7, + NUMWEATHERS = 8, NUMHOURS = 24, NUMEXTRADIRECTIONALS = 4, @@ -100,7 +100,7 @@ enum Config { NUMPACMANPICKUPS = 256, NUMEVENTS = 64, - NUM_CARGENS = 185, + NUM_CARGENS = 195, // 500 on mobile NUM_PATH_NODES_IN_AUTOPILOT = 8, @@ -114,7 +114,7 @@ enum Config { NUM_WATERCANNONS = 3, NUMPEDROUTES = 200, - NUMPHONES = 50, + NUMPHONES = 60, NUMPEDGROUPS = 67, NUMMODELSPERPEDGROUP = 16, MAXZONEPEDSLOADED = 8, @@ -138,7 +138,7 @@ enum Config { NUM_GARAGE_STORED_CARS = 4, - NUM_CRANES = 8, + NUM_CRANES = 11, NUM_ESCALATORS = 22, NUM_WATER_CREATURES = 8, @@ -204,6 +204,9 @@ enum Config { //#define COMPRESSED_COL_VECTORS // use compressed vectors for collision vertices //#define ANIM_COMPRESSION // only keep most recently used anims uncompressed +#define GTA_TRAIN +#define GTA_BRIDGE + #if defined GTA_PS2 # define GTA_PS2_STUFF # define RANDOMSPLASH @@ -216,7 +219,7 @@ enum Config { # define PS2_MATFX # endif # define PC_PLAYER_CONTROLS // mouse player/cam mode -# define GTA_REPLAY +//# define GTA_REPLAY # define GTA_SCENE_EDIT #elif defined GTA_XBOX #endif @@ -245,7 +248,7 @@ enum Config { #endif #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 LOAD_INI_SETTINGS // as the name suggests. fundamental for CUSTOM_FRONTEND_OPTIONS @@ -274,7 +277,7 @@ enum Config { #define USE_TXD_CDIMAGE // generate and load textures from txd.img #define PS2_ALPHA_TEST // emulate ps2 alpha test #define IMPROVED_VIDEOMODE // save and load videomode parameters instead of a magic number -#define DISABLE_LOADING_SCREEN // disable the loading screen which vastly improves the loading time +//#define DISABLE_LOADING_SCREEN // disable the loading screen which vastly improves the loading time #define DISABLE_VSYNC_ON_TEXTURE_CONVERSION // make texture conversion work faster by disabling vsync #define ANISOTROPIC_FILTERING // set all textures to max anisotropic filtering //#define USE_TEXTURE_POOL @@ -294,6 +297,7 @@ enum Config { // Water & Particle // #define PC_WATER #define WATER_CHEATS +//#define PSP_WATERCANNON //#define USE_CUTSCENE_SHADOW_FOR_PED #define DISABLE_CUTSCENE_SHADOWS @@ -336,7 +340,7 @@ enum Config { # ifdef CUSTOM_FRONTEND_OPTIONS # define GRAPHICS_MENU_OPTIONS // otherwise Display settings will be scrollable -# define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU +//# define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU # define CUTSCENE_BORDERS_SWITCH # define MULTISAMPLING // adds MSAA option # define INVERT_LOOK_FOR_PAD // enable the hidden option @@ -358,7 +362,7 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually #endif //#define SIMPLIER_MISSIONS // apply simplifications from mobile #define USE_ADVANCED_SCRIPT_DEBUG_OUTPUT -#define SCRIPT_LOG_FILE_LEVEL 0 // 0 == no log, 1 == overwrite every frame, 2 == full log +#define SCRIPT_LOG_FILE_LEVEL 1 // 0 == no log, 1 == overwrite every frame, 2 == full log #if SCRIPT_LOG_FILE_LEVEL == 0 #undef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT @@ -394,8 +398,8 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually // Audio #define RADIO_SCROLL_TO_PREV_STATION // Won't work without FIX_BUGS -#define AUDIO_CACHE // cache sound lengths to speed up the cold boot -#define PS2_AUDIO_CHANNELS // increases the maximum number of audio channels to PS2 value of 43 (PC has 28 originally) +//#define AUDIO_CACHE // cache sound lengths to speed up the cold boot +#define PS2_AUDIO_CHANNELS // increases the maximum number of audio channels to PS2 value of 41 (PSP and mobile have 21 originally) //#define PS2_AUDIO_PATHS // changes audio paths for cutscenes and radio to PS2 paths (needs vbdec on MSS builds) //#define AUDIO_OAL_USE_SNDFILE // use libsndfile to decode WAVs instead of our internal decoder #define AUDIO_OAL_USE_MPG123 // use mpg123 to support mp3 files diff --git a/src/core/main.cpp b/src/core/main.cpp index 74b896c6..8e53901f 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -81,12 +81,20 @@ GlobalScene Scene; -uint8 work_buff[55000]; +uint8 work_buff[102400]; char gString[256]; char gString2[512]; wchar gUString[256]; wchar gUString2[256]; +// leeds +bool gMakeResources = true; +bool gUseChunkFiles = false; +bool gSecondExportPass; +bool gUseModelResources; +bool gUseResources; +bool gNASTY_NASTY_MEM_SHUTDOWN_HACK; // rather unused + float FramesPerSecond = 30.0f; bool gbPrintShite = false; @@ -108,7 +116,7 @@ RwRGBA gColourTop; bool gameAlreadyInitialised; float NumberOfChunksLoaded; -#define TOTALNUMCHUNKS 95.0f +#define TOTALNUMCHUNKS 52.0f bool g_SlowMode = false; char version_name[64]; @@ -135,7 +143,7 @@ bool gbPrintMemoryUsage; #endif #ifdef NEW_RENDERER -bool gbNewRenderer; +bool gbNewRenderer = true; #endif #ifdef FIX_BUGS // need to clear stencil for mblur fx. no idea why it works in the original game @@ -606,11 +614,11 @@ GetRandomSplashScreen(void) static char splashName[128]; static int splashIndex[12] = { 1, 2, - 3, 4, - 5, 11, - 6, 8, - 9, 10, - 7, 12 + 3, 0, + 1, 2, + 3, 0, + 1, 2, + 3, 0 }; index = splashIndex[2*index2 + CGeneral::GetRandomNumberInRange(0, 2)]; @@ -624,11 +632,12 @@ GetRandomSplashScreen(void) Const char* GetLevelSplashScreen(int level) { - static Const char *splashScreens[4] = { + static Const char *splashScreens[5] = { nil, "splash1", "splash2", "splash3", + "loadsc0", }; return splashScreens[level]; @@ -640,6 +649,7 @@ ResetLoadingScreenBar() NumberOfChunksLoaded = 0.0f; } +//--LCS: not the real thing void LoadingScreen(const char *str1, const char *str2, const char *splashscreen) { @@ -651,7 +661,7 @@ LoadingScreen(const char *str1, const char *str2, const char *splashscreen) #endif #ifndef RANDOMSPLASH - splashscreen = "LOADSC0"; + splashscreen = "SCEELEE"; #endif splash = LoadSplash(splashscreen); @@ -673,24 +683,27 @@ LoadingScreen(const char *str1, const char *str2, const char *splashscreen) NumberOfChunksLoaded += 1; #ifndef RANDOMSPLASH + // this looks nice float hpos = SCREEN_SCALE_X(40); float length = SCREEN_WIDTH - SCREEN_SCALE_X(80); - float top = SCREEN_HEIGHT - SCREEN_SCALE_Y(14); - float bottom = top + SCREEN_SCALE_Y(5); + float top = SCREEN_HEIGHT - SCREEN_SCALE_Y(30); + float bottom = top + SCREEN_SCALE_Y(8); #else - float hpos = SCREEN_STRETCH_X(40); - float length = SCREEN_STRETCH_X(440); - // this is rather weird - float top = SCREEN_STRETCH_Y(407.4f - 7.0f/3.0f); - float bottom = SCREEN_STRETCH_Y(407.4f + 7.0f/3.0f); + // should correspond to PS2 position + float hpos = SCREEN_STRETCH_X(44); + float length = SCREEN_STRETCH_X(176); + float top = SCREEN_STRETCH_Y(420); + float bottom = top + SCREEN_STRETCH_Y(8); #endif - CSprite2d::DrawRect(CRect(hpos-1.0f, top-1.0f, hpos+length+1.0f, bottom+1.0f), CRGBA(40, 53, 68, 255)); + CSprite2d::DrawRect(CRect(hpos+4.0f, top+6.0f, hpos+length+4.0f, bottom+6.0f), CRGBA(0, 0, 0, 200)); - CSprite2d::DrawRect(CRect(hpos, top, hpos+length, bottom), CRGBA(155, 50, 125, 255)); + CSprite2d::DrawRect(CRect(hpos, top, hpos+length, bottom), CRGBA(0, 0, 0, 255)); + + CSprite2d::DrawRect(CRect(hpos+1.0f, top+1.0f, hpos+length-1.0f, bottom-1.0f), CRGBA(99, 99, 99, 255)); length *= NumberOfChunksLoaded/TOTALNUMCHUNKS; - CSprite2d::DrawRect(CRect(hpos, top, hpos+length, bottom), CRGBA(255, 150, 225, 255)); + CSprite2d::DrawRect(CRect(hpos+1.0f, top+1.0f, hpos+length-1.0f, bottom-1.0f), CRGBA(126, 15, 0, 255)); // this is done by the game but is unused CFont::SetBackgroundOff(); @@ -705,7 +718,7 @@ LoadingScreen(const char *str1, const char *str2, const char *splashscreen) // my attempt static wchar tmpstr[80]; float yscale = SCREEN_SCALE_Y(0.9f); - top -= 45*yscale; + top = bottom+5*yscale; CFont::SetScale(SCREEN_SCALE_X(0.75f), yscale); CFont::SetPropOn(); CFont::SetRightJustifyOff(); @@ -726,12 +739,13 @@ LoadingScreen(const char *str1, const char *str2, const char *splashscreen) } } +//--LCS: slightly fixed void LoadingIslandScreen(const char *levelName) { CSprite2d *splash; - splash = LoadSplash(nil); + splash = LoadSplash(GetLevelSplashScreen(CGame::currLevel)); if(!DoRWStuffStartOfFrame(0, 0, 0, 0, 0, 0, 255)) return; @@ -1230,10 +1244,10 @@ MattRenderScene(void) /// CWorld::AdvanceCurrentScanCode(); // CMattRenderer::ResetRenderStates /// CRenderer::ClearForFrame(); // before ConstructRenderList - // CClock::CalcEnvMapTimeMultiplicator + CClock::CalcEnvMapTimeMultiplicator(); RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE); CWaterLevel::RenderWater(); // actually CMattRenderer::RenderWater - // CClock::ms_EnvMapTimeMultiplicator = 1.0f; + CClock::ms_EnvMapTimeMultiplicator = 1.0f; // cWorldStream::ClearDynamics /// CRenderer::ConstructRenderList(); // before PreRender if(gbRenderWorld0) @@ -1246,6 +1260,8 @@ if(gbRenderWorld1) if(gbRenderRoads) CRenderer::RenderRoads(); + CRenderer::GenerateEnvironmentMap(); // should be after static shadows, but that's weird + CRenderer::RenderPeds(); // not sure where to put these since LCS has no underwater entities @@ -1286,7 +1302,6 @@ RenderEffects_new(void) PUSH_RENDERGROUP("RenderEffects_new"); /* // stupid to do this before the whole world is drawn! CShadows::RenderStaticShadows(); - // CRenderer::GenerateEnvironmentMap CShadows::RenderStoredShadows(); CSkidmarks::Render(); CRubbish::Render(); @@ -1373,7 +1388,7 @@ void RenderDebugShit(void) { PUSH_RENDERGROUP("RenderDebugShit"); - CTheScripts::RenderTheScriptDebugLines(); + //CTheScripts::RenderTheScriptDebugLines(); #ifndef FINAL if(gbShowCollisionLines) CRenderer::RenderCollisionLines(); diff --git a/src/core/main.h b/src/core/main.h index 803afb14..3fa26e78 100644 --- a/src/core/main.h +++ b/src/core/main.h @@ -18,7 +18,7 @@ struct GlobalScene }; extern GlobalScene Scene; -extern uint8 work_buff[55000]; +extern uint8 work_buff[102400]; extern char gString[256]; extern char gString2[512]; extern wchar gUString[256]; @@ -35,6 +35,14 @@ extern bool gbShowTimebars; extern bool gbPrintMemoryUsage; #endif +// leeds +extern bool gMakeResources; +extern bool gUseChunkFiles; +extern bool gSecondExportPass; +extern bool gUseModelResources; +extern bool gUseResources; +extern bool gNASTY_NASTY_MEM_SHUTDOWN_HACK; + class CSprite2d; bool DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha); diff --git a/src/core/re3.cpp b/src/core/re3.cpp index e2220467..34976822 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -132,20 +132,20 @@ CustomFrontendOptionsPopulate(void) int fd; // These work only if we have neo folder, so they're dynamically added #ifdef EXTENDED_PIPELINES - const char *vehPipelineNames[] = { "FED_MFX", "FED_NEO" }; + const char *pipelineNames[] = { "FED_PSP", "FED_PS2","FED_MOB" }; const char *off_on[] = { "FEM_OFF", "FEM_ON" }; fd = CFileMgr::OpenFile("neo/neo.txd","r"); if (fd) { #ifdef GRAPHICS_MENU_OPTIONS FrontendOptionSetCursor(MENUPAGE_GRAPHICS_SETTINGS, -3, false); - FrontendOptionAddSelect("FED_VPL", 0, 0, MENUALIGN_LEFT, vehPipelineNames, ARRAY_SIZE(vehPipelineNames), (int8*)&CustomPipes::VehiclePipeSwitch, false, nil, "Graphics", "VehiclePipeline"); - FrontendOptionAddSelect("FED_PRM", 0, 0, MENUALIGN_LEFT, off_on, 2, (int8*)&CustomPipes::RimlightEnable, false, nil, "Graphics", "NeoRimLight"); + FrontendOptionAddSelect("FED_VPL", 0, 0, MENUALIGN_LEFT, pipelineNames, ARRAY_SIZE(pipelineNames), (int8*)&CustomPipes::VehiclePipeSwitch, false, nil, "Graphics", "VehiclePipeline"); + FrontendOptionAddSelect("FED_WPL", 0, 0, MENUALIGN_LEFT, pipelineNames, ARRAY_SIZE(pipelineNames), (int8*)&CustomPipes::WorldPipeSwitch, false, nil, "Graphics", "WorldPipeline"); FrontendOptionAddSelect("FED_WLM", 0, 0, MENUALIGN_LEFT, off_on, 2, (int8*)&CustomPipes::LightmapEnable, false, nil, "Graphics", "NeoLightMaps"); FrontendOptionAddSelect("FED_RGL", 0, 0, MENUALIGN_LEFT, off_on, 2, (int8*)&CustomPipes::GlossEnable, false, nil, "Graphics", "NeoRoadGloss"); #else FrontendOptionSetCursor(MENUPAGE_DISPLAY_SETTINGS, -3, false); - FrontendOptionAddSelect("FED_VPL", 0, 0, MENUALIGN_LEFT, vehPipelineNames, ARRAY_SIZE(vehPipelineNames), (int8*)&CustomPipes::VehiclePipeSwitch, false, nil, "Graphics", "VehiclePipeline"); - FrontendOptionAddSelect("FED_PRM", 0, 0, MENUALIGN_LEFT, off_on, 2, (int8*)&CustomPipes::RimlightEnable, false, nil, "Graphics", "NeoRimLight"); + FrontendOptionAddSelect("FED_VPL", 0, 0, MENUALIGN_LEFT, pipelineNames, ARRAY_SIZE(pipelineNames), (int8*)&CustomPipes::VehiclePipeSwitch, false, nil, "Graphics", "VehiclePipeline"); + FrontendOptionAddSelect("FED_WPL", 0, 0, MENUALIGN_LEFT, pipelineNames, ARRAY_SIZE(pipelineNames), (int8*)&CustomPipes::WorldPipeSwitch, false, nil, "Graphics", "WorldPipeline"); FrontendOptionAddSelect("FED_WLM", 0, 0, MENUALIGN_LEFT, off_on, 2, (int8*)&CustomPipes::LightmapEnable, false, nil, "Graphics", "NeoLightMaps"); FrontendOptionAddSelect("FED_RGL", 0, 0, MENUALIGN_LEFT, off_on, 2, (int8*)&CustomPipes::GlossEnable, false, nil, "Graphics", "NeoRoadGloss"); #endif @@ -463,12 +463,12 @@ void SaveINIControllerSettings() #endif #endif StoreIni("Controller", "PadButtonsInited", ControlsManager.ms_padButtonsInited); - cfg.write_file("reVC.ini"); + cfg.write_file("reLCS.ini"); } bool LoadINISettings() { - if (!cfg.load_file("reVC.ini")) + if (!cfg.load_file("reLCS.ini")) return false; #ifdef IMPROVED_VIDEOMODE @@ -652,7 +652,7 @@ void SaveINISettings() } #endif - cfg.write_file("reVC.ini"); + cfg.write_file("reLCS.ini"); } #endif @@ -682,7 +682,6 @@ void FastWeatherCheat(); void OnlyRenderWheelsCheat(); void ChittyChittyBangBangCheat(); void StrongGripCheat(); -void SpecialCarCheats(); void PickUpChicksCheat(); DebugMenuEntry *carCol1; @@ -801,17 +800,15 @@ SwitchToMission(void) #endif static const char *carnames[] = { - "landstal", "idaho", "stinger", "linerun", "peren", "sentinel", "rio", "firetruk", "trash", "stretch", "manana", - "infernus", "voodoo", "pony", "mule", "cheetah", "ambulan", "fbicar", "moonbeam", "esperant", "taxi", "washing", - "bobcat", "mrwhoop", "bfinject", "hunter", "police", "enforcer", "securica", "banshee", "predator", "bus", - "rhino", "barracks", "cuban", "chopper", "angel", "coach", "cabbie", "stallion", "rumpo", "rcbandit", "romero", - "packer", "sentxs", "admiral", "squalo", "seaspar", "pizzaboy", "gangbur", "airtrain", "deaddodo", "speeder", - "reefer", "tropic", "flatbed", "yankee", "caddy", "zebra", "topfun", "skimmer", "pcj600", "faggio", "freeway", - "rcbaron", "rcraider", "glendale", "oceanic", "sanchez", "sparrow", "patriot", "lovefist", "coastg", "dinghy", - "hermes", "sabre", "sabretur", "pheonix", "walton", "regina", "comet", "deluxo", "burrito", "spand", "marquis", - "baggage", "kaufman", "maverick", "vcnmav", "rancher", "fbiranch", "virgo", "greenwoo", "jetmax", "hotring", - "sandking", "blistac", "polmav", "boxville", "benson", "mesa", "rcgoblin", "hotrina", "hotrinb", - "bloodra", "bloodrb", "vicechee" + "spider", "landstal", "idaho", "stinger", "linerun", "peren", "sentinel", "patriot", "firetruk", "trash", "stretch", + "manana", "infernus", "blista", "pony", "mule", "cheetah", "ambulan", "fbicar", "moonbeam", "esperant", "taxi", + "kuruma", "bobcat", "mrwhoop", "bfinject", "hearse", "police", "enforcer", "securica", "banshee", "bus", "rhino", + "barracks", "dodo", "coach", "cabbie", "stallion", "rumpo", "rcbandit", "bellyup", "mrwongs", "mafia", "yardie", + "yakuza", "diablos", "columb", "hoods", "panlant", "flatbed", "yankee", "borgnine", "toyz", "campvan", "ballot", + "shelby", "pontiac", "esprit", "ammotruk", "hotrod", "Sindacco_Car", "Forelli_Car", "ferry", "ghost", "speeder", + "reefer", "predator", "train", "escape", "chopper", "airtrain", "deaddodo", "angel", "pizzaboy", "noodleboy", + "pcj600", "faggio", "freeway", "angel2", "sanchez2", "sanchez", "rcgoblin", "rcraider", "hunter", "maverick", + "polmav", "vcnmav" }; static CTweakVar** TweakVarsList; @@ -941,11 +938,10 @@ DebugMenuPopulate(void) DebugMenuAddCmd("Cheats", "Only render wheels", OnlyRenderWheelsCheat); DebugMenuAddCmd("Cheats", "Chitty chitty bang bang", ChittyChittyBangBangCheat); DebugMenuAddCmd("Cheats", "Strong grip", StrongGripCheat); - DebugMenuAddCmd("Cheats", "Special car", SpecialCarCheats); DebugMenuAddCmd("Cheats", "Pickup chicks", PickUpChicksCheat); static int spawnCarId = MI_LANDSTAL; - e = DebugMenuAddVar("Spawn", "Spawn Car ID", &spawnCarId, nil, 1, MI_LANDSTAL, MI_VICECHEE, carnames); + e = DebugMenuAddVar("Spawn", "Spawn Car ID", &spawnCarId, nil, 1, MI_SPIDER, MI_VCNMAV, carnames); DebugMenuEntrySetWrap(e, true); DebugMenuAddCmd("Spawn", "Spawn Car", [](){ if(spawnCarId == MI_CHOPPER || @@ -960,22 +956,19 @@ DebugMenuPopulate(void) DebugMenuAddCmd("Spawn", "Spawn Stinger", [](){ SpawnCar(MI_STINGER); }); DebugMenuAddCmd("Spawn", "Spawn Infernus", [](){ SpawnCar(MI_INFERNUS); }); DebugMenuAddCmd("Spawn", "Spawn Cheetah", [](){ SpawnCar(MI_CHEETAH); }); - DebugMenuAddCmd("Spawn", "Spawn Phoenix", [](){ SpawnCar(MI_PHEONIX); }); + DebugMenuAddCmd("Spawn", "Spawn Esprit", [](){ SpawnCar(MI_ESPRIT); }); DebugMenuAddCmd("Spawn", "Spawn Banshee", [](){ SpawnCar(MI_BANSHEE); }); DebugMenuAddCmd("Spawn", "Spawn Esperanto", [](){ SpawnCar(MI_ESPERANT); }); DebugMenuAddCmd("Spawn", "Spawn Stallion", [](){ SpawnCar(MI_STALLION); }); - DebugMenuAddCmd("Spawn", "Spawn Admiral", [](){ SpawnCar(MI_ADMIRAL); }); - DebugMenuAddCmd("Spawn", "Spawn Washington", [](){ SpawnCar(MI_WASHING); }); + DebugMenuAddCmd("Spawn", "Spawn Mafia", [](){ SpawnCar(MI_MAFIA); }); + DebugMenuAddCmd("Spawn", "Spawn Kuruma", [](){ SpawnCar(MI_KURUMA); }); DebugMenuAddCmd("Spawn", "Spawn Taxi", [](){ SpawnCar(MI_TAXI); }); DebugMenuAddCmd("Spawn", "Spawn Police", [](){ SpawnCar(MI_POLICE); }); DebugMenuAddCmd("Spawn", "Spawn Enforcer", [](){ SpawnCar(MI_ENFORCER); }); - DebugMenuAddCmd("Spawn", "Spawn Cuban", [](){ SpawnCar(MI_CUBAN); }); - DebugMenuAddCmd("Spawn", "Spawn Voodoo", [](){ SpawnCar(MI_VOODOO); }); + DebugMenuAddCmd("Spawn", "Spawn Diablo", [](){ SpawnCar(MI_DIABLOS); }); + DebugMenuAddCmd("Spawn", "Spawn Yardie", [](){ SpawnCar(MI_YARDIE); }); DebugMenuAddCmd("Spawn", "Spawn BF injection", [](){ SpawnCar(MI_BFINJECT); }); DebugMenuAddCmd("Spawn", "Spawn Maverick", [](){ SpawnCar(MI_MAVERICK); }); - DebugMenuAddCmd("Spawn", "Spawn VCN Maverick", [](){ SpawnCar(MI_VCNMAV); }); - DebugMenuAddCmd("Spawn", "Spawn Sparrow", [](){ SpawnCar(MI_SPARROW); }); - DebugMenuAddCmd("Spawn", "Spawn Sea Sparrow", [](){ SpawnCar(MI_SEASPAR); }); DebugMenuAddCmd("Spawn", "Spawn Hunter", [](){ SpawnCar(MI_HUNTER); }); DebugMenuAddCmd("Spawn", "Spawn Rhino", [](){ SpawnCar(MI_RHINO); }); DebugMenuAddCmd("Spawn", "Spawn Firetruck", [](){ SpawnCar(MI_FIRETRUCK); }); @@ -983,10 +976,9 @@ DebugMenuPopulate(void) DebugMenuAddCmd("Spawn", "Spawn PCJ 600", [](){ SpawnCar(MI_PCJ600); }); DebugMenuAddCmd("Spawn", "Spawn Faggio", [](){ SpawnCar(MI_FAGGIO); }); DebugMenuAddCmd("Spawn", "Spawn Freeway", [](){ SpawnCar(MI_FREEWAY); }); - DebugMenuAddCmd("Spawn", "Spawn Squalo", [](){ SpawnCar(MI_SQUALO); }); - DebugMenuAddCmd("Spawn", "Spawn Skimmer", [](){ SpawnCar(MI_SKIMMER); }); DebugMenuAddVarBool8("Render", "Draw hud", &CHud::m_Wants_To_Draw_Hud, nil); + DebugMenuAddVar("Render", "Brightness", &FrontEndMenuManager.m_PrefsBrightness, nil, 16, 0, 700, nil); #ifdef PROPER_SCALING DebugMenuAddVarBool8("Render", "Proper Scaling", &CDraw::ms_bProperScaling, nil); #endif @@ -1026,8 +1018,8 @@ extern bool gbRenderWorld2; #endif #ifdef EXTENDED_COLOURFILTER - static const char *filternames[] = { "None", "Simple", "Normal", "Mobile" }; - e = DebugMenuAddVar("Render", "Colourfilter", &CPostFX::EffectSwitch, nil, 1, CPostFX::POSTFX_OFF, CPostFX::POSTFX_MOBILE, filternames); + static const char *filternames[] = { "None", "PSP", "PS2" }; + e = DebugMenuAddVar("Render", "Colourfilter", &CPostFX::EffectSwitch, nil, 1, CPostFX::POSTFX_OFF, CPostFX::POSTFX_PS2, filternames); DebugMenuEntrySetWrap(e, true); DebugMenuAddVar("Render", "Intensity", &CPostFX::Intensity, nil, 0.05f, 0, 10.0f); DebugMenuAddVarBool8("Render", "Blur", &CPostFX::BlurOn, nil); @@ -1043,18 +1035,25 @@ extern bool gbRenderWorld2; DebugMenuAddVarBool32("Render", "MatFX env map use matcolor", &rw::MatFX::envMapUseMatColor, nil); #endif #ifdef EXTENDED_PIPELINES - static const char *vehpipenames[] = { "MatFX", "Neo" }; + static const char *worldpipenames[] = { "PSP", "PS2", "Mobile" }; + e = DebugMenuAddVar("Render", "World Rendering", &CustomPipes::WorldPipeSwitch, nil, + 1, CustomPipes::WORLDPIPE_PSP, CustomPipes::WORLDPIPE_MOBILE, worldpipenames); + DebugMenuEntrySetWrap(e, true); + static const char *vehpipenames[] = { "PSP", "PS2", "Mobile" }; e = DebugMenuAddVar("Render", "Vehicle Pipeline", &CustomPipes::VehiclePipeSwitch, nil, - 1, CustomPipes::VEHICLEPIPE_MATFX, CustomPipes::VEHICLEPIPE_NEO, vehpipenames); + 1, CustomPipes::VEHICLEPIPE_PSP, CustomPipes::VEHICLEPIPE_MOBILE, vehpipenames); DebugMenuEntrySetWrap(e, true); - DebugMenuAddVar("Render", "Neo Vehicle Shininess", &CustomPipes::VehicleShininess, nil, 0.1f, 0, 1.0f); - DebugMenuAddVar("Render", "Neo Vehicle Specularity", &CustomPipes::VehicleSpecularity, nil, 0.1f, 0, 1.0f); + DebugMenuAddVarBool8("Render", "Glass Cars cheat", &CustomPipes::gGlassCarsCheat, nil); +extern bool gbRenderDebugEnvMap; + DebugMenuAddVarBool8("Render", "Show Env map", &gbRenderDebugEnvMap, nil); +// DebugMenuAddVar("Render", "Neo Vehicle Shininess", &CustomPipes::VehicleShininess, nil, 0.1f, 0, 1.0f); +// DebugMenuAddVar("Render", "Neo Vehicle Specularity", &CustomPipes::VehicleSpecularity, nil, 0.1f, 0, 1.0f); DebugMenuAddVarBool8("Render", "Neo Ped Rim light enable", &CustomPipes::RimlightEnable, nil); DebugMenuAddVar("Render", "Mult", &CustomPipes::RimlightMult, nil, 0.1f, 0, 1.0f); - DebugMenuAddVarBool8("Render", "Neo World Lightmaps enable", &CustomPipes::LightmapEnable, nil); - DebugMenuAddVar("Render", "Mult", &CustomPipes::LightmapMult, nil, 0.1f, 0, 1.0f); - DebugMenuAddVarBool8("Render", "Neo Road Gloss enable", &CustomPipes::GlossEnable, nil); - DebugMenuAddVar("Render", "Mult", &CustomPipes::GlossMult, nil, 0.1f, 0, 1.0f); +// DebugMenuAddVarBool8("Render", "Neo World Lightmaps enable", &CustomPipes::LightmapEnable, nil); +// DebugMenuAddVar("Render", "Mult", &CustomPipes::LightmapMult, nil, 0.1f, 0, 1.0f); +// DebugMenuAddVarBool8("Render", "Neo Road Gloss enable", &CustomPipes::GlossEnable, nil); +// DebugMenuAddVar("Render", "Mult", &CustomPipes::GlossMult, nil, 0.1f, 0, 1.0f); #endif DebugMenuAddVarBool8("Debug Render", "Show Ped Paths", &gbShowPedPaths, nil); DebugMenuAddVarBool8("Debug Render", "Show Car Paths", &gbShowCarPaths, nil); @@ -1108,24 +1107,30 @@ extern bool gbRenderWorld2; #ifdef MISSION_SWITCHER DebugMenuEntry *missionEntry; static const char* missions[] = { - "Initial", "Intro", "An Old Friend", "The Party", "Back Alley Brawl", "Jury Fury", "Riot", - "Treacherous Swine", "Mall Shootout", "Guardian Angels", "Sir, Yes Sir!", "All Hands On Deck!", - "The Chase", "Phnom Penh '86", "The Fastest Boat", "Supply & Demand", "Rub Out", "Death Row", - "Four Iron", "Demolition Man", "Two Bit Hit", "No Escape?", "The Shootist", "The Driver", - "The Job", "Gun Runner", "Boomshine Saigon", "Recruitment Drive", "Dildo Dodo", "Martha's Mug Shot", - "G-spotlight", "Shakedown", "Bar Brawl", "Cop Land", "Spilling the Beans", "Hit the Courier", - "Printworks Buy", "Sunshine Autos", "Interglobal Films Buy", "Cherry Popper Icecreams Buy", - "Kaufman Cabs Buy", "Malibu Club Buy", "The Boatyard Buy", "Pole Position Club Buy", "El Swanko Casa Buy", - "Links View Apartment Buy", "Hyman Condo Buy", "Ocean Heighs Aprt. Buy", "1102 Washington Street Buy", - "Vice Point Buy", "Skumole Shack Buy", "Cap the Collector", "Keep your Friends Close...", - "Alloy Wheels of Steel", "Messing with the Man", "Hog Tied", "Stunt Boat Challenge", "Cannon Fodder", - "Naval Engagement", "Trojan Voodoo", "Juju Scramble", "Bombs Away!", "Dirty Lickin's", "Love Juice", - "Psycho Killer", "Publicity Tour", "Weapon Range", "Road Kill", "Waste the Wife", "Autocide", - "Check Out at the Check In", "Loose Ends", "V.I.P.", "Friendly Rivalry", "Cabmaggedon", "TAXI DRIVER", - "PARAMEDIC", "FIREFIGHTER", "VIGILANTE", "HOTRING", "BLOODRING", "DIRTRING", "Sunshine Autos Races", - "Distribution", "Downtown Chopper Checkpoint", "Ocean Beach Chopper Checkpoint", "Vice Point Chopper Checkpoint", - "Little Haiti Chopper Checkpoint", "Trial by Dirt", "Test Track", "PCJ Playground", "Cone Crazy", - "PIZZA BOY", "RC Raider Pickup", "RC Bandit Race", "RC Baron Race", "Checkpoint Charlie" + "initial: objects", "initial: hidden packages", "initial: car generators", "initial: pickups", "initial: unique stunt jumps", + "initial: player", "initial: general info", "initial: lods", "initial: weapons", "Home Sweet Home", "Taxi-Driver Sub-Mission", + "Paramedic Sub-Mission", "Vigilante Sub-Mission", "Karmageddon", "Firefighter Sub-Mission", "Trash Dash", "RC Triad Take-Down", + "Thrashin' RC", "Ragin' RC", "Chasin' RC", "GO GO Faggio", "Noodleboy", "Pizzaboy", "Wong Side Of The Tracks", "Bumps and Grinds: Course 1", + "Bumps and Grinds: Course 2", "Bumps and Grinds: Course 3", "Bumps and Grinds: Course 4", "Bumps and Grinds: Course 5", "Bumps and Grinds: Course 6", + "Bumps and Grinds: Course 7", "Bumps and Grinds: Course 8", "Bumps and Grinds: Course 9", "Bumps and Grinds: Course 10", "Car Salesman", "Bike Salesman", + "RACE: Low-Rider Rumble", "RACE: Deimos Dash", "RACE: Wi-Cheetah Run", "RACE: Red Light Racing", "RACE: Torrington TT", "RACE: Gangsta GP", + "Scooter Shooter", "AWOL Angel", "9mm Mayhem", "Scrapyard Challenge", "See the Sight Before your Flight", "SlashTV", "Slacker (Vincenzo)", + "Dealing Revenge (Vincenzo)", "Snuff (Vincenzo)", "Smash and Grab (Vincenzo)", "Hot Wheels (Vincenzo)", "The Portland Chainsaw Masquerade (Vincenzo)", + "The Offer (Salvatore)", "Ho Selecta! (Salvatore)", "Frighteners (Salvatore)", "Rollercoaster Ride (Salvatore)", "Contra-Banned (Salvatore)", + "Sindacco Sabotage (Salvatore)", "The Trouble with Triads (Salvatore)", "Driving Mr Leone (Salvatore)", "conversation (JD)", "Bone Voyeur! (JD)", + "Don in 60 Seconds (JD)", "A Volatile Situation (JD)", "Blow up 'Dolls' (JD)", "Salvatore's Salvation (JD)", "The Guns of Leone (JD)", + "Calm before the Storm (JD)", "The Made Man (JD)", "Snappy Dresser (Ma Cipriani)", "Big Rumble in Little China (Ma Cipriani)", "Grease Sucho (Ma Cipriani)", + "Dead Meat (Ma Cipriani)", "No Son of Mine (Ma Cipriani)", "Shop 'til you Strop (Maria)", "Taken for a Ride (Maria)", "Booby Prize (Maria)", + "Biker Heat (Maria)", "Overdose of Trouble (Maria)", "Making Toni (Salvatore)", "A Walk In The Park (Salvatore)", "Caught In The Act (Salvatore)", + "Search And Rescue (Salvatore)", "Taking The Peace (Salvatore)", "Shoot The Messenger (Salvatore)", "Sayonara Sindaccos (Leon McAffrey)", + "The Whole 9 Yardies (Leon McAffrey)", "Crazy '69' (Leon McAffrey)", "Night Of The Livid Dreads (Leon McAffrey)", "Munitions Dump (Leon McAffrey)", + "The Morgue Party Candidate (Donald Love)", "Steering The Vote (Donald Love)", "Cam-Pain (Donald Love)", "Friggin' The Riggin' (Donald Love)", + "Love & Bullets (Donald Love)", "Counterfeit Count (Donald Love)", "Love On The Rocks (Donald Love)", "L.C. Confidential (Church Confessional)", + "The Passion Of The Heist (Church Confessional)", "Karmageddon (Church Confessional)", "False Idols (Church Confessional)", "Rough Justice (Salvatore)", + "Dead Reckoning (Salvatore)", "Shogun Showdown (Salvatore)", "The Shoreside Redemption (Salvatore)", "The Sicilian Gambit (Salvatore)", + "Panlantic Land Grab (Donald Love)", "Stop the Press (Donald Love)", "Morgue Party Resurrection (Donald Love)", "No Money, Mo' Problems (Donald Love)", + "Bringing the House Down (Donald Love)", "Love on the Run (Donald Love)", "More Deadly than the Male (Toshiko Kasen)", "Cash Clash (Toshiko Kasen)", + "A Date with Death (Toshiko Kasen)", "Cash in Kazuki's Chips (Toshiko Kasen)" }; missionEntry = DebugMenuAddVar("Game", "Select mission", &nextMissionToSwitch, nil, 1, 0, ARRAY_SIZE(missions) - 1, missions); @@ -1183,7 +1188,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)"); - nCode = ::MessageBoxA(nil, re3_buff, "REVC Assertion Failed!", + nCode = ::MessageBoxA(nil, re3_buff, "RELCS Assertion Failed!", MB_ABORTRETRYIGNORE|MB_ICONHAND|MB_SETFOREGROUND|MB_TASKMODAL); if (nCode == IDABORT) @@ -1204,7 +1209,7 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con abort(); #else // TODO - printf("\nREVC ASSERT FAILED\n\tFile: %s\n\tLine: %d\n\tFunction: %s\n\tExpression: %s\n",filename,lineno,func,expr); + printf("\nRELCS ASSERT FAILED\n\tFile: %s\n\tLine: %d\n\tFunction: %s\n\tExpression: %s\n",filename,lineno,func,expr); assert(false); #endif } @@ -1256,14 +1261,14 @@ void re3_usererror(const char *format, ...) vsprintf_s(re3_buff, re3_buffsize, format, va); va_end(va); - ::MessageBoxA(nil, re3_buff, "REVC Error!", + ::MessageBoxA(nil, re3_buff, "RELCS Error!", MB_OK|MB_ICONHAND|MB_SETFOREGROUND|MB_TASKMODAL); raise(SIGABRT); _exit(3); #else vsprintf(re3_buff, format, va); - printf("\nREVC Error!\n\t%s\n",re3_buff); + printf("\nRELCS Error!\n\t%s\n",re3_buff); assert(false); #endif } |