You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
825 B
45 lines
825 B
|
7 years ago
|
#pragma once
|
||
|
|
|
||
|
5 years ago
|
#include "storm/storm.h"
|
||
|
5 years ago
|
#include "utils/sdl_ptrs.h"
|
||
|
7 years ago
|
|
||
|
5 years ago
|
namespace devilution {
|
||
|
7 years ago
|
|
||
|
|
struct Art {
|
||
|
5 years ago
|
SDLSurfaceUniquePtr surface;
|
||
|
6 years ago
|
int frames;
|
||
|
|
int logical_width;
|
||
|
|
int frame_height;
|
||
|
|
unsigned int palette_version;
|
||
|
|
|
||
|
|
Art()
|
||
|
|
{
|
||
|
|
surface = NULL;
|
||
|
|
frames = 1;
|
||
|
|
logical_width = 0;
|
||
|
|
frame_height = 0; // logical frame height (before scaling)
|
||
|
|
palette_version = 0;
|
||
|
|
}
|
||
|
7 years ago
|
|
||
|
|
int w() const
|
||
|
|
{
|
||
|
6 years ago
|
return logical_width;
|
||
|
7 years ago
|
}
|
||
|
|
|
||
|
|
int h() const
|
||
|
|
{
|
||
|
|
return frame_height;
|
||
|
|
}
|
||
|
|
|
||
|
|
void Unload()
|
||
|
|
{
|
||
|
5 years ago
|
surface = nullptr;
|
||
|
7 years ago
|
}
|
||
|
|
};
|
||
|
|
|
||
|
6 years ago
|
void LoadArt(const char *pszFile, Art *art, int frames = 1, SDL_Color *pPalette = NULL);
|
||
|
7 years ago
|
void LoadMaskedArt(const char *pszFile, Art *art, int frames = 1, int mask = 250);
|
||
|
7 years ago
|
void LoadArt(Art *art, const BYTE *artData, int w, int h, int frames = 1);
|
||
|
7 years ago
|
|
||
|
5 years ago
|
} // namespace devilution
|