From e368b33c0baaaa35bd5ba96f22a3f8f2ac31f717 Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Tue, 7 Sep 2021 18:08:56 +0100 Subject: [PATCH] Ifdef fixes --- src/game/puppylights.c | 4 ++-- src/game/puppylights.h | 3 +-- src/game/puppyprint.c | 2 +- src/game/spawn_object.c | 2 ++ 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/game/puppylights.c b/src/game/puppylights.c index c5620e02a..17c3098aa 100644 --- a/src/game/puppylights.c +++ b/src/game/puppylights.c @@ -9,8 +9,6 @@ but it will not be affected by environmental tinting. If you wish for an object simply set the object flag OBJ_FLAG_EMIT_LIGHT and set some values to o->puppylight. **/ -#ifdef PUPPYLIGHTS - #include #include "types.h" #include "puppylights.h" @@ -26,6 +24,8 @@ simply set the object flag OBJ_FLAG_EMIT_LIGHT and set some values to o->puppyli #include "object_list_processor.h" #include "level_update.h" +#ifdef PUPPYLIGHTS + Lights1 gLevelLight; //Existing ambient light in the area. Will be set by the level script, though can always be changed afterwards if desired. u8 levelAmbient = FALSE; Lights1 *sLightBase; //The base value where lights are written to when worked with. diff --git a/src/game/puppylights.h b/src/game/puppylights.h index 58b284025..47f06b5b8 100644 --- a/src/game/puppylights.h +++ b/src/game/puppylights.h @@ -1,8 +1,7 @@ +#ifdef PUPPYLIGHTS #ifndef PUPPYLIGHTS_H #define PUPPYLIGHTS_H -#ifdef PUPPYLIGHTS - #include "types.h" #include "command_macros_base.h" diff --git a/src/game/puppyprint.c b/src/game/puppyprint.c index dfca552f1..1e15f53ba 100644 --- a/src/game/puppyprint.c +++ b/src/game/puppyprint.c @@ -126,7 +126,7 @@ void puppyprint_calculate_ram_usage(void) //These are a bit hacky, but what can ye do eh? //gEffectsMemoryPool is 0x4000, gObjectsMemoryPool is 0x800. Epic C limitations mean I can't just sizeof their values :) - ramsizeSegment[5] = 0x4000 + 0x800; + ramsizeSegment[5] = 0x4000 + 0x800 + 0x4000 + 0x800; ramsizeSegment[6] = (SURFACE_NODE_POOL_SIZE * sizeof(struct SurfaceNode)) + (SURFACE_POOL_SIZE * sizeof(struct Surface)); ramsizeSegment[7] = gAudioHeapSize + gAudioInitPoolSize; ramsizeSegment[8] = audioPool[0] + audioPool[1] + audioPool[2] + audioPool[3] + audioPool[4] + audioPool[5] + diff --git a/src/game/spawn_object.c b/src/game/spawn_object.c index b30aedef7..7176956bb 100644 --- a/src/game/spawn_object.c +++ b/src/game/spawn_object.c @@ -285,7 +285,9 @@ struct Object *allocate_object(struct ObjectNode *objList) { obj->header.gfx.pos[1] = -10000.0f; obj->header.gfx.pos[2] = -10000.0f; obj->header.gfx.throwMatrix = NULL; +#ifdef PUPPYLIGHTS obj->oLightID = 0xFFFF; +#endif return obj; }