rs_new migration & link CScriptCameraWaypoint, CScriptActorKeyframe

Former-commit-id: 6f33908f35925bdf5807507701c717c5ad69e046
This commit is contained in:
Luke Street 2023-10-12 17:52:29 -04:00
parent fcc8b0b8e7
commit 7e364e92a5
62 changed files with 311 additions and 320 deletions

View File

@ -863,11 +863,11 @@ IDFromFactory__FR11CResFactoryPCc = .text:0x80036D58; // type:function size:0x30
__nw__29TOneStatic<15CTweakSlideShow>FUlPCcPCc = .text:0x80036D88; // type:function size:0x30 scope:global __nw__29TOneStatic<15CTweakSlideShow>FUlPCcPCc = .text:0x80036D88; // type:function size:0x30 scope:global
GetAllocSpace__29TOneStatic<15CTweakSlideShow>Fv = .text:0x80036DB8; // type:function size:0xC scope:global GetAllocSpace__29TOneStatic<15CTweakSlideShow>Fv = .text:0x80036DB8; // type:function size:0xC scope:global
ReferenceCount__29TOneStatic<15CTweakSlideShow>Fv = .text:0x80036DC4; // type:function size:0x24 scope:global ReferenceCount__29TOneStatic<15CTweakSlideShow>Fv = .text:0x80036DC4; // type:function size:0x24 scope:global
fn_80036DE8 = .text:0x80036DE8; // type:function size:0x30 __nw__29TOneStatic<15CTweakPlayerRes>FUlPCcPCc = .text:0x80036DE8; // type:function size:0x30
fn_80036E18 = .text:0x80036E18; // type:function size:0xC GetAllocSpace__29TOneStatic<15CTweakPlayerRes>Fv = .text:0x80036E18; // type:function size:0xC
ReferenceCount__29TOneStatic<15CTweakPlayerRes>Fv = .text:0x80036E24; // type:function size:0x24 scope:global ReferenceCount__29TOneStatic<15CTweakPlayerRes>Fv = .text:0x80036E24; // type:function size:0x24 scope:global
fn_80036E48 = .text:0x80036E48; // type:function size:0x30 __nw__26TOneStatic<12CTweakGunRes>FUlPCcPCc = .text:0x80036E48; // type:function size:0x30
fn_80036E78 = .text:0x80036E78; // type:function size:0xC GetAllocSpace__26TOneStatic<12CTweakGunRes>Fv = .text:0x80036E78; // type:function size:0xC
ReferenceCount__26TOneStatic<12CTweakGunRes>Fv = .text:0x80036E84; // type:function size:0x24 scope:global ReferenceCount__26TOneStatic<12CTweakGunRes>Fv = .text:0x80036E84; // type:function size:0x24 scope:global
__nw__30TOneStatic<16CTweakAutoMapper>FUlPCcPCc = .text:0x80036EA8; // type:function size:0x30 scope:global __nw__30TOneStatic<16CTweakAutoMapper>FUlPCcPCc = .text:0x80036EA8; // type:function size:0x30 scope:global
GetAllocSpace__30TOneStatic<16CTweakAutoMapper>Fv = .text:0x80036ED8; // type:function size:0xC scope:global GetAllocSpace__30TOneStatic<16CTweakAutoMapper>Fv = .text:0x80036ED8; // type:function size:0xC scope:global
@ -2057,7 +2057,7 @@ IncrPickUp__12CPlayerStateFQ212CPlayerState9EItemTypei = .text:0x80091BF0; // ty
ResetAndIncrPickUp__12CPlayerStateFQ212CPlayerState9EItemTypei = .text:0x80091D00; // type:function size:0x30 scope:global ResetAndIncrPickUp__12CPlayerStateFQ212CPlayerState9EItemTypei = .text:0x80091D00; // type:function size:0x30 scope:global
CalculateHealth__12CPlayerStateFv = .text:0x80091D30; // type:function size:0x38 scope:global CalculateHealth__12CPlayerStateFv = .text:0x80091D30; // type:function size:0x38 scope:global
InitializePowerUp__12CPlayerStateFQ212CPlayerState9EItemTypei = .text:0x80091D68; // type:function size:0x124 scope:global InitializePowerUp__12CPlayerStateFQ212CPlayerState9EItemTypei = .text:0x80091D68; // type:function size:0x124 scope:global
ReInitializePowerUp__12CPlayerStateFQ212CPlayerState9EItemTypei = .text:0x80091E8C; // type:function size:0x30 scope:global SetPowerUp__12CPlayerStateFQ212CPlayerState9EItemTypei = .text:0x80091E8C; // type:function size:0x30 scope:global
PutTo__12CPlayerStateFR13COutputStream = .text:0x80091EBC; // type:function size:0x16C scope:global PutTo__12CPlayerStateFR13COutputStream = .text:0x80091EBC; // type:function size:0x16C scope:global
__ct__12CPlayerStateFR12CInputStream = .text:0x80092028; // type:function size:0x2A0 scope:global __ct__12CPlayerStateFR12CInputStream = .text:0x80092028; // type:function size:0x2A0 scope:global
__ct__12CPlayerStateFv = .text:0x800922C8; // type:function size:0xEC scope:global __ct__12CPlayerStateFv = .text:0x800922C8; // type:function size:0xEC scope:global
@ -5555,7 +5555,7 @@ reserve__Q24rstl71vector<Q24rstl27pair<9TUniqueId,9TEditorId>,Q24rstl17rmemory_a
Accept__21CScriptCameraWaypointFR8IVisitor = .text:0x800B51C8; // type:function size:0x38 scope:global Accept__21CScriptCameraWaypointFR8IVisitor = .text:0x800B51C8; // type:function size:0x38 scope:global
Render__21CScriptCameraWaypointCFRC13CStateManager = .text:0x800B5200; // type:function size:0x4 scope:global Render__21CScriptCameraWaypointCFRC13CStateManager = .text:0x800B5200; // type:function size:0x4 scope:global
AddToRenderer__21CScriptCameraWaypointCFRC14CFrustumPlanesRC13CStateManager = .text:0x800B5204; // type:function size:0x4 scope:global AddToRenderer__21CScriptCameraWaypointCFRC14CFrustumPlanesRC13CStateManager = .text:0x800B5204; // type:function size:0x4 scope:global
GetRandomNextWaypointId__21CScriptCameraWaypointCFRC13CStateManager = .text:0x800B5208; // type:function size:0x1B8 scope:global NextWaypoint__21CScriptCameraWaypointFR13CStateManager = .text:0x800B5208; // type:function size:0x1B8 scope:global
AcceptScriptMsg__21CScriptCameraWaypointF20EScriptObjectMessage9TUniqueIdR13CStateManager = .text:0x800B53C0; // type:function size:0x7C scope:global AcceptScriptMsg__21CScriptCameraWaypointF20EScriptObjectMessage9TUniqueIdR13CStateManager = .text:0x800B53C0; // type:function size:0x7C scope:global
__dt__21CScriptCameraWaypointFv = .text:0x800B543C; // type:function size:0x60 scope:global __dt__21CScriptCameraWaypointFv = .text:0x800B543C; // type:function size:0x60 scope:global
__ct__21CScriptCameraWaypointF9TUniqueIdRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>RC11CEntityInfoRC12CTransform4fbfUi = .text:0x800B549C; // type:function size:0x104 scope:global __ct__21CScriptCameraWaypointF9TUniqueIdRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>RC11CEntityInfoRC12CTransform4fbfUi = .text:0x800B549C; // type:function size:0x104 scope:global
@ -17752,7 +17752,7 @@ lbl_803D69E0 = .rodata:0x803D69E0; // type:object size:0x8
lbl_803D69E8 = .rodata:0x803D69E8; // type:object size:0x18 lbl_803D69E8 = .rodata:0x803D69E8; // type:object size:0x18
@stringBase0 = .rodata:0x803D6A00; // type:object size:0x1C scope:local data:string_table @stringBase0 = .rodata:0x803D6A00; // type:object size:0x1C scope:local data:string_table
lbl_803D6A20 = .rodata:0x803D6A20; // type:object size:0x28 lbl_803D6A20 = .rodata:0x803D6A20; // type:object size:0x28
lbl_803D6A48 = .rodata:0x803D6A48; // type:object size:0x8 @stringBase0 = .rodata:0x803D6A48; // type:object size:0x7 scope:local data:string_table
lbl_803D6A50 = .rodata:0x803D6A50; // type:object size:0xC data:4byte lbl_803D6A50 = .rodata:0x803D6A50; // type:object size:0xC data:4byte
lbl_803D6A5C = .rodata:0x803D6A5C; // type:object size:0xC data:4byte lbl_803D6A5C = .rodata:0x803D6A5C; // type:object size:0xC data:4byte
lbl_803D6A68 = .rodata:0x803D6A68; // type:object size:0x10 data:4byte lbl_803D6A68 = .rodata:0x803D6A68; // type:object size:0x10 data:4byte
@ -19216,7 +19216,11 @@ sPlaneObjectBucketHolder$4377 = .bss:0x80479154; // type:object size:0x18 scope:
sOptimalPlane$6479 = .bss:0x8047916C; // type:object size:0xC scope:local data:float sOptimalPlane$6479 = .bss:0x8047916C; // type:object size:0xC scope:local data:float
sAllocSpace$9000 = .bss:0x80479178; // type:object size:0x320 scope:local sAllocSpace$9000 = .bss:0x80479178; // type:object size:0x320 scope:local
normalTable = .bss:0x80479498; // type:object size:0x48 scope:local data:float normalTable = .bss:0x80479498; // type:object size:0x48 scope:local data:float
lbl_804794E0 = .bss:0x804794E0; // type:object size:0x30 ...bss.0 = .bss:0x804794E0; // type:label scope:local
@2493 = .bss:0x804794E0; // type:object size:0xC scope:local
@2494 = .bss:0x804794EC; // type:object size:0xC scope:local
@2495 = .bss:0x804794F8; // type:object size:0xC scope:local
@2496 = .bss:0x80479504; // type:object size:0xC scope:local
normalTable = .bss:0x80479510; // type:object size:0x48 scope:local data:float normalTable = .bss:0x80479510; // type:object size:0x48 scope:local data:float
normalTable = .bss:0x80479558; // type:object size:0x48 scope:local data:float normalTable = .bss:0x80479558; // type:object size:0x48 scope:local data:float
stringize_Buffer$11 = .bss:0x804795A0; // type:object size:0x200 scope:local stringize_Buffer$11 = .bss:0x804795A0; // type:object size:0x200 scope:local
@ -21798,19 +21802,19 @@ lbl_805A91F8 = .sbss:0x805A91F8; // type:object size:0x8 data:4byte
spGuiSys__7CGuiSys = .sbss:0x805A9200; // type:object size:0x4 scope:global data:4byte spGuiSys__7CGuiSys = .sbss:0x805A9200; // type:object size:0x4 scope:global data:4byte
gpExecBuf__15CGuiTextSupport = .sbss:0x805A9208; // type:object size:0x4 scope:global data:4byte gpExecBuf__15CGuiTextSupport = .sbss:0x805A9208; // type:object size:0x4 scope:global data:4byte
gpTextParser__15CGuiTextSupport = .sbss:0x805A920C; // type:object size:0x4 scope:global data:4byte gpTextParser__15CGuiTextSupport = .sbss:0x805A920C; // type:object size:0x4 scope:global data:4byte
lbl_805A9210 = .sbss:0x805A9210; // type:object size:0x4 data:4byte sNumTypes__19CCollisionPrimitive = .sbss:0x805A9210; // type:object size:0x4 scope:global data:4byte
lbl_805A9214 = .sbss:0x805A9214; // type:object size:0x1 data:byte sInitComplete__19CCollisionPrimitive = .sbss:0x805A9214; // type:object size:0x1 scope:global data:byte
lbl_805A9215 = .sbss:0x805A9215; // type:object size:0x1 data:byte sTypesAdded__19CCollisionPrimitive = .sbss:0x805A9215; // type:object size:0x1 scope:global data:byte
lbl_805A9216 = .sbss:0x805A9216; // type:object size:0x1 data:byte sTypesAdding__19CCollisionPrimitive = .sbss:0x805A9216; // type:object size:0x1 scope:global data:byte
lbl_805A9217 = .sbss:0x805A9217; // type:object size:0x1 data:byte sCollidersAdded__19CCollisionPrimitive = .sbss:0x805A9217; // type:object size:0x1 scope:global data:byte
lbl_805A9218 = .sbss:0x805A9218; // type:object size:0x1 data:byte sCollidersAdding__19CCollisionPrimitive = .sbss:0x805A9218; // type:object size:0x1 scope:global data:byte
lbl_805A921C = .sbss:0x805A921C; // type:object size:0x4 data:4byte sCollisionTypeList__19CCollisionPrimitive = .sbss:0x805A921C; // type:object size:0x4 scope:global data:4byte
lbl_805A9220 = .sbss:0x805A9220; // type:object size:0x4 data:4byte sTableOfCollidables__19CCollisionPrimitive = .sbss:0x805A9220; // type:object size:0x4 scope:global data:4byte
lbl_805A9224 = .sbss:0x805A9224; // type:object size:0x4 data:4byte sTableOfBooleanCollidables__19CCollisionPrimitive = .sbss:0x805A9224; // type:object size:0x4 scope:global data:4byte
lbl_805A9228 = .sbss:0x805A9228; // type:object size:0x4 data:4byte sTableOfMovingCollidables__19CCollisionPrimitive = .sbss:0x805A9228; // type:object size:0x4 scope:global data:4byte
lbl_805A922C = .sbss:0x805A922C; // type:object size:0x4 data:4byte sNullCollider = .sbss:0x805A922C; // type:object size:0x4 scope:local data:4byte
lbl_805A9230 = .sbss:0x805A9230; // type:object size:0x4 data:4byte sNullBooleanCollider = .sbss:0x805A9230; // type:object size:0x4 scope:local data:4byte
lbl_805A9234 = .sbss:0x805A9234; // type:object size:0x4 data:4byte sNullMovingCollider = .sbss:0x805A9234; // type:object size:0x4 scope:local data:4byte
mGlobalTimer__10CStopwatch = .sbss:0x805A9238; // type:object size:0x8 scope:global data:4byte mGlobalTimer__10CStopwatch = .sbss:0x805A9238; // type:object size:0x8 scope:global data:4byte
gInitialized = .sbss:0x805A9240; // type:object size:0x1 scope:local data:byte gInitialized = .sbss:0x805A9240; // type:object size:0x1 scope:local data:byte
CallFatal = .sbss:0x805A9248; // type:object size:0x1 scope:local data:byte CallFatal = .sbss:0x805A9248; // type:object size:0x1 scope:local data:byte

View File

@ -863,11 +863,11 @@ IDFromFactory__FR11CResFactoryPCc = .text:0x80036DD4; // type:function size:0x30
__nw__29TOneStatic<15CTweakSlideShow>FUlPCcPCc = .text:0x80036E04; // type:function size:0x30 scope:global __nw__29TOneStatic<15CTweakSlideShow>FUlPCcPCc = .text:0x80036E04; // type:function size:0x30 scope:global
GetAllocSpace__29TOneStatic<15CTweakSlideShow>FUlPCcPCc = .text:0x80036E34; // type:function size:0xC scope:global GetAllocSpace__29TOneStatic<15CTweakSlideShow>FUlPCcPCc = .text:0x80036E34; // type:function size:0xC scope:global
ReferenceCount__29TOneStatic<15CTweakSlideShow>Fv = .text:0x80036E40; // type:function size:0x24 scope:global ReferenceCount__29TOneStatic<15CTweakSlideShow>Fv = .text:0x80036E40; // type:function size:0x24 scope:global
fn_80036DE8 = .text:0x80036E64; // type:function size:0x30 scope:global __nw__29TOneStatic<15CTweakPlayerRes>FUlPCcPCc = .text:0x80036E64; // type:function size:0x30 scope:global
fn_80036E18 = .text:0x80036E94; // type:function size:0xC scope:global GetAllocSpace__29TOneStatic<15CTweakPlayerRes>Fv = .text:0x80036E94; // type:function size:0xC scope:global
ReferenceCount__29TOneStatic<15CTweakPlayerRes>Fv = .text:0x80036EA0; // type:function size:0x24 scope:global ReferenceCount__29TOneStatic<15CTweakPlayerRes>Fv = .text:0x80036EA0; // type:function size:0x24 scope:global
fn_80036E48 = .text:0x80036EC4; // type:function size:0x30 scope:global __nw__26TOneStatic<12CTweakGunRes>FUlPCcPCc = .text:0x80036EC4; // type:function size:0x30 scope:global
fn_80036E78 = .text:0x80036EF4; // type:function size:0xC scope:global GetAllocSpace__26TOneStatic<12CTweakGunRes>Fv = .text:0x80036EF4; // type:function size:0xC scope:global
ReferenceCount__26TOneStatic<12CTweakGunRes>Fv = .text:0x80036F00; // type:function size:0x24 scope:global ReferenceCount__26TOneStatic<12CTweakGunRes>Fv = .text:0x80036F00; // type:function size:0x24 scope:global
__nw__30TOneStatic<16CTweakAutoMapper>FUlPCcPCc = .text:0x80036F24; // type:function size:0x30 scope:global __nw__30TOneStatic<16CTweakAutoMapper>FUlPCcPCc = .text:0x80036F24; // type:function size:0x30 scope:global
GetAllocSpace__30TOneStatic<16CTweakAutoMapper>Fv = .text:0x80036F54; // type:function size:0xC scope:global GetAllocSpace__30TOneStatic<16CTweakAutoMapper>Fv = .text:0x80036F54; // type:function size:0xC scope:global
@ -2057,7 +2057,7 @@ IncrPickUp__12CPlayerStateFQ212CPlayerState9EItemTypei = .text:0x80091C6C; // ty
ResetAndIncrPickUp__12CPlayerStateFQ212CPlayerState9EItemTypei = .text:0x80091D7C; // type:function size:0x30 scope:global ResetAndIncrPickUp__12CPlayerStateFQ212CPlayerState9EItemTypei = .text:0x80091D7C; // type:function size:0x30 scope:global
CalculateHealth__12CPlayerStateFv = .text:0x80091DAC; // type:function size:0x38 scope:global CalculateHealth__12CPlayerStateFv = .text:0x80091DAC; // type:function size:0x38 scope:global
InitializePowerUp__12CPlayerStateFQ212CPlayerState9EItemTypei = .text:0x80091DE4; // type:function size:0x124 scope:global InitializePowerUp__12CPlayerStateFQ212CPlayerState9EItemTypei = .text:0x80091DE4; // type:function size:0x124 scope:global
ReInitializePowerUp__12CPlayerStateFQ212CPlayerState9EItemTypei = .text:0x80091F08; // type:function size:0x30 scope:global SetPowerUp__12CPlayerStateFQ212CPlayerState9EItemTypei = .text:0x80091F08; // type:function size:0x30 scope:global
PutTo__12CPlayerStateFR13COutputStream = .text:0x80091F38; // type:function size:0x16C scope:global PutTo__12CPlayerStateFR13COutputStream = .text:0x80091F38; // type:function size:0x16C scope:global
__ct__12CPlayerStateFR12CInputStream = .text:0x800920A4; // type:function size:0x2A0 scope:global __ct__12CPlayerStateFR12CInputStream = .text:0x800920A4; // type:function size:0x2A0 scope:global
__ct__12CPlayerStateFv = .text:0x80092344; // type:function size:0xEC scope:global __ct__12CPlayerStateFv = .text:0x80092344; // type:function size:0xEC scope:global
@ -5557,7 +5557,7 @@ reserve__Q24rstl71vector<Q24rstl27pair<9TUniqueId,9TEditorId>,Q24rstl17rmemory_a
Accept__21CScriptCameraWaypointFR8IVisitor = .text:0x800B5244; // type:function size:0x38 scope:global Accept__21CScriptCameraWaypointFR8IVisitor = .text:0x800B5244; // type:function size:0x38 scope:global
Render__21CScriptCameraWaypointCFRC13CStateManager = .text:0x800B527C; // type:function size:0x4 scope:global Render__21CScriptCameraWaypointCFRC13CStateManager = .text:0x800B527C; // type:function size:0x4 scope:global
AddToRenderer__21CScriptCameraWaypointCFRC14CFrustumPlanesRC13CStateManager = .text:0x800B5280; // type:function size:0x4 scope:global AddToRenderer__21CScriptCameraWaypointCFRC14CFrustumPlanesRC13CStateManager = .text:0x800B5280; // type:function size:0x4 scope:global
GetRandomNextWaypointId__21CScriptCameraWaypointCFRC13CStateManager = .text:0x800B5284; // type:function size:0x1B8 scope:global NextWaypoint__21CScriptCameraWaypointFR13CStateManager = .text:0x800B5284; // type:function size:0x1B8 scope:global
AcceptScriptMsg__21CScriptCameraWaypointF20EScriptObjectMessage9TUniqueIdR13CStateManager = .text:0x800B543C; // type:function size:0x7C scope:global AcceptScriptMsg__21CScriptCameraWaypointF20EScriptObjectMessage9TUniqueIdR13CStateManager = .text:0x800B543C; // type:function size:0x7C scope:global
__dt__21CScriptCameraWaypointFv = .text:0x800B54B8; // type:function size:0x60 scope:global __dt__21CScriptCameraWaypointFv = .text:0x800B54B8; // type:function size:0x60 scope:global
__ct__21CScriptCameraWaypointF9TUniqueIdRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>RC11CEntityInfoRC12CTransform4fbfUi = .text:0x800B5518; // type:function size:0x104 scope:global __ct__21CScriptCameraWaypointF9TUniqueIdRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>RC11CEntityInfoRC12CTransform4fbfUi = .text:0x800B5518; // type:function size:0x104 scope:global

