Files
Shipwright/soh/include/global.h
T
Tim Schneeberger 0d2346d322 Reduce LUS header bloat & improve build speed (#6802)
* Avoid `randomizer_check_tracker.h` in widely used `randomizer.h` due to transitive `libultraship.h`/`UIWidgets.hpp` inclusion

* Avoid `libultraship.h` inclusion in heavily used `GameInteractor.h` header

* Remove unused libultraship includes

* Break huge unneeded transitive include chain (via UIWidgets.hpp)

This avoids that changing just UIWidgets.hpp, for example, would retrigger a rebuild of like half the project.

There were a huge transitive include chains, mostly via MenuTypes.h and UIWidgets.hpp. Because of that, I'm splitting UIWidgets into a second header file UIWidgetOptions.hpp, which can be consumed by MenuTypes.h. MenuTypes.h is split into BackendTypes.h to avoid pulling in Fast3D/Windowing/GUI stuff into unrelated code.

Example chain, one of many:
libultraship.h <- UIWidgets.hpp <- MenuTypes.hpp <- randomizer/option.h <- randomizer/item_location.h <- trial.h <- static_data.h <- SeedContext <- (basically all randomizer related sources, lots of other sources in Enhancement, more...)

* Avoid libultraship.h in Notification.h and ObjectExtension.h; these headers are also heavily used

* Add missing include

* Remove unused libultraship includes

* Include only ship/window/GuiWindow.h in GUI-related headers instead of libultraship.h

* Cleanup ConfigUpdater.h and playthrough.cpp

* Remove libultraship.h from Anchor.h and fix transitive dependencies in OTRGlobals.cpp

* Remove unused libultraship.h includes in Anchor code
2026-06-23 05:09:25 +00:00

54 lines
1.6 KiB
C

#pragma once
#ifndef GLOBAL_H
#define GLOBAL_H
#include "math.h"
#include "functions.h"
#include "variables.h"
#include "macros.h"
#include "soh/cvar_prefixes.h"
#ifdef __cplusplus
extern "C++" {
#endif
#include "soh/Enhancements/gameconsole.h"
#include "soh/Enhancements/gameplaystats.h"
#ifdef __cplusplus
}
#endif
#include <libultraship/bridge.h>
#define _AudioseqSegmentRomStart "Audioseq"
#define _AudiobankSegmentRomStart "Audiobank"
#define _AudiotableSegmentRomStart "Audiotable"
#define _icon_item_staticSegmentRomStart 0
#define _icon_item_staticSegmentRomEnd 0
#define _map_i_staticSegmentRomStart 0
#define _map_i_staticSegmentRomEnd 0
#define _message_staticSegmentRomStart 0
#define _message_staticSegmentRomEnd 0
#define _do_action_staticSegmentRomStart 0
#define _do_action_staticSegmentRomEnd 0
#define _nes_font_staticSegmentRomStart 0
#define _nes_font_staticSegmentRomEnd 0
#define _nintendo_rogo_staticSegmentRomStart 0
#define _nintendo_rogo_staticSegmentRomEnd 0
#define _dmadataSegmentStart 0
#define _dmadataSegmentEnd 0
#define _parameter_staticSegmentRomStart 0
#define _parameter_staticSegmentRomEnd 0
#define _map_name_staticSegmentRomStart 0
#define _map_name_staticSegmentRomEnd 0
#define _title_staticSegmentRomStart 0
#define _title_staticSegmentRomEnd 0
#define _z_select_staticSegmentRomStart 0
#define _z_select_staticSegmentRomEnd 0
// TODO: POSIX/BSD Bug, this is a hack to fix the build compilation on any BSD system (Switch, Wii-U, Vita, etc)
// <sys/types.h> defines quad as a macro, which conflicts with the quad parameter on z_collision_check.c
#undef quad
#endif