isle-portable/LEGO1/lego/sources/roi/legoroi.h
Christian Semmler d121ae1ecd
Some checks failed
CI / clang-format (push) Has been cancelled
CI / ${{ matrix.name }} (false, --toolchain /usr/local/vitasdk/share/vita.toolchain.cmake, false, false, Ninja, Vita, ubuntu-latest, true, true) (push) Has been cancelled
CI / ${{ matrix.name }} (false, -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0.26100.0, false, false, Visual Studio 17 2022, true, Xbox One, windows-latest, amd64, false, true) (push) Has been cancelled
CI / ${{ matrix.name }} (false, -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/3DS.cmake, false, devkitpro/devkitarm:latest, false, Ninja, true, Nintendo 3DS, ubuntu-latest, true) (push) Has been cancelled
CI / ${{ matrix.name }} (false, -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake, false, devkitpro/devkita64:latest, false, Ninja, Nintendo Switch, true, ubuntu-latest, true) (push) Has been cancelled
CI / ${{ matrix.name }} (false, emcmake, false, false, true, Ninja, Emscripten, ubuntu-latest, true) (push) Has been cancelled
CI / ${{ matrix.name }} (false, false, false, Ninja, true, MSVC (arm64), windows-latest, amd64_arm64, false) (push) Has been cancelled
CI / ${{ matrix.name }} (false, false, true, Ninja, true, MSVC (x86), windows-latest, amd64_x86, false) (push) Has been cancelled
CI / ${{ matrix.name }} (false, true, false, Ninja, true, MSVC (x64), windows-latest, amd64, false) (push) Has been cancelled
CI / ${{ matrix.name }} (false, true, true, false, Ninja, true, MSVC (x64 Debug), windows-latest, amd64, false) (push) Has been cancelled
CI / ${{ matrix.name }} (true, false, -DCMAKE_SYSTEM_NAME=iOS, false, false, Xcode, true, iOS, macos-15, true) (push) Has been cancelled
CI / ${{ matrix.name }} (true, false, false, Ninja, true, mingw-w64-i686, mingw32, msys2 mingw32, windows-latest, msys2 {0}, true) (push) Has been cancelled
CI / ${{ matrix.name }} (true, false, false, false, Ninja, Android, ubuntu-latest, true) (push) Has been cancelled
CI / ${{ matrix.name }} (true, false, true, false, Ninja, macOS, macos-latest, true) (push) Has been cancelled
CI / ${{ matrix.name }} (true, true, false, Ninja, true, mingw-w64-x86_64, mingw64, msys2 mingw64, windows-latest, msys2 {0}, true) (push) Has been cancelled
CI / ${{ matrix.name }} (true, true, true, false, Ninja, true, Linux (Debug), ubuntu-latest, true) (push) Has been cancelled
CI / ${{ matrix.name }} (true, true, true, false, Ninja, true, Linux, ubuntu-latest, true) (push) Has been cancelled
CI / Flatpak (${{ matrix.arch }}) (aarch64, ubuntu-22.04-arm) (push) Has been cancelled
CI / Flatpak (${{ matrix.arch }}) (x86_64, ubuntu-latest) (push) Has been cancelled
CI / C++ (push) Has been cancelled
Docker / Publish web port (push) Has been cancelled
CI / Release (push) Has been cancelled
Merge remote-tracking branch 'isle/master'
2026-01-07 16:39:54 -07:00

134 lines
4.0 KiB
C++