View File

@ -334,7 +334,7 @@ config.libs = [
Object(NonMatching, "MetroidPrime/ScriptObjects/CScriptPlatform.cpp"), Object(NonMatching, "MetroidPrime/ScriptObjects/CScriptPlatform.cpp"),
Object(Matching, "MetroidPrime/UserNames.cpp"), Object(Matching, "MetroidPrime/UserNames.cpp"),
Object(NonMatching, "MetroidPrime/ScriptObjects/CScriptGenerator.cpp"), Object(NonMatching, "MetroidPrime/ScriptObjects/CScriptGenerator.cpp"),
Object(NonMatching, "MetroidPrime/ScriptObjects/CScriptCameraWaypoint.cpp"), Object(Matching, "MetroidPrime/ScriptObjects/CScriptCameraWaypoint.cpp"),
Object(Matching, "MetroidPrime/CGameLight.cpp"), Object(Matching, "MetroidPrime/CGameLight.cpp"),
Object(NonMatching, "MetroidPrime/Tweaks/CTweakTargeting.cpp"), Object(NonMatching, "MetroidPrime/Tweaks/CTweakTargeting.cpp"),
Object(Matching, "MetroidPrime/Tweaks/CTweakAutoMapper.cpp"), Object(Matching, "MetroidPrime/Tweaks/CTweakAutoMapper.cpp"),
@ -378,7 +378,7 @@ config.libs = [
), ),
Object(NonMatching, "MetroidPrime/ScriptObjects/CScriptDebris.cpp"), Object(NonMatching, "MetroidPrime/ScriptObjects/CScriptDebris.cpp"),
Object(Matching, "MetroidPrime/ScriptObjects/CScriptCameraShaker.cpp"), Object(Matching, "MetroidPrime/ScriptObjects/CScriptCameraShaker.cpp"),
Object(NonMatching, "MetroidPrime/ScriptObjects/CScriptActorKeyframe.cpp"), Object(Matching, "MetroidPrime/ScriptObjects/CScriptActorKeyframe.cpp"),
Object(NonMatching, "MetroidPrime/CConsoleOutputWindow.cpp"), Object(NonMatching, "MetroidPrime/CConsoleOutputWindow.cpp"),
Object(NonMatching, "MetroidPrime/ScriptObjects/CScriptWater.cpp"), Object(NonMatching, "MetroidPrime/ScriptObjects/CScriptWater.cpp"),
Object(NonMatching, "MetroidPrime/Weapons/CWeapon.cpp"), Object(NonMatching, "MetroidPrime/Weapons/CWeapon.cpp"),
@ -413,7 +413,7 @@ config.libs = [
Object(Matching, "MetroidPrime/ScriptObjects/CScriptGrapplePoint.cpp"), Object(Matching, "MetroidPrime/ScriptObjects/CScriptGrapplePoint.cpp"),
Object(NonMatching, "MetroidPrime/ScriptObjects/CHUDBillboardEffect.cpp"), Object(NonMatching, "MetroidPrime/ScriptObjects/CHUDBillboardEffect.cpp"),
Object(NonMatching, "MetroidPrime/Enemies/CFlickerBat.cpp"), Object(NonMatching, "MetroidPrime/Enemies/CFlickerBat.cpp"),
Object(NonMatching, "MetroidPrime/BodyState/CBodyStateCmdMgr.cpp"), Object(NonMatching, "MetroidPrime/BodyState/CBodyStateCmdMgr.cpp", cflags=[*cflags_retro, "-inline auto"]),
Object(NonMatching, "MetroidPrime/BodyState/CBodyStateInfo.cpp"), Object(NonMatching, "MetroidPrime/BodyState/CBodyStateInfo.cpp"),
Object(NonMatching, "MetroidPrime/BodyState/CBSAttack.cpp"), Object(NonMatching, "MetroidPrime/BodyState/CBSAttack.cpp"),
Object(Matching, "MetroidPrime/BodyState/CBSDie.cpp"), Object(Matching, "MetroidPrime/BodyState/CBSDie.cpp"),

View File

@ -24,21 +24,16 @@ public:
static void OffsetFakeStatics(int); static void OffsetFakeStatics(int);
}; };
#ifdef __MWERKS__
void* operator new(size_t sz, const char*, const char*);
void* operator new[](size_t sz, const char*, const char*);
#endif
// placement new // placement new
inline void* operator new(size_t n, void* ptr) { return ptr; }; inline void* operator new(size_t n, void* ptr) { return ptr; };
#ifdef __MWERKS__ #ifdef __MWERKS__
void* operator new(size_t sz, const char*, const char*);
void* operator new[](size_t sz, const char*, const char*);
inline void operator delete(void* ptr) { CMemory::Free(ptr); } inline void operator delete(void* ptr) { CMemory::Free(ptr); }
inline void operator delete[](void* ptr) { CMemory::Free(ptr); } inline void operator delete[](void* ptr) { CMemory::Free(ptr); }
#define rs_new new ("??(??)", nullptr) #define rs_new new ("??(??)", nullptr)
#else #else
__attribute__((weak)) void operator delete(void* ptr) { CMemory::Free(ptr); }
__attribute__((weak)) void operator delete[](void* ptr) { CMemory::Free(ptr); }
#define rs_new new #define rs_new new
#endif #endif

View File

@ -3,6 +3,7 @@
#include "types.h" #include "types.h"
#include "Kyoto/Alloc/CMemory.hpp"
#include "Kyoto/SObjectTag.hpp" #include "Kyoto/SObjectTag.hpp"
#include "rstl/auto_ptr.hpp" #include "rstl/auto_ptr.hpp"

View File

