From 0a44ed6fa510faf5db77f323bb25e336de0ebe55 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Sat, 16 Sep 2023 16:14:25 -0600 Subject: [PATCH] Removed audio remainings and fixed skybox crash on windows --- .gitignore | 1 + libultraship | 2 +- sound/sound_data.c | 13 ------------- src/audio/load.c | 4 ---- src/game/skybox.c | 7 +++++-- 5 files changed, 7 insertions(+), 20 deletions(-) delete mode 100644 sound/sound_data.c diff --git a/.gitignore b/.gitignore index f5d043d2..9eece179 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,7 @@ build/* .assets-local.txt build/ +build*/ build-cmake/* cmake-msvc-*/* cmake-build-*/* diff --git a/libultraship b/libultraship index 6ae0476d..69b7b616 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 6ae0476d55c4a53f9d4ecd3bee28cda60c61314d +Subproject commit 69b7b61602b149112c2c398b2382c073a7aa72dd diff --git a/sound/sound_data.c b/sound/sound_data.c deleted file mode 100644 index 5313689c..00000000 --- a/sound/sound_data.c +++ /dev/null @@ -1,13 +0,0 @@ -#include "sound/sound_data.h" - -unsigned char gSoundDataADSR[] = { -#include "sound/sound_data.ctl.inc.c" -}; - -unsigned char gSoundDataRaw[] = { -#include "sound/sound_data.tbl.inc.c" -}; - -unsigned char gMusicData[] = { -#include "sound/sequences.bin.inc.c" -}; diff --git a/src/audio/load.c b/src/audio/load.c index 15ae6eb2..93e3bd6a 100644 --- a/src/audio/load.c +++ b/src/audio/load.c @@ -479,10 +479,6 @@ void load_sequence_internal(u32 player, u32 seqId, s32 loadAsync) { seqPlayer->scriptState.pc = sequenceData; } -unsigned char gBankTempData[] = { -#include "sound/bank_sets.inc.c" -}; - // (void) must be omitted from parameters to fix stack with -framepointer void audio_init() { s32 i, j; diff --git a/src/game/skybox.c b/src/game/skybox.c index d6c50cc6..b4511fad 100644 --- a/src/game/skybox.c +++ b/src/game/skybox.c @@ -251,8 +251,8 @@ void draw_skybox_tile_grid(Gfx **dlist, s8 background, s8 player, s8 colorIndex) uint8_t* texture = gSkyboxTiles[tileIndex]; if(texture == NULL){ - texture = malloc(2048); - gSkyboxTiles[tileIndex] = texture; + gSkyboxTiles[tileIndex] = malloc(2048); + texture = gSkyboxTiles[tileIndex]; } // Memcpy texture with calculated offset from x and y using the fact that every tile is 2048 bytes @@ -303,6 +303,9 @@ Gfx *init_skybox_display_list(s8 player, s8 background, s8 colorIndex) { Mtx *ortho = create_skybox_ortho_matrix(player); if(gSkyboxTiles == NULL){ gSkyboxTiles = malloc(80 * sizeof(uint8_t*)); + for (size_t idx = 0; idx < 80; idx++) { + gSkyboxTiles[idx] = NULL; + } gLastSkybox = background; } else if(gLastSkybox != background ){ for(size_t i = 0; i < 80; i++){