#ifndef LEGOROI_H
#define LEGOROI_H
#include "lego1_export.h"
#include "misc/legotypes.h"
#include "viewmanager/viewroi.h"
typedef unsigned char (*ColorOverride)(const char*, char*, unsigned int);
typedef unsigned char (*TextureHandler)(const char*, unsigned char*, unsigned int);
class LegoEntity;
class LegoTextureContainer;
class LegoTextureInfo;
class LegoStorage;
class LegoAnim;
class LegoAnimNodeData;
class LegoTreeNode;
struct LegoAnimActorEntry;
// VTABLE: LEGO1 0x100dbe38
// VTABLE: BETA10 0x101c3898
// SIZE 0x108
class LegoROI : public ViewROI {
public:
LegoROI(Tgl::Renderer* p_renderer);
LegoROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList);
~LegoROI() override;
LegoResult Read(
OrientableROI* p_parentROI,
Tgl::Renderer* p_renderer,
ViewLODListManager* p_viewLODListManager,
LegoTextureContainer* p_textureContainer,
LegoStorage* p_storage
);
LegoROI* FindChildROI(const LegoChar* p_name, LegoROI* p_roi);
LegoResult ApplyChildAnimationTransformation(
LegoTreeNode* p_node,
const Matrix4& p_matrix,
LegoTime p_time,
LegoROI* p_roi
);
static void ApplyAnimationTransformation(
LegoTreeNode* p_node,
Matrix4& p_matrix,
LegoTime p_time,
LegoROI** p_roiMap
);
static void ApplyTransform(LegoTreeNode* p_node, Matrix4& p_matrix, LegoTime p_time, LegoROI** p_roiMap);
LegoResult SetFrame(LegoAnim* p_anim, LegoTime p_time);
LegoResult SetLodColor(LegoFloat p_red, LegoFloat p_green, LegoFloat p_blue, LegoFloat p_alpha);
LegoResult SetTextureInfo(LegoTextureInfo* p_textureInfo);
LegoResult GetTextureInfo(LegoTextureInfo*& p_textureInfo);
LegoResult SetColor(LegoFloat p_red, LegoFloat p_green, LegoFloat p_blue, LegoFloat p_alpha);
LegoResult SetLodColor(const LegoChar* p_name);
LegoResult SetColorByName(const LegoChar* p_name);
LegoU32 Intersect(
Vector3& p_rayOrigin,
Vector3& p_rayDirection,
float p_rayLength,
float p_unused,
Vector3& p_intersectionPoint,
LegoBool p_collideBox
);
void SetName(const LegoChar* p_name);
float IntrinsicImportance() const override; // vtable+0x04
void UpdateWorldBoundingVolumes() override; // vtable+0x18
void ClearMeshOffset();
void SetDisplayBB(int p_displayBB);
static LegoResult CreateLocalTransform(LegoAnimNodeData* p_data, LegoTime p_time, Matrix4& p_matrix);
static void ReportError(const LegoChar* p_error, ...);
LEGO1_EXPORT static void configureLegoROI(int p_roi);
static void SetColorOverride(ColorOverride p_colorOverride);
static LegoBool GetRGBAColor(const LegoChar* p_name, float& p_red, float& p_green, float& p_blue, float& p_alpha);
static LegoBool ColorAliasLookup(
const LegoChar* p_param,
float& p_red,
float& p_green,
float& p_blue,
float& p_alpha
);
static LegoBool GetPaletteEntries(const LegoChar* p_name, unsigned char* paletteEntries, LegoU32 p_numEntries);
// FUNCTION: BETA10 0x1000f320
const LegoChar* GetName() const { return m_name; }
// FUNCTION: BETA10 0x10015180
LegoEntity* GetEntity() { return m_entity; }
BoundingSphere& GetBoundingSphere() { return m_sphere; }
// FUNCTION: BETA10 0x10013400
void SetEntity(LegoEntity* p_entity) { m_entity = p_entity; }
void SetComp(CompoundObject* p_comp) { comp = p_comp; }
void SetBoundingSphere(const BoundingSphere& p_sphere) { m_sphere = m_world_bounding_sphere = p_sphere; }
void SetBoundingBox(const BoundingBox& p_box) { m_bounding_box = p_box; }
// SYNTHETIC: LEGO1 0x100a82b0
// SYNTHETIC: BETA10 0x1018c490
// LegoROI::`scalar deleting destructor'
private:
LegoChar* m_name; // 0xe4
BoundingSphere m_sphere; // 0xe8
LegoBool m_sharedLodList; // 0x100
LegoEntity* m_entity; // 0x104
};
// VTABLE: LEGO1 0x100dbea8
// VTABLE: BETA10 0x101c38d0
// SIZE 0x10c
class TimeROI : public LegoROI {
public:
TimeROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList, LegoTime p_time);
void CalculateWorldVelocity(Matrix4& p_matrix, LegoTime p_time);
// SYNTHETIC: LEGO1 0x100a9ad0
// SYNTHETIC: BETA10 0x1018c540
// TimeROI::`scalar deleting destructor'
// SYNTHETIC: BETA10 0x1018c580
// TimeROI::~TimeROI
private:
LegoTime m_time; // 0x108
};
#endif // LEGOROI_H