@ -30,7 +30,7 @@ private:
class CBCAdditiveFlinchCmd : public CBodyStateCmd { class CBCAdditiveFlinchCmd : public CBodyStateCmd {
public: public:
CBCAdditiveFlinchCmd(float f) : CBodyStateCmd(kBSC_AdditiveFlinch), x8_weight(f) {} CBCAdditiveFlinchCmd(float weight) : CBodyStateCmd(kBSC_AdditiveFlinch), x8_weight(weight) {}
float GetWeight() const { return x8_weight; } float GetWeight() const { return x8_weight; }
@ -74,23 +74,23 @@ private:
class CBCScriptedCmd : public CBodyStateCmd { class CBCScriptedCmd : public CBodyStateCmd {
public: public:
CBCScriptedCmd(int i, bool b1, bool b2, float f) CBCScriptedCmd(int animId, bool isLooped, bool useLoopDuration, float loopDuration)
: CBodyStateCmd(kBSC_Scripted) : CBodyStateCmd(kBSC_Scripted)
, x8_anim(i) , x8_animId(animId)
, xc_24_loopAnim(b1) , xc_24_isLooped(isLooped)
, xc_25_timedLoop(b2) , xc_25_useLoopDuration(useLoopDuration)
, x10_loopDur(f) {} , x10_loopDuration(loopDuration) {}
int GetAnimId() const { return x8_anim; } int GetAnimId() const { return x8_animId; }
bool IsLooped() const { return xc_24_loopAnim; } bool IsLooped() const { return xc_24_isLooped; }
bool GetUseLoopDuration() const { return xc_25_timedLoop; } bool GetUseLoopDuration() const { return xc_25_useLoopDuration; }
float GetLoopDuration() const { return x10_loopDur; } float GetLoopDuration() const { return x10_loopDuration; }
private: private:
int x8_anim; int x8_animId;
bool xc_24_loopAnim : 1; bool xc_24_isLooped : 1;
bool xc_25_timedLoop : 1; bool xc_25_useLoopDuration : 1;
float x10_loopDur; float x10_loopDuration;
}; };
// //
@ -399,29 +399,25 @@ public:
void ClearLocomotionCmds(); void ClearLocomotionCmds();
void DeliverCmd(const CBCLocomotionCmd& cmd); void DeliverCmd(const CBCLocomotionCmd& cmd);
void DeliverCmd(EBodyStateCmd cmd); void DeliverCmd(EBodyStateCmd cmd);
void DeliverCmd2(EBodyStateCmd cmd) {
xb4_deliveredCmdMask |= 1 << cmd;
}
void DeliverCmd(const CBodyStateCmd& cmd); void DeliverCmd(const CBodyStateCmd& cmd);
void DeliverCmd(const CBCGenerateCmd& cmd) { void DeliverCmd(const CBCGenerateCmd& cmd) {
DeliverCmd(kBSC_Generate); DeliverCmd(cmd.GetCommandId());
x18c_generate = cmd; x18c_generate = cmd;
} }
void DeliverCmd(const CBCKnockDownCmd& cmd) { void DeliverCmd(const CBCKnockDownCmd& cmd) {
DeliverCmd(kBSC_KnockDown); DeliverCmd(cmd.GetCommandId());
xdc_knockDown = cmd; xdc_knockDown = cmd;
} }
void DeliverCmd(const CBCScriptedCmd& cmd) {
DeliverCmd(kBSC_Scripted);
x21c_scripted = cmd;
}
void DeliverCmd(const CBCSlideCmd& cmd) { void DeliverCmd(const CBCSlideCmd& cmd) {
DeliverCmd(cmd.GetCommandId()); DeliverCmd(cmd.GetCommandId());
x1f8_slide = cmd; x1f8_slide = cmd;
} }
void DeliverCmd(const CBCScriptedCmd& cmd) {
DeliverCmd(cmd.GetCommandId());
x21c_scripted = cmd;
}
void DeliverCmd(const CBCAdditiveReactionCmd& cmd) { void DeliverCmd(const CBCAdditiveReactionCmd& cmd) {
DeliverCmd(cmd.GetCommandId()); DeliverCmd(cmd.GetCommandId());
x284_additiveReaction = cmd; x284_additiveReaction = cmd;
@ -437,6 +433,7 @@ public:
const CVector3f& GetFaceVector() const { return xc_face; } const CVector3f& GetFaceVector() const { return xc_face; }
const CVector3f& GetTargetVector() const { return x18_target; } const CVector3f& GetTargetVector() const { return x18_target; }
const CVector3f& GetAdditiveTargetVector() const { return x24_additiveTarget; } const CVector3f& GetAdditiveTargetVector() const { return x24_additiveTarget; }
private: private:
CVector3f x0_move; CVector3f x0_move;
CVector3f xc_face; CVector3f xc_face;

View File

@ -140,7 +140,7 @@ public:
float GetAdditiveAnimationWeight(uint idx); float GetAdditiveAnimationWeight(uint idx);
short GetDefaultAnimation() const { return x208_defaultAnim; } short GetCurrentAnimation() const { return x208_currentAnim; }
const CCharacterInfo& GetCharacterInfo() const { return xc_charInfo; } const CCharacterInfo& GetCharacterInfo() const { return xc_charInfo; }
// GetCharLayoutInfo__9CAnimDataCFv // GetCharLayoutInfo__9CAnimDataCFv
// GetDeltaRotation__9CAnimDataCFv // GetDeltaRotation__9CAnimDataCFv
@ -165,7 +165,6 @@ public:
// GetIceModel__9CAnimDataCFv // GetIceModel__9CAnimDataCFv
const CPASDatabase& GetPASDatabase() const { return xc_charInfo.GetPASDatabase(); } const CPASDatabase& GetPASDatabase() const { return xc_charInfo.GetPASDatabase(); }
// EnableLooping__9CAnimDataFb // EnableLooping__9CAnimDataFb
// GetCurrentAnimation__9CAnimDataCFv
// GetSkinnedModel__9CAnimDataCFv // GetSkinnedModel__9CAnimDataCFv
// GetXRayModel__9CAnimDataCFv // GetXRayModel__9CAnimDataCFv
// GetInfraModel__9CAnimDataCFv // GetInfraModel__9CAnimDataCFv
@ -203,7 +202,7 @@ private:
rstl::rc_ptr< CTransitionManager > x1fc_transMgr; rstl::rc_ptr< CTransitionManager > x1fc_transMgr;
float x200_speedScale; float x200_speedScale;
int x204_charIdx; int x204_charIdx;
short x208_defaultAnim; short x208_currentAnim;
short x20a_padding; short x20a_padding;
int x20c_passedBoolCount; int x20c_passedBoolCount;
int x210_passedIntCount; int x210_passedIntCount;

View File

@ -41,7 +41,7 @@ private:
EAnimationState x2d0_animState; EAnimationState x2d0_animState;
float x2d4_alertRange; float x2d4_alertRange;
float x2d8_impactRange; float x2d8_impactRange;
s32 x2dc_defaultAnim; s32 x2dc_currentAnim;
s32 x2e0_alertAnim; s32 x2e0_alertAnim;
s32 x2e4_impactAnim; s32 x2e4_impactAnim;
bool x2e8_24_dead : 1; bool x2e8_24_dead : 1;

View File

@ -250,7 +250,7 @@ public:
bool IsAlive() const { return x400_25_alive; } bool IsAlive() const { return x400_25_alive; }
void SetWasHit(bool v) { x400_24_hitByPlayerProjectile = v; } void SetWasHit(bool v) { x400_24_hitByPlayerProjectile = v; }
void SetPendingDeath(bool v) { x401_30_pendingDeath = v; } void SetPendingDeath(bool v) { x401_30_pendingDeath = v; }
CBodyController* GetBodyCtrl() { return x450_bodyController.get(); } CBodyController* BodyCtrl() { return x450_bodyController.get(); }
const CBodyController* GetBodyCtrl() const { return x450_bodyController.get(); } const CBodyController* GetBodyCtrl() const { return x450_bodyController.get(); }
CKnockBackController& GetKnockBackCtrl() { return x460_knockBackController; } CKnockBackController& GetKnockBackCtrl() { return x460_knockBackController; }
const CKnockBackController& GetKnockBackCtrl() const { return x460_knockBackController; } const CKnockBackController& GetKnockBackCtrl() const { return x460_knockBackController; }

View File

@ -134,12 +134,12 @@ public:
int GetItemAmount(EItemType type) const; int GetItemAmount(EItemType type) const;
void DecrPickUp(EItemType type, int amount); void DecrPickUp(EItemType type, int amount);
void IncrPickUp(EItemType type, int amount); void IncrPickUp(EItemType type, int amount);
void ResetAndIncrPickUp(EItemType type, int amount); void SetPickup(EItemType type, int amount);
static float GetEnergyTankCapacity(); static float GetEnergyTankCapacity();
static float GetBaseHealthCapacity(); static float GetBaseHealthCapacity();
float CalculateHealth(); float CalculateHealth();
void InitializePowerUp(CPlayerState::EItemType type, int capacity); void InitializePowerUp(CPlayerState::EItemType type, int capacity);
void ReInitializePowerUp(CPlayerState::EItemType type, int capacity); void SetPowerUp(CPlayerState::EItemType type, int capacity);
void InitializeScanTimes(); void InitializeScanTimes();

View File

@ -22,7 +22,7 @@ private:
float x38_initialLifetime; float x38_initialLifetime;
float x3c_playbackRate; float x3c_playbackRate;
float x40_lifetime; float x40_lifetime;
bool x44_24_looping : 1; bool x44_24_isLooped : 1;
bool x44_25_isPassive : 1; bool x44_25_isPassive : 1;
bool x44_26_fadeOut : 1; bool x44_26_fadeOut : 1;
bool x44_27_timedLoop : 1; bool x44_27_timedLoop : 1;

View File

@ -17,7 +17,7 @@ public:
void AddToRenderer(const CFrustumPlanes&, const CStateManager&) const override; void AddToRenderer(const CFrustumPlanes&, const CStateManager&) const override;
void Render(const CStateManager&) const override; void Render(const CStateManager&) const override;
TUniqueId GetRandomNextWaypointId(const CStateManager& mgr) const; TUniqueId NextWaypoint(CStateManager& mgr);
float GetHFov() const { return xe8_hfov; } float GetHFov() const { return xe8_hfov; }
}; };

View File

@ -9,6 +9,7 @@ namespace rstl {
struct rmemory_allocator { struct rmemory_allocator {
rmemory_allocator() {} rmemory_allocator() {}
rmemory_allocator(const rmemory_allocator&) {} rmemory_allocator(const rmemory_allocator&) {}
template < typename T > template < typename T >
static void allocate(T*& out, int count) { static void allocate(T*& out, int count) {
int size = count * sizeof(T); int size = count * sizeof(T);
@ -18,16 +19,7 @@ struct rmemory_allocator {
out = reinterpret_cast< T* >(rs_new uchar[size]); out = reinterpret_cast< T* >(rs_new uchar[size]);
} }
} }
// TODO: this fixes a regswap in vector::reserve
template < typename T >
static T* allocate2(int count) {
int size = count * sizeof(T);
if (size == 0) {
return nullptr;
} else {
return reinterpret_cast< T* >(rs_new uchar[size]);
}
}
template < typename T > template < typename T >
static void deallocate(T* ptr) { static void deallocate(T* ptr) {
if (ptr != nullptr) { if (ptr != nullptr) {

View File

@ -17,7 +17,7 @@ public:
T* operator->() { return x0_ptr; } T* operator->() { return x0_ptr; }
const T* operator->() const { return x0_ptr; } const T* operator->() const { return x0_ptr; }
single_ptr(const single_ptr& other) : x0_ptr(other.x0_ptr) { other.x0_ptr = nullptr; } single_ptr(const single_ptr& other) : x0_ptr(other.x0_ptr) { other.x0_ptr = nullptr; }
single_ptr& operator=(T* ptr) { single_ptr& operator=(T* const ptr) {
delete x0_ptr; delete x0_ptr;
x0_ptr = ptr; x0_ptr = ptr;
return *this; return *this;

View File

@ -29,7 +29,7 @@ class basic_string {
void internal_prepare_to_write(int len, bool); void internal_prepare_to_write(int len, bool);
void internal_allocate(int size); void internal_allocate(int size);
// { // {
// x4_cow = reinterpret_cast<COWData*>(new uchar[size * sizeof(_CharTp) + // x4_cow = reinterpret_cast<COWData*>(rs_new uchar[size * sizeof(_CharTp) +
// 8]); x0_ptr = x4_cow->x8_data; x4_cow->x0_capacity = uint(size); // 8]); x0_ptr = x4_cow->x8_data; x4_cow->x0_capacity = uint(size);
// x4_cow->x4_refCount = 1; // x4_cow->x4_refCount = 1;
// } // }

View File

@ -42,7 +42,8 @@ public:
const_iterator begin() const { return const_iterator(xc_items); } const_iterator begin() const { return const_iterator(xc_items); }
iterator end() { return iterator(xc_items + x4_count); } iterator end() { return iterator(xc_items + x4_count); }
const_iterator end() const { return const_iterator(xc_items + x4_count); } const_iterator end() const { return const_iterator(xc_items + x4_count); }
vector() : x4_count(0), x8_capacity(0), xc_items(NULL) {} vector(const Alloc& alloc = Alloc())
: x0_allocator(alloc), x4_count(0), x8_capacity(0), xc_items(nullptr) {}
vector(int count) : x4_count(0), x8_capacity(0), xc_items(0) { reserve(count); } vector(int count) : x4_count(0), x8_capacity(0), xc_items(0) { reserve(count); }
vector(int count, const T& v) : x4_count(count), x8_capacity(count) { vector(int count, const T& v) : x4_count(count), x8_capacity(count) {
x0_allocator.allocate(xc_items, x4_count); x0_allocator.allocate(xc_items, x4_count);
@ -127,7 +128,8 @@ void vector< T, Alloc >::reserve(int newSize) {
if (newSize <= x8_capacity) { if (newSize <= x8_capacity) {
return; return;
} }
T* newData = x0_allocator.template allocate2< T >(newSize); T* newData;
x0_allocator.allocate(newData, newSize);
uninitialized_copy(begin(), end(), newData); uninitialized_copy(begin(), end(), newData);
destroy(xc_items, xc_items + x4_count); destroy(xc_items, xc_items + x4_count);
x0_allocator.deallocate(xc_items); x0_allocator.deallocate(xc_items);

View File

@ -17,7 +17,7 @@ rstl::single_ptr< MovingComparisonFunc > CCollisionPrimitive::sTableOfMovingColl
CCollisionPrimitive::CCollisionPrimitive(const CMaterialList& list) : x8_material(list) {} CCollisionPrimitive::CCollisionPrimitive(const CMaterialList& list) : x8_material(list) {}
void CCollisionPrimitive::InitBeginTypes() { void CCollisionPrimitive::InitBeginTypes() {
sCollisionTypeList = new rstl::vector< Type >(); sCollisionTypeList = rs_new rstl::vector< Type >();
sCollisionTypeList->reserve(3); sCollisionTypeList->reserve(3);
sTypesAdding = true; sTypesAdding = true;
InternalColliders::AddTypes(); InternalColliders::AddTypes();

View File

@ -36,5 +36,5 @@ CFactoryFnReturn::CFactoryFnReturn(CAudioGrpSetLoc* ptr)
CFactoryFnReturn FAudioGroupSetLocDataFactory(const SObjectTag& tag, CFactoryFnReturn FAudioGroupSetLocDataFactory(const SObjectTag& tag,
const rstl::auto_ptr< uchar >& data, int length, const rstl::auto_ptr< uchar >& data, int length,
const CVParamTransfer& xfer) { const CVParamTransfer& xfer) {
return new CAudioGrpSetLoc(data, length); return rs_new CAudioGrpSetLoc(data, length);
} }

View File

@ -22,7 +22,7 @@ bool CAudioSys::mProLogic2 = true;
const rstl::string CAudioSys::mpDefaultInvalidString(rstl::string_l("NULL")); const rstl::string CAudioSys::mpDefaultInvalidString(rstl::string_l("NULL"));
void* DoMalloc(u32 len) { return new char[len]; } void* DoMalloc(u32 len) { return rs_new char[len]; }
void DoFree(void* ptr) { void DoFree(void* ptr) {
if (!ptr) { if (!ptr) {
@ -44,11 +44,11 @@ CAudioSys::CAudioSys(char numVoices, char numMusic, char numSfx, char maxNumEmit
} }
DTKInit(); DTKInit();
mpGroupSetDB = new rstl::map< rstl::string, rstl::ncrc_ptr< CAudioGroupSet > >(); mpGroupSetDB = rs_new rstl::map< rstl::string, rstl::ncrc_ptr< CAudioGroupSet > >();
mpGroupSetResNameDB = new rstl::map< uint, rstl::string >(); mpGroupSetResNameDB = rs_new rstl::map< uint, rstl::string >();
mpDVDTrackDB = new rstl::map< rstl::string, rstl::ncrc_ptr< CTrkData > >(); mpDVDTrackDB = rs_new rstl::map< rstl::string, rstl::ncrc_ptr< CTrkData > >();
mpEmitterDB = new rstl::vector< CEmitterData >(maxNumEmitters, CEmitterData()); mpEmitterDB = rs_new rstl::vector< CEmitterData >(maxNumEmitters, CEmitterData());
mpListener = new u8[0x90]; // TODO: Add actual listener allocation mpListener = rs_new u8[0x90]; // TODO: Add actual listener allocation
mIsListenerActive = false; mIsListenerActive = false;
mMaxNumEmitters = maxNumEmitters; mMaxNumEmitters = maxNumEmitters;

View File

@ -21,75 +21,75 @@ CIntElement* CParticleDataFactory::GetIntElement(CInputStream& in) {
FourCC clsId = GetClassID(in); FourCC clsId = GetClassID(in);
switch (clsId) { switch (clsId) {
case SBIG('CNST'): { case SBIG('CNST'): {
return new CIEConstant(GetInt(in)); return rs_new CIEConstant(GetInt(in));
} }
case SBIG('KEYE'): case SBIG('KEYE'):
case SBIG('KEYP'): { case SBIG('KEYP'): {
return new CIEKeyframeEmitter(in); return rs_new CIEKeyframeEmitter(in);
} }
case SBIG('TSCL'): { case SBIG('TSCL'): {
return new CIETimescale(GetRealElement(in)); return rs_new CIETimescale(GetRealElement(in));
} }
case SBIG('DETH'): { case SBIG('DETH'): {
CIntElement* a = GetIntElement(in); CIntElement* a = GetIntElement(in);
CIntElement* b = GetIntElement(in); CIntElement* b = GetIntElement(in);
return new CIEDeath(a, b); return rs_new CIEDeath(a, b);
} }
case SBIG('CHAN'): { case SBIG('CHAN'): {
CIntElement* a = GetIntElement(in); CIntElement* a = GetIntElement(in);
CIntElement* b = GetIntElement(in); CIntElement* b = GetIntElement(in);
CIntElement* c = GetIntElement(in); CIntElement* c = GetIntElement(in);
return new CIETimeChain(a, b, c); return rs_new CIETimeChain(a, b, c);
} }
case SBIG('ADD_'): { case SBIG('ADD_'): {
CIntElement* a = GetIntElement(in); CIntElement* a = GetIntElement(in);
CIntElement* b = GetIntElement(in); CIntElement* b = GetIntElement(in);
return new CIEAdd(a, b); return rs_new CIEAdd(a, b);
} }
case SBIG('MULT'): { case SBIG('MULT'): {
CIntElement* a = GetIntElement(in); CIntElement* a = GetIntElement(in);
CIntElement* b = GetIntElement(in); CIntElement* b = GetIntElement(in);
return new CIEMultiply(a, b); return rs_new CIEMultiply(a, b);
} }
case SBIG('MODU'): { case SBIG('MODU'): {
CIntElement* a = GetIntElement(in); CIntElement* a = GetIntElement(in);
CIntElement* b = GetIntElement(in); CIntElement* b = GetIntElement(in);
return new CIEModulo(a, b); return rs_new CIEModulo(a, b);
} }
case SBIG('RAND'): { case SBIG('RAND'): {
CIntElement* a = GetIntElement(in); CIntElement* a = GetIntElement(in);
CIntElement* b = GetIntElement(in); CIntElement* b = GetIntElement(in);
return new CIERandom(a, b); return rs_new CIERandom(a, b);
} }
case SBIG('IMPL'): { case SBIG('IMPL'): {
return new CIEImpulse(GetIntElement(in)); return rs_new CIEImpulse(GetIntElement(in));
} }
case SBIG('ILPT'): { case SBIG('ILPT'): {
return new CIELifetimePercent(GetIntElement(in)); return rs_new CIELifetimePercent(GetIntElement(in));
} }
case SBIG('SPAH'): { case SBIG('SPAH'): {
CIntElement* a = GetIntElement(in); CIntElement* a = GetIntElement(in);
CIntElement* b = GetIntElement(in); CIntElement* b = GetIntElement(in);
CIntElement* c = GetIntElement(in); CIntElement* c = GetIntElement(in);
return new CIESampleAndHold(c, a, b); return rs_new CIESampleAndHold(c, a, b);
} }
case SBIG('IRND'): { case SBIG('IRND'): {
CIntElement* a = GetIntElement(in); CIntElement* a = GetIntElement(in);
CIntElement* b = GetIntElement(in); CIntElement* b = GetIntElement(in);
return new CIEInitialRandom(a, b); return rs_new CIEInitialRandom(a, b);
} }
case SBIG('CLMP'): { case SBIG('CLMP'): {
CIntElement* a = GetIntElement(in); CIntElement* a = GetIntElement(in);
CIntElement* b = GetIntElement(in); CIntElement* b = GetIntElement(in);
CIntElement* c = GetIntElement(in); CIntElement* c = GetIntElement(in);
return new CIEClamp(a, b, c); return rs_new CIEClamp(a, b, c);
} }
case SBIG('PULS'): { case SBIG('PULS'): {
CIntElement* a = GetIntElement(in); CIntElement* a = GetIntElement(in);
CIntElement* b = GetIntElement(in); CIntElement* b = GetIntElement(in);
CIntElement* c = GetIntElement(in); CIntElement* c = GetIntElement(in);
CIntElement* d = GetIntElement(in); CIntElement* d = GetIntElement(in);
return new CIEPulse(a, b, c, d); return rs_new CIEPulse(a, b, c, d);
} }
case SBIG('NONE'): { case SBIG('NONE'): {
return nullptr; return nullptr;
@ -97,21 +97,21 @@ CIntElement* CParticleDataFactory::GetIntElement(CInputStream& in) {
case SBIG('RTOI'): { case SBIG('RTOI'): {
CRealElement* a = GetRealElement(in); CRealElement* a = GetRealElement(in);
CRealElement* b = GetRealElement(in); CRealElement* b = GetRealElement(in);
return new CIERealToInt(a, b); return rs_new CIERealToInt(a, b);
} }
case SBIG('SUB_'): { case SBIG('SUB_'): {
CIntElement* a = GetIntElement(in); CIntElement* a = GetIntElement(in);
CIntElement* b = GetIntElement(in); CIntElement* b = GetIntElement(in);
return new CIESubtract(a, b); return rs_new CIESubtract(a, b);
} }
case SBIG('GTCP'): { case SBIG('GTCP'): {
return new CIEGetCumulativeParticleCount(); return rs_new CIEGetCumulativeParticleCount();
} }
case SBIG('GAPC'): { case SBIG('GAPC'): {
return new CIEGetActiveParticleCount(); return rs_new CIEGetActiveParticleCount();
} }
case SBIG('GEMT'): { case SBIG('GEMT'): {
return new CIEGetEmitterTime(); return rs_new CIEGetEmitterTime();
} }
} }
return nullptr; return nullptr;
@ -139,40 +139,40 @@ CModVectorElement* CParticleDataFactory::GetModVectorElement(CInputStream& in) {
a->GetValue(0, bf); a->GetValue(0, bf);
a->GetValue(0, cf); a->GetValue(0, cf);
#endif #endif
CModVectorElement* result = new CMVEFastConstant(af, bf, cf); CModVectorElement* result = rs_new CMVEFastConstant(af, bf, cf);
delete a; delete a;
delete b; delete b;
delete c; delete c;
return result; return result;
} else { } else {
return new CMVEConstant(a, b, c); return rs_new CMVEConstant(a, b, c);
} }
} }
case SBIG('GRAV'): { case SBIG('GRAV'): {
return new CMVEGravity(GetVectorElement(in)); return rs_new CMVEGravity(GetVectorElement(in));
} }
case SBIG('WIND'): { case SBIG('WIND'): {
CVectorElement* a = GetVectorElement(in); CVectorElement* a = GetVectorElement(in);
CRealElement* b = GetRealElement(in); CRealElement* b = GetRealElement(in);
return new CMVEWind(a, b); return rs_new CMVEWind(a, b);
} }
case SBIG('EXPL'): { case SBIG('EXPL'): {
CRealElement* a = GetRealElement(in); CRealElement* a = GetRealElement(in);
CRealElement* b = GetRealElement(in); CRealElement* b = GetRealElement(in);
return new CMVEExplode(a, b); return rs_new CMVEExplode(a, b);
} }
case SBIG('CHAN'): { case SBIG('CHAN'): {
CModVectorElement* a = GetModVectorElement(in); CModVectorElement* a = GetModVectorElement(in);
CModVectorElement* b = GetModVectorElement(in); CModVectorElement* b = GetModVectorElement(in);
CIntElement* c = GetIntElement(in); CIntElement* c = GetIntElement(in);
return new CMVETimeChain(a, b, c); return rs_new CMVETimeChain(a, b, c);
} }
case SBIG('PULS'): { case SBIG('PULS'): {
CIntElement* a = GetIntElement(in); CIntElement* a = GetIntElement(in);
CIntElement* b = GetIntElement(in); CIntElement* b = GetIntElement(in);
CModVectorElement* c = GetModVectorElement(in); CModVectorElement* c = GetModVectorElement(in);
CModVectorElement* d = GetModVectorElement(in); CModVectorElement* d = GetModVectorElement(in);
return new CMVEPulse(a, b, c, d); return rs_new CMVEPulse(a, b, c, d);
} }
case SBIG('IMPL'): { case SBIG('IMPL'): {
CVectorElement* a = GetVectorElement(in); CVectorElement* a = GetVectorElement(in);
@ -180,7 +180,7 @@ CModVectorElement* CParticleDataFactory::GetModVectorElement(CInputStream& in) {
CRealElement* c = GetRealElement(in); CRealElement* c = GetRealElement(in);
CRealElement* d = GetRealElement(in); CRealElement* d = GetRealElement(in);
bool e = GetBool(in); bool e = GetBool(in);
return new CMVEImplosion(a, b, c, d, e); return rs_new CMVEImplosion(a, b, c, d, e);
} }
case SBIG('LMPL'): { case SBIG('LMPL'): {
CVectorElement* a = GetVectorElement(in); CVectorElement* a = GetVectorElement(in);
@ -188,7 +188,7 @@ CModVectorElement* CParticleDataFactory::GetModVectorElement(CInputStream& in) {
CRealElement* c = GetRealElement(in); CRealElement* c = GetRealElement(in);
CRealElement* d = GetRealElement(in); CRealElement* d = GetRealElement(in);
bool e = GetBool(in); bool e = GetBool(in);
return new CMVELinearImplosion(a, b, c, d, e); return rs_new CMVELinearImplosion(a, b, c, d, e);
} }
case SBIG('EMPL'): { case SBIG('EMPL'): {
CVectorElement* a = GetVectorElement(in); CVectorElement* a = GetVectorElement(in);
@ -196,14 +196,14 @@ CModVectorElement* CParticleDataFactory::GetModVectorElement(CInputStream& in) {
CRealElement* c = GetRealElement(in); CRealElement* c = GetRealElement(in);
CRealElement* d = GetRealElement(in); CRealElement* d = GetRealElement(in);
bool e = GetBool(in); bool e = GetBool(in);
return new CMVEExponentialImplosion(a, b, c, d, e); return rs_new CMVEExponentialImplosion(a, b, c, d, e);
} }
case SBIG('SWRL'): { case SBIG('SWRL'): {
CVectorElement* a = GetVectorElement(in); CVectorElement* a = GetVectorElement(in);
CVectorElement* b = GetVectorElement(in); CVectorElement* b = GetVectorElement(in);
CRealElement* c = GetRealElement(in); CRealElement* c = GetRealElement(in);
CRealElement* d = GetRealElement(in); CRealElement* d = GetRealElement(in);
return new CMVESwirl(a, b, c, d); return rs_new CMVESwirl(a, b, c, d);
} }
case SBIG('BNCE'): { case SBIG('BNCE'): {
CVectorElement* a = GetVectorElement(in); CVectorElement* a = GetVectorElement(in);
@ -211,10 +211,10 @@ CModVectorElement* CParticleDataFactory::GetModVectorElement(CInputStream& in) {
CRealElement* c = GetRealElement(in); CRealElement* c = GetRealElement(in);
CRealElement* d = GetRealElement(in); CRealElement* d = GetRealElement(in);
bool e = GetBool(in); bool e = GetBool(in);
return new CMVEBounce(a, b, c, d, e); return rs_new CMVEBounce(a, b, c, d, e);
} }
case SBIG('SPOS'): { case SBIG('SPOS'): {
return new CMVESetPosition(GetVectorElement(in)); return rs_new CMVESetPosition(GetVectorElement(in));
} }
} }
return nullptr; return nullptr;

View File

@ -9,7 +9,7 @@ CZipOutputStream::CZipOutputStream(COutputStream* out, int level)
: COutputStream(1024) : COutputStream(1024)
, mOutput(out) , mOutput(out)
, mCompressedBytesWritten(0) , mCompressedBytesWritten(0)
, mZStream(new z_stream) , mZStream(rs_new z_stream)
, mUnk(0) { , mUnk(0) {
mZStream->zalloc = CZipSupport::Alloc; mZStream->zalloc = CZipSupport::Alloc;
mZStream->zfree = CZipSupport::Free; mZStream->zfree = CZipSupport::Free;

View File

@ -53,7 +53,7 @@ void CBodyStateCmdMgr::SetSteeringSpeedRange(float rmin, float rmax) {
} }
void CBodyStateCmdMgr::DeliverCmd(const CBodyStateCmd& cmd) { void CBodyStateCmdMgr::DeliverCmd(const CBodyStateCmd& cmd) {
DeliverCmd2(cmd.GetCommandId()); DeliverCmd(cmd.GetCommandId());
*x40_commandTable[(uint)cmd.GetCommandId()] = cmd; *x40_commandTable[(uint)cmd.GetCommandId()] = cmd;
} }

View File

@ -60,13 +60,13 @@ CBodyStateInfo::CBodyStateInfo(CActor& actor, EBodyType type)
x1c_additiveStates.reserve(4); x1c_additiveStates.reserve(4);
x1c_additiveStates.push_back(rstl::pair< int, rstl::auto_ptr< CAdditiveBodyState > >( x1c_additiveStates.push_back(rstl::pair< int, rstl::auto_ptr< CAdditiveBodyState > >(
pas::kAS_AdditiveIdle, new CABSIdle())); pas::kAS_AdditiveIdle, rs_new CABSIdle()));
x1c_additiveStates.push_back( x1c_additiveStates.push_back(
rstl::pair< int, rstl::auto_ptr< CAdditiveBodyState > >(pas::kAS_AdditiveAim, new CABSAim())); rstl::pair< int, rstl::auto_ptr< CAdditiveBodyState > >(pas::kAS_AdditiveAim, rs_new CABSAim()));
x1c_additiveStates.push_back(rstl::pair< int, rstl::auto_ptr< CAdditiveBodyState > >( x1c_additiveStates.push_back(rstl::pair< int, rstl::auto_ptr< CAdditiveBodyState > >(
pas::kAS_AdditiveIdle, new CABSFlinch())); pas::kAS_AdditiveIdle, rs_new CABSFlinch()));
x1c_additiveStates.push_back(rstl::pair< int, rstl::auto_ptr< CAdditiveBodyState > >( x1c_additiveStates.push_back(rstl::pair< int, rstl::auto_ptr< CAdditiveBodyState > >(
pas::kAS_AdditiveReaction, new CABSReaction())); pas::kAS_AdditiveReaction, rs_new CABSReaction()));
} }
CBodyStateInfo::~CBodyStateInfo() { CBodyStateInfo::~CBodyStateInfo() {
@ -148,47 +148,47 @@ float CBodyStateInfo::GetLocomotionSpeed(pas::ELocomotionAnim anim) const {
CBodyState* CBodyStateInfo::SetupBiPedalBodyStates(int stateId, CActor& actor) { CBodyState* CBodyStateInfo::SetupBiPedalBodyStates(int stateId, CActor& actor) {
switch (stateId) { switch (stateId) {
// case pas::kAS_Fall: // case pas::kAS_Fall:
// return new CBSFall(); // return rs_new CBSFall();
// case pas::kAS_Getup: // case pas::kAS_Getup:
// return new CBSGetup(); // return rs_new CBSGetup();
// case pas::kAS_LieOnGround: // case pas::kAS_LieOnGround:
// return new CBSLieOnGround(actor); // return rs_new CBSLieOnGround(actor);
// case pas::kAS_Step: // case pas::kAS_Step:
// return new CBSStep(); // return rs_new CBSStep();
// case pas::kAS_Death: // case pas::kAS_Death:
// return new CBSDie(); // return rs_new CBSDie();
// case pas::kAS_Locomotion: // case pas::kAS_Locomotion:
// return new CBSBiPedLocomotion(actor); // return rs_new CBSBiPedLocomotion(actor);
// case pas::kAS_KnockBack: // case pas::kAS_KnockBack:
// return new CBSKnockBack(); // return rs_new CBSKnockBack();
// case pas::kAS_MeleeAttack: // case pas::kAS_MeleeAttack:
// return new CBSAttack(); // return rs_new CBSAttack();
// case pas::kAS_ProjectileAttack: // case pas::kAS_ProjectileAttack:
// return new CBSProjectileAttack(); // return rs_new CBSProjectileAttack();
// case pas::kAS_LoopAttack: // case pas::kAS_LoopAttack:
// return new CBSLoopAttack(); // return rs_new CBSLoopAttack();
// case pas::kAS_Turn: // case pas::kAS_Turn:
// return new CBSTurn(); // return rs_new CBSTurn();
// case pas::kAS_LoopReaction: // case pas::kAS_LoopReaction:
// return new CBSLoopReaction(); // return rs_new CBSLoopReaction();
// case pas::kAS_GroundHit: // case pas::kAS_GroundHit:
// return new CBSGroundHit(); // return rs_new CBSGroundHit();
// case pas::kAS_Generate: // case pas::kAS_Generate:
// return new CBSGenerate(); // return rs_new CBSGenerate();
// case pas::kAS_Jump: // case pas::kAS_Jump:
// return new CBSJump(); // return rs_new CBSJump();
// case pas::kAS_Hurled: // case pas::kAS_Hurled:
// return new CBSHurled(); // return rs_new CBSHurled();
case pas::kAS_Slide: case pas::kAS_Slide:
return new CBSSlide(); return rs_new CBSSlide();
// case pas::kAS_Taunt: // case pas::kAS_Taunt:
// return new CBSTaunt(); // return rs_new CBSTaunt();
// case pas::kAS_Scripted: // case pas::kAS_Scripted:
// return new CBSScripted(); // return rs_new CBSScripted();
// case pas::kAS_Cover: // case pas::kAS_Cover:
// return new CBSCover(); // return rs_new CBSCover();
// case pas::kAS_WallHang: // case pas::kAS_WallHang:
// return new CBSWallHang(); // return rs_new CBSWallHang();
default: default:
return nullptr; return nullptr;
} }

View File

@ -40,7 +40,7 @@ CActor::CActor(TUniqueId uid, bool active, const rstl::string& name, const CEnti
const CActorParameters& params, TUniqueId nextDrawNode) const CActorParameters& params, TUniqueId nextDrawNode)
: CEntity(uid, info, active, name) : CEntity(uid, info, active, name)
, x34_transform(xf) , x34_transform(xf)
, x64_modelData(mData.IsNull() ? nullptr : new CModelData(mData)) , x64_modelData(mData.IsNull() ? nullptr : rs_new CModelData(mData))
, x68_material(MakeActorMaterialList(list, params)) , x68_material(MakeActorMaterialList(list, params))
, x70_materialFilter( , x70_materialFilter(
CMaterialFilter::MakeIncludeExclude(CMaterialList(SolidMaterial), CMaterialList())) CMaterialFilter::MakeIncludeExclude(CMaterialList(SolidMaterial), CMaterialList()))
@ -97,7 +97,7 @@ CActor::CActor(TUniqueId uid, bool active, const rstl::string& name, const CEnti
const CAssetId scanId = params.GetScannable().GetScannableObject0(); const CAssetId scanId = params.GetScannable().GetScannableObject0();
if (scanId != kInvalidAssetId) { if (scanId != kInvalidAssetId) {
x98_scanObjectInfo = x98_scanObjectInfo =
new TCachedToken< CScannableObjectInfo >(gpSimplePool->GetObj(SObjectTag('SCAN', scanId))); rs_new TCachedToken< CScannableObjectInfo >(gpSimplePool->GetObj(SObjectTag('SCAN', scanId)));
x98_scanObjectInfo->Lock(); x98_scanObjectInfo->Lock();
} }
} }
@ -205,7 +205,7 @@ void CActor::CalculateRenderBounds() {
} }
void CActor::SetModelData(const CModelData& modelData) { void CActor::SetModelData(const CModelData& modelData) {
x64_modelData = modelData.IsNull() ? nullptr : new CModelData(modelData); x64_modelData = modelData.IsNull() ? nullptr : rs_new CModelData(modelData);
} }
// TODO nonmatching // TODO nonmatching

View File

@ -33,4 +33,6 @@ void CAnimationDatabaseGame::GetAllUniquePrimitives(rstl::vector< CPrimitive >&
} }
void CAnimationDatabaseGame::GetUniquePrimitivesFromMetaAnim(rstl::set< CPrimitive >& primsOut, void CAnimationDatabaseGame::GetUniquePrimitivesFromMetaAnim(rstl::set< CPrimitive >& primsOut,
const rstl::string& name) const {} const rstl::string& name) const {
// Non-matching
}

View File

@ -57,7 +57,7 @@ CIOWin::EMessageReturn CCredits::Update(float dt, CArchitectureQueue& queue) {
if (x30_text.empty()) { if (x30_text.empty()) {
for (int i = 0; i < x18_creditsTable->GetStringCount(); ++i) { for (int i = 0; i < x18_creditsTable->GetStringCount(); ++i) {
x30_text.push_back(rstl::pair< rstl::single_ptr< CGuiTextSupport >, CVector2i >( x30_text.push_back(rstl::pair< rstl::single_ptr< CGuiTextSupport >, CVector2i >(
new CGuiTextSupport( rs_new CGuiTextSupport(
gpResourceFactory->GetResourceIdByName(gpTweakGui->GetCreditsFont().data())->id, gpResourceFactory->GetResourceIdByName(gpTweakGui->GetCreditsFont().data())->id,
CGuiTextProperties(true, true, kJustification_Center, kVerticalJustification_Top), CGuiTextProperties(true, true, kJustification_Center, kVerticalJustification_Top),
gpTweakGui->GetCreditsTextFontColor(), gpTweakGui->GetCreditsTextBorderColor(), gpTweakGui->GetCreditsTextFontColor(), gpTweakGui->GetCreditsTextBorderColor(),
@ -113,14 +113,14 @@ CIOWin::EMessageReturn CCredits::Update(float dt, CArchitectureQueue& queue) {
} }
case 1: { case 1: {
if (x28_moviePlayer.null()) { if (x28_moviePlayer.null()) {
x28_moviePlayer = new CMoviePlayer("Video/creditBG.thp", 0.f, true, true); x28_moviePlayer = rs_new CMoviePlayer("Video/creditBG.thp", 0.f, true, true);
} }
x14_ = 2; x14_ = 2;
break; break;
} }
case 2: { case 2: {
// if (x2c_.null()) { // if (x2c_.null()) {
// x2c_ = new CStaticAudioPlayer("Audio/ending3.rsf", 0, 0x5d7c00); // x2c_ = rs_new CStaticAudioPlayer("Audio/ending3.rsf", 0, 0x5d7c00);
// } // }
// if (!x2c_->IsReady()) { // if (!x2c_->IsReady()) {
// return kMR_Exit; // return kMR_Exit;

View File

@ -3,14 +3,14 @@
#include "Kyoto/CDvdRequest.hpp" #include "Kyoto/CDvdRequest.hpp"
#include "Kyoto/CResFactory.hpp" #include "Kyoto/CResFactory.hpp"
#define ROUND_UP_32(val) (((val) + 31) & ~31) #define ROUND_UP_32(val) (((val) + 31) & ~31)
rstl::pair< rstl::auto_ptr< uchar >, int > GetScriptingMemoryAlways(const IGameArea& area) { rstl::pair< rstl::auto_ptr< uchar >, int > GetScriptingMemoryAlways(const IGameArea& area) {
SObjectTag tag('MREA', area.IGetAreaAssetId()); SObjectTag tag('MREA', area.IGetAreaAssetId());
rstl::auto_ptr< char > buf = new char[0x60]; rstl::auto_ptr< char > buf = rs_new char[0x60];
CInputStream* resource = gpResourceFactory->GetResLoader().LoadNewResourceSync(tag, 0, 0x60, buf.get()); CInputStream* resource =
gpResourceFactory->GetResLoader().LoadNewResourceSync(tag, 0, 0x60, buf.get());
if (!resource || *(uint*)(buf.get()) != 0xdeadbeef) { if (!resource || *(uint*)(buf.get()) != 0xdeadbeef) {
return rstl::pair< rstl::auto_ptr< uchar >, int >(nullptr, 0); return rstl::pair< rstl::auto_ptr< uchar >, int >(nullptr, 0);
} }
@ -45,7 +45,7 @@ bool CGameArea::StartStreamingMainArea() {
case kP_LoadHeader: { case kP_LoadHeader: {
x110_mreaSecBufs.reserve(3); x110_mreaSecBufs.reserve(3);
AllocNewAreaData(0, 96); AllocNewAreaData(0, 96);
x12c_postConstructed.Set(new CPostConstructed()); x12c_postConstructed.Set(rs_new CPostConstructed());
xf4_phase = kP_LoadSecSizes; xf4_phase = kP_LoadSecSizes;
break; break;
} }

View File

@ -15,7 +15,7 @@
CGameCubeDoll::CGameCubeDoll() CGameCubeDoll::CGameCubeDoll()
: x0_model(gpSimplePool->GetObj("CMDL_GameCube")) : x0_model(gpSimplePool->GetObj("CMDL_GameCube"))
, x8_lights(1, CLight::BuildDirectional(CVector3f::Forward(), CColor(0xFFFFFFFF)), rstl::rmemory_allocator()) , x8_lights(1, CLight::BuildDirectional(CVector3f::Forward(), CColor(0xFFFFFFFF)), rstl::rmemory_allocator())
, x18_actorLights(new CActorLights(8, CVector3f::Zero(), 4, 4, 0.1f, false, false, false)) , x18_actorLights(rs_new CActorLights(8, CVector3f::Zero(), 4, 4, 0.1f, false, false, false))
, x1c_fader(0.0f) , x1c_fader(0.0f)
, x20_24_loaded(false) { , x20_24_loaded(false) {
x0_model.Lock(); x0_model.Lock();

View File

@ -19,7 +19,7 @@ void CIOWinManager::AddIOWin(rstl::ncrc_ptr< CIOWin > chIow, int pumpPrio, int d
IOWinPQNode* prevNode = nullptr; IOWinPQNode* prevNode = nullptr;
for (node = x4_pumpRoot; node && node->x4_prio > pumpPrio; node = node->x8_next) for (node = x4_pumpRoot; node && node->x4_prio > pumpPrio; node = node->x8_next)
prevNode = node; prevNode = node;
IOWinPQNode* newNode = new IOWinPQNode(chIow, pumpPrio, node); IOWinPQNode* newNode = rs_new IOWinPQNode(chIow, pumpPrio, node);
if (prevNode) if (prevNode)
prevNode->x8_next = newNode; prevNode->x8_next = newNode;
else else
@ -28,7 +28,7 @@ void CIOWinManager::AddIOWin(rstl::ncrc_ptr< CIOWin > chIow, int pumpPrio, int d
prevNode = nullptr; prevNode = nullptr;
for (node = x0_drawRoot; node && drawPrio < node->x4_prio; node = node->x8_next) for (node = x0_drawRoot; node && drawPrio < node->x4_prio; node = node->x8_next)
prevNode = node; prevNode = node;
newNode = new IOWinPQNode(chIow, drawPrio, node); newNode = rs_new IOWinPQNode(chIow, drawPrio, node);
if (prevNode) if (prevNode)
prevNode->x8_next = newNode; prevNode->x8_next = newNode;
else else

View File

@ -76,12 +76,12 @@ void CMainFlow::SetGameState(EClientFlowStates state, CArchitectureQueue& queue)
case CMain::kRM_WinGood: case CMain::kRM_WinGood:
case CMain::kRM_WinBest: case CMain::kRM_WinBest:
queue.Push(MakeMsg::CreateCreateIOWin(kAMT_IOWinManager, kFrontEndUIMsgPriority, queue.Push(MakeMsg::CreateCreateIOWin(kAMT_IOWinManager, kFrontEndUIMsgPriority,
kFrontEndUIDrawPriority, new CCredits())); kFrontEndUIDrawPriority, rs_new CCredits()));
break; break;
default: default:
queue.Push(MakeMsg::CreateCreateIOWin(kAMT_IOWinManager, kFrontEndUIMsgPriority, queue.Push(MakeMsg::CreateCreateIOWin(kAMT_IOWinManager, kFrontEndUIMsgPriority,
kFrontEndUIDrawPriority, kFrontEndUIDrawPriority,
new CPlayMovie(CPlayMovie::kWM_LoseGame))); rs_new CPlayMovie(CPlayMovie::kWM_LoseGame)));
break; break;
} }
break; break;
@ -94,7 +94,7 @@ void CMainFlow::SetGameState(EClientFlowStates state, CArchitectureQueue& queue)
} }
queue.Push(MakeMsg::CreateCreateIOWin(kAMT_IOWinManager, kFrontEndUIMsgPriority, queue.Push(MakeMsg::CreateCreateIOWin(kAMT_IOWinManager, kFrontEndUIMsgPriority,
kFrontEndUIDrawPriority, new CPreFrontEnd())); kFrontEndUIDrawPriority, rs_new CPreFrontEnd()));
break; break;
} }
case kCFS_FrontEnd: case kCFS_FrontEnd:
@ -103,16 +103,16 @@ void CMainFlow::SetGameState(EClientFlowStates state, CArchitectureQueue& queue)
} }
CIOWin* ioWin; CIOWin* ioWin;
if (gpMain->GetRestartMode() == CMain::kRM_StateSetter) { if (gpMain->GetRestartMode() == CMain::kRM_StateSetter) {
ioWin = new CStateSetterFlow(); ioWin = rs_new CStateSetterFlow();
} else { } else {
ioWin = new CFrontEndUI(); ioWin = rs_new CFrontEndUI();
} }
queue.Push(MakeMsg::CreateCreateIOWin(kAMT_IOWinManager, kFrontEndUIMsgPriority, queue.Push(MakeMsg::CreateCreateIOWin(kAMT_IOWinManager, kFrontEndUIMsgPriority,
kFrontEndUIDrawPriority, ioWin)); kFrontEndUIDrawPriority, ioWin));
break; break;
case kCFS_Game: case kCFS_Game:
gpGameState->GameOptions().EnsureOptions(); gpGameState->GameOptions().EnsureOptions();
CIOWin* gameFlow = new CMFGameLoader(); CIOWin* gameFlow = rs_new CMFGameLoader();
gpMain->SetRestartMode(CMain::kRM_Default); gpMain->SetRestartMode(CMain::kRM_Default);
queue.Push(MakeMsg::CreateCreateIOWin(kAMT_IOWinManager, kMFGameMsgPriority, queue.Push(MakeMsg::CreateCreateIOWin(kAMT_IOWinManager, kMFGameMsgPriority,
kMFGameDrawPriority, gameFlow)); kMFGameDrawPriority, gameFlow));

View File

@ -78,7 +78,7 @@ CMapArea::CMapArea(CInputStream& in, uint size)
, x2c_vertexCount(in.ReadLong()) , x2c_vertexCount(in.ReadLong())
, x30_surfaceCount(in.ReadLong()) , x30_surfaceCount(in.ReadLong())
, x34_size(size - 52) { , x34_size(size - 52) {
x44_buf = NEW u8[x34_size]; x44_buf = rs_new u8[x34_size];
in.Get(x44_buf.get(), x34_size); in.Get(x44_buf.get(), x34_size);
PostConstruct(); PostConstruct();
@ -239,5 +239,5 @@ const CVector3f& CMapArea::GetAreaPostTranslate(const IWorld& world, TAreaId aid
CFactoryFnReturn FMapAreaFactory(const SObjectTag& objTag, CInputStream& in, CFactoryFnReturn FMapAreaFactory(const SObjectTag& objTag, CInputStream& in,
const CVParamTransfer&) { const CVParamTransfer&) {
gHackAssetId = objTag.id; gHackAssetId = objTag.id;
return CFactoryFnReturn(new CMapArea(in, gpResourceFactory->ResourceSize(objTag))); return CFactoryFnReturn(rs_new CMapArea(in, gpResourceFactory->ResourceSize(objTag)));
} }

View File

@ -583,7 +583,7 @@ void CMemoryCardDriver::StartFileCreate() {
x194_fileIdx = 0; x194_fileIdx = 0;
x198_fileInfo = x198_fileInfo =
new CMemoryCardSys::CCardFileInfo(x0_cardPort, rstl::string_l(skSaveFileNames[x194_fileIdx])); rs_new CMemoryCardSys::CCardFileInfo(x0_cardPort, rstl::string_l(skSaveFileNames[x194_fileIdx]));
InitializeFileInfo(); InitializeFileInfo();
ECardResult result = x198_fileInfo->CreateFile(); ECardResult result = x198_fileInfo->CreateFile();
if (result != kCR_READY) if (result != kCR_READY)
@ -617,7 +617,7 @@ void CMemoryCardDriver::StartFileCreateTransactional() {
x194_fileIdx = altFileIdx; x194_fileIdx = altFileIdx;
x198_fileInfo = x198_fileInfo =
new CMemoryCardSys::CCardFileInfo(x0_cardPort, rstl::string_l(skSaveFileNames[x194_fileIdx])); rs_new CMemoryCardSys::CCardFileInfo(x0_cardPort, rstl::string_l(skSaveFileNames[x194_fileIdx]));
InitializeFileInfo(); InitializeFileInfo();
ECardResult result = x198_fileInfo->CreateFile(); ECardResult result = x198_fileInfo->CreateFile();
if (result != kCR_READY) if (result != kCR_READY)
@ -708,7 +708,7 @@ void CMemoryCardDriver::ReadFinished() {
for (int i = 0; i < xe4_fileSlots.capacity(); ++i) { for (int i = 0; i < xe4_fileSlots.capacity(); ++i) {
if (header.x4_savePresent[i]) { if (header.x4_savePresent[i]) {
xe4_fileSlots[i] = new SGameFileSlot(r); xe4_fileSlots[i] = rs_new SGameFileSlot(r);
} else { } else {
xe4_fileSlots[i] = nullptr; xe4_fileSlots[i] = nullptr;
} }
@ -727,7 +727,7 @@ void CMemoryCardDriver::BuildNewFileSlot(int saveIdx) {
rstl::auto_ptr< SGameFileSlot >& slot = xe4_fileSlots[saveIdx]; rstl::auto_ptr< SGameFileSlot >& slot = xe4_fileSlots[saveIdx];
if (slot.null()) if (slot.null())
slot = new SGameFileSlot(); slot = rs_new SGameFileSlot();
slot->LoadGameState(saveIdx); slot->LoadGameState(saveIdx);
@ -746,7 +746,7 @@ void CMemoryCardDriver::BuildExistingFileSlot(int saveIdx) {
rstl::auto_ptr< SGameFileSlot >& slot = xe4_fileSlots[saveIdx]; rstl::auto_ptr< SGameFileSlot >& slot = xe4_fileSlots[saveIdx];
if (slot.null()) if (slot.null())
slot = new SGameFileSlot(); slot = rs_new SGameFileSlot();
else else
slot->InitializeFromGameState(); slot->InitializeFromGameState();

View File

@ -84,7 +84,7 @@ CStateManager::CStateManager(const rstl::ncrc_ptr< CScriptMailbox >& mailbox,
, x4_objectIndexArray(0) , x4_objectIndexArray(0)
, x808_objectLists(rstl::auto_ptr< CObjectList >()) , x808_objectLists(rstl::auto_ptr< CObjectList >())
, x86c_stateManagerContainer(new CStateManagerContainer()) , x86c_stateManagerContainer(rs_new CStateManagerContainer())
, x870_cameraManager(&x86c_stateManagerContainer->x0_cameraManager) , x870_cameraManager(&x86c_stateManagerContainer->x0_cameraManager)
, x874_sortedListManager(&x86c_stateManagerContainer->x3c0_sortedListManager) , x874_sortedListManager(&x86c_stateManagerContainer->x3c0_sortedListManager)
@ -160,14 +160,14 @@ CStateManager::CStateManager(const rstl::ncrc_ptr< CScriptMailbox >& mailbox,
, xf94_30_fullThreat(false) , xf94_30_fullThreat(false)
{ {
x808_objectLists[0] = new CObjectList(kOL_All); x808_objectLists[0] = rs_new CObjectList(kOL_All);
x808_objectLists[1] = new CActorList(); x808_objectLists[1] = rs_new CActorList();
x808_objectLists[2] = new CPhysicsActorList(); x808_objectLists[2] = rs_new CPhysicsActorList();
x808_objectLists[3] = new CGameCameraList(); x808_objectLists[3] = rs_new CGameCameraList();
x808_objectLists[4] = new CGameLightList(); x808_objectLists[4] = rs_new CGameLightList();
x808_objectLists[5] = new CListeningAiList(); x808_objectLists[5] = rs_new CListeningAiList();
x808_objectLists[6] = new CAiWaypointList(); x808_objectLists[6] = rs_new CAiWaypointList();
x808_objectLists[7] = new CPlatformAndDoorList(); x808_objectLists[7] = rs_new CPlatformAndDoorList();
gpRender->SetDrawableCallback(RendererDrawCallback, this); gpRender->SetDrawableCallback(RendererDrawCallback, this);
CMemory::SetOutOfMemoryCallback(MemoryAllocatorAllocationFailedCallback, this); CMemory::SetOutOfMemoryCallback(MemoryAllocatorAllocationFailedCallback, this);

View File

@ -16,7 +16,7 @@
static int kUnknownValue = 1; static int kUnknownValue = 1;
CWorldShadow::CWorldShadow(uint w, uint h, bool rgba8) CWorldShadow::CWorldShadow(uint w, uint h, bool rgba8)
: x0_texture(NEW CTexture(rgba8 ? kTF_RGBA8 : kTF_RGB565, w, h, 1)) : x0_texture(rs_new CTexture(rgba8 ? kTF_RGBA8 : kTF_RGB565, w, h, 1))
, x4_view(CTransform4f::Identity()) , x4_view(CTransform4f::Identity())
, x34_model(CTransform4f::Identity()) , x34_model(CTransform4f::Identity())
, x64_objHalfExtent(1.f) , x64_objHalfExtent(1.f)

View File

@ -141,8 +141,8 @@ CBallCamera::CBallCamera(TUniqueId uid, TUniqueId watchedId, const CTransform4f&
, x470_clampVelTimer(0.f) , x470_clampVelTimer(0.f)
, x474_clampVelRange(0.f) , x474_clampVelRange(0.f)
, x478_shortMoveCount(0) , x478_shortMoveCount(0)
, x47c_failsafeState(new SFailsafeState) , x47c_failsafeState(rs_new SFailsafeState)
, x480_(new SUnknown) { , x480_(rs_new SUnknown) {
SetupColliders(x264_smallColliders, 2.31f, 2.31f, 0.1f, 3, 2.f, 0.5f, -M_PIF / 2.f); SetupColliders(x264_smallColliders, 2.31f, 2.31f, 0.1f, 3, 2.f, 0.5f, -M_PIF / 2.f);
SetupColliders(x274_mediumColliders, 4.62f, 4.62f, 0.1f, 6, 2.f, 0.5f, -M_PIF / 2.f); SetupColliders(x274_mediumColliders, 4.62f, 4.62f, 0.1f, 6, 2.f, 0.5f, -M_PIF / 2.f);
SetupColliders(x284_largeColliders, 7.f, 7.f, 0.1f, 12, 2.f, 0.5f, -M_PIF / 2.f); SetupColliders(x284_largeColliders, 7.f, 7.f, 0.1f, 12, 2.f, 0.5f, -M_PIF / 2.f);

View File

@ -37,7 +37,7 @@ void CCameraFilterPass::SetFilter(EFilterType type, EFilterShape shape, float ti
if (txtr != kInvalidAssetId) { if (txtr != kInvalidAssetId) {
x24_texObj = x24_texObj =
new TLockedToken< CTexture >(gpSimplePool->GetObj(SObjectTag(SBig('TXTR'), txtr))); rs_new TLockedToken< CTexture >(gpSimplePool->GetObj(SObjectTag(SBig('TXTR'), txtr)));
} }
} else { } else {
x1c_nextColor = color; x1c_nextColor = color;
@ -47,7 +47,7 @@ void CCameraFilterPass::SetFilter(EFilterType type, EFilterShape shape, float ti
if (txtr != kInvalidAssetId) { if (txtr != kInvalidAssetId) {
x24_texObj = x24_texObj =
new TLockedToken< CTexture >(gpSimplePool->GetObj(SObjectTag(SBig('TXTR'), txtr))); rs_new TLockedToken< CTexture >(gpSimplePool->GetObj(SObjectTag(SBig('TXTR'), txtr)));
} }
x10_remTime = time; x10_remTime = time;

View File

@ -70,19 +70,19 @@ void CCameraManager::CreateStandardCameras(CStateManager& mgr) {
xf.SetTranslation(mgr.GetPlayer()->GetEyePosition()); xf.SetTranslation(mgr.GetPlayer()->GetEyePosition());
TUniqueId fpId = mgr.AllocateUniqueId(); TUniqueId fpId = mgr.AllocateUniqueId();
x7c_fpCamera = new CFirstPersonCamera(fpId, xf, plId, gpTweakPlayer->GetOrbitCameraSpeed(), x7c_fpCamera = rs_new CFirstPersonCamera(fpId, xf, plId, gpTweakPlayer->GetOrbitCameraSpeed(),
DefaultFirstPersonFov(), DefaultNearPlane(), DefaultFirstPersonFov(), DefaultNearPlane(),
DefaultFarPlane(), DefaultAspect()); DefaultFarPlane(), DefaultAspect());
mgr.AddObject(x7c_fpCamera); mgr.AddObject(x7c_fpCamera);
mgr.Player()->SetCameraState(CPlayer::kCS_FirstPerson, mgr); mgr.Player()->SetCameraState(CPlayer::kCS_FirstPerson, mgr);
SetCurrentCameraId(fpId); SetCurrentCameraId(fpId);
TUniqueId ballId = mgr.AllocateUniqueId(); TUniqueId ballId = mgr.AllocateUniqueId();
x80_ballCamera = new CBallCamera(ballId, plId, xf, DefaultThirdPersonFov(), DefaultNearPlane(), x80_ballCamera = rs_new CBallCamera(ballId, plId, xf, DefaultThirdPersonFov(), DefaultNearPlane(),
DefaultFarPlane(), DefaultAspect()); DefaultFarPlane(), DefaultAspect());
mgr.AddObject(x80_ballCamera); mgr.AddObject(x80_ballCamera);
TUniqueId interpId = mgr.AllocateUniqueId(); TUniqueId interpId = mgr.AllocateUniqueId();
x88_interpCamera = new CInterpolationCamera(interpId, xf); x88_interpCamera = rs_new CInterpolationCamera(interpId, xf);
mgr.AddObject(x88_interpCamera); mgr.AddObject(x88_interpCamera);
} }

View File

@ -22,7 +22,7 @@ CAmbientAI::CAmbientAI(TUniqueId uid, const rstl::string& name, const CEntityInf
, x2d0_animState(kAS_Ready) , x2d0_animState(kAS_Ready)
, x2d4_alertRange(alertRange) , x2d4_alertRange(alertRange)
, x2d8_impactRange(impactRange) , x2d8_impactRange(impactRange)
, x2dc_defaultAnim(GetModelData()->GetAnimationData()->GetDefaultAnimation()) , x2dc_currentAnim(GetModelData()->GetAnimationData()->GetCurrentAnimation())
, x2e0_alertAnim(alertAnim) , x2e0_alertAnim(alertAnim)
, x2e4_impactAnim(impactAnim) , x2e4_impactAnim(impactAnim)
, x2e8_24_dead(false) , x2e8_24_dead(false)
@ -90,7 +90,7 @@ void CAmbientAI::Think(float dt, CStateManager& mgr) {
if (!inAlertRange) { if (!inAlertRange) {
x2d0_animState = kAS_Ready; x2d0_animState = kAS_Ready;
ModelData()->AnimationData()->SetAnimation( ModelData()->AnimationData()->SetAnimation(
CAnimPlaybackParms(x2dc_defaultAnim, -1, 1.f, true), false); CAnimPlaybackParms(x2dc_currentAnim, -1, 1.f, true), false);
ModelData()->EnableLooping(true); ModelData()->EnableLooping(true);
RandomizePlaybackRate(mgr); RandomizePlaybackRate(mgr);
} else if (inImpactRange) { } else if (inImpactRange) {
@ -104,7 +104,7 @@ void CAmbientAI::Think(float dt, CStateManager& mgr) {
if (!x2e8_25_animating) { if (!x2e8_25_animating) {
x2d0_animState = kAS_Ready; x2d0_animState = kAS_Ready;
ModelData()->AnimationData()->SetAnimation( ModelData()->AnimationData()->SetAnimation(
CAnimPlaybackParms(x2dc_defaultAnim, -1, 1.f, true), false); CAnimPlaybackParms(x2dc_currentAnim, -1, 1.f, true), false);
ModelData()->EnableLooping(true); ModelData()->EnableLooping(true);
RandomizePlaybackRate(mgr); RandomizePlaybackRate(mgr);
} }
@ -130,7 +130,7 @@ void CAmbientAI::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CState
if (!GetActive()) if (!GetActive())
SetActive(true); SetActive(true);
x2d0_animState = kAS_Ready; x2d0_animState = kAS_Ready;
ModelData()->AnimationData()->SetAnimation(CAnimPlaybackParms(x2dc_defaultAnim, -1, 1.f, true), ModelData()->AnimationData()->SetAnimation(CAnimPlaybackParms(x2dc_currentAnim, -1, 1.f, true),
false); false);
ModelData()->EnableLooping(true); ModelData()->EnableLooping(true);
RandomizePlaybackRate(mgr); RandomizePlaybackRate(mgr);

View File

@ -41,7 +41,7 @@ CPuffer::CPuffer(TUniqueId uid, const rstl::string& name, const CEntityInfo& inf
CreateShadow(false); CreateShadow(false);
GetKnockBackCtrl().SetImpulseDurationIdx(1); GetKnockBackCtrl().SetImpulseDurationIdx(1);
x574_cloudEffect.Lock(); x574_cloudEffect.Lock();
GetBodyCtrl()->SetRestrictedFlyerMoveSpeed(hoverSpeed); BodyCtrl()->SetRestrictedFlyerMoveSpeed(hoverSpeed);
} }
CPuffer::~CPuffer() {} CPuffer::~CPuffer() {}
@ -53,7 +53,7 @@ void CPuffer::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateMan
switch (msg) { switch (msg) {
case kSM_Registered: case kSM_Registered:
GetBodyCtrl()->Activate(mgr); BodyCtrl()->Activate(mgr);
SetMaterialFilter(CMaterialFilter::MakeIncludeExclude(CMaterialList(kMT_Player), SetMaterialFilter(CMaterialFilter::MakeIncludeExclude(CMaterialList(kMT_Player),
CMaterialList(kMT_NoStaticCollision))); CMaterialList(kMT_NoStaticCollision)));
break; break;
@ -97,7 +97,7 @@ void CPuffer::Death(CStateManager& mgr, const CVector3f& vec, EScriptObjectState
CAABox aabb = CAABox aabb =
CAABox(CVector3f(-1.f, -1.f, -1.f), CVector3f(1.f, 1.f, 1.f)) CAABox(CVector3f(-1.f, -1.f, -1.f), CVector3f(1.f, 1.f, 1.f))
.GetTransformedAABox(GetTransform() * CTransform4f::Scale(x57c_cloudDamage.GetRadius())); .GetTransformedAABox(GetTransform() * CTransform4f::Scale(x57c_cloudDamage.GetRadius()));
mgr.AddObject(new CFire(x574_cloudEffect, uid, GetCurrentAreaId(), true, GetUniqueId(), mgr.AddObject(rs_new CFire(x574_cloudEffect, uid, GetCurrentAreaId(), true, GetUniqueId(),
GetTransform(), x57c_cloudDamage, aabb, CVector3f(1.f, 1.f, 1.f), true, GetTransform(), x57c_cloudDamage, aabb, CVector3f(1.f, 1.f, 1.f), true,
x5bc_cloudSteam, x598_24_, x598_26_, x598_25_, 1.f, x5b8_, 1.f, 1.f)); x5bc_cloudSteam, x598_24_, x598_26_, x598_25_, 1.f, x5b8_, 1.f, 1.f));
} }
@ -106,22 +106,22 @@ void CPuffer::Think(float dt, CStateManager& mgr) {
CPatterned::Think(dt, mgr); CPatterned::Think(dt, mgr);
sub8025bfa4(mgr); sub8025bfa4(mgr);
CVector3f moveVector = GetBodyCtrl()->GetCommandMgr().GetMoveVector(); CVector3f moveVector = BodyCtrl()->GetCommandMgr().GetMoveVector();
if (x5cc_ != GetDestObj()) { if (x5cc_ != GetDestObj()) {
x5cc_ = GetDestObj(); x5cc_ = GetDestObj();
CSfxManager::AddEmitter(x59a_, GetTranslation(), CVector3f::Zero(), true, false); CSfxManager::AddEmitter(x59a_, GetTranslation(), CVector3f::Zero(), true, false);
} }
GetBodyCtrl()->CommandMgr().ClearLocomotionCmds(); BodyCtrl()->CommandMgr().ClearLocomotionCmds();
if (moveVector.CanBeNormalized()) { if (moveVector.CanBeNormalized()) {
x5c0_move = CVector3f::Lerp(x5c0_move, moveVector, dt / 0.5f).AsNormalized(); x5c0_move = CVector3f::Lerp(x5c0_move, moveVector, dt / 0.5f).AsNormalized();
GetBodyCtrl()->CommandMgr().DeliverCmd(CBCLocomotionCmd(x5c0_move, x568_face, 1.f)); BodyCtrl()->CommandMgr().DeliverCmd(CBCLocomotionCmd(x5c0_move, x568_face, 1.f));
} }
} }
void CPuffer::sub8025bfa4(CStateManager& mgr) { void CPuffer::sub8025bfa4(CStateManager& mgr) {
CVector3f moveVector = GetBodyCtrl()->GetCommandMgr().GetMoveVector(); CVector3f moveVector = BodyCtrl()->GetCommandMgr().GetMoveVector();
if (x5d4_gasLocators.empty()) { if (x5d4_gasLocators.empty()) {
for (int i = 0; i < ARRAY_SIZE(skGasLocators); ++i) { for (int i = 0; i < ARRAY_SIZE(skGasLocators); ++i) {

View File

@ -20,5 +20,5 @@ inline CFactoryFnReturn::CFactoryFnReturn(CScannableObjectInfo* ptr)
CFactoryFnReturn FScannableObjectInfoFactory(const SObjectTag& tag, CInputStream& in, CFactoryFnReturn FScannableObjectInfoFactory(const SObjectTag& tag, CInputStream& in,
const CVParamTransfer& xfer) { const CVParamTransfer& xfer) {
return new CScannableObjectInfo(in, in.GetBlockOffset()); return rs_new CScannableObjectInfo(in, in.GetBlockOffset());
} }

View File

@ -8,8 +8,8 @@
CFaceplateDecoration::CFaceplateDecoration(CStateManager& stateMgr) : x0_id(kInvalidAssetId) {} CFaceplateDecoration::CFaceplateDecoration(CStateManager& stateMgr) : x0_id(kInvalidAssetId) {}
void CFaceplateDecoration::Update(float dt, const CStateManager& stateMgr) { void CFaceplateDecoration::Update(float dt, const CStateManager& mgr) {
CAssetId txtrId = stateMgr.GetPlayer()->GetVisorSteam().GetTextureId(); CAssetId txtrId = mgr.GetPlayer()->GetVisorSteam().GetTextureId();
if (txtrId == kInvalidAssetId && x4_tex.valid()) { if (txtrId == kInvalidAssetId && x4_tex.valid()) {
x4_tex->Unlock(); x4_tex->Unlock();
x0_id = txtrId; x0_id = txtrId;

View File

@ -235,24 +235,24 @@ CPlayerGun::CPlayerGun(TUniqueId playerId)
, x730_outgoingBeam(nullptr) , x730_outgoingBeam(nullptr)
, x734_loadingBeam(nullptr) , x734_loadingBeam(nullptr)
, x738_nextBeam(nullptr) , x738_nextBeam(nullptr)
, x73c_gunMotion(new CGunMotion(gpTweakGunRes->x4_gunMotion, kScaleVector)) , x73c_gunMotion(rs_new CGunMotion(gpTweakGunRes->x4_gunMotion, kScaleVector))
, x740_grappleArm(new CGrappleArm(kScaleVector)) , x740_grappleArm(rs_new CGrappleArm(kScaleVector))
, x744_auxWeapon(new CAuxWeapon(playerId)) , x744_auxWeapon(rs_new CAuxWeapon(playerId))
, x748_rainSplashGenerator(new CRainSplashGenerator(kScaleVector, 20, 2, 0.f, 0.125f)) , x748_rainSplashGenerator(rs_new CRainSplashGenerator(kScaleVector, 20, 2, 0.f, 0.125f))
, x74c_powerBeam( , x74c_powerBeam(
new CPowerBeam(gpTweakGunRes->x10_powerBeam, kWT_Power, playerId, kMT_Player, kScaleVector)) rs_new CPowerBeam(gpTweakGunRes->x10_powerBeam, kWT_Power, playerId, kMT_Player, kScaleVector))
, x750_iceBeam( , x750_iceBeam(
new CIceBeam(gpTweakGunRes->x14_iceBeam, kWT_Ice, playerId, kMT_Player, kScaleVector)) rs_new CIceBeam(gpTweakGunRes->x14_iceBeam, kWT_Ice, playerId, kMT_Player, kScaleVector))
, x754_waveBeam( , x754_waveBeam(
new CWaveBeam(gpTweakGunRes->x18_waveBeam, kWT_Wave, playerId, kMT_Player, kScaleVector)) rs_new CWaveBeam(gpTweakGunRes->x18_waveBeam, kWT_Wave, playerId, kMT_Player, kScaleVector))
, x758_plasmaBeam(new CPlasmaBeam(gpTweakGunRes->x1c_plasmaBeam, kWT_Plasma, playerId, kMT_Player, , x758_plasmaBeam(rs_new CPlasmaBeam(gpTweakGunRes->x1c_plasmaBeam, kWT_Plasma, playerId, kMT_Player,
kScaleVector)) kScaleVector))
, x75c_phazonBeam(new CPhazonBeam(gpTweakGunRes->x20_phazonBeam, kWT_Phazon, playerId, kMT_Player, , x75c_phazonBeam(rs_new CPhazonBeam(gpTweakGunRes->x20_phazonBeam, kWT_Phazon, playerId, kMT_Player,
kScaleVector)) kScaleVector))
, x760_selectableBeams(nullptr) , x760_selectableBeams(nullptr)
, x774_holoTransitionGen( , x774_holoTransitionGen(
new CElementGen(gpSimplePool->GetObj(SObjectTag('PART', gpTweakGunRes->x24_holoTransition)))) rs_new CElementGen(gpSimplePool->GetObj(SObjectTag('PART', gpTweakGunRes->x24_holoTransition))))
, x82c_shadow(new CWorldShadow(32, 32, true)) , x82c_shadow(rs_new CWorldShadow(32, 32, true))
, x830_chargeRumbleHandle(-1) , x830_chargeRumbleHandle(-1)
, x832_24_coolingCharge(false) , x832_24_coolingCharge(false)
, x832_25_chargeEffectVisible(false) , x832_25_chargeEffectVisible(false)
@ -587,7 +587,7 @@ void CPlayerGun::InitMuzzleData() {
SObjectTag tag('PART', (i < 0 || 4 < i) ? kInvalidAssetId : gpTweakGunRes->xa4_auxMuzzle[i]); SObjectTag tag('PART', (i < 0 || 4 < i) ? kInvalidAssetId : gpTweakGunRes->xa4_auxMuzzle[i]);
x7c0_auxMuzzleEffects.push_back(gpSimplePool->GetObj(tag)); x7c0_auxMuzzleEffects.push_back(gpSimplePool->GetObj(tag));
// TODO: not likely correct, maybe need improvements to auto_ptr // TODO: not likely correct, maybe need improvements to auto_ptr
x800_auxMuzzleGenerators.push_back(new CElementGen(x7c0_auxMuzzleEffects.back())); x800_auxMuzzleGenerators.push_back(rs_new CElementGen(x7c0_auxMuzzleEffects.back()));
x800_auxMuzzleGenerators.back()->SetParticleEmission(false); x800_auxMuzzleGenerators.back()->SetParticleEmission(false);
} }
} }

View File

@ -155,7 +155,7 @@ void CPlayerState::PutTo(COutputStream& stream) {
stream.WriteBits(x184_scanCompletionRateSecond, GetBitCount(0x100)); stream.WriteBits(x184_scanCompletionRateSecond, GetBitCount(0x100));
} }
void CPlayerState::ReInitializePowerUp(CPlayerState::EItemType type, int capacity) { void CPlayerState::SetPowerUp(CPlayerState::EItemType type, int capacity) {
x24_powerups[uint(type)].x4_capacity = 0; x24_powerups[uint(type)].x4_capacity = 0;
InitializePowerUp(type, capacity); InitializePowerUp(type, capacity);
} }
@ -183,7 +183,7 @@ float CPlayerState::CalculateHealth() {
return (kEnergyTankCapacity * x24_powerups[kIT_EnergyTanks].x0_amount) + kBaseHealthCapacity; return (kEnergyTankCapacity * x24_powerups[kIT_EnergyTanks].x0_amount) + kBaseHealthCapacity;
} }
void CPlayerState::ResetAndIncrPickUp(CPlayerState::EItemType type, int amount) { void CPlayerState::SetPickup(CPlayerState::EItemType type, int amount) {
x24_powerups[uint(type)].x0_amount = 0; x24_powerups[uint(type)].x0_amount = 0;
IncrPickUp(type, amount); IncrPickUp(type, amount);
} }

View File

@ -25,7 +25,7 @@ static const CTransform4f skFaceModelViewAdjust =
CSamusFaceReflection::CSamusFaceReflection(const CStateManager& mgr) CSamusFaceReflection::CSamusFaceReflection(const CStateManager& mgr)
: x0_modelData(CModelData(CAnimRes(gpResourceFactory->GetResourceIdByName(skFaceAssetIdName)->id, : x0_modelData(CModelData(CAnimRes(gpResourceFactory->GetResourceIdByName(skFaceAssetIdName)->id,
CAnimRes::kDefaultCharIdx, CVector3f(1.f, 1.f, 1.f), 0, true))) CAnimRes::kDefaultCharIdx, CVector3f(1.f, 1.f, 1.f), 0, true)))
, x4c_lights(new CActorLights(8, CVector3f::Zero(), 4, 4)) , x4c_lights(rs_new CActorLights(8, CVector3f::Zero(), 4, 4))
, x50_lookRot(CQuaternion::NoRotation()) , x50_lookRot(CQuaternion::NoRotation())
, x60_lookDir(CVector3f::Forward()) , x60_lookDir(CVector3f::Forward())
, x6c_(0) , x6c_(0)

View File

@ -18,7 +18,6 @@
#include "MetroidPrime/ScriptObjects/CScriptSpawnPoint.hpp" #include "MetroidPrime/ScriptObjects/CScriptSpawnPoint.hpp"
#include "MetroidPrime/ScriptObjects/CScriptTrigger.hpp" #include "MetroidPrime/ScriptObjects/CScriptTrigger.hpp"
#include "Kyoto/Alloc/CMemory.hpp" #include "Kyoto/Alloc/CMemory.hpp"
#include "Kyoto/CResFactory.hpp" #include "Kyoto/CResFactory.hpp"
#include "Kyoto/Math/CQuaternion.hpp" #include "Kyoto/Math/CQuaternion.hpp"
@ -193,8 +192,8 @@ CEntity* ScriptLoader::LoadTrigger(CStateManager& mgr, CInputStream& in, int pro
CVector3f orientedForce = CVector3f orientedForce =
mgr.GetWorld()->GetAreaAlways(info.GetAreaId()).GetTM().Rotate(forceVec); mgr.GetWorld()->GetAreaAlways(info.GetAreaId()).GetTM().Rotate(forceVec);
return new CScriptTrigger(mgr.AllocateUniqueId(), name, info, position, box, dInfo, orientedForce, return rs_new CScriptTrigger(mgr.AllocateUniqueId(), name, info, position, box, dInfo,
flags, active, b2, b3); orientedForce, flags, active, b2, b3);
} }
CEntity* ScriptLoader::LoadCameraHintTrigger(CStateManager& mgr, CInputStream& in, int propCount, CEntity* ScriptLoader::LoadCameraHintTrigger(CStateManager& mgr, CInputStream& in, int propCount,
@ -211,13 +210,14 @@ CEntity* ScriptLoader::LoadCameraHintTrigger(CStateManager& mgr, CInputStream& i
if (aHead.x10_transform.GetRotation() == CTransform4f::Identity()) { if (aHead.x10_transform.GetRotation() == CTransform4f::Identity()) {
CAABox box(CVector3f(-(scale.GetX()), -(scale.GetY()), -(scale.GetZ())), CAABox box(CVector3f(-(scale.GetX()), -(scale.GetY()), -(scale.GetZ())),
CVector3f((scale.GetX()), (scale.GetY()), (scale.GetZ()))); CVector3f((scale.GetX()), (scale.GetY()), (scale.GetZ())));
return new CScriptTrigger(mgr.AllocateUniqueId(), aHead.x0_name, info, return rs_new CScriptTrigger(mgr.AllocateUniqueId(), aHead.x0_name, info,
aHead.x10_transform.GetTranslation(), box, CDamageInfo(), aHead.x10_transform.GetTranslation(), box, CDamageInfo(),
CVector3f::Zero(), kTFL_DetectPlayer, active, deactivateOnEnter, CVector3f::Zero(), kTFL_DetectPlayer, active, deactivateOnEnter,
deactivateOnExit); deactivateOnExit);
} else { } else {
return new CScriptCameraHintTrigger(mgr.AllocateUniqueId(), active, aHead.x0_name, info, scale, return rs_new CScriptCameraHintTrigger(mgr.AllocateUniqueId(), active, aHead.x0_name, info,
aHead.x10_transform, deactivateOnEnter, deactivateOnExit); scale, aHead.x10_transform, deactivateOnEnter,
deactivateOnExit);
} }
} }
@ -276,9 +276,9 @@ CEntity* ScriptLoader::LoadDamageableTrigger(CStateManager& mgr, CInputStream& i
CScriptDamageableTrigger::ECanOrbit(in.Get< bool >()); CScriptDamageableTrigger::ECanOrbit(in.Get< bool >());
bool active = in.Get< bool >(); bool active = in.Get< bool >();
CVisorParameters vParms = LoadVisorParameters(in); CVisorParameters vParms = LoadVisorParameters(in);
return new CScriptDamageableTrigger(mgr.AllocateUniqueId(), name, info, position, volume, hInfo, return rs_new CScriptDamageableTrigger(mgr.AllocateUniqueId(), name, info, position, volume,
dVuln, triggerFlags, patternTex1, patternTex2, colorTex, hInfo, dVuln, triggerFlags, patternTex1, patternTex2,
canOrbit, active, vParms); colorTex, canOrbit, active, vParms);
} }
// static CFluidUVMotion LoadFluidUVMotion(CInputStream&) {} // static CFluidUVMotion LoadFluidUVMotion(CInputStream&) {}
@ -306,10 +306,10 @@ CEntity* ScriptLoader::LoadSpawnPoint(CStateManager& mgr, CInputStream& in, int
if (propCount >= 35) if (propCount >= 35)
morphed = in.Get< bool >(); morphed = in.Get< bool >();
return new CScriptSpawnPoint(mgr.AllocateUniqueId(), name, info, return rs_new CScriptSpawnPoint(
ConvertEditorEulerToTransform4f(rotation, position), mgr.AllocateUniqueId(), name, info, ConvertEditorEulerToTransform4f(rotation, position),
rstl::reserved_vector< int, int(CPlayerState::kIT_Max) >(itemCounts), rstl::reserved_vector< int, int(CPlayerState::kIT_Max) >(itemCounts), defaultSpawn, active,
defaultSpawn, active, morphed); morphed);
} }
CEntity* ScriptLoader::LoadDock(CStateManager& mgr, CInputStream& in, int propCount, CEntity* ScriptLoader::LoadDock(CStateManager& mgr, CInputStream& in, int propCount,
@ -324,8 +324,8 @@ CEntity* ScriptLoader::LoadDock(CStateManager& mgr, CInputStream& in, int propCo
int dock = in.Get< int >(); int dock = in.Get< int >();
TAreaId area = in.Get< int >(); TAreaId area = in.Get< int >();
bool loadConnected = in.Get< bool >(); bool loadConnected = in.Get< bool >();
return new CScriptDock(mgr.AllocateUniqueId(), name, info, position, scale, dock, area, active, 0, return rs_new CScriptDock(mgr.AllocateUniqueId(), name, info, position, scale, dock, area, active,
loadConnected); 0, loadConnected);
} }
static CAABox GetCollisionBox(CStateManager& stateMgr, TAreaId id, const CVector3f& extent, static CAABox GetCollisionBox(CStateManager& stateMgr, TAreaId id, const CVector3f& extent,
@ -398,8 +398,8 @@ CEntity* ScriptLoader::LoadActor(CStateManager& mgr, CInputStream& in, int propC
if (collisionExtent == CVector3f::Zero() || negativeCollisionExtent) if (collisionExtent == CVector3f::Zero() || negativeCollisionExtent)
aabb = data.GetBounds(head.x0_actorHead.x10_transform.GetRotation()); aabb = data.GetBounds(head.x0_actorHead.x10_transform.GetRotation());
return new CScriptActor(mgr.AllocateUniqueId(), head.x0_actorHead.x0_name, info, return rs_new CScriptActor(mgr.AllocateUniqueId(), head.x0_actorHead.x0_name, info,
head.x0_actorHead.x10_transform, data, aabb, list, mass, zMomentum, hInfo, head.x0_actorHead.x10_transform, data, aabb, list, mass, zMomentum,
dVuln, actParms, looping, active, shaderIdx, xrayAlpha, noThermalHotZ, hInfo, dVuln, actParms, looping, active, shaderIdx, xrayAlpha,
castsShadow, scaleAdvancementDelta, materialFlag54); noThermalHotZ, castsShadow, scaleAdvancementDelta, materialFlag54);
} }

View File

@ -10,7 +10,7 @@ CFire::CFire(const TToken< CGenDescription >& effect, TUniqueId uid, TAreaId are
: CActor(uid, active, "Fire", CEntityInfo(area, NullConnectionList), xf, : CActor(uid, active, "Fire", CEntityInfo(area, NullConnectionList), xf,
CModelData::CModelDataNull(), MakeMaterialList(), CActorParameters::None(), CModelData::CModelDataNull(), MakeMaterialList(), CActorParameters::None(),
kInvalidUniqueId) kInvalidUniqueId)
, xe8_(new CElementGen(effect)) , xe8_(rs_new CElementGen(effect))
, xec_owner(owner) , xec_owner(owner)
, xf0_damageInfo1(dInfo) , xf0_damageInfo1(dInfo)
, x10c_damageInfo2(dInfo) , x10c_damageInfo2(dInfo)

View File

@ -50,11 +50,11 @@ CHUDBillboardEffect::CHUDBillboardEffect(
if (particle) { if (particle) {
x104_26_isElementGen = true; x104_26_isElementGen = true;
xe8_generator = new CElementGen(*particle); xe8_generator = rs_new CElementGen(*particle);
if (static_cast< CElementGen& >(*xe8_generator).IsIndirectTextured()) if (static_cast< CElementGen& >(*xe8_generator).IsIndirectTextured())
++g_IndirectTexturedBillboardCount; ++g_IndirectTexturedBillboardCount;
} else { } else {
xe8_generator = new CParticleElectric(TToken< CElectricDescription >(*electric)); xe8_generator = rs_new CParticleElectric(TToken< CElectricDescription >(*electric));
} }
++g_BillboardCount; ++g_BillboardCount;
xe8_generator->SetModulationColor(color); xe8_generator->SetModulationColor(color);

View File

@ -17,7 +17,7 @@ CScriptActorKeyframe::CScriptActorKeyframe(TUniqueId uid, const rstl::string& na
, x38_initialLifetime(lifetime) , x38_initialLifetime(lifetime)
, x3c_playbackRate(totalPlayback) , x3c_playbackRate(totalPlayback)
, x40_lifetime(lifetime) , x40_lifetime(lifetime)
, x44_24_looping(looping) , x44_24_isLooped(looping)
, x44_25_isPassive(isPassive) , x44_25_isPassive(isPassive)
, x44_26_fadeOut((fadeOut << 5) & 0x20) , x44_26_fadeOut((fadeOut << 5) & 0x20)
, x44_27_timedLoop((fadeOut << 3) & 0x10) , x44_27_timedLoop((fadeOut << 3) & 0x10)
@ -74,28 +74,29 @@ void CScriptActorKeyframe::UpdateEntity(TUniqueId uid, CStateManager& mgr) {
act->SetModelFlags(CModelFlags::Normal()); act->SetModelFlags(CModelFlags::Normal());
if (act->HasAnimation()) { if (act->HasAnimation()) {
if (act->AnimationData()->IsAdditiveAnimation(x34_animationId)) { if (act->AnimationData()->IsAdditiveAnimation(x34_animationId)) {
act->AnimationData()->AddAdditiveAnimation(x34_animationId, 1.f, x44_24_looping, act->AnimationData()->AddAdditiveAnimation(x34_animationId, 1.f, x44_24_isLooped,
x44_26_fadeOut); x44_26_fadeOut);
} else { } else {
act->AnimationData()->SetAnimation(CAnimPlaybackParms(x34_animationId, -1, 1.f, true), act->AnimationData()->SetAnimation(CAnimPlaybackParms(x34_animationId, -1, 1.f, true),
false); false);
act->ModelData()->EnableLooping(x44_24_looping); act->ModelData()->EnableLooping(x44_24_isLooped);
act->AnimationData()->MultiplyPlaybackRate(x3c_playbackRate); act->AnimationData()->MultiplyPlaybackRate(x3c_playbackRate);
} }
} }
} else if (CPatterned* ai = TCastToPtr< CPatterned >(ent)) { } else if (CPatterned* ai = TCastToPtr< CPatterned >(ent)) {
if (ai->AnimationData()->IsAdditiveAnimation(x34_animationId)) { if (ai->AnimationData()->IsAdditiveAnimation(x34_animationId)) {
ai->AnimationData()->AddAdditiveAnimation(x34_animationId, 1.f, x44_24_looping, ai->AnimationData()->AddAdditiveAnimation(x34_animationId, 1.f, x44_24_isLooped,
x44_26_fadeOut); x44_26_fadeOut);
} else { } else {
ai->GetBodyCtrl()->CommandMgr().DeliverCmd( CBodyStateCmdMgr& cmdMgr = ai->BodyCtrl()->CommandMgr();
CBCScriptedCmd(x34_animationId, x44_24_looping, x44_27_timedLoop, x38_initialLifetime)); cmdMgr.DeliverCmd(
CBCScriptedCmd(x34_animationId, x44_24_isLooped, x44_27_timedLoop, x38_initialLifetime));
} }
} }
} }
void CScriptActorKeyframe::Think(float dt, CStateManager& mgr) { void CScriptActorKeyframe::Think(float dt, CStateManager& mgr) {
if (!x44_25_isPassive && x44_24_looping && x44_27_timedLoop && x44_28_playing && if (!x44_25_isPassive && x44_24_isLooped && x44_27_timedLoop && x44_28_playing &&
x40_lifetime > 0.f) { x40_lifetime > 0.f) {
x40_lifetime -= dt; x40_lifetime -= dt;
@ -113,7 +114,7 @@ void CScriptActorKeyframe::Think(float dt, CStateManager& mgr) {
if (act->HasAnimation()) { if (act->HasAnimation()) {
if (act->AnimationData()->IsAdditiveAnimation(x34_animationId)) { if (act->AnimationData()->IsAdditiveAnimation(x34_animationId)) {
act->AnimationData()->DelAdditiveAnimation(x34_animationId); act->AnimationData()->DelAdditiveAnimation(x34_animationId);
} else if (act->AnimationData()->GetDefaultAnimation() == x34_animationId) { } else if (act->AnimationData()->GetCurrentAnimation() == x34_animationId) {
act->ModelData()->EnableLooping(false); act->ModelData()->EnableLooping(false);
} }
} }
@ -121,10 +122,9 @@ void CScriptActorKeyframe::Think(float dt, CStateManager& mgr) {
if (ai->AnimationData()->IsAdditiveAnimation(x34_animationId)) { if (ai->AnimationData()->IsAdditiveAnimation(x34_animationId)) {
ai->AnimationData()->DelAdditiveAnimation(x34_animationId); ai->AnimationData()->DelAdditiveAnimation(x34_animationId);
} else if (ai->GetBodyCtrl()->GetBodyStateInfo().GetCurrentStateId() == } else if (ai->BodyCtrl()->GetBodyStateInfo().GetCurrentStateId() == pas::kAS_Scripted &&
pas::kAS_Scripted && ai->AnimationData()->GetCurrentAnimation() == x34_animationId) {
ai->AnimationData()->GetDefaultAnimation() == x34_animationId) { ai->BodyCtrl()->CommandMgr().DeliverCmd(CBodyStateCmd(kBSC_ExitState));
ai->GetBodyCtrl()->CommandMgr().DeliverCmd(CBodyStateCmd(kBSC_ExitState));
} }
} }
} }

View File

@ -26,7 +26,7 @@ void CScriptCameraWaypoint::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId
} }
} }
TUniqueId CScriptCameraWaypoint::GetRandomNextWaypointId(const CStateManager& mgr) const { TUniqueId CScriptCameraWaypoint::NextWaypoint(CStateManager& mgr) {
rstl::vector< TUniqueId > candidateIds; rstl::vector< TUniqueId > candidateIds;
rstl::vector< SConnection >::const_iterator conn = GetConnectionList().begin(); rstl::vector< SConnection >::const_iterator conn = GetConnectionList().begin();
@ -47,8 +47,7 @@ TUniqueId CScriptCameraWaypoint::GetRandomNextWaypointId(const CStateManager& mg
return candidateIds[mgr.Random()->Range(0, s32(candidateIds.size() - 1))]; return candidateIds[mgr.Random()->Range(0, s32(candidateIds.size() - 1))];
} }
void CScriptCameraWaypoint::AddToRenderer(const CFrustumPlanes&, void CScriptCameraWaypoint::AddToRenderer(const CFrustumPlanes&, const CStateManager&) const {}
const CStateManager&) const {}
void CScriptCameraWaypoint::Render(const CStateManager&) const {} void CScriptCameraWaypoint::Render(const CStateManager&) const {}

View File

@ -33,7 +33,7 @@ void CScriptEMPulse::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CS
case kSM_Activate: case kSM_Activate:
x114_particleGen = x114_particleGen =
new CElementGen(x108_particleDesc, CElementGen::kMOT_Normal, CElementGen::kOSF_One); rs_new CElementGen(x108_particleDesc, CElementGen::kMOT_Normal, CElementGen::kOSF_One);
x114_particleGen->SetOrientation(GetTransform().GetRotation()); x114_particleGen->SetOrientation(GetTransform().GetRotation());
x114_particleGen->SetGlobalTranslation(GetTranslation()); x114_particleGen->SetGlobalTranslation(GetTranslation());

View File

@ -98,7 +98,7 @@ CScriptPlatform::CScriptPlatform(
AnimationData()->SetIsAnimating(true); AnimationData()->SetIsAnimating(true);
} }
if (x304_treeGroupContainer) { if (x304_treeGroupContainer) {
x314_treeGroup = new CCollidableOBBTreeGroup(**x304_treeGroupContainer, GetMaterialList()); x314_treeGroup = rs_new CCollidableOBBTreeGroup(**x304_treeGroupContainer, GetMaterialList());
} }
} }

View File

@ -53,7 +53,7 @@ void CScriptShadowProjector::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId
case kSM_Activate: case kSM_Activate:
if (GetActive() && x104_target != kInvalidUniqueId && xfc_opacity > 0.f) { if (GetActive() && x104_target != kInvalidUniqueId && xfc_opacity > 0.f) {
x108_projectedShadow = x108_projectedShadow =
new CProjectedShadow(x10c_textureSize, x10c_textureSize, GetPersistent()); rs_new CProjectedShadow(x10c_textureSize, x10c_textureSize, GetPersistent());
} else { } else {
x108_projectedShadow = nullptr; x108_projectedShadow = nullptr;
} }

View File

@ -34,8 +34,8 @@ void CScriptSpawnPoint::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objI
case kSM_Reset: case kSM_Reset:
for (int i = 0; i < CPlayerState::kIT_Max; ++i) { for (int i = 0; i < CPlayerState::kIT_Max; ++i) {
const CPlayerState::EItemType e = CPlayerState::EItemType(i); const CPlayerState::EItemType e = CPlayerState::EItemType(i);
stateMgr.PlayerState()->ReInitializePowerUp(e, GetPowerup(e)); stateMgr.PlayerState()->SetPowerUp(e, GetPowerup(e));
stateMgr.PlayerState()->ResetAndIncrPickUp(e, GetPowerup(e)); stateMgr.PlayerState()->SetPickup(e, GetPowerup(e));
} }
case kSM_SetToZero: case kSM_SetToZero:

View File

@ -302,7 +302,7 @@ void CScriptSpecialFunction::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId
case kSF_MissileStation: { case kSF_MissileStation: {
if (msg == kSM_Action) { if (msg == kSM_Action) {
CPlayerState& pState = *mgr.PlayerState(); CPlayerState& pState = *mgr.PlayerState();
pState.ResetAndIncrPickUp(CPlayerState::kIT_Missiles, pState.SetPickup(CPlayerState::kIT_Missiles,
pState.GetItemCapacity(CPlayerState::kIT_Missiles)); pState.GetItemCapacity(CPlayerState::kIT_Missiles));
} }
break; break;
@ -310,7 +310,7 @@ void CScriptSpecialFunction::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId
case kSF_PowerBombStation: { case kSF_PowerBombStation: {
if (msg == kSM_Action) { if (msg == kSM_Action) {
CPlayerState& pState = *mgr.PlayerState(); CPlayerState& pState = *mgr.PlayerState();
pState.ResetAndIncrPickUp(CPlayerState::kIT_PowerBombs, pState.SetPickup(CPlayerState::kIT_PowerBombs,
pState.GetItemCapacity(CPlayerState::kIT_PowerBombs)); pState.GetItemCapacity(CPlayerState::kIT_PowerBombs));
} }
break; break;
@ -875,7 +875,7 @@ void CScriptSpecialFunction::ThinkSpinnerController(float dt, CStateManager& mgr
} }
const CAnimData* animData = plat->GetAnimationData(); const CAnimData* animData = plat->GetAnimationData();
const float dur = animData->GetAnimationDuration(animData->GetDefaultAnimation()) * x138_; const float dur = animData->GetAnimationDuration(animData->GetCurrentAnimation()) * x138_;
plat->AnimationData()->SetPhase(0.f); plat->AnimationData()->SetPhase(0.f);
plat->AnimationData()->SetPlaybackRate(1.f); plat->AnimationData()->SetPlaybackRate(1.f);
CAdvancementDeltas deltas = plat->UpdateAnimation(dur, mgr, true); CAdvancementDeltas deltas = plat->UpdateAnimation(dur, mgr, true);

View File

@ -85,7 +85,7 @@ void CScriptVisorGoo::Think(float, CStateManager& mgr) {
const float t = (x108_maxDist - eyeToGooDist) / (x108_maxDist - x104_minDist); const float t = (x108_maxDist - eyeToGooDist) / (x108_maxDist - x104_minDist);
float prob = t * x10c_nearProb + (1.0f - t) * x110_farProb; float prob = t * x10c_nearProb + (1.0f - t) * x110_farProb;
if (mgr.Random()->Float() * 100.f <= prob) { if (mgr.Random()->Float() * 100.f <= prob) {
mgr.AddObject(new CHUDBillboardEffect( mgr.AddObject(rs_new CHUDBillboardEffect(
xfc_particleId != kInvalidAssetId xfc_particleId != kInvalidAssetId
? rstl::optional_object< TToken< CGenDescription > >(xe8_particleDesc) ? rstl::optional_object< TToken< CGenDescription > >(xe8_particleDesc)
: rstl::optional_object_null(), : rstl::optional_object_null(),

View File

@ -64,13 +64,13 @@ void CTweaks::RegisterTweaks() {
{ {
rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync( rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync(
SObjectTag('CTWK', IDFromFactory(*resFactory, "Particle")), nullptr); SObjectTag('CTWK', IDFromFactory(*resFactory, "Particle")), nullptr);
gpTweakParticle = new CTweakParticle(*stream); gpTweakParticle = rs_new CTweakParticle(*stream);
mTweakObjects[2] = gpTweakParticle; mTweakObjects[2] = gpTweakParticle;
} }
{ {
rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync( rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync(
SObjectTag('CTWK', IDFromFactory(*resFactory, "Player")), nullptr); SObjectTag('CTWK', IDFromFactory(*resFactory, "Player")), nullptr);
gpTweakPlayer = new CTweakPlayer(*stream); gpTweakPlayer = rs_new CTweakPlayer(*stream);
mTweakObjects[0] = gpTweakPlayer; mTweakObjects[0] = gpTweakPlayer;
} }
{ {
@ -82,67 +82,67 @@ void CTweaks::RegisterTweaks() {
{ {
rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync( rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync(
SObjectTag('CTWK', IDFromFactory(*resFactory, "Ball")), nullptr); SObjectTag('CTWK', IDFromFactory(*resFactory, "Ball")), nullptr);
gpTweakBall = new CTweakBall(*stream); gpTweakBall = rs_new CTweakBall(*stream);
mTweakObjects[7] = gpTweakBall; mTweakObjects[7] = gpTweakBall;
} }
{ {
rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync( rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync(
SObjectTag('CTWK', IDFromFactory(*resFactory, "PlayerGun")), nullptr); SObjectTag('CTWK', IDFromFactory(*resFactory, "PlayerGun")), nullptr);
gpTweakPlayerGun = new CTweakPlayerGun(*stream); gpTweakPlayerGun = rs_new CTweakPlayerGun(*stream);
mTweakObjects[4] = gpTweakPlayerGun; mTweakObjects[4] = gpTweakPlayerGun;
} }
{ {
rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync( rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync(
SObjectTag('CTWK', IDFromFactory(*resFactory, "Targeting")), nullptr); SObjectTag('CTWK', IDFromFactory(*resFactory, "Targeting")), nullptr);
gpTweakTargeting = new CTweakTargeting(*stream); gpTweakTargeting = rs_new CTweakTargeting(*stream);
mTweakObjects[8] = gpTweakTargeting; mTweakObjects[8] = gpTweakTargeting;
} }
{ {
rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync( rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync(
SObjectTag('CTWK', IDFromFactory(*resFactory, "Game")), nullptr); SObjectTag('CTWK', IDFromFactory(*resFactory, "Game")), nullptr);
gpTweakGame = new CTweakGame(*stream); gpTweakGame = rs_new CTweakGame(*stream);
mTweakObjects[1] = gpTweakGame; mTweakObjects[1] = gpTweakGame;
} }
{ {
rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync( rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync(
SObjectTag('CTWK', IDFromFactory(*resFactory, "GuiColors")), nullptr); SObjectTag('CTWK', IDFromFactory(*resFactory, "GuiColors")), nullptr);
gpTweakGuiColors = new CTweakGuiColors(*stream); gpTweakGuiColors = rs_new CTweakGuiColors(*stream);
mTweakObjects[6] = gpTweakGuiColors; mTweakObjects[6] = gpTweakGuiColors;
} }
{ {
rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync( rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync(
SObjectTag('CTWK', IDFromFactory(*resFactory, "AutoMapper")), nullptr); SObjectTag('CTWK', IDFromFactory(*resFactory, "AutoMapper")), nullptr);
gpTweakAutoMapper = new CTweakAutoMapper(*stream); gpTweakAutoMapper = rs_new CTweakAutoMapper(*stream);
mTweakObjects[2] = gpTweakAutoMapper; mTweakObjects[2] = gpTweakAutoMapper;
CMappableObject::ReadAutomapperTweaks(*gpTweakAutoMapper); CMappableObject::ReadAutomapperTweaks(*gpTweakAutoMapper);
} }
{ {
rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync( rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync(
SObjectTag('CTWK', IDFromFactory(*resFactory, "Gui")), nullptr); SObjectTag('CTWK', IDFromFactory(*resFactory, "Gui")), nullptr);
gpTweakGui = new CTweakGui(*stream); gpTweakGui = rs_new CTweakGui(*stream);
mTweakObjects[5] = gpTweakGui; mTweakObjects[5] = gpTweakGui;
} }
{ {
rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync( rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync(
SObjectTag('CTWK', IDFromFactory(*resFactory, "PlayerControls")), nullptr); SObjectTag('CTWK', IDFromFactory(*resFactory, "PlayerControls")), nullptr);
gpTweakPlayerControlCurrent = new CTweakPlayerControl(*stream); gpTweakPlayerControlCurrent = rs_new CTweakPlayerControl(*stream);
mTweakObjects[3] = gpTweakPlayerControlCurrent; mTweakObjects[3] = gpTweakPlayerControlCurrent;
gpTweakPlayerControl1 = gpTweakPlayerControlCurrent; gpTweakPlayerControl1 = gpTweakPlayerControlCurrent;
} }
{ {
rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync( rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync(
SObjectTag('CTWK', IDFromFactory(*resFactory, "PlayerControls2")), nullptr); SObjectTag('CTWK', IDFromFactory(*resFactory, "PlayerControls2")), nullptr);
gpTweakPlayerControl2 = new CTweakPlayerControl(*stream); gpTweakPlayerControl2 = rs_new CTweakPlayerControl(*stream);
mTweakObjects[13] = gpTweakPlayerControl2; mTweakObjects[13] = gpTweakPlayerControl2;
} }
{ {
rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync( rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync(
SObjectTag('CTWK', IDFromFactory(*resFactory, "SlideShow")), nullptr); SObjectTag('CTWK', IDFromFactory(*resFactory, "SlideShow")), nullptr);
gpTweakSlideShow = new CTweakSlideShow(*stream); gpTweakSlideShow = rs_new CTweakSlideShow(*stream);
mTweakObjects[12] = gpTweakSlideShow; mTweakObjects[12] = gpTweakSlideShow;
} }
} }
@ -152,14 +152,14 @@ void CTweaks::RegisterResourceTweaks() {
if (gpTweakGunRes == nullptr) { if (gpTweakGunRes == nullptr) {
rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync( rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync(
SObjectTag('CTWK', IDFromFactory(*resFactory, "GunRes")), nullptr); SObjectTag('CTWK', IDFromFactory(*resFactory, "GunRes")), nullptr);
gpTweakGunRes = new CTweakGunRes(*stream); gpTweakGunRes = rs_new CTweakGunRes(*stream);
mTweakObjects[10] = gpTweakGunRes; mTweakObjects[10] = gpTweakGunRes;
} }
if (gpTweakPlayerRes == nullptr) { if (gpTweakPlayerRes == nullptr) {
rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync( rstl::auto_ptr< CInputStream > stream = resFactory->GetResLoader().LoadNewResourceSync(
SObjectTag('CTWK', IDFromFactory(*resFactory, "PlayerRes")), nullptr); SObjectTag('CTWK', IDFromFactory(*resFactory, "PlayerRes")), nullptr);
gpTweakPlayerRes = new CTweakPlayerRes(*stream); gpTweakPlayerRes = rs_new CTweakPlayerRes(*stream);
mTweakObjects[11] = gpTweakPlayerRes; mTweakObjects[11] = gpTweakPlayerRes;
} }
} }

View File

@ -18,9 +18,9 @@ CElectricBeamProjectile::CElectricBeamProjectile(const TToken< CWeaponDescriptio
: CBeamProjectile(wDesc, rstl::string_l("ElectricBeamProjectile"), wType, xf, elec.x8_maxLength, : CBeamProjectile(wDesc, rstl::string_l("ElectricBeamProjectile"), wType, xf, elec.x8_maxLength,
elec.xc_radius, elec.x10_travelSpeed, matTypes, dInfo, uid, areaId, owner, elec.xc_radius, elec.x10_travelSpeed, matTypes, dInfo, uid, areaId, owner,
attribs, false) attribs, false)
, x468_electric(new CParticleElectric(elec.x0_electricDescription)) , x468_electric(rs_new CParticleElectric(elec.x0_electricDescription))
, x46c_genDescription(gpSimplePool->GetObj(SObjectTag('PART', elec.x14_particleId))) , x46c_genDescription(gpSimplePool->GetObj(SObjectTag('PART', elec.x14_particleId)))
, x478_elementGen(new CElementGen(x46c_genDescription)) , x478_elementGen(rs_new CElementGen(x46c_genDescription))
, x47c_fadeSpeed(elec.x18_fadeSpeed) , x47c_fadeSpeed(elec.x18_fadeSpeed)
, x484_damageTimer(0.f) , x484_damageTimer(0.f)
, x488_damageInterval(elec.x1c_damageInterval) , x488_damageInterval(elec.x1c_damageInterval)

View File

@ -111,7 +111,7 @@ const SWeaponInfo& CGunWeapon::GetWeaponInfo() const {
void CGunWeapon::LoadMuzzleFx(float dt) { void CGunWeapon::LoadMuzzleFx(float dt) {
for (int i = 0; i < x16c_muzzleEffects.capacity(); ++i) { for (int i = 0; i < x16c_muzzleEffects.capacity(); ++i) {
CElementGen* newElement = new CElementGen(x16c_muzzleEffects[i]); CElementGen* newElement = rs_new CElementGen(x16c_muzzleEffects[i]);
newElement->SetParticleEmission(false); newElement->SetParticleEmission(false);
newElement->Update(dt); newElement->Update(dt);
x1a4_muzzleGenerators.push_back(newElement); x1a4_muzzleGenerators.push_back(newElement);
@ -130,7 +130,7 @@ void CGunWeapon::LoadGunModels(CStateManager& mgr) {
LoadSuitArm(mgr); LoadSuitArm(mgr);
x10_solidModelData->SetSortThermal(true); x10_solidModelData->SetSortThermal(true);
x60_holoModelData->SetSortThermal(true); x60_holoModelData->SetSortThermal(true);
x100_gunController = new CGunController(*x10_solidModelData); x100_gunController = rs_new CGunController(*x10_solidModelData);
} }
void CGunWeapon::LoadProjectileData(CStateManager& mgr) { void CGunWeapon::LoadProjectileData(CStateManager& mgr) {
@ -299,7 +299,7 @@ void CGunWeapon::ActivateCharge(bool enable, bool resetEffect) {
x208_muzzleEffectIdx = !!enable; x208_muzzleEffectIdx = !!enable;
if (enable || resetEffect) { if (enable || resetEffect) {
x1a4_muzzleGenerators[x208_muzzleEffectIdx] = x1a4_muzzleGenerators[x208_muzzleEffectIdx] =
new CElementGen(x16c_muzzleEffects[x208_muzzleEffectIdx]); rs_new CElementGen(x16c_muzzleEffects[x208_muzzleEffectIdx]);
} }
} }
@ -406,7 +406,7 @@ void CGunWeapon::Fire(bool underwater, float dt, CPlayerState::EChargeStage char
if (chargeState != CPlayerState::kCS_Normal) if (chargeState != CPlayerState::kCS_Normal)
attribs = kPA_ArmCannon | kPA_Charged; attribs = kPA_ArmCannon | kPA_Charged;
CEnergyProjectile* proj = new CEnergyProjectile( CEnergyProjectile* proj = rs_new CEnergyProjectile(
true, x144_weapons[chargeState], x1c0_weaponType, xf, x1c8_playerMaterial, dInfo, true, x144_weapons[chargeState], x1c0_weaponType, xf, x1c8_playerMaterial, dInfo,
mgr.AllocateUniqueId(), kInvalidAreaId, GetPlayerId(), homingTarget, mgr.AllocateUniqueId(), kInvalidAreaId, GetPlayerId(), homingTarget,
particleChargeAttribs | attribs, underwater, scale, rstl::optional_object_null(), particleChargeAttribs | attribs, underwater, scale, rstl::optional_object_null(),
@ -672,13 +672,13 @@ void CGunWeapon::EnableFrozenEffect(EFrozenFxType type) {
case kFFT_Thawed: case kFFT_Thawed:
if (x204_frozenEffect == kFFT_Thawed) if (x204_frozenEffect == kFFT_Thawed)
break; break;
x1b8_frozenGenerator = new CElementGen(x188_frozenEffects[1]); x1b8_frozenGenerator = rs_new CElementGen(x188_frozenEffects[1]);
x1b8_frozenGenerator->SetGlobalScale(x4_scale); x1b8_frozenGenerator->SetGlobalScale(x4_scale);
break; break;
case kFFT_Frozen: case kFFT_Frozen:
if (x204_frozenEffect == kFFT_Frozen) if (x204_frozenEffect == kFFT_Frozen)
break; break;
x1b8_frozenGenerator = new CElementGen(x188_frozenEffects[0]); x1b8_frozenGenerator = rs_new CElementGen(x188_frozenEffects[0]);
x1b8_frozenGenerator->SetGlobalScale(x4_scale); x1b8_frozenGenerator->SetGlobalScale(x4_scale);
break; break;
default: default:

View File

@ -80,7 +80,7 @@ void CIceBeam::Update(float dt, CStateManager& mgr) {
if (!x248_24_loaded) { if (!x248_24_loaded) {
x248_24_loaded = x21c_iceSmoke.IsLoaded() && x228_ice2nd1.IsLoaded() && x234_ice2nd2.IsLoaded(); x248_24_loaded = x21c_iceSmoke.IsLoaded() && x228_ice2nd1.IsLoaded() && x234_ice2nd2.IsLoaded();
if (x248_24_loaded) { if (x248_24_loaded) {
x240_smokeGen = new CElementGen(x21c_iceSmoke); x240_smokeGen = rs_new CElementGen(x21c_iceSmoke);
x240_smokeGen->SetGlobalScale(x4_scale); x240_smokeGen->SetGlobalScale(x4_scale);
x240_smokeGen->SetParticleEmission(false); x240_smokeGen->SetParticleEmission(false);
} }
@ -127,14 +127,14 @@ void CIceBeam::EnableSecondaryFx(ESecondaryFxType type) {
case kSFT_ToCombo: case kSFT_ToCombo:
case kSFT_CancelCharge: case kSFT_CancelCharge:
if (!x248_25_inEndFx) { if (!x248_25_inEndFx) {
x244_chargeFx = new CElementGen(x234_ice2nd2); x244_chargeFx = rs_new CElementGen(x234_ice2nd2);
x244_chargeFx->SetGlobalScale(x4_scale); x244_chargeFx->SetGlobalScale(x4_scale);
x248_25_inEndFx = true; x248_25_inEndFx = true;
x1cc_enabledSecondaryEffect = kSFT_CancelCharge; x1cc_enabledSecondaryEffect = kSFT_CancelCharge;
} }
break; break;
case kSFT_Charge: case kSFT_Charge:
x244_chargeFx = new CElementGen(x228_ice2nd1); x244_chargeFx = rs_new CElementGen(x228_ice2nd1);
x244_chargeFx->SetGlobalScale(x4_scale); x244_chargeFx->SetGlobalScale(x4_scale);
x1cc_enabledSecondaryEffect = type; x1cc_enabledSecondaryEffect = type;
x248_25_inEndFx = false; x248_25_inEndFx = false;

View File

@ -35,7 +35,7 @@ bool CTargetableProjectile::Explode(const CVector3f& pos, const CVector3f& norma
TUniqueId uid = mgr.AllocateUniqueId(); TUniqueId uid = mgr.AllocateUniqueId();
CVector3f aimPosition = act->GetAimPosition(mgr, 0.f); CVector3f aimPosition = act->GetAimPosition(mgr, 0.f);
CEnergyProjectile* projectile = new CEnergyProjectile( CEnergyProjectile* projectile = rs_new CEnergyProjectile(
true, x3d8_weaponDesc, GetWeaponType(), true, x3d8_weaponDesc, GetWeaponType(),
CTransform4f::LookAt(x170_projectile.GetTranslation(), aimPosition, CVector3f::Up()), CTransform4f::LookAt(x170_projectile.GetTranslation(), aimPosition, CVector3f::Up()),
kMT_Player, x3e0_damage, uid, GetCurrentAreaId(), GetHitProjectileOwner(), GetOwnerId(), kMT_Player, x3e0_damage, uid, GetCurrentAreaId(), GetHitProjectileOwner(), GetOwnerId(),

View File

@ -101,7 +101,7 @@ void CWaveBeam::Fire(bool underwater, float dt, CPlayerState::EChargeStage charg
for (int i = 0; i < 3; ++i) { for (int i = 0; i < 3; ++i) {
CTransform4f shotXf = CTransform4f shotXf =
xf * CTransform4f::RotateY(CRelAngle::FromDegrees((randAng + i) * skShotAnglePitch)); xf * CTransform4f::RotateY(CRelAngle::FromDegrees((randAng + i) * skShotAnglePitch));
CEnergyProjectile* proj = new CEnergyProjectile( CEnergyProjectile* proj = rs_new CEnergyProjectile(
true, x144_weapons[chargeState], GetWeaponType(), shotXf, GetPlayerMaterial(), true, x144_weapons[chargeState], GetWeaponType(), shotXf, GetPlayerMaterial(),
GetDamageInfo(mgr, chargeState, chargeFactor1), mgr.AllocateUniqueId(), kInvalidAreaId, GetDamageInfo(mgr, chargeState, chargeFactor1), mgr.AllocateUniqueId(), kInvalidAreaId,
GetPlayerId(), homingTarget, kPA_ArmCannon, underwater, CVector3f(1.f, 1.f, 1.f), GetPlayerId(), homingTarget, kPA_ArmCannon, underwater, CVector3f(1.f, 1.f, 1.f),
@ -151,7 +151,7 @@ void CWaveBeam::EnableSecondaryFx(ESecondaryFxType type) {
default: default:
if (x1cc_enabledSecondaryEffect != kSFT_ToCombo) { if (x1cc_enabledSecondaryEffect != kSFT_ToCombo) {
CToken fx = type == kSFT_Charge ? x228_wave2nd1 : x234_wave2nd2; CToken fx = type == kSFT_Charge ? x228_wave2nd1 : x234_wave2nd2;
x250_chargeElec = new CParticleElectric(fx); x250_chargeElec = rs_new CParticleElectric(fx);
x250_chargeElec->SetGlobalScale(x4_scale); x250_chargeElec->SetGlobalScale(x4_scale);
} }
switch (type) { switch (type) {
@ -167,7 +167,7 @@ void CWaveBeam::EnableSecondaryFx(ESecondaryFxType type) {
} }
break; break;
case kSFT_ToCombo: case kSFT_ToCombo:
x254_chargeFx = new CElementGen(x240_wave2nd3); x254_chargeFx = rs_new CElementGen(x240_wave2nd3);
x254_chargeFx->SetGlobalScale(x4_scale); x254_chargeFx->SetGlobalScale(x4_scale);
x24c_effectTimer = 0.f; x24c_effectTimer = 0.f;
x258_25_effectTimerActive = true; x258_25_effectTimerActive = true;

View File

@ -209,8 +209,8 @@ void CMain::ShutdownSubsystems() {
CGameGlobalObjects::CGameGlobalObjects(COsContext& osContext, CMemorySys& memorySys) CGameGlobalObjects::CGameGlobalObjects(COsContext& osContext, CMemorySys& memorySys)
: xcc_simplePool(x4_resFactory) : xcc_simplePool(x4_resFactory)
, x130_graphicsSys(osContext, memorySys, GRAPHICS_FIFO_SIZE, sGraphicsFifo) , x130_graphicsSys(osContext, memorySys, GRAPHICS_FIFO_SIZE, sGraphicsFifo)
, x134_gameState(new CGameState()) , x134_gameState(rs_new CGameState())
, x150_inGameTweakManager(new CInGameTweakManager()) , x150_inGameTweakManager(rs_new CInGameTweakManager())
, x154_defaultFont(LoadDefaultFont()) { , x154_defaultFont(LoadDefaultFont()) {
gpResourceFactory = &x4_resFactory; gpResourceFactory = &x4_resFactory;
gpSimplePool = &xcc_simplePool; gpSimplePool = &xcc_simplePool;
@ -397,11 +397,11 @@ const uchar sDefaultFontTexture[] = {
}; };
CRasterFont* CGameGlobalObjects::LoadDefaultFont() { CRasterFont* CGameGlobalObjects::LoadDefaultFont() {
CZipInputStream fontDataStream(new CMemoryInStream(sDefaultFontData, sizeof(sDefaultFontData))); CZipInputStream fontDataStream(rs_new CMemoryInStream(sDefaultFontData, sizeof(sDefaultFontData)));
CRasterFont* font = new CRasterFont(fontDataStream, nullptr); CRasterFont* font = rs_new CRasterFont(fontDataStream, nullptr);
CZipInputStream fontTextureStream( CZipInputStream fontTextureStream(
new CMemoryInStream(sDefaultFontTexture, sizeof(sDefaultFontTexture))); rs_new CMemoryInStream(sDefaultFontTexture, sizeof(sDefaultFontTexture)));
font->SetTexture(new CTexture(fontTextureStream, CTexture::kAM_Zero, CTexture::kBK_Zero)); font->SetTexture(rs_new CTexture(fontTextureStream, CTexture::kAM_Zero, CTexture::kBK_Zero));
return font; return font;
} }
@ -450,12 +450,12 @@ CGameArchitectureSupport::CGameArchitectureSupport(COsContext& osContext)
gpMain->SetMaxSpeed(false); gpMain->SetMaxSpeed(false);
gpMain->ResetGameState(); gpMain->ResetGameState();
if (!gpTweakGame->GetSplashScreensDisabled()) { if (!gpTweakGame->GetSplashScreensDisabled()) {
x58_ioWinMgr.AddIOWin(new CSplashScreen(CSplashScreen::Nintendo), 1000, 10000); x58_ioWinMgr.AddIOWin(rs_new CSplashScreen(CSplashScreen::Nintendo), 1000, 10000);
} }
x58_ioWinMgr.AddIOWin(new CMainFlow(), 0, 0); x58_ioWinMgr.AddIOWin(rs_new CMainFlow(), 0, 0);
x58_ioWinMgr.AddIOWin(new CConsoleOutputWindow(8, 5.f, 0.75f), 100, 0); x58_ioWinMgr.AddIOWin(rs_new CConsoleOutputWindow(8, 5.f, 0.75f), 100, 0);
x58_ioWinMgr.AddIOWin(new CAudioStateWin(), 100, -1); x58_ioWinMgr.AddIOWin(rs_new CAudioStateWin(), 100, -1);
x58_ioWinMgr.AddIOWin(new CErrorOutputWindow(false), 10000, 100000); x58_ioWinMgr.AddIOWin(rs_new CErrorOutputWindow(false), 10000, 100000);
InitializeApplicationUI(x44_guiSys); InitializeApplicationUI(x44_guiSys);
CGuiSys::SetGlobalGuiSys(&x44_guiSys); CGuiSys::SetGlobalGuiSys(&x44_guiSys);
gpController = x30_inputGenerator.GetController(); gpController = x30_inputGenerator.GetController();
@ -481,7 +481,7 @@ void CMain::StreamNewGameState(CInputStream& in, int saveIdx) {
bool hasFusion = gpGameState->SystemOptions().GetHasFusion(); bool hasFusion = gpGameState->SystemOptions().GetHasFusion();
x128_gameGlobalObjects->GameState() = nullptr; x128_gameGlobalObjects->GameState() = nullptr;
gpGameState = nullptr; gpGameState = nullptr;
x128_gameGlobalObjects->GameState() = new CGameState(in, saveIdx); x128_gameGlobalObjects->GameState() = rs_new CGameState(in, saveIdx);
gpGameState = x128_gameGlobalObjects->GameState().get(); gpGameState = x128_gameGlobalObjects->GameState().get();
gpGameState->SystemOptions().SetHasFusion(hasFusion); gpGameState->SystemOptions().SetHasFusion(hasFusion);
gpGameState->PlayerState()->SetIsFusionEnabled(gpGameState->SystemOptions().GetHasFusion()); gpGameState->PlayerState()->SetIsFusionEnabled(gpGameState->SystemOptions().GetHasFusion());
@ -499,7 +499,7 @@ void CMain::RefreshGameState() {
gpGameState = nullptr; gpGameState = nullptr;
{ {
CMemoryInStream stream(backupBuf.data(), backupBuf.size(), CMemoryInStream::kOS_Owned); CMemoryInStream stream(backupBuf.data(), backupBuf.size(), CMemoryInStream::kOS_Owned);
x128_gameGlobalObjects->GameState() = new CGameState(stream, saveIdx); x128_gameGlobalObjects->GameState() = rs_new CGameState(stream, saveIdx);
} }
gpGameState = x128_gameGlobalObjects->GameState().get(); gpGameState = x128_gameGlobalObjects->GameState().get();
gpGameState->SystemOptions() = systemOptions; gpGameState->SystemOptions() = systemOptions;
@ -564,7 +564,7 @@ int CMain::RsMain(int argc, const char* const* argv) {
LCEnable(); LCEnable();
rstl::single_ptr< CGameGlobalObjects > gameGlobalObjects( rstl::single_ptr< CGameGlobalObjects > gameGlobalObjects(
new CGameGlobalObjects(x0_osContext, x6d_memorySys)); rs_new CGameGlobalObjects(x0_osContext, x6d_memorySys));
x128_gameGlobalObjects = gameGlobalObjects.get(); x128_gameGlobalObjects = gameGlobalObjects.get();
for (int i = 0; i < 4; ++i) { for (int i = 0; i < 4; ++i) {
@ -593,7 +593,7 @@ int CMain::RsMain(int argc, const char* const* argv) {
FillInAssetIDs(); FillInAssetIDs();
rstl::single_ptr< CGameArchitectureSupport > archSupport( rstl::single_ptr< CGameArchitectureSupport > archSupport(
new CGameArchitectureSupport(x0_osContext)); rs_new CGameArchitectureSupport(x0_osContext));
x164_ = archSupport.get(); x164_ = archSupport.get();
archSupport->PreloadAudio(); archSupport->PreloadAudio();
@ -680,7 +680,7 @@ int CMain::RsMain(int argc, const char* const* argv) {
sub_8036ccfc(); sub_8036ccfc();
archSupport = nullptr; archSupport = nullptr;
CGameArchitectureSupport* tmp = new CGameArchitectureSupport(x0_osContext); CGameArchitectureSupport* tmp = rs_new CGameArchitectureSupport(x0_osContext);
archSupport = tmp; archSupport = tmp;
x164_ = archSupport.get(); x164_ = archSupport.get();
tmp->PreloadAudio(); tmp->PreloadAudio();
@ -724,7 +724,7 @@ void CMain::ResetGameState() {
CGameOptions gameOptions = gpGameState->GameOptions(); CGameOptions gameOptions = gpGameState->GameOptions();
x128_gameGlobalObjects->GameState() = nullptr; x128_gameGlobalObjects->GameState() = nullptr;
gpGameState = nullptr; gpGameState = nullptr;
x128_gameGlobalObjects->GameState() = new CGameState(); x128_gameGlobalObjects->GameState() = rs_new CGameState();
gpGameState = x128_gameGlobalObjects->GameState().get(); gpGameState = x128_gameGlobalObjects->GameState().get();
gpGameState->SystemOptions() = persistentOptions; gpGameState->SystemOptions() = persistentOptions;
gpGameState->GameOptions() = gameOptions; gpGameState->GameOptions() = gameOptions;