summaryrefslogtreecommitdiff
path: root/src/engine/World.cpp
diff options
context:
space:
mode:
authorcoco875 <59367621+coco875@users.noreply.github.com>2025-07-01 23:42:14 +0000
committerGitHub <noreply@github.com>2025-07-01 17:42:14 -0600
commit7937896598f3df46eb78c158bde787bc4f12ad7f (patch)
tree876548daaec2f8a5bb284374d834abcf9aad15b9 /src/engine/World.cpp
parentb57afa83b42bb14e526043be4ca9f6e322788edb (diff)
make some texture more flexible and editable + port documentation from the decomp + fix some bug (#309)
* support a more flexible background * remove useless function * rename of some font * experimental png * migrate to the new initdata * fix skybox and adjust minimap * format in audio * simplify player render * simplify shell render and support custom texture of shell * clean redshell texture * format and multiple fix * some update of name * allow change icon of character * more rename * continue rename * more documentation and simplification * change lus and continue rename * continue rename * few fix for asan * fix ghost * Update menu_items.c * fix mac error * some test of tweak for texture * some tweak * some button constant * finish fix ghost * Update menu_items.c * Update render_objects.c * Update menu_items.c * Update libultraship * Update libultraship * Delete valgrind.report * Update libultraship * callgrind benchmark * Update valgrind_callgrind.sh * fix animation * some rename * remove useless submodule * Update libultraship * fix assets * fix mistake * fix more mistake * Update menu_items.c * sync more rename with the decom + fix review * fix a mistake * fix more mistake * re add the limit of fps * fix some hd texture and minimap * fix a name * Update menu_items.c * fix a regression * fix some segment 5 texture (not all) * Update camera.c * improve performance of custom sprite * fix flatten bug and add documentation on player vertex * Update render_player.c * fix data menu * fix trophy for 50 and 150 * Update memory.c * Update code_80057C60.c * fix ghost * fix boo tlut * fix a mistake in yaml * fix yaml * Update common_data.yml * add comment for segment 3 * allow even more change in texture * Update common_data.yml * Update update.inc.c * Update camera.c * Update some_data.c * wip changes * Update other_textures.yml * More changes * Update update_objects.c * Fix compile * Update memory.c * Update memory.c --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
Diffstat (limited to 'src/engine/World.cpp')
-rw-r--r--src/engine/World.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/engine/World.cpp b/src/engine/World.cpp
index 68ca27343..100b1275d 100644
--- a/src/engine/World.cpp
+++ b/src/engine/World.cpp
@@ -42,7 +42,8 @@ void World::SetCourseFromCup() {
CurrentCourse = CurrentCup->GetCourse();
}
-TrainCrossing* World::AddCrossing(Vec3f position, u32 waypointMin, u32 waypointMax, f32 approachRadius, f32 exitRadius) {
+TrainCrossing* World::AddCrossing(Vec3f position, u32 waypointMin, u32 waypointMax, f32 approachRadius,
+ f32 exitRadius) {
auto crossing = std::make_shared<TrainCrossing>(position, waypointMin, waypointMax, approachRadius, exitRadius);
Crossings.push_back(crossing);
return crossing.get();
@@ -160,7 +161,7 @@ AActor* World::ConvertActorToAActor(Actor* actor) {
// Move the ptr back so that it points at the vtable.
// Which is the initial item in the class, or in other words
// Point to the class.
- return reinterpret_cast<AActor*>((char*)actor - sizeof(void*));
+ return reinterpret_cast<AActor*>((char*) actor - sizeof(void*));
}
/**
@@ -169,7 +170,7 @@ AActor* World::ConvertActorToAActor(Actor* actor) {
Actor* World::ConvertAActorToActor(AActor* actor) {
// Move the ptr forward past the vtable.
// This allows C to access the class variables like a normal Actor* struct.
- return reinterpret_cast<Actor*>((char*)actor + sizeof(void*));
+ return reinterpret_cast<Actor*>((char*) actor + sizeof(void*));
}
AActor* World::GetActor(size_t index) {
@@ -236,7 +237,7 @@ void World::TickObjects() {
// This is a fallback to support those objects. Probably don't use this.
void World::TickObjects60fps() {
for (const auto& object : Objects) {
- object->Tick60fps();
+ object->Tick60fps();
}
}
@@ -247,19 +248,19 @@ ParticleEmitter* World::AddEmitter(ParticleEmitter* emitter) {
void World::DrawObjects(s32 cameraId) {
for (const auto& object : Objects) {
- object->Draw(cameraId);
+ object->Draw(cameraId);
}
}
void World::TickParticles() {
for (const auto& emitter : Emitters) {
- emitter->Tick();
+ emitter->Tick();
}
}
void World::DrawParticles(s32 cameraId) {
for (const auto& emitter : Emitters) {
- emitter->Draw(cameraId);
+ emitter->Draw(cameraId);
}
}
@@ -271,8 +272,8 @@ void World::Reset() {
}
Object* World::GetObjectByIndex(size_t index) {
- //if (index < this->Objects.size()) {
- // Assuming GameActor::a is accessible, use reinterpret_cast if needed
+ // if (index < this->Objects.size()) {
+ // Assuming GameActor::a is accessible, use reinterpret_cast if needed
// return reinterpret_cast<Object*>(&this->Objects[index]->o);
//}
return nullptr; // Or handle the error as needed