diff --git a/include/bspfile.h b/include/bspfile.h index f5acd0c..4a0becc 100644 --- a/include/bspfile.h +++ b/include/bspfile.h @@ -115,8 +115,8 @@ typedef struct typedef struct miptex_s { char name[16]; - unsigned width, height; - unsigned offsets[MIPLEVELS]; // four mip maps stored + unsigned int width, height; + unsigned int offsets[MIPLEVELS]; // four mip maps stored } miptex_t; diff --git a/include/checksum.h b/include/checksum.h index 0b4f99e..9af9a59 100644 --- a/include/checksum.h +++ b/include/checksum.h @@ -31,9 +31,9 @@ #include "qtypes.h" -unsigned Com_BlockChecksum (void *buffer, int length); +unsigned int Com_BlockChecksum (void *buffer, int length); void Com_BlockFullChecksum (void *buffer, int len, unsigned char *outbuf); -byte COM_BlockSequenceCheckByte (byte *base, int length, int sequence, unsigned mapchecksum); +byte COM_BlockSequenceCheckByte (byte *base, int length, int sequence, unsigned int mapchecksum); byte COM_BlockSequenceCRCByte (byte *base, int length, int sequence); #endif // _CHECKSUM_H diff --git a/include/d_local.h b/include/d_local.h index 8022905..73ad992 100644 --- a/include/d_local.h +++ b/include/d_local.h @@ -51,8 +51,8 @@ typedef struct surfcache_s int lightadj[MAXLIGHTMAPS]; // checked for strobe flush int dlight; int size; // including header - unsigned width; - unsigned height; // DEBUG only needed for debug + unsigned int width; + unsigned int height; // DEBUG only needed for debug float mipscale; struct texture_s *texture; // checked for animating textures byte data[4]; // width*height elements diff --git a/include/glquake.h b/include/glquake.h index 153e683..651657d 100644 --- a/include/glquake.h +++ b/include/glquake.h @@ -142,8 +142,8 @@ typedef struct surfcache_s int lightadj[MAXLIGHTMAPS]; // checked for strobe flush int dlight; int size; // including header - unsigned width; - unsigned height; // DEBUG only needed for debug + unsigned int width; + unsigned int height; // DEBUG only needed for debug float mipscale; struct texture_s *texture; // checked for animating textures byte data[4]; // width*height elements diff --git a/include/model.h b/include/model.h index 6b3e204..53504cb 100644 --- a/include/model.h +++ b/include/model.h @@ -90,7 +90,7 @@ typedef struct mplane_s typedef struct texture_s { char name[16]; - unsigned width, height; + unsigned int width, height; int gl_texturenum; int gl_fb_texturenum; struct msurface_s *texturechain; // for gl_texsort drawing @@ -98,7 +98,7 @@ typedef struct texture_s int anim_min, anim_max; // time for this frame min <=time< max struct texture_s *anim_next; // in the animation sequence struct texture_s *alternate_anims; // bmodels in frmae 1 use these - unsigned offsets[MIPLEVELS]; // four mip maps stored + unsigned int offsets[MIPLEVELS]; // four mip maps stored } texture_t; @@ -433,8 +433,8 @@ typedef struct model_s byte *lightdata; char *entities; - unsigned checksum; - unsigned checksum2; + unsigned int checksum; + unsigned int checksum2; // // additional model data diff --git a/include/server.h b/include/server.h index 28a0bac..93df363 100644 --- a/include/server.h +++ b/include/server.h @@ -68,8 +68,8 @@ typedef struct qboolean paused; // are we paused? //check player/eyes models for hacks - unsigned model_player_checksum; - unsigned eyes_player_checksum; + unsigned int model_player_checksum; + unsigned int eyes_player_checksum; char name[64]; // map name char modelname[MAX_QPATH]; // maps/.bsp, for model_precache[0] @@ -146,7 +146,7 @@ typedef struct client_s // this prevents malicious multiple broadcasts float lastnametime; // time of last name change int lastnamecount; // time of last name change - unsigned checksum; // checksum for calcs + unsigned int checksum; // checksum for calcs qboolean drop; // lose this guy next opportunity int lossage; // loss percentage diff --git a/include/vid.h b/include/vid.h index c1ae384..83f4ae2 100644 --- a/include/vid.h +++ b/include/vid.h @@ -46,16 +46,16 @@ typedef struct pixel_t *colormap; // 256 * VID_GRADES size unsigned short *colormap16; // 256 * VID_GRADES size int fullbright; // index of first fullbright color - unsigned rowbytes; // may be > width if displayed in a window - unsigned width; - unsigned height; + unsigned int rowbytes; // may be > width if displayed in a window + unsigned int width; + unsigned int height; float aspect; // width / height -- < 0 is taller than wide int numpages; int recalc_refdef; // if true, recalc vid-based stuff pixel_t *conbuffer; int conrowbytes; - unsigned conwidth; - unsigned conheight; + unsigned int conwidth; + unsigned int conheight; int maxwarpwidth; int maxwarpheight; pixel_t *direct; // direct drawing to framebuffer, if not @@ -64,7 +64,7 @@ typedef struct extern viddef_t vid; // global video state extern unsigned short d_8to16table[256]; -extern unsigned d_8to24table[256]; +extern unsigned int d_8to24table[256]; extern void (*vid_menudrawfn)(void); extern void (*vid_menukeyfn)(int key); diff --git a/source/cl_main.c b/source/cl_main.c index b1e2c9b..4eed520 100644 --- a/source/cl_main.c +++ b/source/cl_main.c @@ -911,8 +911,8 @@ void CL_ConnectionlessPacket (void) Con_Printf ("client command\n"); - if ((*(unsigned *)net_from.ip != *(unsigned *)net_local_adr.ip - && *(unsigned *)net_from.ip != htonl(INADDR_LOOPBACK)) ) + if ((*(unsigned int *)net_from.ip != *(unsigned int *)net_local_adr.ip + && *(unsigned int *)net_from.ip != htonl(INADDR_LOOPBACK)) ) { Con_Printf ("Command packet from remote host. Ignored.\n"); return; diff --git a/source/cl_parse.c b/source/cl_parse.c index 3f09bbe..2207409 100644 --- a/source/cl_parse.c +++ b/source/cl_parse.c @@ -1082,7 +1082,7 @@ void CL_MuzzleFlash (void) i = MSG_ReadShort (); - if ((unsigned)(i-1) >= MAX_CLIENTS) + if ((unsigned int)(i-1) >= MAX_CLIENTS) return; // don't draw our own muzzle flash in gl if flashblending diff --git a/source/d_fill.c b/source/d_fill.c index 9b354c0..cc1e69c 100644 --- a/source/d_fill.c +++ b/source/d_fill.c @@ -41,7 +41,7 @@ void D_FillRect (vrect_t *rect, int color) { int rx, ry, rwidth, rheight; unsigned char *dest; - unsigned *ldest; + unsigned int *ldest; rx = rect->x; ry = rect->y; @@ -71,7 +71,7 @@ void D_FillRect (vrect_t *rect, int color) if (((rwidth & 0x03) == 0) && (((long)dest & 0x03) == 0)) { // faster aligned dword clear - ldest = (unsigned *)dest; + ldest = (unsigned int *)dest; color += color << 16; rwidth >>= 2; @@ -81,7 +81,7 @@ void D_FillRect (vrect_t *rect, int color) { for (rx=0 ; rxwidth) > vid.width || y < 0 || - (unsigned)(y + pic->height) > vid.height) + if (x < 0 || (unsigned int)(x + pic->width) > vid.width || y < 0 || + (unsigned int)(y + pic->height) > vid.height) { Sys_Error ("Draw_TransPic: bad coordinates"); } @@ -524,8 +524,8 @@ void Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte *translation) unsigned short *pusdest; int v, u; - if (x < 0 || (unsigned)(x + pic->width) > vid.width || y < 0 || - (unsigned)(y + pic->height) > vid.height) + if (x < 0 || (unsigned int)(x + pic->width) > vid.width || y < 0 || + (unsigned int)(y + pic->height) > vid.height) { Sys_Error ("Draw_TransPic: bad coordinates"); } @@ -869,7 +869,7 @@ void Draw_Fill (int x, int y, int w, int h, int c) { byte *dest; unsigned short *pusdest; - unsigned uc; + unsigned int uc; int u, v; if (x < 0 || x + w > vid.width || diff --git a/source/gl_draw.c b/source/gl_draw.c index 94fc2d5..3323c78 100644 --- a/source/gl_draw.c +++ b/source/gl_draw.c @@ -676,8 +676,8 @@ Draw_TransPic void Draw_TransPic (int x, int y, qpic_t *pic) { - if (x < 0 || (unsigned)(x + pic->width) > vid.width || y < 0 || - (unsigned)(y + pic->height) > vid.height) + if (x < 0 || (unsigned int)(x + pic->width) > vid.width || y < 0 || + (unsigned int)(y + pic->height) > vid.height) { Sys_Error ("Draw_TransPic: bad coordinates"); } @@ -696,7 +696,7 @@ Only used for the player color selection menu void Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte *translation) { int v, u, c; - unsigned trans[64*64], *dest; + unsigned int trans[64*64], *dest; byte *src; int p; @@ -985,11 +985,11 @@ void GL_Set2D (void) GL_ResampleTexture ================ */ -static void GL_ResampleTexture (unsigned *in, int inwidth, int inheight, unsigned *out, int outwidth, int outheight) +static void GL_ResampleTexture (unsigned int *in, int inwidth, int inheight, unsigned int *out, int outwidth, int outheight) { int i, j; - unsigned *inrow; - unsigned frac, fracstep; + unsigned int *inrow; + unsigned int frac, fracstep; fracstep = inwidth*0x10000/outwidth; for (i=0 ; i>= (int)gl_picmip->value; scaled_height >>= (int)gl_picmip->value; @@ -1121,44 +1119,26 @@ static unsigned scaled[1024*512]; // [512*256]; scaled_width = min(scaled_width, gl_max_size->value); scaled_height = min(scaled_height, gl_max_size->value); - if (scaled_width * scaled_height > sizeof(scaled)/4) + if (!(scaled = malloc(scaled_width * scaled_height * 4 * sizeof(unsigned int)))) Sys_Error ("GL_LoadTexture: too big"); samples = alpha ? gl_alpha_format : gl_solid_format; -#if 0 - if (mipmap) - gluBuild2DMipmaps (GL_TEXTURE_2D, samples, width, height, GL_RGBA, GL_UNSIGNED_BYTE, trans); - else if (scaled_width == width && scaled_height == height) - glTexImage2D (GL_TEXTURE_2D, 0, samples, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, trans); - else - { - gluScaleImage (GL_RGBA, width, height, GL_UNSIGNED_BYTE, trans, - scaled_width, scaled_height, GL_UNSIGNED_BYTE, scaled); - glTexImage2D (GL_TEXTURE_2D, 0, samples, scaled_width, scaled_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, scaled); - } -#else - - if (scaled_width == width && scaled_height == height) - { - if (!mipmap) - { - glTexImage2D (GL_TEXTURE_2D, 0, samples, scaled_width, scaled_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data); - goto done; - } + // If the real width/height and the 'scaled' width/height then we + // rescale it. + if (scaled_width == width && scaled_height == height) { memcpy (scaled, data, width*height*4); - } - else + } else { GL_ResampleTexture (data, width, height, scaled, scaled_width, scaled_height); + } glTexImage2D (GL_TEXTURE_2D, 0, samples, scaled_width, scaled_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, scaled); - if (mipmap) - { + + if (mipmap) { int miplevel; miplevel = 0; - while (scaled_width > 1 || scaled_height > 1) - { + while (scaled_width > 1 || scaled_height > 1) { GL_MipMap ((byte *)scaled, scaled_width, scaled_height); scaled_width >>= 1; scaled_height >>= 1; @@ -1170,49 +1150,27 @@ static unsigned scaled[1024*512]; // [512*256]; glTexImage2D (GL_TEXTURE_2D, miplevel, samples, scaled_width, scaled_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, scaled); } } -done: ; -#endif - - if (mipmap) - { + if (mipmap) { glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_min); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max); - } - else - { + } else { glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_max); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max); } + + free(scaled); } void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboolean alpha) { - int i, s; - qboolean noalpha; - int samples; - static unsigned char scaled[1024*512]; // [512*256]; - int scaled_width, scaled_height; +#ifdef HAVE_GL_COLOR_INDEX8_EXT + byte *scaled; + int scaled_width, scaled_height; - s = width*height; - // if there are no transparent pixels, make it a 3 component - // texture even if it was specified as otherwise - if (alpha) - { - noalpha = true; - for (i=0 ; i>= (int)gl_picmip->value; scaled_height >>= (int)gl_picmip->value; @@ -1220,41 +1178,24 @@ void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboole scaled_width = min(scaled_width, gl_max_size->value); scaled_height = min(scaled_height, gl_max_size->value); - if (scaled_width * scaled_height > sizeof(scaled)) + if (!(scaled = malloc(scaled_width * scaled_height))) Sys_Error ("GL_LoadTexture: too big"); - samples = 1; // alpha ? gl_alpha_format : gl_solid_format; - - if (scaled_width == width && scaled_height == height) - { - if (!mipmap) - { -/* FIXME - what if this extension isn't available? */ -#ifdef HAVE_GL_COLOR_INDEX8_EXT - glTexImage2D (GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX , GL_UNSIGNED_BYTE, data); -#else - /* FIXME - should warn that this isn't available */ -#endif - goto done; - } + // If the real width/height and the 'scaled' width/height then we + // rescale it. + if (scaled_width == width && scaled_height == height) { memcpy (scaled, data, width*height); - } - else + } else { GL_Resample8BitTexture (data, width, height, scaled, scaled_width, scaled_height); + } -// FIXME - what if this extension isn't available? -#ifdef HAVE_GL_COLOR_INDEX8_EXT glTexImage2D (GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, scaled); -#else - /* FIXME - should warn that this isn't available */ -#endif - if (mipmap) - { + + if (mipmap) { int miplevel; miplevel = 0; - while (scaled_width > 1 || scaled_height > 1) - { + while (scaled_width > 1 || scaled_height > 1) { GL_MipMap8Bit ((byte *)scaled, scaled_width, scaled_height); scaled_width >>= 1; scaled_height >>= 1; @@ -1263,26 +1204,22 @@ void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboole if (scaled_height < 1) scaled_height = 1; miplevel++; -/* FIXME - what if this extension isn't available? */ -#ifdef HAVE_GL_COLOR_INDEX8_EXT glTexImage2D (GL_TEXTURE_2D, miplevel, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, scaled); -#else - /* FIXME - should warn that this isn't available */ -#endif } } -done: ; - if (mipmap) - { + if (mipmap) { glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_min); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max); - } - else - { + } else { glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_max); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max); } + + free(scaled); +#else + Sys_Error ("GL_Upload8_EXT without HAVE_GL_COLOR_INDEX8_EXT"); +#endif } extern qboolean VID_Is8bit(); @@ -1294,10 +1231,50 @@ GL_Upload8 */ void GL_Upload8 (byte *data, int width, int height, qboolean mipmap, qboolean alpha) { -static unsigned trans[640*480]; // FIXME, temporary - int i, s; - qboolean noalpha; - int p; +#if 1 + unsigned int *trans = NULL; + int i, s, p; + + s = width*height; + trans = malloc(s * sizeof(unsigned int)); + // if there are no transparent pixels, make it a 3 component + // texture even if it was specified as otherwise + if (alpha) { + alpha = false; + for (i=0 ; icontents < 0) diff --git a/source/gl_rmisc.c b/source/gl_rmisc.c index a086650..b9f71ab 100644 --- a/source/gl_rmisc.c +++ b/source/gl_rmisc.c @@ -304,15 +304,15 @@ void R_TranslatePlayerSkin (int playernum) { int top, bottom; byte translate[256]; - unsigned translate32[256]; + unsigned int translate32[256]; int i, j; byte *original; - unsigned pixels[512*256], *out; - unsigned scaled_width, scaled_height; + unsigned int pixels[512*256], *out; + unsigned int scaled_width, scaled_height; int inwidth, inheight; int tinwidth, tinheight; byte *inrow; - unsigned frac, fracstep; + unsigned int frac, fracstep; player_info_t *player; extern byte player_8bit_texels[320*200]; char s[512]; diff --git a/source/gl_rsurf.c b/source/gl_rsurf.c index f6c41e7..21f960b 100644 --- a/source/gl_rsurf.c +++ b/source/gl_rsurf.c @@ -63,7 +63,7 @@ int lightmap_bytes; // 1 or 3 int lightmap_textures; -unsigned blocklights[18*18*3]; +unsigned int blocklights[18*18*3]; cvar_t *gl_colorlights; @@ -136,7 +136,7 @@ R_AddDynamicLights void R_AddDynamicLights (msurface_t *surf) { int sdtable[18], lnum, td, maxdist, maxdist2, maxdist3, i, s, t, smax, tmax, red, green, blue, j; - unsigned *bl; + unsigned int *bl; float dist, f; vec3_t impact, local; // use 64bit integer... shame it's not very standardized... @@ -238,10 +238,10 @@ R_BuildLightMap (msurface_t *surf, byte *dest, int stride) int t; int i, j, size; byte *lightmap; - unsigned scale; + unsigned int scale; int maps; float t2; - unsigned *bl; + unsigned int *bl; surf->cached_dlight = (surf->dlightframe == r_framecount); diff --git a/source/gl_warp.c b/source/gl_warp.c index c7e01e6..ed69504 100644 --- a/source/gl_warp.c +++ b/source/gl_warp.c @@ -795,10 +795,10 @@ void R_InitSky (texture_t *mt) { int i, j, p; byte *src; - unsigned trans[128*128]; - unsigned transpix; + unsigned int trans[128*128]; + unsigned int transpix; int r, g, b; - unsigned *rgba; + unsigned int *rgba; src = (byte *)mt + mt->offsets[0]; diff --git a/source/model.c b/source/model.c index 5f084d3..bacc516 100644 --- a/source/model.c +++ b/source/model.c @@ -125,7 +125,7 @@ Loads a model into the cache model_t *Mod_LoadModel (model_t *mod, qboolean crash) { void *d; - unsigned *buf; + unsigned int *buf; byte stackbuf[1024]; // avoid dirtying the cache heap if (!mod->needload) @@ -143,7 +143,7 @@ model_t *Mod_LoadModel (model_t *mod, qboolean crash) // // load the file // - buf = (unsigned *)COM_LoadStackFile (mod->name, stackbuf, sizeof(stackbuf)); + buf = (unsigned int *)COM_LoadStackFile (mod->name, stackbuf, sizeof(stackbuf)); if (!buf) { if (crash) @@ -166,7 +166,7 @@ model_t *Mod_LoadModel (model_t *mod, qboolean crash) mod->needload = false; mod->hasfullbrights = false; - switch (LittleLong(*(unsigned *)buf)) + switch (LittleLong(*(unsigned int *)buf)) { case IDPOLYHEADER: Mod_LoadAliasModel (mod, buf); diff --git a/source/net_chan.c b/source/net_chan.c index f45aa32..514ac9e 100644 --- a/source/net_chan.c +++ b/source/net_chan.c @@ -254,7 +254,7 @@ void Netchan_Transmit (netchan_t *chan, int length, byte *data) sizebuf_t send; byte send_buf[MAX_MSGLEN + PACKET_HEADER]; qboolean send_reliable; - unsigned w1, w2; + unsigned int w1, w2; int i; // check for message overflow @@ -352,8 +352,8 @@ modifies net_message so that it points to the packet payload */ qboolean Netchan_Process (netchan_t *chan) { - unsigned sequence, sequence_ack; - unsigned reliable_ack, reliable_message; + unsigned int sequence, sequence_ack; + unsigned int reliable_ack, reliable_message; int qport; if (is_server) @@ -424,7 +424,7 @@ qboolean Netchan_Process (netchan_t *chan) // // discard stale or duplicated packets // - if (sequence <= (unsigned)chan->incoming_sequence) + if (sequence <= (unsigned int)chan->incoming_sequence) { if (showdrop->value) Con_Printf ("%s:Out of order packet %i at %i\n" @@ -453,7 +453,7 @@ qboolean Netchan_Process (netchan_t *chan) // if the current outgoing reliable message has been acknowledged // clear the buffer to make way for the next // - if (reliable_ack == (unsigned)chan->reliable_sequence) + if (reliable_ack == (unsigned int)chan->reliable_sequence) chan->reliable_length = 0; // it has been received // diff --git a/source/net_com.c b/source/net_com.c index d2a199f..139c78c 100644 --- a/source/net_com.c +++ b/source/net_com.c @@ -34,10 +34,10 @@ #endif #include -unsigned Com_BlockChecksum (void *buffer, int length) +unsigned int Com_BlockChecksum (void *buffer, int length) { int digest[4]; - unsigned val; + unsigned int val; mdfour ( (unsigned char *) digest, (unsigned char *) buffer, length ); diff --git a/source/pr_exec.c b/source/pr_exec.c index 02952a4..6c52446 100644 --- a/source/pr_exec.c +++ b/source/pr_exec.c @@ -176,7 +176,7 @@ void PR_PrintStatement (dstatement_t *s) { int i; - if ( (unsigned)s->op < sizeof(pr_opnames)/sizeof(pr_opnames[0])) + if ( (unsigned int)s->op < sizeof(pr_opnames)/sizeof(pr_opnames[0])) { Con_Printf ("%s ", pr_opnames[s->op]); i = strlen(pr_opnames[s->op]); @@ -190,7 +190,7 @@ void PR_PrintStatement (dstatement_t *s) { Con_Printf ("branch %i",s->a); } - else if ( (unsigned)(s->op - OP_STORE_F) < 6) + else if ( (unsigned int)(s->op - OP_STORE_F) < 6) { Con_Printf ("%s",PR_GlobalString(s->a)); Con_Printf ("%s", PR_GlobalStringNoContents(s->b)); diff --git a/source/r_aclip.c b/source/r_aclip.c index 586b854..8d352da 100644 --- a/source/r_aclip.c +++ b/source/r_aclip.c @@ -247,7 +247,7 @@ void R_AliasClipTriangle (mtriangle_t *ptri) { int i, k, pingpong; mtriangle_t mtri; - unsigned clipflags; + unsigned int clipflags; // copy vertexes and fix seam texture coordinates if (ptri->facesfront) diff --git a/source/r_alias.c b/source/r_alias.c index 631760a..31e87f5 100644 --- a/source/r_alias.c +++ b/source/r_alias.c @@ -107,7 +107,7 @@ qboolean R_AliasCheckBBox (void) auxvert_t *pa0, *pa1, viewaux[16]; maliasframedesc_t *pframedesc; qboolean zclipped, zfullyclipped; - unsigned anyclip, allclip; + unsigned int anyclip, allclip; int minz; // expand, rotate, and translate points into worldspace diff --git a/source/r_draw.c b/source/r_draw.c index a758c66..96a0804 100644 --- a/source/r_draw.c +++ b/source/r_draw.c @@ -395,7 +395,7 @@ R_RenderFace void R_RenderFace (msurface_t *fa, int clipflags) { int i, lindex; - unsigned mask; + unsigned int mask; mplane_t *pplane; float distinv; vec3_t p_normal; @@ -593,7 +593,7 @@ R_RenderBmodelFace void R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf) { int i; - unsigned mask; + unsigned int mask; mplane_t *pplane; float distinv; vec3_t p_normal; @@ -709,7 +709,7 @@ void R_RenderPoly (msurface_t *fa, int clipflags) { int i, lindex, lnumverts, s_axis, t_axis; float dist, lastdist, lzi, scale, u, v, frac; - unsigned mask; + unsigned int mask; vec3_t local, transformed; clipplane_t *pclip; medge_t *pedges; diff --git a/source/r_light.c b/source/r_light.c index 2230362..3366cc8 100644 --- a/source/r_light.c +++ b/source/r_light.c @@ -162,7 +162,7 @@ int RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end) int i; mtexinfo_t *tex; byte *lightmap; - unsigned scale; + unsigned int scale; int maps; if (node->contents < 0) diff --git a/source/r_sky.c b/source/r_sky.c index 3ca49d7..0a5f23c 100644 --- a/source/r_sky.c +++ b/source/r_sky.c @@ -109,7 +109,7 @@ void R_MakeSky (void) int x, y; int ofs, baseofs; int xshift, yshift; - unsigned *pnewsky; + unsigned int *pnewsky; static int xlast = -1, ylast = -1; xshift = skytime*skyspeed; @@ -121,7 +121,7 @@ void R_MakeSky (void) xlast = xshift; ylast = yshift; - pnewsky = (unsigned *)&newsky[0]; + pnewsky = (unsigned int *)&newsky[0]; for (y=0 ; y 0)) diff --git a/source/sv_init.c b/source/sv_init.c index 5e3067b..de59747 100644 --- a/source/sv_init.c +++ b/source/sv_init.c @@ -209,7 +209,7 @@ void SV_CalcPHS (void) int rowbytes, rowwords; int i, j, k, l, index, num; int bitbyte; - unsigned *dest, *src; + unsigned int *dest, *src; byte *scan; int count, vcount; @@ -241,7 +241,7 @@ void SV_CalcPHS (void) sv.phs = Hunk_Alloc (rowbytes*num); count = 0; scan = sv.pvs; - dest = (unsigned *)sv.phs; + dest = (unsigned int *)sv.phs; for (i=0 ; i= num) continue; - src = (unsigned *)sv.pvs + index*rowwords; + src = (unsigned int *)sv.pvs + index*rowwords; for (l=0 ; lmask = *(unsigned *)m; - f->compare = *(unsigned *)b; + f->mask = *(unsigned int *)m; + f->compare = *(unsigned int *)b; return true; } @@ -1130,7 +1130,7 @@ void SV_ListIP_f (void) Con_Printf ("Filter list:\n"); for (i=0 ; istate != cs_connected) { @@ -468,7 +468,7 @@ SV_Begin_f */ void SV_Begin_f (void) { - unsigned pmodel = 0, emodel = 0; + unsigned int pmodel = 0, emodel = 0; int i; if (host_client->state == cs_spawned) diff --git a/source/vid_3dfxsvga.c b/source/vid_3dfxsvga.c index 5d3a2f5..d5f4684 100644 --- a/source/vid_3dfxsvga.c +++ b/source/vid_3dfxsvga.c @@ -64,7 +64,7 @@ //unsigned short d_8to16table[256]; -unsigned d_8to24table[256]; +unsigned int d_8to24table[256]; unsigned char d_15to8table[65536]; static cvar_t *vid_mode; @@ -153,12 +153,12 @@ void VID_ShiftPalette(unsigned char *p) void VID_SetPalette (unsigned char *palette) { byte *pal; - unsigned r,g,b; - unsigned v; + unsigned int r,g,b; + unsigned int v; int r1,g1,b1; int k; unsigned short i; - unsigned *table; + unsigned int *table; FILE *f; char s[255]; //#endif diff --git a/source/vid_glx.c b/source/vid_glx.c index 8643440..385d7a3 100644 --- a/source/vid_glx.c +++ b/source/vid_glx.c @@ -92,7 +92,7 @@ static Cursor nullcursor = None; #define X_MASK (VisibilityChangeMask | StructureNotifyMask) unsigned short d_8to16table[256]; -unsigned d_8to24table[256]; +unsigned int d_8to24table[256]; unsigned char d_15to8table[65536]; cvar_t *vid_mode; @@ -254,12 +254,12 @@ void VID_ShiftPalette(unsigned char *p) void VID_SetPalette (unsigned char *palette) { byte *pal; - unsigned r,g,b; - unsigned v; + unsigned int r,g,b; + unsigned int v; int r1,g1,b1; int k; unsigned short i; - unsigned *table; + unsigned int *table; FILE *f; char s[255]; float dist, bestdist; diff --git a/source/vid_mgl.c b/source/vid_mgl.c index c11a930..379f5aa 100644 --- a/source/vid_mgl.c +++ b/source/vid_mgl.c @@ -138,7 +138,7 @@ static int VID_highhunkmark; unsigned char vid_curpal[256*3]; unsigned short d_8to16table[256]; -unsigned d_8to24table[256]; +unsigned int d_8to24table[256]; int driver = grDETECT,mode; qboolean useWinDirect = true, useDirectDraw = true; diff --git a/source/vid_null.c b/source/vid_null.c index e89409a..0244684 100644 --- a/source/vid_null.c +++ b/source/vid_null.c @@ -42,7 +42,7 @@ short zbuffer[BASEWIDTH*BASEHEIGHT]; byte surfcache[256*1024]; unsigned short d_8to16table[256]; -unsigned d_8to24table[256]; +unsigned int d_8to24table[256]; void VID_SetPalette (unsigned char *palette) { diff --git a/source/vid_sgl.c b/source/vid_sgl.c index 49534bf..8a2ee70 100644 --- a/source/vid_sgl.c +++ b/source/vid_sgl.c @@ -69,7 +69,7 @@ HWND mainwindow; #endif unsigned short d_8to16table[256]; -unsigned d_8to24table[256]; +unsigned int d_8to24table[256]; unsigned char d_15to8table[65536]; int scr_width, scr_height; @@ -148,12 +148,12 @@ void VID_SetPalette (unsigned char *palette) { byte *pal; - unsigned r,g,b; - unsigned v; + unsigned int r,g,b; + unsigned int v; int r1,g1,b1; int k; unsigned short i; - unsigned *table; + unsigned int *table; FILE *f; char s[256]; float dist, bestdist; diff --git a/source/vid_wgl.c b/source/vid_wgl.c index 5dd8dda..3a08e68 100644 --- a/source/vid_wgl.c +++ b/source/vid_wgl.c @@ -127,7 +127,7 @@ HWND WINAPI InitializeWindow (HINSTANCE hInstance, int nCmdShow); extern viddef_t vid; // global video state unsigned short d_8to16table[256]; -unsigned d_8to24table[256]; +unsigned int d_8to24table[256]; unsigned char d_15to8table[65536]; float gldepthmin, gldepthmax; @@ -715,12 +715,12 @@ void GL_EndRendering (void) void VID_SetPalette (unsigned char *palette) { byte *pal; - unsigned r,g,b; - unsigned v; + unsigned int r,g,b; + unsigned int v; int r1,g1,b1; int k; unsigned short i; - unsigned *table; + unsigned int *table; FILE *f; char s[255]; float dist, bestdist; diff --git a/source/wad.c b/source/wad.c index 9754f74..7710991 100644 --- a/source/wad.c +++ b/source/wad.c @@ -82,7 +82,7 @@ void W_LoadWadFile (char *filename) { lumpinfo_t *lump_p; wadinfo_t *header; - unsigned i; + unsigned int i; int infotableofs; wad_base = COM_LoadHunkFile (filename);