Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

[1] mmCullCity::Init() #140

wants to merge 4 commits into from

Conversation

KcRobin9
Copy link
Collaborator

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)
Props_CnR

Comment on lines 142 to 143
if (!city_dlp)
Quitf("Unable to load city '%s'", name);
Copy link
Owner

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

arts_strcpy(lm_path, name);
arts_strcat(lm_path, "lm");

TEXSHEET.allow_remapping_ = (MMSTATE.TimeOfDay == mmTimeOfDay::Sunset or MMSTATE.TimeOfDay == mmTimeOfDay::Night);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use ||, not or

Comment on lines 152 to 158
asNode::AddChild(&BangerDataManager);
asNode::AddChild(&BangerActiveManager);
asNode::AddChild(&BangerManager);
asNode::AddChild(&asnode34AF0);
asNode::AddChild(&PHYS);
asNode::AddChild(&RenderWeb);
asNode::AddChild(&Particles);
Copy link
Owner

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

Comment on lines 200 to 219
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));
}
Copy link
Owner

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

Copy link
Collaborator Author

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);

Copy link
Owner

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

BuildingChain.Parent(light_1, 35);
BuildingChain.Parent(light_2, 35);

InitTimeOfDayAndWeather();
Copy link
Owner

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)

Copy link
Collaborator Author

@KcRobin9 KcRobin9 Dec 29, 2023

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 ...


EndMemStat();

void ShowRenderStats();
Copy link
Owner

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

Copy link
Collaborator Author

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

mmSky Sky;
asRenderWeb RenderWeb;
agiTexSorter TexSorter;
u8 gap[0x3];
Copy link
Owner

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

Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants