mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
946da7d622
This is to allow giving them a texture ID so that they can be used from ZScript which has no access to naked textures. This also consolidates AnimTexture and VpxTexture.
43 lines
747 B
C++
43 lines
747 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 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();
|
|
}
|
|
};
|