World of Might and Magic
0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
|
См. документацию.
22 stru355 stru_4E82A4 = {0x20, 0x41, 0, 0x20, 0xFF0000, 0xFF00, 0xFF,
static_cast<int>(0xFF000000)};
30 return L
"IMAGE_FORMAT_R5G6B5";
32 return L
"IMAGE_FORMAT_A1R5G5B5";
34 return L
"IMAGE_FORMAT_A8R8G8B8";
36 return L
"IMAGE_FORMAT_R8G8B8";
38 return L
"IMAGE_FORMAT_R8G8B8A8";
41 Error(
"Invalid format: %d",
format);
42 return L
"Invalid format";
60 Error(
"Invalid format: %d",
format);
74 FILE *file = fopen(
"data\\dtft.bin",
"wb");
75 if (file ==
nullptr) {
76 Error(
"Unable to save dtft.bin!", 0);
78 fwrite(
v1, 4u, 1u, file);
79 fwrite(
v1->pTextures, 0x14u,
v1->sNumTextures, file);
84 uint num_mm6_frames = data_mm6 ? *(
int *)data_mm6 : 0,
85 num_mm7_frames = data_mm7 ? *(
int *)data_mm7 : 0,
86 num_mm8_frames = data_mm8 ? *(
int *)data_mm8 : 0;
99 frames[i].name.begin(), ::tolower);
102 frames[i].uAnimTime = frame_data->
uAnimTime;
103 frames[i].uFlags = frame_data->
uFlags;
120 for (
unsigned int i = uFrameID;; ++i) {
130 if (this->
pTextures[i].uFlags & 1)
break;
151 if (v5->
uFlags & 1 && (v6 != 0)) {
152 int v7 = (a3 >> 3) % v6;
153 for (
char *i = (
char *)&v5->
uAnimTime;; i += 20) {
154 int v9 = *(
short *)i;
205 void *
data =
nullptr;
249 img->initialized =
true;
253 unsigned int num_pixels =
img->GetWidth() *
img->GetHeight();
254 unsigned int num_pixels_bytes =
256 img->pixels[
format] =
new unsigned char[num_pixels_bytes];
260 memset(
img->pixels[
format], 0, num_pixels_bytes);
317 new unsigned char[num_pixels *
319 if (cvt(
width *
height, native_pixels, cvt_pixels)) {
323 cvt_pixels =
nullptr;
IMAGE_FORMAT native_format
int FindTextureByName(const char *Str2)
struct TextureFrameTable * pTextureFrameTable
EGLSurface EGLint EGLint EGLint EGLint height
unsigned int IMAGE_FORMAT_BytesPerPixel(IMAGE_FORMAT format)
void FromFile(void *data_mm6, void *data_mm7, void *data_mm8)
uint8_t * paletted_pixels
const wchar_t * IMAGE_FORMAT_ToString(IMAGE_FORMAT format)
virtual bool LoadImageData()
EGLSurface EGLint EGLint EGLint width
void Warning(const wchar_t *pFormat,...)
virtual String GetResourceName() const
void LoadAnimationSequenceAndPalettes(int uIconID)
Texture * GetBitmap(const String &name)
GLuint GLenum GLenum transform
Image(bool lazy_initialization=true)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
bool ReleaseImage(const String &name)
EGLImageKHR EGLint * name
virtual bool Load(unsigned int *width, unsigned int *height, void **pixels, IMAGE_FORMAT *format)=0
static Image * Create(unsigned int width, unsigned int height, IMAGE_FORMAT format, const void *pixels=nullptr)
GLfloat GLfloat GLfloat GLfloat v3
void __cdecl __debugbreak(void)
const void * GetPixels(IMAGE_FORMAT format)
uint8_t * pLevelOfDetail1
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
Texture * GetFrameTexture(int uFrameID, int time)