Bring more changes from DC port

This commit is contained in:
Shinovon 2026-05-02 15:22:39 +05:00
parent f6a5685de8
commit 7dae1b0268
10 changed files with 401 additions and 119 deletions

View file

@ -30,7 +30,7 @@ bool PrintDebugCode = false;
int16 DebugCamMode;
#ifdef FREE_CAM
bool CCamera::bFreeCam = false;
bool CCamera::bFreeCam = true;
int nPreviousMode = -1;
#endif

View file

@ -219,7 +219,7 @@ CFileLoader::LoadCollisionFile(const char *filename)
mi = CModelInfo::GetModelInfo(modelname, nil);
if(mi){
if(mi->GetColModel()){
if(mi->GetColModel() && mi->DoesOwnColModel()){
LoadCollisionModel(work_buff+24, *mi->GetColModel(), modelname);
}else{
CColModel *model = new CColModel;
@ -671,34 +671,296 @@ char *DoubleSidedNames[] = {
"sbwy_tunl_cstm2",
"sbwy_tunl_cstm1",
"tenmnt6ad",
"LUIGICLUBout",
"redlightbuild03",
"dinerind",
"dinerind02",
"franksclb02",
"glassfx1",
"lswank_inside",
"luigiineerclub",
"swank_inside",
"train_rust",
"glassfx2",
"glassfx3",
"glassfx4",
"glassfx55",
"glassfx_composh",
"glassfxsub1",
"glassfxsub2",
""
};
char *TreeNames[] = {
"Dam_pod1",
"building_fucked",
"ch_roof_kb",
"chtwn_fmrkt",
"hghwysgn01",
"hghwysgn02",
"hghwysgn_sub",
"ind_land037",
"ind_land125ind",
"indbilbridge1",
"industpatch05",
"iten_club01",
"iten_details7",
"iten_washline02",
"iten_washline03",
"mak_Watertank",
"mak_Watertank2",
"mak_Watertank3",
"pharmas",
"rd_Road1A5",
"rdsign02bk",
"rdsign06",
"rdsign14",
"rdsign15",
"rdsign17",
"rdsign18bk",
"rdsign19",
"rdsign19",
"wire_shed",
"Dam_pod2",
"Dineradam",
"Gdyn_barrier17",
"LODky_skyscrp6",
"LODt_skyscrp1",
"LODy_skyscrp23",
"LODy_skyscrp26b",
"Pumpfirescape",
"Pumphouse",
"airtower1",
"airtower2",
"bar_barrier10",
"bar_barrier10b",
"bar_barrier12",
"bar_barrier16",
"bar_barriergate1",
"barrierturn",
"billboard01",
"billboard02",
"billboard03",
"carlift01",
"carlift02",
"carparkfence",
"casino_garden",
"chinabanner1",
"chinabanner2",
"chinabanner3",
"chinabanner4",
"coast_treepatch",
"comparknewtrees",
"comtreepatchprk",
"condo_ivy",
"condotree01",
"condotree1",
"cons_buid02",
"cranebasea",
"cranebaseb",
"cranesmalltop",
"cranetopa",
"cranetopb",
"csky_skyscrp23",
"csky_skyscrp26b",
"damfence01",
"damfence02",
"damfence03",
"damfence04",
"damfence05",
"damfence06",
"damfence07",
"damfence08",
"damfencing",
"dinerind",
"dinerind02",
"dinersign",
"doc_crane_cab",
"doc_crane_leggs",
"doc_shedbig1",
"doc_shedbig12",
"doc_shedbig13",
"doc_shedbig2",
"doc_shedbig3",
"doc_shedbig31",
"doc_shedbig4",
"fencesmallb",
"firescapa1",
"firescapb1",
"foundation",
"glassfx1",
"glassfx2",
"glassfx3",
"glassfx4",
"glassfx55",
"glassfx_composh",
"glassfxsub1",
"glassfxsub2",
"helix_barrier",
"ind_customroad001",
"ind_customroad002",
"ind_customroad003",
"ind_customroad004",
"ind_customroad005",
"ind_customroad006",
"ind_customroad008",
"ind_customroad009",
"ind_customroad010",
"ind_customroad011",
"ind_customroad012",
"ind_customroad013",
"ind_customroad014",
"ind_customroad015",
"ind_customroad016",
"ind_customroad017",
"ind_customroad018",
"ind_customroad019",
"ind_customroad020",
"ind_customroad021",
"ind_customroad022",
"ind_customroad023",
"ind_customroad024",
"ind_customroad025",
"ind_customroad026",
"ind_customroad028",
"ind_customroad029",
"ind_customroad033",
"ind_customroad034",
"ind_customroad035",
"ind_customroad036",
"ind_customroad037",
"ind_customroad038",
"ind_customroad039",
"ind_customroad040",
"ind_customroad041",
"ind_customroad042",
"ind_customroad043",
"ind_customroad044",
"ind_customroad045",
"ind_customroad046",
"ind_customroad047",
"ind_customroad048",
"ind_customroad049",
"ind_customroad050",
"ind_customroad051",
"ind_customroad052",
"ind_customroad053",
"ind_customroad054",
"ind_customroad055",
"ind_customroad056",
"ind_customroad057",
"ind_customroad058",
"ind_customroad059",
"ind_customroad060",
"ind_customroad061",
"ind_customroad062",
"ind_customroad063",
"ind_customroad064",
"ind_customroad065",
"ind_customroad066",
"ind_customroad067",
"ind_customroad068",
"ind_customroad069",
"ind_customroad070",
"ind_customroad071",
"ind_customroad072",
"ind_customroad073",
"ind_customroad074",
"ind_customroad075",
"ind_customroad076",
"ind_customroad077",
"ind_customroad078",
"ind_customroad079",
"ind_customroad080",
"ind_customroad081",
"ind_customroad082",
"ind_customroad083",
"ind_customroad084",
"ind_customroad085",
"ind_customroad086",
"ind_customroad087",
"ind_customroad088",
"ind_customroad089",
"ind_customroad090",
"ind_customroad091",
"ind_customroad093",
"ind_customroad094",
"ind_customroad095",
"ind_customroad096",
"ind_customroad097",
"ind_customroad098",
"ind_customroad099",
"ind_customroad0bb",
"indatree03",
"indtreepatch5",
"indhelix_barrier",
"indjunk",
"indtreepatch06f",
"indtreepatch5",
"iten_washline01",
"kmricndo01",
"kmricndo02",
"lhouse_barrier1",
"lhouse_barrier2",
"lhouse_barrier3",
"mak_billboard",
"mak_billboardsrvc",
"mscp_barrier",
"mscp_barrier01",
"mscp_barriersup",
"nbbridgerda",
"nbbridgerdb",
"new_carprktrees",
"new_carprktrees4",
"newairportwall1",
"newairportwall2",
"newairportwall3",
"newairportwall4",
"newairportwall5",
"newairportwall6",
"newcoasttrees1",
"newcoasttrees2",
"newcoasttrees3",
"newtreepatch_sub",
"newtrees1_sub",
"newunitrepatch",
"nrailsteps",
"nrailstepswest",
"overpassind",
"pinetree_narrow",
"pinetree_wide",
"plnt_chimgrad",
"plnt_pipepart01",
"plnt_pipjoin4way04",
"plnt_pylon01",
"rd_Road1A10",
"salvsdetail",
"salvstrans",
"skyscrapenew",
"skyscrpunbuilt2",
"sub_billboard1",
"sub_tripbboard",
"subfraightback02",
"subfraightback03",
"subfraightback04",
"subsign1",
"tall_fence",
"tcsky_skyscrp6",
"telepole",
"telepole01",
"telepole02",
"telepole03",
"telepole04",
"tenkb_builds01",
"tenkb_builds03",
"tenkb_builds04",
"tenkb_builds05",
"tenkb_builds06",
"tenkb_builds11",
"trainstairst",
"treencom2",
"treepatch",
"treepatch01_sub",
"treepatch02_sub",
"treepatch2",
"treepatch2b",
"treepatch03",
"treepatch03_sub",
"treepatch04_sub",
@ -712,12 +974,21 @@ char *TreeNames[] = {
"treepatch12_sub",
"treepatch13_sub",
"treepatch14_sub",
"treepatch152_sub",
"treepatch153_sub",
"treepatch15_sub",
"treepatch16_sub",
"treepatch171_sub",
"treepatch172_sub",
"treepatch173_sub",
"treepatch17_sub",
"treepatch18_sub",
"treepatch19_sub",
"treepatch2",
"treepatch20_sub",
"treepatch212_sub",
"treepatch213_sub",
"treepatch214_sub",
"treepatch21_sub",
"treepatch22_sub",
"treepatch23_sub",
@ -727,6 +998,7 @@ char *TreeNames[] = {
"treepatch27_sub",
"treepatch28_sub",
"treepatch29_sub",
"treepatch2b",
"treepatch30_sub",
"treepatch31_sub",
"treepatch32_sub",
@ -734,14 +1006,6 @@ char *TreeNames[] = {
"treepatch34_sub",
"treepatch35_sub",
"treepatch69",
"treepatch152_sub",
"treepatch153_sub",
"treepatch171_sub",
"treepatch172_sub",
"treepatch173_sub",
"treepatch212_sub",
"treepatch213_sub",
"treepatch214_sub",
"treepatcha",
"treepatchb",
"treepatchcomtop1",
@ -763,8 +1027,8 @@ char *TreeNames[] = {
"treepatchttwrs",
"treesuni1",
"trepatchindaa1",
"veg_bush2",
"veg_bush14",
"veg_bush2",
"veg_tree1",
"veg_tree3",
"veg_treea1",
@ -783,6 +1047,7 @@ char *TreeNames[] = {
"vegclubtree02",
"vegclubtree03",
"vegpathtree",
"wlst_skyscrp1",
""
};
char *OptimizedNames[] = {

View file

@ -155,7 +155,7 @@ void RestoreDefDisplay(int8 action) {
CMenuManager::m_PrefsCutsceneBorders = true;
#endif
#ifdef FREE_CAM
TheCamera.bFreeCam = false;
TheCamera.bFreeCam = true;
#endif
#ifdef PED_CAR_DENSITY_SLIDERS
CIniFile::PedNumberMultiplier = 0.6f;

View file

@ -1214,8 +1214,9 @@ CStreaming::RemoveReferencedTxds(size_t mem)
CStreamingInfo *si;
int streamId;
for(si = ms_endLoadedList.m_prev; si != &ms_startLoadedList; si = si->m_prev){
for(si = ms_endLoadedList.m_prev; si != &ms_startLoadedList; ){
streamId = si - ms_aInfoForModel;
si = si->m_prev;
if(streamId >= STREAM_OFFSET_TXD &&
CTxdStore::GetNumRefs(streamId-STREAM_OFFSET_TXD) == 0){
RemoveModel(streamId);

View file

@ -370,7 +370,7 @@ enum Config {
# ifdef CUSTOM_FRONTEND_OPTIONS
# define MENU_MAP // VC-like menu map. Won't appear if you don't have our menu.txd
# 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 // add bInvertLook4Pad from VC

View file

@ -38,6 +38,14 @@ CBaseModelInfo::DeleteCollisionModel(void)
}
}
void CBaseModelInfo::SetColModel(CColModel *col, bool owns) {
if (m_bOwnsColModel) {
delete m_colModel;
}
m_colModel = col;
m_bOwnsColModel = owns;
}
void
CBaseModelInfo::AddRef(void)
{

View file

@ -56,8 +56,7 @@ public:
}
char *GetModelName(void) { return m_name; }
void SetModelName(const char *name) { strncpy(m_name, name, MAX_MODEL_NAME); }
void SetColModel(CColModel *col, bool owns = false){
m_colModel = col; m_bOwnsColModel = owns; }
void SetColModel(CColModel *col, bool owns = false);
CColModel *GetColModel(void) { return m_colModel; }
bool DoesOwnColModel(void) { return m_bOwnsColModel; }
void DeleteCollisionModel(void);

View file

@ -94,7 +94,9 @@ CCutsceneHead::ProcessControl(void)
// PS2 only plays anims in cutscene, PC always plays anims
if(!lastLoadedSKA || CCutsceneMgr::IsRunning())
#endif
if (hier) {
RpHAnimHierarchyAddAnimTime(hier, CTimer::GetTimeStepNonClippedInSeconds());
}
}
void
@ -195,6 +197,10 @@ CCutsceneHead::PlayAnimation(const char *animName)
RwStreamSkip(stream, offset*2048);
if(RwStreamFindChunk(stream, rwID_HANIMANIMATION, nil, nil)){
anim = RpHAnimAnimationStreamRead(stream);
if (hier->interpolator->currentAnim) {
RpHAnimAnimationDestroy(hier->interpolator->currentAnim);
hier->interpolator->currentAnim = nil;
}
RpHAnimHierarchySetCurrentAnim(hier, anim);
}

View file

@ -218,7 +218,7 @@ CAutomobile::SetModelIndex(uint32 id)
CVector vecDAMAGE_ENGINE_POS_SMALL(-0.1f, -0.1f, 0.0f);
CVector vecDAMAGE_ENGINE_POS_BIG(-0.5f, -0.3f, 0.0f);
#pragma optimize("", off) // that's what R* did
//#pragma optimize("", off) // that's what R* did
void
CAutomobile::ProcessControl(void)
@ -1222,7 +1222,7 @@ CAutomobile::ProcessControl(void)
}
}
#pragma optimize("", on)
//#pragma optimize("", on)
void
CAutomobile::Teleport(CVector pos)

View file

@ -134,7 +134,10 @@ HAnimHierarchy::getIndex(Frame *f)
HAnimHierarchy*
HAnimHierarchy::get(Frame *f)
{
if (f)
return HAnimData::get(f)->hierarchy;
else
return nil;
}
HAnimHierarchy*