mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-29 20:20:43 +00:00
cleanup unused vars
This commit is contained in:
parent
b2bc3f13ea
commit
32257923a5
1 changed files with 8 additions and 13 deletions
|
@ -293,8 +293,8 @@ decode_truecolor_32_rle (TargaHeader *targa, tex_t *tex, byte *dataByte)
|
||||||
struct tex_s *
|
struct tex_s *
|
||||||
LoadTGA (QFile *fin)
|
LoadTGA (QFile *fin)
|
||||||
{
|
{
|
||||||
byte *dataByte, *pixcol, *pixrow;
|
byte *dataByte;
|
||||||
int column, row, columns, rows, numPixels, span, targa_mark;
|
int numPixels, targa_mark;
|
||||||
TargaHeader *targa;
|
TargaHeader *targa;
|
||||||
tex_t *tex;
|
tex_t *tex;
|
||||||
|
|
||||||
|
@ -317,32 +317,27 @@ LoadTGA (QFile *fin)
|
||||||
Sys_Error ("Texture_LoadTGA: Only 32 or 24 bit images supported "
|
Sys_Error ("Texture_LoadTGA: Only 32 or 24 bit images supported "
|
||||||
"(no colormaps)");
|
"(no colormaps)");
|
||||||
|
|
||||||
columns = targa->width;
|
numPixels = targa->width * targa->height;
|
||||||
rows = targa->height;
|
|
||||||
numPixels = columns * rows;
|
tex = Hunk_TempAlloc (field_offset (tex_t, data[numPixels * 4]));
|
||||||
|
tex->width = targa->width;
|
||||||
|
tex->height = targa->height;
|
||||||
|
tex->palette = 0;
|
||||||
|
|
||||||
switch (targa->pixel_size) {
|
switch (targa->pixel_size) {
|
||||||
case 24:
|
case 24:
|
||||||
tex = Hunk_TempAlloc (field_offset (tex_t, data[numPixels * 4]));
|
|
||||||
tex->format = tex_rgb;
|
tex->format = tex_rgb;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
case 32:
|
case 32:
|
||||||
tex = Hunk_TempAlloc (field_offset (tex_t, data[numPixels * 4]));
|
|
||||||
tex->format = tex_rgba;
|
tex->format = tex_rgba;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
tex->width = columns;
|
|
||||||
tex->height = rows;
|
|
||||||
tex->palette = 0;
|
|
||||||
|
|
||||||
// skip TARGA image comment
|
// skip TARGA image comment
|
||||||
dataByte = (byte *) (targa + 1);
|
dataByte = (byte *) (targa + 1);
|
||||||
dataByte += targa->id_length;
|
dataByte += targa->id_length;
|
||||||
|
|
||||||
span = columns * 4; // tex->format
|
|
||||||
|
|
||||||
if (targa->image_type == 2) { // Uncompressed image
|
if (targa->image_type == 2) { // Uncompressed image
|
||||||
switch (targa->pixel_size) {
|
switch (targa->pixel_size) {
|
||||||
case 24:
|
case 24:
|
||||||
|
|
Loading…
Reference in a new issue