rodecomp/Source/Resource/Bitmap/BitmapResource.h
ragnarok-clanker 5ec8920fd4 Maintenance: Add mandatory field offset markers /* XXXX */ and assertions to Resource headers
Batch #1067 by ragnarok-clanker: no function's compiled code changes; checked with 83 compiled unit(s), including every includer of Source/Resource/Audio/WaveResource.h, Source/Resource/BinkRuntime.h, Source/Resource/Bitmap/BitmapResource.h, Source/Resource/Bitmap/IJL15Runtime.h, Source/Resource/Models/ModelResource.h, Source/Resource/Resource.h, Source/Resource/ResourceAliases.h, Source/Resource/Sprites/ActionResource.h, Source/Resource/World/WorldResource.h.
2026-10-27 14:00:13 +00:00

48 lines
1.1 KiB
C++

#ifndef RAGNAROK_SOURCE_RESOURCE_BITMAP_BITMAPRESOURCE_H
#define RAGNAROK_SOURCE_RESOURCE_BITMAP_BITMAPRESOURCE_H
#include "Resource/Bitmap/BitmapImage.h"
#include "Resource/Resource.h"
#include <cstddef>
class IJL15Runtime;
class ResourceBytes {
public:
virtual bool Open(const char* name) = 0;
virtual const void* Data() const = 0;
virtual int Size() const = 0;
virtual void Close() = 0;
protected:
~ResourceBytes() = default;
};
struct BitmapResourceContext {
ResourceBytes& file;
IJL15Runtime& jpeg;
CRenderSystemBase* renderSystem;
};
class CBitmapRes : public CRes {
public:
explicit CBitmapRes(BitmapResourceContext& context);
~CBitmapRes() override;
CBitmapRes* Create() override;
bool Load(const char* name) override;
void Unload() override;
virtual bool Decode(const char* name, const void* data, int bytes, bool iconOnly);
/* 0110 */ BitmapImage image;
private:
BitmapResourceContext* m_context;
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(CBitmapRes) == 296);
static_assert(offsetof(CBitmapRes, image) == 0x0110);
#endif
#endif