Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.
Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
45 lines
1,018 B
C++
45 lines
1,018 B
C++
#ifndef RAGNAROK_SOURCE_RESOURCE_BITMAP_BITMAPRESOURCE_H
|
|
#define RAGNAROK_SOURCE_RESOURCE_BITMAP_BITMAPRESOURCE_H
|
|
|
|
#include "Resource/Bitmap/BitmapImage.h"
|
|
#include "Resource/Resource.h"
|
|
|
|
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);
|
|
|
|
BitmapImage image;
|
|
|
|
private:
|
|
BitmapResourceContext* m_context;
|
|
};
|
|
|
|
#if defined(_WIN32) && !defined(_WIN64)
|
|
static_assert(sizeof(CBitmapRes) == 296);
|
|
#endif
|
|
|
|
#endif
|