rename s|bitesPerPixel|bitsPerPixel|g

This commit is contained in:
Denis Pauk 2024-07-30 08:49:50 +03:00
parent 40e4eb135a
commit f1d8387d81
5 changed files with 36 additions and 36 deletions

View File

@ -98,19 +98,19 @@ cinematics_t cin;
static void
SCR_LoadPCX(char *filename, byte **pic, byte **palette, int *width, int *height,
int *bitesPerPixel)
int *bitsPerPixel)
{
byte *data, *palette_in;
*pic = NULL;
*palette = NULL;
VID_ImageDecode(filename, &data, &palette_in, width, height, bitesPerPixel);
VID_ImageDecode(filename, &data, &palette_in, width, height, bitsPerPixel);
if (data)
{
*pic = Z_Malloc((*width) * (*height) * (*bitesPerPixel) / 8);
memcpy(*pic, data, (*height) * (*width) * (*bitesPerPixel) / 8);
*pic = Z_Malloc((*width) * (*height) * (*bitsPerPixel) / 8);
memcpy(*pic, data, (*height) * (*width) * (*bitsPerPixel) / 8);
free(data);
}
else
@ -779,7 +779,7 @@ SCR_DrawCinematic(void)
static byte *
SCR_LoadHiColor(const char* namewe, const char *ext, int *width, int *height,
int *bitesPerPixel)
int *bitsPerPixel)
{
byte *pic, *data = NULL, *palette = NULL;
char filename[256];
@ -789,7 +789,7 @@ SCR_LoadHiColor(const char* namewe, const char *ext, int *width, int *height,
Q_strlcat(filename, ext, sizeof(filename));
VID_ImageDecode(filename, &data, &palette,
width, height, bitesPerPixel);
width, height, bitsPerPixel);
if (data == NULL)
{
return NULL;
@ -801,8 +801,8 @@ SCR_LoadHiColor(const char* namewe, const char *ext, int *width, int *height,
free(palette);
}
pic = Z_Malloc(cin.height * cin.width * (*bitesPerPixel) / 8);
memcpy(pic, data, cin.height * cin.width * (*bitesPerPixel) / 8);
pic = Z_Malloc(cin.height * cin.width * (*bitsPerPixel) / 8);
memcpy(pic, data, cin.height * cin.width * (*bitsPerPixel) / 8);
free(data);
return pic;

View File

@ -508,7 +508,7 @@ void V_AddParticle (vec3_t org, unsigned int color, float alpha);
void V_AddLight (vec3_t org, float intensity, float r, float g, float b);
void V_AddLightStyle (int style, float r, float g, float b);
void VID_ImageDecode(const char *filename, byte **pic, byte **palette,
int *width, int *height, int *bitesPerPixel);
int *width, int *height, int *bitsPerPixel);
void VID_GetPalette(byte **colormap, unsigned *d_8to24table);
void VID_GetPalette24to8(const byte *d_8to24table, byte** d_16to8table);
unsigned VID_PaletteColor(byte color);

View File

@ -58,7 +58,7 @@ FixFileExt(const char *origname, const char *ext, char *filename, size_t size)
qboolean
LoadSTB(const char *origname, const char* type, byte **pic, int *width, int *height)
{
int w, h, bitesPerPixel;
int w, h, bitsPerPixel;
char filename[256];
byte* data = NULL;
@ -66,18 +66,18 @@ LoadSTB(const char *origname, const char* type, byte **pic, int *width, int *hei
*pic = NULL;
ri.VID_ImageDecode(filename, &data, NULL, &w, &h, &bitesPerPixel);
ri.VID_ImageDecode(filename, &data, NULL, &w, &h, &bitsPerPixel);
if (data == NULL)
{
return false;
}
if (bitesPerPixel != 32)
if (bitsPerPixel != 32)
{
free(data);
R_Printf(PRINT_ALL, "%s unexpected file format of %s with %d bytes per pixel!\n",
__func__, filename, bitesPerPixel);
__func__, filename, bitsPerPixel);
return false;
}
@ -503,13 +503,13 @@ LoadImage_Ext(const char *name, const char* namewe, const char *ext, imagetype_t
int width = 0, height = 0, realwidth = 0, realheight = 0;
byte *pic = NULL, *palette = NULL;
char filename[256];
int bitesPerPixel;
int bitsPerPixel;
/* name could not be used here as could have different extension
* originaly */
FixFileExt(namewe, ext, filename, sizeof(filename));
ri.VID_ImageDecode(filename, &pic, &palette, &width, &height, &bitesPerPixel);
ri.VID_ImageDecode(filename, &pic, &palette, &width, &height, &bitsPerPixel);
if (!pic)
{
@ -520,13 +520,13 @@ LoadImage_Ext(const char *name, const char* namewe, const char *ext, imagetype_t
realheight = height;
realwidth = width;
if (bitesPerPixel == 32)
if (bitsPerPixel == 32)
{
image = load_image(name, pic,
width, realwidth,
height, realheight,
width * height,
type, bitesPerPixel);
type, bitsPerPixel);
}
else
{
@ -575,7 +575,7 @@ LoadImage_Ext(const char *name, const char* namewe, const char *ext, imagetype_t
image = load_image(name, pic,
width, realwidth,
height, realheight,
width * height, type, bitesPerPixel);
width * height, type, bitsPerPixel);
}
}

View File

@ -255,7 +255,7 @@ typedef struct
void (IMPORT *Vid_WriteScreenshot)( int width, int height, int comp, const void* data );
/* load image from file */
void (IMPORT *VID_ImageDecode)( const char *filename, byte **pic, byte **palette,
int *width, int *height, int *bitesPerPixel);
int *width, int *height, int *bitsPerPixel);
void (IMPORT *VID_GetPalette)(byte **colormap, unsigned *d_8to24table);
void (IMPORT *VID_GetPalette24to8)(const byte *d_8to24table, byte** d_16to8table);

View File

@ -189,7 +189,7 @@ PCX_RLE_Decode(byte *pix, byte *pix_max, const byte *raw, const byte *raw_max,
static void
PCX_Decode(const char *name, const byte *raw, int len, byte **pic, byte **palette,
int *width, int *height, int *bitesPerPixel)
int *width, int *height, int *bitsPerPixel)
{
const pcx_t *pcx;
int full_size;
@ -199,7 +199,7 @@ PCX_Decode(const char *name, const byte *raw, int len, byte **pic, byte **palett
const byte *data;
*pic = NULL;
*bitesPerPixel = 8;
*bitsPerPixel = 8;
if (palette)
{
@ -238,7 +238,7 @@ PCX_Decode(const char *name, const byte *raw, int len, byte **pic, byte **palett
if (pcx->color_planes == 3 && pcx->bits_per_pixel == 8)
{
full_size *= 4;
*bitesPerPixel = 32;
*bitsPerPixel = 32;
}
out = malloc(full_size);
@ -772,7 +772,7 @@ Convert24to32(unsigned *d_8to24table, byte *pal)
static void
LoadImageWithPalette(const char *filename, byte **pic, byte **palette,
int *width, int *height, int *bitesPerPixel)
int *width, int *height, int *bitsPerPixel)
{
const char* ext;
int len, ident;
@ -798,10 +798,10 @@ LoadImageWithPalette(const char *filename, byte **pic, byte **palette,
ident = LittleShort(*((short*)raw));
if (!strcmp(ext, "pcx") && (ident == PCX_IDENT))
{
PCX_Decode(filename, raw, len, pic, palette, width, height, bitesPerPixel);
PCX_Decode(filename, raw, len, pic, palette, width, height, bitsPerPixel);
if(*pic && width && height
&& *width == 319 && *height == 239 && *bitesPerPixel == 8
&& *width == 319 && *height == 239 && *bitsPerPixel == 8
&& Q_strcasecmp(filename, "pics/quit.pcx") == 0
&& Com_BlockChecksum(raw, len) == 3329419434u)
{
@ -813,21 +813,21 @@ LoadImageWithPalette(const char *filename, byte **pic, byte **palette,
else if (!strcmp(ext, "m8"))
{
M8_Decode(filename, raw, len, pic, palette, width, height);
*bitesPerPixel = 8;
*bitsPerPixel = 8;
}
else if (!strcmp(ext, "swl"))
{
SWL_Decode(filename, raw, len, pic, palette, width, height);
*bitesPerPixel = 8;
*bitsPerPixel = 8;
}
else if (!strcmp(ext, "wal"))
{
WAL_Decode(filename, raw, len, pic, palette, width, height);
*bitesPerPixel = 8;
*bitsPerPixel = 8;
}
else
{
int sourcebitesPerPixel = 0;
int sourcebitsPerPixel = 0;
/* other formats does not have palette directly */
if (palette)
@ -842,7 +842,7 @@ LoadImageWithPalette(const char *filename, byte **pic, byte **palette,
else
{
*pic = stbi_load_from_memory(raw, len, width, height,
&sourcebitesPerPixel, STBI_rgb_alpha);
&sourcebitsPerPixel, STBI_rgb_alpha);
if (*pic == NULL)
{
@ -851,7 +851,7 @@ LoadImageWithPalette(const char *filename, byte **pic, byte **palette,
}
}
*bitesPerPixel = 32;
*bitsPerPixel = 32;
}
FS_FreeFile(raw);
@ -859,9 +859,9 @@ LoadImageWithPalette(const char *filename, byte **pic, byte **palette,
void
VID_ImageDecode(const char *filename, byte **pic, byte **palette,
int *width, int *height, int *bitesPerPixel)
int *width, int *height, int *bitsPerPixel)
{
LoadImageWithPalette(filename, pic, palette, width, height, bitesPerPixel);
LoadImageWithPalette(filename, pic, palette, width, height, bitsPerPixel);
if (palette && *palette && colormap_cache && !colormap_loaded)
{
@ -876,14 +876,14 @@ static void
LoadPalette(byte **colormap, unsigned *d_8to24table)
{
const char * filename;
int bitesPerPixel;
int bitsPerPixel;
byte *pal = NULL;
filename = "pics/colormap.pcx";
/* get the palette and colormap */
LoadImageWithPalette(filename, colormap, &pal, NULL, NULL,
&bitesPerPixel);
&bitsPerPixel);
if (!*colormap || !pal)
{
int width = 0, height = 0;
@ -891,7 +891,7 @@ LoadPalette(byte **colormap, unsigned *d_8to24table)
filename = "pics/colormap.bmp";
LoadImageWithPalette(filename, &pic, NULL, &width, &height, &bitesPerPixel);
LoadImageWithPalette(filename, &pic, NULL, &width, &height, &bitsPerPixel);
if (pic && width == 256 && height == 320)
{
int i;