a bit of cleanup (#26)

disabled the loading screen properly with gCLIOpts.hideLoadingScreen
This commit is contained in:
Isaac0-dev 2024-05-06 22:16:48 +10:00 committed by GitHub
parent 76b66e9b7d
commit c288fdf0d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 10 deletions

View File

@ -31,7 +31,7 @@ void loading_screen_set_segment_text(const char *text) {
}
static void loading_screen_produce_frame_callback(void) {
if (sLoading && !gCLIOpts.hideLoadingScreen) { djui_base_render(&sLoading->base); }
if (sLoading) { djui_base_render(&sLoading->base); }
}
static void loading_screen_produce_one_frame(void) {

View File

@ -93,6 +93,10 @@ bool gGfxInited = false;
static struct AudioAPI *audio_api;
struct GfxWindowManagerAPI *wm_api = &WAPI;
#if !defined(WAPI_DXGI) && !defined(WAPI_DUMMY)
#define LOADING_SCREEN_SUPPORTED
#endif
extern void gfx_run(Gfx *commands);
extern void thread5_game_loop(void *arg);
extern void create_next_audio_buffer(s16 *samples, u32 num_samples);
@ -381,18 +385,21 @@ int main(int argc, char *argv[]) {
// Render the rom setup screen
if (!main_rom_handler()) {
#if !defined(WAPI_DXGI) && !defined(WAPI_DUMMY)
render_rom_setup_screen(); // Holds the game load until a valid rom is provided
#else
printf("ERROR: could not find valid vanilla us sm64 rom in game's user folder\n");
return 0;
#ifdef LOADING_SCREEN_SUPPORTED
if (!gCLIOpts.hideLoadingScreen) {
render_rom_setup_screen(); // Holds the game load until a valid rom is provided
} else
#endif
{
printf("ERROR: could not find valid vanilla us sm64 rom in game's user folder\n");
return 0;
}
}
// Start the thread for setting up the game
#if !defined(WAPI_DXGI) && !defined(WAPI_DUMMY)
#ifdef LOADING_SCREEN_SUPPORTED
bool threadSuccess = false;
if (pthread_mutex_init(&gLoadingThreadMutex, NULL) == 0) {
if (!gCLIOpts.hideLoadingScreen && pthread_mutex_init(&gLoadingThreadMutex, NULL) == 0) {
if (pthread_create(&gLoadingThreadId, NULL, main_game_init, (void*) 1) == 0) {
render_loading_screen(); // Render the loading screen while the game is setup
threadSuccess = true;

View File

@ -85,7 +85,6 @@ static bool rom_asset_load_segment(u32 physicalAddress, u32 physicalSize) {
// Some Vtx arrays have been manually modified to use white opaque vertex colors
// so they can be shaded by Lua and not stand out as being unlit
static inline bool rom_asset_override_vertex_colors(void* ptr) {
extern Vtx hoot_seg5_vertex_05002E50[];
extern Vtx hoot_seg5_vertex_05002E50[];
extern Vtx hoot_seg5_vertex_05002F78[];
extern Vtx hoot_seg5_vertex_050030A0[];
@ -102,7 +101,6 @@ static inline bool rom_asset_override_vertex_colors(void* ptr) {
extern Vtx lll_seg7_vertex_07013830[];
extern Vtx ttc_seg7_vertex_0700B238[];
return ptr == hoot_seg5_vertex_05002E50 ||
ptr == hoot_seg5_vertex_05002E50 ||
ptr == hoot_seg5_vertex_05002F78 ||
ptr == hoot_seg5_vertex_050030A0 ||
ptr == hoot_seg5_vertex_050031C8 ||