mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-13 08:27:39 +00:00
[sw] Remove some unnecessary casting
I'm not sure what the author of that code was thinking (maybe trying to do 4 pixels at a time?), but the resulting code still did only one. Better to remove all the casts, use the right pointer type, and keep the code clear.
This commit is contained in:
parent
5eb397dd31
commit
2a87983bf4
1 changed files with 5 additions and 7 deletions
|
@ -94,7 +94,7 @@ R_MakeSky (void)
|
||||||
int x, y;
|
int x, y;
|
||||||
int ofs, baseofs;
|
int ofs, baseofs;
|
||||||
int xshift, yshift;
|
int xshift, yshift;
|
||||||
unsigned int *pnewsky;
|
byte *pnewsky;
|
||||||
static int xlast = -1, ylast = -1;
|
static int xlast = -1, ylast = -1;
|
||||||
|
|
||||||
xshift = r_skytime * r_skyspeed;
|
xshift = r_skytime * r_skyspeed;
|
||||||
|
@ -106,19 +106,17 @@ R_MakeSky (void)
|
||||||
xlast = xshift;
|
xlast = xshift;
|
||||||
ylast = yshift;
|
ylast = yshift;
|
||||||
|
|
||||||
pnewsky = (unsigned int *) &newsky[0];
|
pnewsky = &newsky[0];
|
||||||
|
|
||||||
for (y = 0; y < SKYSIZE; y++) {
|
for (y = 0; y < SKYSIZE; y++) {
|
||||||
baseofs = ((y + yshift) & SKYMASK) * 131;
|
baseofs = ((y + yshift) & SKYMASK) * 131;
|
||||||
for (x = 0; x < SKYSIZE; x++) {
|
for (x = 0; x < SKYSIZE; x++) {
|
||||||
ofs = baseofs + ((x + xshift) & SKYMASK);
|
ofs = baseofs + ((x + xshift) & SKYMASK);
|
||||||
|
|
||||||
*(byte *) pnewsky = (*((byte *) pnewsky + 128) &
|
*pnewsky = (*(pnewsky + 128) & bottommask[ofs]) | bottomsky[ofs];
|
||||||
*(byte *) & bottommask[ofs]) |
|
pnewsky = pnewsky + 1;
|
||||||
*(byte *) & bottomsky[ofs];
|
|
||||||
pnewsky = (unsigned int *) ((byte *) pnewsky + 1);
|
|
||||||
}
|
}
|
||||||
pnewsky += 128 / sizeof (unsigned int);
|
pnewsky += 128;
|
||||||
}
|
}
|
||||||
|
|
||||||
r_skymade = 1;
|
r_skymade = 1;
|
||||||
|
|
Loading…
Reference in a new issue