mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-26 22:11:58 +00:00
67fa7f8275
Now without any Build drawing code, it goes directly to DrawTexture now. :)
44 lines
762 B
C++
44 lines
762 B
C++
#pragma once
|
|
|
|
#include "textures.h"
|
|
|
|
|
|
class AnimTexture : public FTexture
|
|
{
|
|
uint8_t Palette[768];
|
|
TArray<uint8_t> Image;
|
|
int pixelformat;
|
|
public:
|
|
enum
|
|
{
|
|
Paletted = 0,
|
|
RGB = 1,
|
|
YUV = 2
|
|
};
|
|
AnimTexture() = default;
|
|
void SetFrameSize(int format, int width, int height);
|
|
void SetFrame(const uint8_t* palette, const void* data);
|
|
virtual FBitmap GetBgraBitmap(const PalEntry* remap, int* trans) override;
|
|
};
|
|
|
|
class AnimTextures
|
|
{
|
|
int active;
|
|
FGameTexture* tex[2];
|
|
|
|
public:
|
|
AnimTextures();
|
|
~AnimTextures();
|
|
void Clean();
|
|
void SetSize(int format, int width, int height);
|
|
void SetFrame(const uint8_t* palette, const void* data);
|
|
FGameTexture* GetFrame()
|
|
{
|
|
return tex[active];
|
|
}
|
|
|
|
FTextureID GetFrameID()
|
|
{
|
|
return tex[active]->GetID();
|
|
}
|
|
};
|