World of Might and Magic
0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
|
См. документацию.
16 for (
unsigned int y = 0;
y <
height; ++
y) {
17 for (
unsigned int x = 0;
x <
width; ++
x) {
19 auto r = palette[(
index * 3) + 0];
20 auto g = palette[(
index * 3) + 1];
21 auto b = palette[(
index * 3) + 2];
33 for (
unsigned int y = 0;
y <
height; ++
y) {
34 for (
unsigned int x = 0;
x <
width; ++
x) {
36 auto r = palette[(
index * 3) + 0];
37 auto g = palette[(
index * 3) + 1];
38 auto b = palette[(
index * 3) + 2];
55 for (
unsigned int y = 0;
y <
height; ++
y) {
56 for (
unsigned int x = 0;
x <
width; ++
x) {
58 auto r = palette[(
index * 3) + 0];
59 auto g = palette[(
index * 3) + 1];
60 auto b = palette[(
index * 3) + 2];
73 unsigned int *out_height,
void **out_pixels,
77 *out_pixels =
nullptr;
82 if ((tex ==
nullptr) || (tex->
pPalette24 ==
nullptr) ||
97 if (*out_pixels ==
nullptr) {
109 unsigned int *out_height,
void **out_pixels,
113 *out_pixels =
nullptr;
118 if ((tex ==
nullptr) || (tex->
pPalette24 ==
nullptr) ||
133 if (*out_pixels ==
nullptr) {
148 *out_pixels =
nullptr;
153 if ((tex ==
nullptr) || (tex->
pPalette24 ==
nullptr) ||
168 if (*out_pixels ==
nullptr) {
197 fseek(file, 0, SEEK_END);
198 size_t filesize = ftell(file);
199 fseek(file, 0, SEEK_SET);
229 return *
pixels !=
nullptr;
241 if (
data ==
nullptr) {
260 size_t data_size = 0;
262 if (pcx_data ==
nullptr) {
288 return *
pixels !=
nullptr;
295 *out_pixels =
nullptr;
298 auto tex =
lod->GetTexture(
lod->LoadTexture(this->resource_name.c_str()));
300 int num_pixels = tex->header.uTextureWidth * tex->header.uTextureHeight;
303 *
width = tex->header.uTextureWidth;
304 *
height = tex->header.uTextureHeight;
307 if (tex->header.pBits & 2) {
311 for (
int s = 0;
s < tex->header.uTextureHeight; ++
s) {
312 for (
int t = 0;
t < tex->header.uTextureWidth; ++
t) {
313 unsigned int resampled_x =
t * hwl->
uWidth / tex->header.uTextureWidth,
314 resampled_y =
s * hwl->
uHeight / tex->header.uTextureHeight;
315 unsigned short sample = hwl->
pPixels[resampled_y * hwl->
uWidth + resampled_x];
317 pixels[
s * tex->header.uTextureWidth +
t] = sample;
337 *out_pixels =
nullptr;
342 int dst_width = hwl->
uWidth;
345 int num_pixels = dst_width * dst_height;
349 for (
int s = 0;
s < dst_height; ++
s) {
350 for (
int t = 0;
t < dst_width; ++
t) {
351 unsigned int resampled_x =
t * hwl->
uWidth / dst_width,
352 resampled_y =
s * hwl->
uHeight / dst_height;
354 unsigned short sample =
unsigned __int16 uint16_t
virtual bool Load(unsigned int *width, unsigned int *height, void **pixels, IMAGE_FORMAT *format)
uint32_t * MakeImageSolid(unsigned int width, unsigned int height, uint8_t *pixels, uint8_t *palette)
virtual bool Load(unsigned int *width, unsigned int *height, void **pixels, IMAGE_FORMAT *format)
EGLSurface EGLint EGLint EGLint EGLint height
bool Decode(const void *pcx_data, uint16_t *pOutPixels, unsigned int *width, unsigned int *height)
uint32_t Color32(uint16_t color16)
uint8_t * paletted_pixels
virtual bool Load(unsigned int *width, unsigned int *height, void **out_pixels, IMAGE_FORMAT *format)
bool DecodePCX(const void *pcx_data, uint16_t *pOutPixels, unsigned int *width, unsigned int *height)
EGLSurface EGLint EGLint y
virtual bool Load(unsigned int *width, unsigned int *height, void **pixels, IMAGE_FORMAT *format)
virtual bool Load(unsigned int *width, unsigned int *height, void **pixels, IMAGE_FORMAT *format)
EGLSurface EGLint EGLint EGLint width
void Warning(const wchar_t *pFormat,...)
virtual bool Load(unsigned int *width, unsigned int *height, void **out_pixels, IMAGE_FORMAT *format)
uint32_t * MakeImageColorKey(unsigned int width, unsigned int height, uint8_t *pixels, uint8_t *palette, uint16_t color_key)
bool IsValid(const void *pcx_data)
void GetSize(const void *pcx_data, unsigned int *width, unsigned int *height)
GLboolean GLboolean GLboolean b
bool InternalLoad(void *file, size_t size, unsigned int *width, unsigned int *height, void **pixels, IMAGE_FORMAT *format)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
virtual bool Load(unsigned int *width, unsigned int *height, void **pixels, IMAGE_FORMAT *format)
virtual bool Load(unsigned int *width, unsigned int *height, void **pixels, IMAGE_FORMAT *format)
uint16_t Color16(uint32_t r, uint32_t g, uint32_t b)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
unsigned __int32 uint32_t
uint32_t * MakeImageAlpha(unsigned int width, unsigned int height, uint8_t *pixels, uint8_t *palette)
std::shared_ptr< IRender > render