-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1] mmCullCity::Init() #140
base: master
Are you sure you want to change the base?
Conversation
Scale should be a float
code/midtown/mmcity/cullcity.cpp
Outdated
if (!city_dlp) | ||
Quitf("Unable to load city '%s'", name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you comment out these two lines? There's a patch in patches.cpp which removes this Quitf
code/midtown/mmcity/cullcity.cpp
Outdated
arts_strcpy(lm_path, name); | ||
arts_strcat(lm_path, "lm"); | ||
|
||
TEXSHEET.allow_remapping_ = (MMSTATE.TimeOfDay == mmTimeOfDay::Sunset or MMSTATE.TimeOfDay == mmTimeOfDay::Night); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use ||
, not or
code/midtown/mmcity/cullcity.cpp
Outdated
asNode::AddChild(&BangerDataManager); | ||
asNode::AddChild(&BangerActiveManager); | ||
asNode::AddChild(&BangerManager); | ||
asNode::AddChild(&asnode34AF0); | ||
asNode::AddChild(&PHYS); | ||
asNode::AddChild(&RenderWeb); | ||
asNode::AddChild(&Particles); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need the asNode::
prefix for these
code/midtown/mmcity/cullcity.cpp
Outdated
if (MMSTATE.GameMode == mmGameMode::Blitz) | ||
{ | ||
LoadBangers(arts_formatf<64>("%s_b%d", name, MMSTATE.EventId)); | ||
} | ||
else if (MMSTATE.GameMode == mmGameMode::Checkpoint) | ||
{ | ||
LoadBangers(arts_formatf<64>("%s_r%d", name, MMSTATE.EventId)); | ||
} | ||
else if (MMSTATE.GameMode == mmGameMode::Circuit) | ||
{ | ||
LoadBangers(arts_formatf<64>("%s_c%d", name, MMSTATE.EventId)); | ||
} | ||
else if (MMSTATE.GameMode == mmGameMode::Cruise) | ||
{ | ||
LoadBangers(arts_formatf<64>("%s_roam", name)); | ||
} | ||
else if (MMSTATE.GameMode == mmGameMode::CnR) | ||
{ | ||
LoadBangers(arts_formatf<64>("%s_cops", name)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this a switch instead of lots of if-elses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed them to a switch, and also reordered them so they're consistent with the codebase.
ResetInst = new mmYInstance(); | ||
|
||
LoadFacades(name); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing the EnableSphereCull = CHICAGO;
line
code/midtown/mmcity/cullcity.cpp
Outdated
BuildingChain.Parent(light_1, 35); | ||
BuildingChain.Parent(light_2, 35); | ||
|
||
InitTimeOfDayAndWeather(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code and onwards shouldn't be inside if (CHICAGO)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully the new code matches what you intended.
In the future it would be nice to have something like this (next to the Chicago case)
if (CityName = "custom_city")
... custom Runway lights ...
... custom Runway lights ...
code/midtown/mmcity/cullcity.cpp
Outdated
|
||
EndMemStat(); | ||
|
||
void ShowRenderStats(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing the CULLMGR->AddPage call.
Since ShowRenderStats
is a static function, it wasn't automatically imported. You need to do ARTS_IMPORT void ShowRenderStats();
outside the function, and add import_symbol(0x48CC30, "?ShowRenderStats@@YAXXZ");
to symbols.cpp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the function and the import.
CULLMGR->AddPage(ShowRenderStats);
correctly adds the page in the game
code/midtown/mmcity/cullcity.h
Outdated
mmSky Sky; | ||
asRenderWeb RenderWeb; | ||
agiTexSorter TexSorter; | ||
u8 gap[0x3]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this gap, since it's just from alignment padding
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this would mess with the check_size
, but yeah it's still good now
Removed unnecessary parenthesis
Currently, it's only possible to load props in Circuit races.
With the re-implementation of this function, it will also be possible to load props in Blitzes, Checkpoints, Cruise and CnR (all have been tested, see e.g. (1)). The code compiles without errors in Final mode.
If there are any changes still needed, let me know.
(1)
