diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp index 53eb7cb..1d074f8 100644 --- a/src/core/Cam.cpp +++ b/src/core/Cam.cpp @@ -30,7 +30,7 @@ bool PrintDebugCode = false; int16 DebugCamMode; #ifdef FREE_CAM -bool CCamera::bFreeCam = false; +bool CCamera::bFreeCam = true; int nPreviousMode = -1; #endif diff --git a/src/core/FileLoader.cpp b/src/core/FileLoader.cpp index a93ac7d..e41a75c 100644 --- a/src/core/FileLoader.cpp +++ b/src/core/FileLoader.cpp @@ -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,118 +671,383 @@ 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[] = { - "coast_treepatch", - "comparknewtrees", - "comtreepatchprk", - "condotree01", - "condotree1", - "indatree03", - "indtreepatch5", - "indtreepatch06f", - "new_carprktrees", - "new_carprktrees4", - "newcoasttrees1", - "newcoasttrees2", - "newcoasttrees3", - "newtreepatch_sub", - "newtrees1_sub", - "newunitrepatch", - "pinetree_narrow", - "pinetree_wide", - "treencom2", - "treepatch", - "treepatch01_sub", - "treepatch02_sub", - "treepatch2", - "treepatch2b", - "treepatch03", - "treepatch03_sub", - "treepatch04_sub", - "treepatch05_sub", - "treepatch06_sub", - "treepatch07_sub", - "treepatch08_sub", - "treepatch09_sub", - "treepatch10_sub", - "treepatch11_sub", - "treepatch12_sub", - "treepatch13_sub", - "treepatch14_sub", - "treepatch15_sub", - "treepatch16_sub", - "treepatch17_sub", - "treepatch18_sub", - "treepatch19_sub", - "treepatch20_sub", - "treepatch21_sub", - "treepatch22_sub", - "treepatch23_sub", - "treepatch24_sub", - "treepatch25_sub", - "treepatch26_sub", - "treepatch27_sub", - "treepatch28_sub", - "treepatch29_sub", - "treepatch30_sub", - "treepatch31_sub", - "treepatch32_sub", - "treepatch33_sub", - "treepatch34_sub", - "treepatch35_sub", - "treepatch69", - "treepatch152_sub", - "treepatch153_sub", - "treepatch171_sub", - "treepatch172_sub", - "treepatch173_sub", - "treepatch212_sub", - "treepatch213_sub", - "treepatch214_sub", - "treepatcha", - "treepatchb", - "treepatchcomtop1", - "treepatchd", - "treepatche", - "treepatchh", - "treepatchindaa2", - "treepatchindnew", - "treepatchindnew2", - "treepatchk", - "treepatchkb4", - "treepatchkb5", - "treepatchkb6", - "treepatchkb7", - "treepatchkb9", - "treepatchl", - "treepatchm", - "treepatchnew_sub", - "treepatchttwrs", - "treesuni1", - "trepatchindaa1", - "veg_bush2", - "veg_bush14", - "veg_tree1", - "veg_tree3", - "veg_treea1", - "veg_treea3", - "veg_treeb1", - "veg_treenew01", - "veg_treenew03", - "veg_treenew05", - "veg_treenew06", - "veg_treenew08", - "veg_treenew09", - "veg_treenew10", - "veg_treenew16", - "veg_treenew17", - "vegclubtree01", - "vegclubtree02", - "vegclubtree03", - "vegpathtree", + "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", + "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", + "treepatch03", + "treepatch03_sub", + "treepatch04_sub", + "treepatch05_sub", + "treepatch06_sub", + "treepatch07_sub", + "treepatch08_sub", + "treepatch09_sub", + "treepatch10_sub", + "treepatch11_sub", + "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", + "treepatch24_sub", + "treepatch25_sub", + "treepatch26_sub", + "treepatch27_sub", + "treepatch28_sub", + "treepatch29_sub", + "treepatch2b", + "treepatch30_sub", + "treepatch31_sub", + "treepatch32_sub", + "treepatch33_sub", + "treepatch34_sub", + "treepatch35_sub", + "treepatch69", + "treepatcha", + "treepatchb", + "treepatchcomtop1", + "treepatchd", + "treepatche", + "treepatchh", + "treepatchindaa2", + "treepatchindnew", + "treepatchindnew2", + "treepatchk", + "treepatchkb4", + "treepatchkb5", + "treepatchkb6", + "treepatchkb7", + "treepatchkb9", + "treepatchl", + "treepatchm", + "treepatchnew_sub", + "treepatchttwrs", + "treesuni1", + "trepatchindaa1", + "veg_bush14", + "veg_bush2", + "veg_tree1", + "veg_tree3", + "veg_treea1", + "veg_treea3", + "veg_treeb1", + "veg_treenew01", + "veg_treenew03", + "veg_treenew05", + "veg_treenew06", + "veg_treenew08", + "veg_treenew09", + "veg_treenew10", + "veg_treenew16", + "veg_treenew17", + "vegclubtree01", + "vegclubtree02", + "vegclubtree03", + "vegpathtree", + "wlst_skyscrp1", "" }; char *OptimizedNames[] = { diff --git a/src/core/MenuScreensCustom.cpp b/src/core/MenuScreensCustom.cpp index fa7e859..043785a 100644 --- a/src/core/MenuScreensCustom.cpp +++ b/src/core/MenuScreensCustom.cpp @@ -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; diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp index 8097c5d..4a7fbd7 100644 --- a/src/core/Streaming.cpp +++ b/src/core/Streaming.cpp @@ -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); diff --git a/src/core/config.h b/src/core/config.h index 7b476f4..b3514a8 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -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 diff --git a/src/modelinfo/BaseModelInfo.cpp b/src/modelinfo/BaseModelInfo.cpp index 7137c60..f48a580 100644 --- a/src/modelinfo/BaseModelInfo.cpp +++ b/src/modelinfo/BaseModelInfo.cpp @@ -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) { diff --git a/src/modelinfo/BaseModelInfo.h b/src/modelinfo/BaseModelInfo.h index f46cea8..98b57b2 100644 --- a/src/modelinfo/BaseModelInfo.h +++ b/src/modelinfo/BaseModelInfo.h @@ -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); diff --git a/src/objects/CutsceneHead.cpp b/src/objects/CutsceneHead.cpp index 19b3a59..a22b53d 100644 --- a/src/objects/CutsceneHead.cpp +++ b/src/objects/CutsceneHead.cpp @@ -94,7 +94,9 @@ CCutsceneHead::ProcessControl(void) // PS2 only plays anims in cutscene, PC always plays anims if(!lastLoadedSKA || CCutsceneMgr::IsRunning()) #endif - RpHAnimHierarchyAddAnimTime(hier, CTimer::GetTimeStepNonClippedInSeconds()); + 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); } diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp index 417dd14..7d2396d 100644 --- a/src/vehicles/Automobile.cpp +++ b/src/vehicles/Automobile.cpp @@ -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) diff --git a/vendor/librw/src/hanim.cpp b/vendor/librw/src/hanim.cpp index 6bc7c5e..b46d3e5 100644 --- a/vendor/librw/src/hanim.cpp +++ b/vendor/librw/src/hanim.cpp @@ -134,7 +134,10 @@ HAnimHierarchy::getIndex(Frame *f) HAnimHierarchy* HAnimHierarchy::get(Frame *f) { - return HAnimData::get(f)->hierarchy; + if (f) + return HAnimData::get(f)->hierarchy; + else + return nil; } HAnimHierarchy*