{gl1,gl3,soft}_model.c fix const parameters

This commit is contained in:
Denis Pauk 2022-09-25 23:03:12 +03:00
parent ae13c7e034
commit e01e5273f8
5 changed files with 11 additions and 11 deletions

View file

@ -96,7 +96,7 @@ LoadSTB(const char *origname, const char* type, byte **pic, int *width, int *hei
} }
qboolean qboolean
ResizeSTB(byte *input_pixels, int input_width, int input_height, ResizeSTB(const byte *input_pixels, int input_width, int input_height,
byte *output_pixels, int output_width, int output_height) byte *output_pixels, int output_width, int output_height)
{ {
if (stbir_resize_uint8(input_pixels, input_width, input_height, 0, if (stbir_resize_uint8(input_pixels, input_width, input_height, 0,
@ -223,7 +223,7 @@ SmoothColorImage(unsigned *dst, size_t size, size_t rstep)
/* https://en.wikipedia.org/wiki/Pixel-art_scaling_algorithms */ /* https://en.wikipedia.org/wiki/Pixel-art_scaling_algorithms */
void void
scale2x(byte *src, byte *dst, int width, int height) scale2x(const byte *src, byte *dst, int width, int height)
{ {
/* /*
EPX/Scale2×/AdvMAME2× EPX/Scale2×/AdvMAME2×
@ -239,7 +239,7 @@ scale2x(byte *src, byte *dst, int width, int height)
IF B==D AND B!=A AND D!=C => 4=D IF B==D AND B!=A AND D!=C => 4=D
*/ */
{ {
byte *in_buff = src; const byte *in_buff = src;
byte *out_buff = dst; byte *out_buff = dst;
byte *out_buff_full = dst + ((width * height) << 2); byte *out_buff_full = dst + ((width * height) << 2);
while (out_buff < out_buff_full) while (out_buff < out_buff_full)
@ -304,7 +304,7 @@ scale2x(byte *src, byte *dst, int width, int height)
} }
void void
scale3x(byte *src, byte *dst, int width, int height) scale3x(const byte *src, byte *dst, int width, int height)
{ {
/* /*
Scale3×/AdvMAME3× and ScaleFX Scale3×/AdvMAME3× and ScaleFX
@ -326,7 +326,7 @@ scale3x(byte *src, byte *dst, int width, int height)
IF F==H AND F!=B AND H!=D => 9=F IF F==H AND F!=B AND H!=D => 9=F
*/ */
{ {
byte *in_buff = src; const byte *in_buff = src;
byte *out_buff = dst; byte *out_buff = dst;
byte *out_buff_full = dst + ((width * height) * 9); byte *out_buff_full = dst + ((width * height) * 9);
while (out_buff < out_buff_full) while (out_buff < out_buff_full)

View file

@ -210,7 +210,7 @@ Mod_SP2Fixup(model_t *mod, const dsprite_t *sprout)
/* byte swap everything */ /* byte swap everything */
for (i = 0; i < sprout->numframes; i++) for (i = 0; i < sprout->numframes; i++)
{ {
mod->skins[i] = R_FindImage(sprout->frames[i].name, mod->skins[i] = R_FindImage((char *)sprout->frames[i].name,
it_sprite); it_sprite);
} }
} }

View file

@ -1009,7 +1009,7 @@ Mod_SP2Fixup(gl3model_t *mod, const dsprite_t *sprout)
/* byte swap everything */ /* byte swap everything */
for (i = 0; i < sprout->numframes; i++) for (i = 0; i < sprout->numframes; i++)
{ {
mod->skins[i] = GL3_FindImage(sprout->frames[i].name, mod->skins[i] = GL3_FindImage((char *)sprout->frames[i].name,
it_sprite); it_sprite);
} }
} }

View file

@ -81,11 +81,11 @@ extern void LoadPCX(char *origname, byte **pic, byte **palette, int *width, int
extern void GetPCXInfo(char *filename, int *width, int *height); extern void GetPCXInfo(char *filename, int *width, int *height);
extern qboolean LoadSTB(const char *origname, const char* type, byte **pic, int *width, int *height); extern qboolean LoadSTB(const char *origname, const char* type, byte **pic, int *width, int *height);
extern qboolean ResizeSTB(byte *input_pixels, int input_width, int input_height, extern qboolean ResizeSTB(const byte *input_pixels, int input_width, int input_height,
byte *output_pixels, int output_width, int output_height); byte *output_pixels, int output_width, int output_height);
extern void SmoothColorImage(unsigned *dst, size_t size, size_t rstep); extern void SmoothColorImage(unsigned *dst, size_t size, size_t rstep);
extern void scale2x(byte *src, byte *dst, int width, int height); extern void scale2x(const byte *src, byte *dst, int width, int height);
extern void scale3x(byte *src, byte *dst, int width, int height); extern void scale3x(const byte *src, byte *dst, int width, int height);
extern void GetWalInfo(char *name, int *width, int *height); extern void GetWalInfo(char *name, int *width, int *height);
extern void GetM8Info(char *name, int *width, int *height); extern void GetM8Info(char *name, int *width, int *height);

View file

@ -169,7 +169,7 @@ Mod_SP2Fixup(model_t *mod, const dsprite_t *sprout)
/* byte swap everything */ /* byte swap everything */
for (i = 0; i < sprout->numframes; i++) for (i = 0; i < sprout->numframes; i++)
{ {
mod->skins[i] = R_FindImage (sprout->frames[i].name, mod->skins[i] = R_FindImage ((char *)sprout->frames[i].name,
it_sprite); it_sprite);
} }
} }