mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-30 16:30:43 +00:00
heh, nor do we need PROGHEADER_CRC
This commit is contained in:
parent
9d27a12df7
commit
3edd4550d2
5 changed files with 95 additions and 99 deletions
|
@ -26,8 +26,8 @@
|
||||||
$Id$
|
$Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _PROGS_H
|
#ifndef __QF_progs_h
|
||||||
#define _PROGS_H
|
#define __QF_progs_h
|
||||||
|
|
||||||
#include "QF/link.h"
|
#include "QF/link.h"
|
||||||
#include "QF/vfile.h"
|
#include "QF/vfile.h"
|
||||||
|
@ -291,4 +291,4 @@ struct progs_s {
|
||||||
} fields;
|
} fields;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _PROGS_H
|
#endif//__QF_progs_h
|
||||||
|
|
|
@ -49,107 +49,105 @@ void
|
||||||
Skin_Set_Translate (int top, int bottom, void *_dest)
|
Skin_Set_Translate (int top, int bottom, void *_dest)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
byte *dest2; // FIXME: bleargh, this needs cleaning up
|
|
||||||
|
|
||||||
top = bound (0, top, 13) * 16;
|
top = bound (0, top, 13) * 16;
|
||||||
bottom = bound (0, bottom, 13) * 16;
|
bottom = bound (0, bottom, 13) * 16;
|
||||||
|
|
||||||
switch(r_pixbytes) {
|
switch(r_pixbytes) {
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
byte *source;
|
byte *source;
|
||||||
byte *dest = (byte *) _dest;
|
byte *dest = (byte *) _dest;
|
||||||
|
|
||||||
source = vid.colormap8;
|
source = vid.colormap8;
|
||||||
memcpy (dest, vid.colormap8, VID_GRADES * 256);
|
memcpy (dest, vid.colormap8, VID_GRADES * 256);
|
||||||
|
|
||||||
for (i = 0; i < VID_GRADES; i++, dest += 256, source += 256) {
|
for (i = 0; i < VID_GRADES; i++, dest += 256, source += 256) {
|
||||||
if (top < 128) // the artists made some backwards
|
if (top < 128) // the artists made some backwards ranges.
|
||||||
// ranges. sigh.
|
memcpy (dest + TOP_RANGE, source + top, 16);
|
||||||
memcpy (dest + TOP_RANGE, source + top, 16);
|
else
|
||||||
else
|
for (j = 0; j < 16; j++)
|
||||||
for (j = 0; j < 16; j++)
|
dest[TOP_RANGE + j] = source[top + 15 - j];
|
||||||
dest[TOP_RANGE + j] = source[top + 15 - j];
|
|
||||||
|
|
||||||
if (bottom < 128)
|
if (bottom < 128)
|
||||||
memcpy (dest + BOTTOM_RANGE, source + bottom, 16);
|
memcpy (dest + BOTTOM_RANGE, source + bottom, 16);
|
||||||
else
|
else
|
||||||
for (j = 0; j < 16; j++)
|
for (j = 0; j < 16; j++)
|
||||||
dest[BOTTOM_RANGE + j] = source[bottom + 15 - j];
|
dest[BOTTOM_RANGE + j] = source[bottom + 15 - j];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
unsigned short *source;
|
||||||
|
unsigned short *dest = (unsigned short *) _dest;
|
||||||
|
|
||||||
|
source = vid.colormap16;
|
||||||
|
memcpy (dest, vid.colormap16, 2 * VID_GRADES * 256);
|
||||||
|
|
||||||
|
for (i = 0; i < VID_GRADES; i++, dest += 256, source += 256) {
|
||||||
|
if (top < 128)
|
||||||
|
{
|
||||||
|
for (j = 0; j < 16; j++)
|
||||||
|
dest[TOP_RANGE + j] = source[top + j];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (j = 0; j < 16; j++)
|
||||||
|
dest[TOP_RANGE + j] = source[top + 15 - j];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bottom < 128)
|
||||||
|
{
|
||||||
|
for (j = 0; j < 16; j++)
|
||||||
|
dest[BOTTOM_RANGE + j] = source[bottom + j];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (j = 0; j < 16; j++)
|
||||||
|
dest[BOTTOM_RANGE + j] = source[bottom + 15 - j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
{
|
||||||
|
unsigned int *source;
|
||||||
|
unsigned int *dest = (unsigned int *) _dest;
|
||||||
|
|
||||||
|
source = vid.colormap32;
|
||||||
|
memcpy (dest, vid.colormap32, 4 * VID_GRADES * 256);
|
||||||
|
|
||||||
|
for (i = 0; i < VID_GRADES; i++, dest += 256, source += 256) {
|
||||||
|
if (top < 128)
|
||||||
|
{
|
||||||
|
for (j = 0; j < 16; j++)
|
||||||
|
dest[TOP_RANGE + j] = source[top + j];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (j = 0; j < 16; j++)
|
||||||
|
dest[TOP_RANGE + j] = source[top + 15 - j];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bottom < 128)
|
||||||
|
{
|
||||||
|
for (j = 0; j < 16; j++)
|
||||||
|
dest[BOTTOM_RANGE + j] = source[bottom + j];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (j = 0; j < 16; j++)
|
||||||
|
dest[BOTTOM_RANGE + j] = source[bottom + 15 - j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Sys_Error("Skin_Set_Translate: unsupported r_pixbytes %i\n",
|
||||||
|
r_pixbytes);
|
||||||
}
|
}
|
||||||
break;
|
/*
|
||||||
case 2:
|
|
||||||
{
|
|
||||||
unsigned short *source;
|
|
||||||
unsigned short *dest = (unsigned short *) _dest;
|
|
||||||
|
|
||||||
source = vid.colormap16;
|
|
||||||
memcpy (dest, vid.colormap16, 2 * VID_GRADES * 256);
|
|
||||||
|
|
||||||
for (i = 0; i < VID_GRADES; i++, dest += 256, source += 256) {
|
|
||||||
if (top < 128)
|
|
||||||
{
|
|
||||||
for (j = 0; j < 16; j++)
|
|
||||||
dest[TOP_RANGE + j] = source[top + j];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (j = 0; j < 16; j++)
|
|
||||||
dest[TOP_RANGE + j] = source[top + 15 - j];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bottom < 128)
|
|
||||||
{
|
|
||||||
for (j = 0; j < 16; j++)
|
|
||||||
dest[BOTTOM_RANGE + j] = source[bottom + j];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (j = 0; j < 16; j++)
|
|
||||||
dest[BOTTOM_RANGE + j] = source[bottom + 15 - j];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
{
|
|
||||||
unsigned int *source;
|
|
||||||
unsigned int *dest = (unsigned int *) _dest;
|
|
||||||
|
|
||||||
source = vid.colormap32;
|
|
||||||
memcpy (dest, vid.colormap32, 4 * VID_GRADES * 256);
|
|
||||||
|
|
||||||
for (i = 0; i < VID_GRADES; i++, dest += 256, source += 256) {
|
|
||||||
if (top < 128)
|
|
||||||
{
|
|
||||||
for (j = 0; j < 16; j++)
|
|
||||||
dest[TOP_RANGE + j] = source[top + j];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (j = 0; j < 16; j++)
|
|
||||||
dest[TOP_RANGE + j] = source[top + 15 - j];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bottom < 128)
|
|
||||||
{
|
|
||||||
for (j = 0; j < 16; j++)
|
|
||||||
dest[BOTTOM_RANGE + j] = source[bottom + j];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (j = 0; j < 16; j++)
|
|
||||||
dest[BOTTOM_RANGE + j] = source[bottom + 15 - j];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Sys_Error("Skin_Set_Translate: unsupported r_pixbytes %i\n",
|
|
||||||
r_pixbytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
dest2 = (byte *) _dest;
|
dest2 = (byte *) _dest;
|
||||||
|
|
||||||
for (j = 0;j < 256;j++)
|
for (j = 0;j < 256;j++)
|
||||||
|
@ -170,6 +168,7 @@ Skin_Set_Translate (int top, int bottom, void *_dest)
|
||||||
for (j = 0; j < 16; j++)
|
for (j = 0; j < 16; j++)
|
||||||
dest2[BOTTOM_RANGE + j] = d_8to24table[bottom + 15 - j];
|
dest2[BOTTOM_RANGE + j] = d_8to24table[bottom + 15 - j];
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -45,8 +45,6 @@
|
||||||
#include "sv_progs.h"
|
#include "sv_progs.h"
|
||||||
#include "world.h"
|
#include "world.h"
|
||||||
|
|
||||||
#define PROGHEADER_CRC 5927
|
|
||||||
|
|
||||||
progs_t sv_pr_state;
|
progs_t sv_pr_state;
|
||||||
sv_globals_t sv_globals;
|
sv_globals_t sv_globals;
|
||||||
sv_funcs_t sv_funcs;
|
sv_funcs_t sv_funcs;
|
||||||
|
|
|
@ -93,6 +93,7 @@ typedef struct player_info_s
|
||||||
|
|
||||||
int spectator;
|
int spectator;
|
||||||
byte translations[4*VID_GRADES*256]; // space for colormap32
|
byte translations[4*VID_GRADES*256]; // space for colormap32
|
||||||
|
int translationcolor[256];
|
||||||
struct skin_s *skin;
|
struct skin_s *skin;
|
||||||
} player_info_t;
|
} player_info_t;
|
||||||
|
|
||||||
|
|
|
@ -45,8 +45,6 @@
|
||||||
#include "sv_progs.h"
|
#include "sv_progs.h"
|
||||||
#include "world.h"
|
#include "world.h"
|
||||||
|
|
||||||
#define PROGHEADER_CRC 54730
|
|
||||||
|
|
||||||
sv_globals_t sv_globals;
|
sv_globals_t sv_globals;
|
||||||
sv_funcs_t sv_funcs;
|
sv_funcs_t sv_funcs;
|
||||||
sv_fields_t sv_fields;
|
sv_fields_t sv_fields;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue