diff options
| author | MegaMech <MegaMech@users.noreply.github.com> | 2025-01-18 08:58:12 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-18 08:58:12 -0700 |
| commit | 8c46368d5d93ad278c124ffc6446ab691dff8082 (patch) | |
| tree | 3506dce3de08c514eeb3ee9d1dc575e7713331ca /src/engine/objects/Boos.h | |
| parent | 04d56d6ba0705776149358608a27db8ab23e9449 (diff) | |
Fix data, option menus, impl boos, fix demo camera (#156)
* Fix data and option menus
* safer code
* wip boos impl
* finish impl boos
* Fix demo camera
* slightly better match
Diffstat (limited to 'src/engine/objects/Boos.h')
| -rw-r--r-- | src/engine/objects/Boos.h | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/src/engine/objects/Boos.h b/src/engine/objects/Boos.h new file mode 100644 index 000000000..cc49df474 --- /dev/null +++ b/src/engine/objects/Boos.h @@ -0,0 +1,75 @@ +#pragma once + +#include <libultraship.h> +#include <vector> +#include "Object.h" + +#include "World.h" +#include "CoreMath.h" + +extern "C" { +#include "macros.h" +#include "main.h" +#include "vehicles.h" +#include "waypoints.h" +#include "common_structs.h" +#include "objects.h" +#include "camera.h" +#include "some_data.h" +} + +/** + * OBoos + * + * Args use path indices or path points. Recommended to use a span of 10 + * for each IPathSpan as that's how the original game did it. Ex. IPathSpan(10, 20) + * + * Once boos are active, they do not deactivate until the player drives into leftBoundary + * or rightBoundary. leftBoundary is really only used to deactivate the boos when the player is + * driving in the reverse direction. + * + * @arg numBoos to show, default 5, maximum 10 allowed due to limited splines + * @arg leftBoundary When the player enters this area, deactivate the boos. + * @arg active When the player enters this area, activate the boos. + * @arg rightBoundary When the player enters this area, deactivate the boos. + * + */ +class OBoos : public OObject { +public: + explicit OBoos(size_t numBoos, const IPathSpan& leftBoundary, const IPathSpan& active, const IPathSpan& rightBoundary); + + ~OBoos() { + _count--; + } + + static size_t GetCount() { + return _count; + } + + virtual void Tick() override; + virtual void Draw(s32 cameraId) override; + void func_800523B8(s32 objectIndex, s32 arg1, u32 arg2); + + void func_8007CA70(void); + void func_8007C5B4(s32 objectIndex); + void func_8007C684(s32 objectIndex); + void func_8007C4A4(s32 objectIndex); + s32 func_8007C9F8(void); + void BooStart(s32 someIndex, s32 arg1); + void BooExit(s32 someIndex); + void func_8007C550(s32 objectIndex); + +private: + FVector _pos; + static size_t _count; + size_t _idx; + std::vector<s32> _indices; // indices into gObjectList + size_t _numBoos; + + bool _isActive = false; + s32 _playerId = 0; + + IPathSpan _leftBoundary; + IPathSpan _active; + IPathSpan _rightBoundary; +}; |
