rodecomp/Source/Resource/Sprites/ActionResource.h
ragnarok-clanker 85414e2012 Maintenance: [forced, user-approved] R1 (resubmit of 10219 on 4cf7a69f): remove invented resource contexts ActionResourceContext, Spr
Batch #10229 by ragnarok-clanker: forced by an admin (4 lower score(s), 45 changed function(s)); checked with 314 compiled unit(s), including every includer of Source/Resource/Bitmap/BitmapImage.h, Source/Resource/Bitmap/BitmapResource.h, Source/Resource/Bitmap/IJL15Runtime.h, Source/Resource/EmblemResource.h, Source/Resource/GifResource.h, Source/Resource/Models/AnimatedModelResource.h, Source/Resource/Models/GrannyModelResource.h, Source/Resource/Models/ModelResource.h, Source/Resource/Sprites/ActionResource.h, Source/Resource/Sprites/SpriteResource.h, Source/UI/Buttons/UIBmpRadioBtn.h.
2026-11-03 09:38:10 +00:00

68 lines
2.1 KiB
C++

#ifndef RAGNAROK_SOURCE_RESOURCE_SPRITES_ACTIONRESOURCE_H
#define RAGNAROK_SOURCE_RESOURCE_SPRITES_ACTIONRESOURCE_H
#include "Render/Textures/SpritePixels.h"
#include "Resource/Resource.h"
#include <cstddef>
#include <string>
#include <vector>
class ResourceBytes;
class ResourceMgr;
struct ActionAnchor {
/* 0000 */ std::int32_t x;
/* 0004 */ std::int32_t y;
/* 0008 */ std::int32_t unknown_0008;
};
struct ActionFrame {
/* 0000 */ std::int32_t unknown_0000[8]{};
/* 0020 */ std::vector<SpriteFrameCell> cells;
/* 002C */ int cellCount = 0;
/* 0030 */ int sound = 0;
/* 0034 */ std::vector<ActionAnchor> anchors;
/* 0040 */ int anchorCount = 0;
const SpriteFrameCell& Cell(unsigned index) const;
};
class CActRes : public CRes {
public:
CActRes();
~CActRes() override;
CActRes* Create() override;
bool Load(const char* name) override;
void Unload() override;
const std::vector<ActionFrame>& Animation(unsigned index) const;
const ActionFrame& Frame(unsigned animation, unsigned frame) const;
unsigned FrameCount(unsigned animation) const;
float Speed(unsigned index) const;
const char* Sound(unsigned index) const;
/* 0110 */ std::vector<std::vector<ActionFrame>> animations;
/* 011C */ int maximumCells;
/* 0120 */ std::vector<std::string> sounds;
/* 012C */ std::vector<float> speeds;
};
static_assert(sizeof(ActionAnchor) == 12);
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(ActionFrame) == 68);
static_assert(sizeof(CActRes) == 312);
static_assert(offsetof(ActionAnchor, y) == 0x0004);
static_assert(offsetof(ActionAnchor, unknown_0008) == 0x0008);
static_assert(offsetof(ActionFrame, cells) == 0x0020);
static_assert(offsetof(ActionFrame, cellCount) == 0x002C);
static_assert(offsetof(ActionFrame, sound) == 0x0030);
static_assert(offsetof(ActionFrame, anchors) == 0x0034);
static_assert(offsetof(ActionFrame, anchorCount) == 0x0040);
static_assert(offsetof(CActRes, animations) == 0x0110);
static_assert(offsetof(CActRes, maximumCells) == 0x011C);
static_assert(offsetof(CActRes, sounds) == 0x0120);
static_assert(offsetof(CActRes, speeds) == 0x012C);
#endif
#endif