got rid of some anonymous unions

fixed a few msvc2005 complaints


git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1971 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2006-02-17 02:51:59 +00:00
parent 7276203458
commit d245b06c91
25 changed files with 767 additions and 257 deletions

View file

@ -1612,15 +1612,15 @@ void CL_Packet_f (void)
if (Cmd_FromGamecode()) //some mvd servers stuffcmd a packet command which lets them know which ip the client is from. if (Cmd_FromGamecode()) //some mvd servers stuffcmd a packet command which lets them know which ip the client is from.
{ //unfortunatly, 50% of servers are badly configured. { //unfortunatly, 50% of servers are badly configured.
if (adr.type == NA_IP) if (adr.type == NA_IP)
if (adr.ip[0] == 127) if (adr.address.ip[0] == 127)
if (adr.ip[1] == 0) if (adr.address.ip[1] == 0)
if (adr.ip[2] == 0) if (adr.address.ip[2] == 0)
if (adr.ip[3] == 1) if (adr.address.ip[3] == 1)
{ {
adr.ip[0] = cls.netchan.remote_address.ip[0]; adr.address.ip[0] = cls.netchan.remote_address.address.ip[0];
adr.ip[1] = cls.netchan.remote_address.ip[1]; adr.address.ip[1] = cls.netchan.remote_address.address.ip[1];
adr.ip[2] = cls.netchan.remote_address.ip[2]; adr.address.ip[2] = cls.netchan.remote_address.address.ip[2];
adr.ip[3] = cls.netchan.remote_address.ip[3]; adr.address.ip[3] = cls.netchan.remote_address.address.ip[3];
adr.port = cls.netchan.remote_address.port; adr.port = cls.netchan.remote_address.port;
Con_Printf ("^b^1Server is broken. Trying to send to server instead.\n"); Con_Printf ("^b^1Server is broken. Trying to send to server instead.\n");
@ -2056,7 +2056,7 @@ client_connect: //fixme: make function
Con_TPrintf (TLC_CONLESS_CONCMD); Con_TPrintf (TLC_CONLESS_CONCMD);
if (net_from.type != net_local_cl_ipadr.type if (net_from.type != net_local_cl_ipadr.type
|| ((*(unsigned *)net_from.ip != *(unsigned *)net_local_cl_ipadr.ip) && (*(unsigned *)net_from.ip != htonl(INADDR_LOOPBACK)))) || ((*(unsigned *)net_from.address.ip != *(unsigned *)net_local_cl_ipadr.address.ip) && (*(unsigned *)net_from.address.ip != htonl(INADDR_LOOPBACK))))
{ {
Con_TPrintf (TLC_CMDFROMREMOTE); Con_TPrintf (TLC_CMDFROMREMOTE);
return; return;

View file

@ -73,7 +73,7 @@ typedef struct tagRAWMOUSE {
USHORT usButtonFlags; USHORT usButtonFlags;
USHORT usButtonData; USHORT usButtonData;
}; };
}; } buttondata;
ULONG ulRawButtons; ULONG ulRawButtons;
LONG lLastX; LONG lLastX;
LONG lLastY; LONG lLastY;

View file

@ -73,7 +73,7 @@ typedef struct {
DWORD threadid; DWORD threadid;
}; };
HANDLE rawinputhandle; // raw input HANDLE rawinputhandle; // raw input
}; } handles;
int numbuttons; int numbuttons;
@ -852,11 +852,11 @@ unsigned int _stdcall IN_SerialMSRun(void *param)
char code[3]; char code[3];
DWORD read; DWORD read;
int total=0; int total=0;
IN_SetSerialBoad(mouse->comhandle, 1200); IN_SetSerialBoad(mouse->handles.comhandle, 1200);
total=0; total=0;
while(1) while(1)
{ {
ReadFile(mouse->comhandle, code, sizeof(code)-total, &read, NULL); ReadFile(mouse->handles.comhandle, code, sizeof(code)-total, &read, NULL);
total+=read; total+=read;
if (total == 3) if (total == 3)
{ {
@ -886,15 +886,15 @@ unsigned long __stdcall IN_SerialMSIntelliRun(void *param)
mouse_t *mouse = param; mouse_t *mouse = param;
unsigned char code[80]; unsigned char code[80];
DWORD read, total=0; DWORD read, total=0;
IN_SetSerialBoad(mouse->comhandle, 1200); IN_SetSerialBoad(mouse->handles.comhandle, 1200);
ReadFile(mouse->comhandle, code, 11*4+2, &read, NULL); //header info which we choose to ignore ReadFile(mouse->handles.comhandle, code, 11*4+2, &read, NULL); //header info which we choose to ignore
mouse->numbuttons = 3; mouse->numbuttons = 3;
while(1) while(1)
{ {
ReadFile(mouse->comhandle, code+total, 4-total, &read, NULL); ReadFile(mouse->handles.comhandle, code+total, 4-total, &read, NULL);
total+=read; total+=read;
if (total >= 4) if (total >= 4)
{ {
@ -1073,7 +1073,7 @@ void IN_RawInput_Init(void)
Con_SafePrintf("Raw input: [%i] %s\n", i, dname); Con_SafePrintf("Raw input: [%i] %s\n", i, dname);
// set handle // set handle
rawmice[rawmicecount].rawinputhandle = pRawInputDeviceList[i].hDevice; rawmice[rawmicecount].handles.rawinputhandle = pRawInputDeviceList[i].hDevice;
rawmice[rawmicecount].numbuttons = 10; rawmice[rawmicecount].numbuttons = 10;
rawmice[rawmicecount].pos[0] = RI_INVALID_POS; rawmice[rawmicecount].pos[0] = RI_INVALID_POS;
rawmicecount++; rawmicecount++;
@ -1160,17 +1160,17 @@ void IN_StartupMouse (void)
IN_ActivateMouse (); IN_ActivateMouse ();
#ifdef SERIALMOUSE #ifdef SERIALMOUSE
if (serialmouse.comhandle) if (serialmouse.handles.comhandle)
{ {
TerminateThread(serialmouse.threadhandle, 0); TerminateThread(serialmouse.handles.threadhandle, 0);
CloseHandle(serialmouse.threadhandle); CloseHandle(serialmouse.handles.threadhandle);
CloseHandle(serialmouse.comhandle); CloseHandle(serialmouse.handles.comhandle);
} }
serialmouse.numbuttons = 0; serialmouse.numbuttons = 0;
if (COM_CheckParm("-mouse2")) if (COM_CheckParm("-mouse2"))
{ {
serialmouse.comhandle = CreateFile("\\\\.\\COM2", serialmouse.handles.comhandle = CreateFile("\\\\.\\COM2",
GENERIC_READ, GENERIC_READ,
0, // share for reading 0, // share for reading
NULL, // default security NULL, // default security
@ -1178,17 +1178,17 @@ void IN_StartupMouse (void)
FILE_ATTRIBUTE_NORMAL, // normal file FILE_ATTRIBUTE_NORMAL, // normal file
NULL); // no attr. template NULL); // no attr. template
if (serialmouse.comhandle == INVALID_HANDLE_VALUE) if (serialmouse.handles.comhandle == INVALID_HANDLE_VALUE)
{ {
serialmouse.comhandle = NULL; serialmouse.handles.comhandle = NULL;
return; return;
} }
serialmouse.threadhandle = CreateThread(NULL, 1024, IN_SerialMSIntelliRun, (void *)&serialmouse, CREATE_SUSPENDED, &serialmouse.threadid); serialmouse.handles.threadhandle = CreateThread(NULL, 1024, IN_SerialMSIntelliRun, (void *)&serialmouse, CREATE_SUSPENDED, &serialmouse.handles.threadid);
SetThreadPriority(serialmouse.threadhandle, THREAD_PRIORITY_HIGHEST); SetThreadPriority(serialmouse.handles.threadhandle, THREAD_PRIORITY_HIGHEST);
ResumeThread(serialmouse.threadhandle); ResumeThread(serialmouse.handles.threadhandle);
} }
else else
serialmouse.comhandle = NULL; serialmouse.handles.comhandle = NULL;
#endif #endif
} }
@ -1765,7 +1765,7 @@ void IN_RawInput_MouseRead(HANDLE in_device_handle)
// find mouse in our mouse list // find mouse in our mouse list
for (; i < rawmicecount; i++) for (; i < rawmicecount; i++)
{ {
if (rawmice[i].rawinputhandle == raw->header.hDevice) if (rawmice[i].handles.rawinputhandle == raw->header.hDevice)
break; break;
} }
@ -1791,34 +1791,37 @@ void IN_RawInput_MouseRead(HANDLE in_device_handle)
} }
// buttons // buttons
if (raw->data.mouse.usButtonFlags & RI_MOUSE_BUTTON_1_DOWN) if (raw->data.mouse.buttondata.usButtonFlags & RI_MOUSE_BUTTON_1_DOWN)
Key_Event(K_MOUSE1, true); Key_Event(K_MOUSE1, true);
if (raw->data.mouse.usButtonFlags & RI_MOUSE_BUTTON_1_UP) if (raw->data.mouse.buttondata.usButtonFlags & RI_MOUSE_BUTTON_1_UP)
Key_Event(K_MOUSE1, false); Key_Event(K_MOUSE1, false);
if (raw->data.mouse.usButtonFlags & RI_MOUSE_BUTTON_2_DOWN) if (raw->data.mouse.buttondata.usButtonFlags & RI_MOUSE_BUTTON_2_DOWN)
Key_Event(K_MOUSE2, true); Key_Event(K_MOUSE2, true);
if (raw->data.mouse.usButtonFlags & RI_MOUSE_BUTTON_2_UP) if (raw->data.mouse.buttondata.usButtonFlags & RI_MOUSE_BUTTON_2_UP)
Key_Event(K_MOUSE2, false); Key_Event(K_MOUSE2, false);
if (raw->data.mouse.usButtonFlags & RI_MOUSE_BUTTON_3_DOWN) if (raw->data.mouse.buttondata.usButtonFlags & RI_MOUSE_BUTTON_3_DOWN)
Key_Event(K_MOUSE3, true); Key_Event(K_MOUSE3, true);
if (raw->data.mouse.usButtonFlags & RI_MOUSE_BUTTON_3_UP) if (raw->data.mouse.buttondata.usButtonFlags & RI_MOUSE_BUTTON_3_UP)
Key_Event(K_MOUSE3, false); Key_Event(K_MOUSE3, false);
if (raw->data.mouse.usButtonFlags & RI_MOUSE_BUTTON_4_DOWN) if (raw->data.mouse.buttondata.usButtonFlags & RI_MOUSE_BUTTON_4_DOWN)
Key_Event(K_MOUSE4, true); Key_Event(K_MOUSE4, true);
if (raw->data.mouse.usButtonFlags & RI_MOUSE_BUTTON_4_UP) if (raw->data.mouse.buttondata.usButtonFlags & RI_MOUSE_BUTTON_4_UP)
Key_Event(K_MOUSE4, false); Key_Event(K_MOUSE4, false);
if (raw->data.mouse.usButtonFlags & RI_MOUSE_BUTTON_5_DOWN) if (raw->data.mouse.buttondata.usButtonFlags & RI_MOUSE_BUTTON_5_DOWN)
Key_Event(K_MOUSE5, true); Key_Event(K_MOUSE5, true);
if (raw->data.mouse.usButtonFlags & RI_MOUSE_BUTTON_5_UP) if (raw->data.mouse.buttondata.usButtonFlags & RI_MOUSE_BUTTON_5_UP)
Key_Event(K_MOUSE5, false); Key_Event(K_MOUSE5, false);
// mouse wheel // mouse wheel
if (raw->data.mouse.usButtonFlags & RI_MOUSE_WHEEL) { // If the current message has a mouse_wheel message if (raw->data.mouse.buttondata.usButtonFlags & RI_MOUSE_WHEEL)
if ((SHORT)raw->data.mouse.usButtonData > 0) { { // If the current message has a mouse_wheel message
if ((SHORT)raw->data.mouse.buttondata.usButtonData > 0)
{
Key_Event(K_MWHEELUP, true); Key_Event(K_MWHEELUP, true);
Key_Event(K_MWHEELUP, false); Key_Event(K_MWHEELUP, false);
} }
if ((SHORT)raw->data.mouse.usButtonData < 0) { if ((SHORT)raw->data.mouse.buttondata.usButtonData < 0)
{
Key_Event(K_MWHEELDOWN, true); Key_Event(K_MWHEELDOWN, true);
Key_Event(K_MWHEELDOWN, false); Key_Event(K_MWHEELDOWN, false);
} }

View file

@ -1596,10 +1596,10 @@ void CL_MasterListParse(int type, qboolean slashpad)
info = Z_Malloc(sizeof(serverinfo_t)); info = Z_Malloc(sizeof(serverinfo_t));
info->adr.type = NA_IP; info->adr.type = NA_IP;
info->adr.ip[0] = MSG_ReadByte(); info->adr.address.ip[0] = MSG_ReadByte();
info->adr.ip[1] = MSG_ReadByte(); info->adr.address.ip[1] = MSG_ReadByte();
info->adr.ip[2] = MSG_ReadByte(); info->adr.address.ip[2] = MSG_ReadByte();
info->adr.ip[3] = MSG_ReadByte(); info->adr.address.ip[3] = MSG_ReadByte();
p1 = MSG_ReadByte(); p1 = MSG_ReadByte();
p2 = MSG_ReadByte(); p2 = MSG_ReadByte();

View file

@ -2108,7 +2108,7 @@ int P_RunParticleEffectState (vec3_t org, vec3_t dir, float count, int typenum,
if (ptype->flags & PT_INVFRAMETIME) if (ptype->flags & PT_INVFRAMETIME)
pcount /= host_frametime; pcount /= host_frametime;
if (ts) if (ts)
pcount += ts->emittime; pcount += ts->state2.emittime;
switch (ptype->spawnmode) switch (ptype->spawnmode)
{ {
@ -2155,10 +2155,10 @@ int P_RunParticleEffectState (vec3_t org, vec3_t dir, float count, int typenum,
// time limit (for completeness) // time limit (for completeness)
if (ptype->spawntime && ts) if (ptype->spawntime && ts)
{ {
if (ts->statetime > particletime) if (ts->state1.statetime > particletime)
return 0; // timelimit still in effect return 0; // timelimit still in effect
ts->statetime = particletime + ptype->spawntime; // record old time ts->state1.statetime = particletime + ptype->spawntime; // record old time
} }
// random chance for point effects // random chance for point effects
@ -2204,9 +2204,10 @@ int P_RunParticleEffectState (vec3_t org, vec3_t dir, float count, int typenum,
else else
p->alpha = ptype->alpha; p->alpha = ptype->alpha;
// p->color = 0; // p->color = 0;
p->nextemit = particletime + ptype->emitstart - p->die;
if (ptype->emittime < 0) if (ptype->emittime < 0)
p->trailstate = NULL; p->state.trailstate = NULL;
else
p->state.nextemit = particletime + ptype->emitstart - p->die;
p->rotationspeed = ptype->rotationmin + frandom()*ptype->rotationrand; p->rotationspeed = ptype->rotationmin + frandom()*ptype->rotationrand;
p->angle = ptype->rotationstartmin + frandom()*ptype->rotationstartrand; p->angle = ptype->rotationstartmin + frandom()*ptype->rotationstartrand;
@ -2428,7 +2429,7 @@ int P_RunParticleEffectState (vec3_t org, vec3_t dir, float count, int typenum,
// save off emit times in trailstate // save off emit times in trailstate
if (ts) if (ts)
ts->emittime = pcount - i; ts->state2.emittime = pcount - i;
// go to next associated effect // go to next associated effect
if (ptype->assoc < 0) if (ptype->assoc < 0)
@ -2780,10 +2781,10 @@ static void P_ParticleTrailDraw (vec3_t startpos, vec3_t end, part_type_t *ptype
// time limit for trails // time limit for trails
if (ptype->spawntime && ts) if (ptype->spawntime && ts)
{ {
if (ts->statetime > particletime) if (ts->state1.statetime > particletime)
return; // timelimit still in effect return; // timelimit still in effect
ts->statetime = particletime + ptype->spawntime; // record old time ts->state1.statetime = particletime + ptype->spawntime; // record old time
ts = NULL; // clear trailstate so we don't save length/lastseg ts = NULL; // clear trailstate so we don't save length/lastseg
} }
@ -2834,8 +2835,8 @@ static void P_ParticleTrailDraw (vec3_t startpos, vec3_t end, part_type_t *ptype
// store last stop here for lack of a better solution besides vectors // store last stop here for lack of a better solution besides vectors
if (ts) if (ts)
{ {
ts->laststop = stop = ts->laststop + len; //when to stop ts->state2.laststop = stop = ts->state2.laststop + len; //when to stop
len = ts->lastdist; len = ts->state1.lastdist;
} }
else else
{ {
@ -2946,9 +2947,10 @@ static void P_ParticleTrailDraw (vec3_t startpos, vec3_t end, part_type_t *ptype
p->rgb[2] += p->org[2]*ptype->rgbrand[2] + ptype->rgbchange[2]*p->die; p->rgb[2] += p->org[2]*ptype->rgbrand[2] + ptype->rgbchange[2]*p->die;
VectorCopy (vec3_origin, p->vel); VectorCopy (vec3_origin, p->vel);
p->nextemit = particletime + ptype->emitstart - p->die;
if (ptype->emittime < 0) if (ptype->emittime < 0)
p->trailstate = NULL; // init trailstate p->state.trailstate = NULL; // init trailstate
else
p->state.nextemit = particletime + ptype->emitstart - p->die;
p->rotationspeed = ptype->rotationmin + frandom()*ptype->rotationrand; p->rotationspeed = ptype->rotationmin + frandom()*ptype->rotationrand;
p->angle = ptype->rotationstartmin + frandom()*ptype->rotationstartrand; p->angle = ptype->rotationstartmin + frandom()*ptype->rotationstartrand;
@ -3101,7 +3103,7 @@ static void P_ParticleTrailDraw (vec3_t startpos, vec3_t end, part_type_t *ptype
if (ts) if (ts)
{ {
ts->lastdist = len; ts->state1.lastdist = len;
// update beamseg list // update beamseg list
if (ptype->type == PT_BEAM) if (ptype->type == PT_BEAM)
@ -4110,7 +4112,7 @@ void DrawParticleTypes (void texturedparticles(particle_t *,part_type_t*), void
kill = type->particles; kill = type->particles;
if (kill && kill->die < particletime) if (kill && kill->die < particletime)
{ {
P_DelinkTrailstate(&kill->trailstate); P_DelinkTrailstate(&kill->state.trailstate);
type->particles = kill->next; type->particles = kill->next;
kill->next = kill_list; kill->next = kill_list;
kill_list = kill; kill_list = kill;
@ -4151,7 +4153,7 @@ void DrawParticleTypes (void texturedparticles(particle_t *,part_type_t*), void
kill = p->next; kill = p->next;
if (kill && kill->die < particletime) if (kill && kill->die < particletime)
{ {
P_DelinkTrailstate(&kill->trailstate); P_DelinkTrailstate(&kill->state.trailstate);
p->next = kill->next; p->next = kill->next;
kill->next = kill_list; kill->next = kill_list;
kill_list = kill; kill_list = kill;
@ -4225,10 +4227,10 @@ void DrawParticleTypes (void texturedparticles(particle_t *,part_type_t*), void
if (type->emit >= 0) if (type->emit >= 0)
{ {
if (type->emittime < 0) if (type->emittime < 0)
P_ParticleTrail(oldorg, p->org, type->emit, &p->trailstate); P_ParticleTrail(oldorg, p->org, type->emit, &p->state.trailstate);
else if (p->nextemit < particletime) else if (p->state.nextemit < particletime)
{ {
p->nextemit = particletime + type->emittime + frandom()*type->emitrand; p->state.nextemit = particletime + type->emittime + frandom()*type->emitrand;
P_RunParticleEffectType(p->org, p->vel, 1, type->emit); P_RunParticleEffectType(p->org, p->vel, 1, type->emit);
} }
} }

View file

@ -1640,8 +1640,8 @@ TRACE(("dbg: R_ApplyRenderer: clearing world\n"));
{ {
for (i = 0; i < MAX_MODELS; i++) for (i = 0; i < MAX_MODELS; i++)
{ {
if (sv.model_precache[i] && *sv.model_precache[i] && (!strcmp(sv.model_precache[i] + strlen(sv.model_precache[i]) - 4, ".bsp") || i-1 < sv.worldmodel->numsubmodels)) if (sv.strings.model_precache[i] && *sv.strings.model_precache[i] && (!strcmp(sv.strings.model_precache[i] + strlen(sv.strings.model_precache[i]) - 4, ".bsp") || i-1 < sv.worldmodel->numsubmodels))
sv.models[i] = Mod_FindName(sv.model_precache[i]); sv.models[i] = Mod_FindName(sv.strings.model_precache[i]);
else else
sv.models[i] = NULL; sv.models[i] = NULL;
} }

View file

@ -1,442 +1,884 @@
/* /*
** Winamp frontend/plug-in control API documentation v1.1. ** Winamp frontend/plug-in control API documentation v1.1.
** By Justin Frankel. Updates by Christophe Thibault. ** By Justin Frankel. Updates by Christophe Thibault.
** Copyright (C) 1997-2000, Nullsoft Inc. ** Copyright (C) 1997-2000, Nullsoft Inc.
** Last updated: JUL.12.2000. ** Last updated: JUL.12.2000.
** **
** Introduction ** Introduction
** ----------------------- ** -----------------------
** This file describes a means to easily communicate to Winamp ** This file describes a means to easily communicate to Winamp
** via the classic Win32 Message API. ** via the classic Win32 Message API.
** **
** These definitions/code assume C/C++. Porting to VB/Delphi shouldn't ** These definitions/code assume C/C++. Porting to VB/Delphi shouldn't
** be too hard. ** be too hard.
** **
** First, you find the HWND of the Winamp main window. From a plug-in ** First, you find the HWND of the Winamp main window. From a plug-in
** you can easily extract this from the plug-in structure (hMainWindow, ** you can easily extract this from the plug-in structure (hMainWindow,
** hwndParent, whatever). For external apps, use: ** hwndParent, whatever). For external apps, use:
** **
** HWND hwnd_winamp = FindWindow("Winamp v1.x",NULL); ** HWND hwnd_winamp = FindWindow("Winamp v1.x",NULL);
** **
** (note: I know, we're in Winamp 2.x, but it's 1.x for compatibility) ** (note: I know, we're in Winamp 2.x, but it's 1.x for compatibility)
** **
** Once you have the hwnd_winamp, it's a good idea to check the version ** Once you have the hwnd_winamp, it's a good idea to check the version
** number. To do this, you send a WM_WA_IPC message to hwnd_winamp. ** number. To do this, you send a WM_WA_IPC message to hwnd_winamp.
** Note that WM_WA_IPC is defined as Win32's WM_USER. ** Note that WM_WA_IPC is defined as Win32's WM_USER.
** **
** Note that sometimes you might want to use PostMessage instead of ** Note that sometimes you might want to use PostMessage instead of
** SendMessage. ** SendMessage.
*/ */
#ifndef _WAFE_H_ #ifndef _WAFE_H_
#define _WAFE_H_ #define _WAFE_H_
#define WM_WA_IPC WM_USER #define WM_WA_IPC WM_USER
/**************************************************************************/ /**************************************************************************/
#define IPC_GETVERSION 0 #define IPC_GETVERSION 0
/* /*
** int version = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETVERSION); ** int version = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETVERSION);
** **
** Version will be 0x20yx for winamp 2.yx. versions previous to Winamp 2.0 ** Version will be 0x20yx for winamp 2.yx. versions previous to Winamp 2.0
** typically (but not always) use 0x1zyx for 1.zx versions. Weird, I know. ** typically (but not always) use 0x1zyx for 1.zx versions. Weird, I know.
** **
** The basic format for sending messages to Winamp is: ** The basic format for sending messages to Winamp is:
** int result=SendMessage(hwnd_winamp,WM_WA_IPC,command_data,command); ** int result=SendMessage(hwnd_winamp,WM_WA_IPC,command_data,command);
** (for the version check, command_data is 0). ** (for the version check, command_data is 0).
*/ */
#define IPC_DELETE 101 #define IPC_DELETE 101
/* /*
** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_DELETE); ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_DELETE);
** **
** You can use IPC_DELETE to clear Winamp's internal playlist. ** You can use IPC_DELETE to clear Winamp's internal playlist.
*/ */
#define IPC_STARTPLAY 102 #define IPC_STARTPLAY 102
/* /*
** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_STARTPLAY); ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_STARTPLAY);
** **
** Using IPC_STARTPLAY is like hitting 'Play' in Winamp, mostly. ** Using IPC_STARTPLAY is like hitting 'Play' in Winamp, mostly.
*/ */
#define IPC_ISPLAYING 104 #define IPC_ISPLAYING 104
/* /*
** int res = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISPLAYING); ** int res = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISPLAYING);
** **
** IPC_ISPLAYING returns the status of playback. ** IPC_ISPLAYING returns the status of playback.
** If it returns 1, it is playing. if it returns 3, it is paused, ** If it returns 1, it is playing. if it returns 3, it is paused,
** if it returns 0, it is not playing. ** if it returns 0, it is not playing.
*/ */
#define IPC_GETOUTPUTTIME 105 #define IPC_GETOUTPUTTIME 105
/* /*
** int res = SendMessage(hwnd_winamp,WM_WA_IPC,mode,IPC_GETOUTPUTTIME); ** int res = SendMessage(hwnd_winamp,WM_WA_IPC,mode,IPC_GETOUTPUTTIME);
** **
** IPC_GETOUTPUTTIME returns the position in milliseconds of the ** IPC_GETOUTPUTTIME returns the position in milliseconds of the
** current song (mode = 0), or the song length, in seconds (mode = 1). ** current song (mode = 0), or the song length, in seconds (mode = 1).
** Returns -1 if not playing or error. ** Returns -1 if not playing or error.
*/ */
#define IPC_JUMPTOTIME 106 #define IPC_JUMPTOTIME 106
/* (requires Winamp 1.60+) /* (requires Winamp 1.60+)
** SendMessage(hwnd_winamp,WM_WA_IPC,ms,IPC_JUMPTOTIME); ** SendMessage(hwnd_winamp,WM_WA_IPC,ms,IPC_JUMPTOTIME);
** IPC_JUMPTOTIME sets the position in milliseconds of the ** IPC_JUMPTOTIME sets the position in milliseconds of the
** current song (approximately). ** current song (approximately).
** Returns -1 if not playing, 1 on eof, or 0 if successful ** Returns -1 if not playing, 1 on eof, or 0 if successful
*/ */
#define IPC_WRITEPLAYLIST 120 #define IPC_WRITEPLAYLIST 120
/* (requires Winamp 1.666+) /* (requires Winamp 1.666+)
** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_WRITEPLAYLIST); ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_WRITEPLAYLIST);
** **
** IPC_WRITEPLAYLIST writes the current playlist to <winampdir>\\Winamp.m3u, ** IPC_WRITEPLAYLIST writes the current playlist to <winampdir>\\Winamp.m3u,
** and returns the current playlist position. ** and returns the current playlist position.
** Kinda obsoleted by some of the 2.x new stuff, but still good for when ** Kinda obsoleted by some of the 2.x new stuff, but still good for when
** using a front-end (instead of a plug-in) ** using a front-end (instead of a plug-in)
*/ */
#define IPC_SETPLAYLISTPOS 121 #define IPC_SETPLAYLISTPOS 121
/* (requires Winamp 2.0+) /* (requires Winamp 2.0+)
** SendMessage(hwnd_winamp,WM_WA_IPC,position,IPC_SETPLAYLISTPOS) ** SendMessage(hwnd_winamp,WM_WA_IPC,position,IPC_SETPLAYLISTPOS)
** **
** IPC_SETPLAYLISTPOS sets the playlsit position to 'position'. ** IPC_SETPLAYLISTPOS sets the playlsit position to 'position'.
*/ */
#define IPC_SETVOLUME 122 #define IPC_SETVOLUME 122
/* (requires Winamp 2.0+) /* (requires Winamp 2.0+)
** SendMessage(hwnd_winamp,WM_WA_IPC,volume,IPC_SETVOLUME); ** SendMessage(hwnd_winamp,WM_WA_IPC,volume,IPC_SETVOLUME);
** **
** IPC_SETVOLUME sets the volume of Winamp (from 0-255). ** IPC_SETVOLUME sets the volume of Winamp (from 0-255).
*/ */
#define IPC_SETPANNING 123 #define IPC_SETPANNING 123
/* (requires Winamp 2.0+) /* (requires Winamp 2.0+)
** SendMessage(hwnd_winamp,WM_WA_IPC,panning,IPC_SETPANNING); ** SendMessage(hwnd_winamp,WM_WA_IPC,panning,IPC_SETPANNING);
** **
** IPC_SETPANNING sets the panning of Winamp (from 0 (left) to 255 (right)). ** IPC_SETPANNING sets the panning of Winamp (from 0 (left) to 255 (right)).
*/ */
#define IPC_GETLISTLENGTH 124 #define IPC_GETLISTLENGTH 124
/* (requires Winamp 2.0+) /* (requires Winamp 2.0+)
** int length = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTLENGTH); ** int length = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTLENGTH);
** **
** IPC_GETLISTLENGTH returns the length of the current playlist, in ** IPC_GETLISTLENGTH returns the length of the current playlist, in
** tracks. ** tracks.
*/ */
#define IPC_SETSKIN 200 #define IPC_SETSKIN 200
/* (requires Winamp 2.04+, only usable from plug-ins (not external apps)) /* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)"skinname",IPC_SETSKIN); ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)"skinname",IPC_SETSKIN);
** **
** IPC_SETSKIN sets the current skin to "skinname". Note that skinname ** IPC_SETSKIN sets the current skin to "skinname". Note that skinname
** can be the name of a skin, a skin .zip file, with or without path. ** can be the name of a skin, a skin .zip file, with or without path.
** If path isn't specified, the default search path is the winamp skins ** If path isn't specified, the default search path is the winamp skins
** directory. ** directory.
*/ */
#define IPC_GETSKIN 201 #define IPC_GETSKIN 201
/* (requires Winamp 2.04+, only usable from plug-ins (not external apps)) /* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)skinname_buffer,IPC_GETSKIN); ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)skinname_buffer,IPC_GETSKIN);
** **
** IPC_GETSKIN puts the directory where skin bitmaps can be found ** IPC_GETSKIN puts the directory where skin bitmaps can be found
** into skinname_buffer. ** into skinname_buffer.
** skinname_buffer must be MAX_PATH characters in length. ** skinname_buffer must be MAX_PATH characters in length.
** When using a .zip'd skin file, it'll return a temporary directory ** When using a .zip'd skin file, it'll return a temporary directory
** where the ZIP was decompressed. ** where the ZIP was decompressed.
*/ */
#define IPC_EXECPLUG 202 #define IPC_EXECPLUG 202
/* (requires Winamp 2.04+, only usable from plug-ins (not external apps)) /* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)"vis_file.dll",IPC_EXECPLUG); ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)"vis_file.dll",IPC_EXECPLUG);
** **
** IPC_EXECPLUG executes a visualization plug-in pointed to by WPARAM. ** IPC_EXECPLUG executes a visualization plug-in pointed to by WPARAM.
** the format of this string can be: ** the format of this string can be:
** "vis_whatever.dll" ** "vis_whatever.dll"
** "vis_whatever.dll,0" // (first mod, file in winamp plug-in dir) ** "vis_whatever.dll,0" // (first mod, file in winamp plug-in dir)
** "C:\\dir\\vis_whatever.dll,1" ** "C:\\dir\\vis_whatever.dll,1"
*/ */
#define IPC_GETPLAYLISTFILE 211 #define IPC_GETPLAYLISTFILE 211
/* (requires Winamp 2.04+, only usable from plug-ins (not external apps)) /* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
** char *name=SendMessage(hwnd_winamp,WM_WA_IPC,index,IPC_GETPLAYLISTFILE); ** char *name=SendMessage(hwnd_winamp,WM_WA_IPC,index,IPC_GETPLAYLISTFILE);
** **
** IPC_GETPLAYLISTFILE gets the filename of the playlist entry [index]. ** IPC_GETPLAYLISTFILE gets the filename of the playlist entry [index].
** returns a pointer to it. returns NULL on error. ** returns a pointer to it. returns NULL on error.
*/ */
#define IPC_GETPLAYLISTTITLE 212 #define IPC_GETPLAYLISTTITLE 212
/* (requires Winamp 2.04+, only usable from plug-ins (not external apps)) /* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
** char *name=SendMessage(hwnd_winamp,WM_WA_IPC,index,IPC_GETPLAYLISTTITLE); ** char *name=SendMessage(hwnd_winamp,WM_WA_IPC,index,IPC_GETPLAYLISTTITLE);
** **
** IPC_GETPLAYLISTTITLE gets the title of the playlist entry [index]. ** IPC_GETPLAYLISTTITLE gets the title of the playlist entry [index].
** returns a pointer to it. returns NULL on error. ** returns a pointer to it. returns NULL on error.
*/ */
#define IPC_GETLISTPOS 125 #define IPC_GETLISTPOS 125
/* (requires Winamp 2.05+) /* (requires Winamp 2.05+)
** int pos=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS); ** int pos=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS);
** **
** IPC_GETLISTPOS returns the playlist position. A lot like IPC_WRITEPLAYLIST ** IPC_GETLISTPOS returns the playlist position. A lot like IPC_WRITEPLAYLIST
** only faster since it doesn't have to write out the list. Heh, silly me. ** only faster since it doesn't have to write out the list. Heh, silly me.
*/ */
#define IPC_GETINFO 126 #define IPC_GETINFO 126
/* (requires Winamp 2.05+) /* (requires Winamp 2.05+)
** int inf=SendMessage(hwnd_winamp,WM_WA_IPC,mode,IPC_GETINFO); ** int inf=SendMessage(hwnd_winamp,WM_WA_IPC,mode,IPC_GETINFO);
** **
** IPC_GETINFO returns info about the current playing song. The value ** IPC_GETINFO returns info about the current playing song. The value
** it returns depends on the value of 'mode'. ** it returns depends on the value of 'mode'.
** Mode Meaning ** Mode Meaning
** ------------------ ** ------------------
** 0 Samplerate (i.e. 44100) ** 0 Samplerate (i.e. 44100)
** 1 Bitrate (i.e. 128) ** 1 Bitrate (i.e. 128)
** 2 Channels (i.e. 2) ** 2 Channels (i.e. 2)
*/ */
#define IPC_GETEQDATA 127 #define IPC_GETEQDATA 127
/* (requires Winamp 2.05+) /* (requires Winamp 2.05+)
** int data=SendMessage(hwnd_winamp,WM_WA_IPC,pos,IPC_GETEQDATA); ** int data=SendMessage(hwnd_winamp,WM_WA_IPC,pos,IPC_GETEQDATA);
** **
** IPC_GETEQDATA queries the status of the EQ. ** IPC_GETEQDATA queries the status of the EQ.
** The value returned depends on what 'pos' is set to: ** The value returned depends on what 'pos' is set to:
** Value Meaning ** Value Meaning
** ------------------ ** ------------------
** 0-9 The 10 bands of EQ data. 0-63 (+20db - -20db) ** 0-9 The 10 bands of EQ data. 0-63 (+20db - -20db)
** 10 The preamp value. 0-63 (+20db - -20db) ** 10 The preamp value. 0-63 (+20db - -20db)
** 11 Enabled. zero if disabled, nonzero if enabled. ** 11 Enabled. zero if disabled, nonzero if enabled.
** 12 Autoload. zero if disabled, nonzero if enabled. ** 12 Autoload. zero if disabled, nonzero if enabled.
*/ */
#define IPC_SETEQDATA 128 #define IPC_SETEQDATA 128
/* (requires Winamp 2.05+) /* (requires Winamp 2.05+)
** SendMessage(hwnd_winamp,WM_WA_IPC,pos,IPC_GETEQDATA); ** SendMessage(hwnd_winamp,WM_WA_IPC,pos,IPC_GETEQDATA);
** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SETEQDATA); ** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SETEQDATA);
** **
** IPC_SETEQDATA sets the value of the last position retrieved ** IPC_SETEQDATA sets the value of the last position retrieved
** by IPC_GETEQDATA. ** by IPC_GETEQDATA.
*/ */
#define IPC_ADDBOOKMARK 129 #define IPC_ADDBOOKMARK 129
/* (requires Winamp 2.4+) /* (requires Winamp 2.4+)
** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)file,IPC_ADDBOOKMARK); ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)file,IPC_ADDBOOKMARK);
** **
** IPC_ADDBOOKMARK will add the specified file to the Winamp bookmark list. ** IPC_ADDBOOKMARK will add the specified file to the Winamp bookmark list.
*/ */
#define IPC_RESTARTWINAMP 135 #define IPC_RESTARTWINAMP 135
/* (requires Winamp 2.2+) /* (requires Winamp 2.2+)
** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_RESTARTWINAMP); ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_RESTARTWINAMP);
** **
** IPC_RESTARTWINAMP will restart Winamp (isn't that obvious ? :) ** IPC_RESTARTWINAMP will restart Winamp (isn't that obvious ? :)
*/ */
#define IPC_MBOPEN 241 #define IPC_MBOPEN 241
/* (requires Winamp 2.05+) /* (requires Winamp 2.05+)
** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_MBOPEN); ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_MBOPEN);
** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)url,IPC_MBOPEN); ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)url,IPC_MBOPEN);
** **
** IPC_MBOPEN will open a new URL in the minibrowser. if url is NULL, it will open the Minibrowser window. ** IPC_MBOPEN will open a new URL in the minibrowser. if url is NULL, it will open the Minibrowser window.
*/ */
#define IPC_INETAVAILABLE 242 #define IPC_INETAVAILABLE 242
/* (requires Winamp 2.05+) /* (requires Winamp 2.05+)
** val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_INETAVAILABLE); ** val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_INETAVAILABLE);
** **
** IPC_INETAVAILABLE will return 1 if the Internet connection is available for Winamp. ** IPC_INETAVAILABLE will return 1 if the Internet connection is available for Winamp.
*/ */
#define IPC_UPDTITLE 243 #define IPC_UPDTITLE 243
/* (requires Winamp 2.2+) /* (requires Winamp 2.2+)
** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_UPDTITLE); ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_UPDTITLE);
** **
** IPC_UPDTITLE will ask Winamp to update the informations about the current title. ** IPC_UPDTITLE will ask Winamp to update the informations about the current title.
*/ */
#define IPC_CHANGECURRENTFILE 245 #define IPC_CHANGECURRENTFILE 245
/* (requires Winamp 2.05+) /* (requires Winamp 2.05+)
** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)file,IPC_CHANGECURRENTFILE); ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)file,IPC_CHANGECURRENTFILE);
** **
** IPC_CHANGECURRENTFILE will set the current playlist item. ** IPC_CHANGECURRENTFILE will set the current playlist item.
*/ */
#define IPC_GETMBURL 246 #define IPC_GETMBURL 246
/* (requires Winamp 2.2+) /* (requires Winamp 2.2+)
** char buffer[4096]; // Urls can be VERY long ** char buffer[4096]; // Urls can be VERY long
** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)buffer,IPC_GETMBURL); ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)buffer,IPC_GETMBURL);
** **
** IPC_GETMBURL will retrieve the current Minibrowser URL into buffer. ** IPC_GETMBURL will retrieve the current Minibrowser URL into buffer.
*/ */
#define IPC_REFRESHPLCACHE 247 #define IPC_REFRESHPLCACHE 247
/* (requires Winamp 2.2+) /* (requires Winamp 2.2+)
** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_REFRESHPLCACHE); ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_REFRESHPLCACHE);
** **
** IPC_REFRESHPLCACHE will flush the playlist cache buffer. ** IPC_REFRESHPLCACHE will flush the playlist cache buffer.
*/ */
#define IPC_MBBLOCK 248 #define IPC_MBBLOCK 248
/* (requires Winamp 2.4+) /* (requires Winamp 2.4+)
** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_MBBLOCK); ** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_MBBLOCK);
** **
** IPC_MBBLOCK will block the Minibrowser from updates if value is set to 1 ** IPC_MBBLOCK will block the Minibrowser from updates if value is set to 1
*/ */
#define IPC_MBOPENREAL 249 #define IPC_MBOPENREAL 249
/* (requires Winamp 2.4+) /* (requires Winamp 2.4+)
** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)url,IPC_MBOPENREAL); ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)url,IPC_MBOPENREAL);
** **
** IPC_MBOPENREAL works the same as IPC_MBOPEN except that it will works even if ** IPC_MBOPENREAL works the same as IPC_MBOPEN except that it will works even if
** IPC_MBBLOCK has been set to 1 ** IPC_MBBLOCK has been set to 1
*/ */
#define IPC_GET_SHUFFLE 250 #define IPC_GET_SHUFFLE 250
/* (requires Winamp 2.4+) /* (requires Winamp 2.4+)
** val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_SHUFFLE); ** val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_SHUFFLE);
** **
** IPC_GET_SHUFFLE returns the status of the Shuffle option (1 if set) ** IPC_GET_SHUFFLE returns the status of the Shuffle option (1 if set)
*/ */
#define IPC_GET_REPEAT 251 #define IPC_GET_REPEAT 251
/* (requires Winamp 2.4+) /* (requires Winamp 2.4+)
** val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_REPEAT); ** val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_REPEAT);
** **
** IPC_GET_REPEAT returns the status of the Repeat option (1 if set) ** IPC_GET_REPEAT returns the status of the Repeat option (1 if set)
*/ */
#define IPC_SET_SHUFFLE 252 #define IPC_SET_SHUFFLE 252
/* (requires Winamp 2.4+) /* (requires Winamp 2.4+)
** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SET_SHUFFLE); ** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SET_SHUFFLE);
** **
** IPC_SET_SHUFFLE sets the status of the Shuffle option (1 to turn it on) ** IPC_SET_SHUFFLE sets the status of the Shuffle option (1 to turn it on)
*/ */
#define IPC_SET_REPEAT 253 #define IPC_SET_REPEAT 253
/* (requires Winamp 2.4+) /* (requires Winamp 2.4+)
** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SET_REPEAT); ** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SET_REPEAT);
** **
** IPC_SET_REPEAT sets the status of the Repeat option (1 to turn it on) ** IPC_SET_REPEAT sets the status of the Repeat option (1 to turn it on)
*/ */
/**************************************************************************/ /**************************************************************************/
/* /*
** Some API calls tend to require that you send data via WM_COPYDATA ** Some API calls tend to require that you send data via WM_COPYDATA
** instead of WM_USER. Such as IPC_PLAYFILE: ** instead of WM_USER. Such as IPC_PLAYFILE:
*/ */
#define IPC_PLAYFILE 100 #define IPC_PLAYFILE 100
/* /*
** COPYDATASTRUCT cds; ** COPYDATASTRUCT cds;
** cds.dwData = IPC_PLAYFILE; ** cds.dwData = IPC_PLAYFILE;
** cds.lpData = (void *) "file.mp3"; ** cds.lpData = (void *) "file.mp3";
** cds.cbData = strlen((char *) cds.lpData)+1; // include space for null char ** cds.cbData = strlen((char *) cds.lpData)+1; // include space for null char
** SendMessage(hwnd_winamp,WM_COPYDATA,(WPARAM)NULL,(LPARAM)&cds); ** SendMessage(hwnd_winamp,WM_COPYDATA,(WPARAM)NULL,(LPARAM)&cds);
** **
** This will play the file "file.mp3". ** This will play the file "file.mp3".
** **
*/ */
#define IPC_CHDIR 103 #define IPC_CHDIR 103
/* /*
** COPYDATASTRUCT cds; ** COPYDATASTRUCT cds;
** cds.dwData = IPC_CHDIR; ** cds.dwData = IPC_CHDIR;
** cds.lpData = (void *) "c:\\download"; ** cds.lpData = (void *) "c:\\download";
** cds.cbData = strlen((char *) cds.lpData)+1; // include space for null char ** cds.cbData = strlen((char *) cds.lpData)+1; // include space for null char
** SendMessage(hwnd_winamp,WM_COPYDATA,(WPARAM)NULL,(LPARAM)&cds); ** SendMessage(hwnd_winamp,WM_COPYDATA,(WPARAM)NULL,(LPARAM)&cds);
** **
** This will make Winamp change to the directory C:\\download ** This will make Winamp change to the directory C:\\download
** **
*/ */
/**************************************************************************/ /**************************************************************************/
/* /*
** Finally there are some WM_COMMAND messages that you can use to send ** Finally there are some WM_COMMAND messages that you can use to send
** Winamp misc commands. ** Winamp misc commands.
** **
** To send these, use: ** To send these, use:
** **
** SendMessage(hwnd_winamp, WM_COMMAND,command_name,0); ** SendMessage(hwnd_winamp, WM_COMMAND,command_name,0);
*/ */
#define WINAMP_OPTIONS_EQ 40036 // toggles the EQ window #define WINAMP_OPTIONS_EQ 40036 // toggles the EQ window
#define WINAMP_OPTIONS_PLEDIT 40040 // toggles the playlist window #define WINAMP_OPTIONS_PLEDIT 40040 // toggles the playlist window
#define WINAMP_VOLUMEUP 40058 // turns the volume up a little #define WINAMP_VOLUMEUP 40058 // turns the volume up a little
#define WINAMP_VOLUMEDOWN 40059 // turns the volume down a little #define WINAMP_VOLUMEDOWN 40059 // turns the volume down a little
#define WINAMP_FFWD5S 40060 // fast forwards 5 seconds #define WINAMP_FFWD5S 40060 // fast forwards 5 seconds
#define WINAMP_REW5S 40061 // rewinds 5 seconds #define WINAMP_REW5S 40061 // rewinds 5 seconds
// the following are the five main control buttons, with optionally shift // the following are the five main control buttons, with optionally shift
// or control pressed // or control pressed
// (for the exact functions of each, just try it out) // (for the exact functions of each, just try it out)
#define WINAMP_BUTTON1 40044 #define WINAMP_BUTTON1 40044
#define WINAMP_BUTTON2 40045 #define WINAMP_BUTTON2 40045
#define WINAMP_BUTTON3 40046 #define WINAMP_BUTTON3 40046
#define WINAMP_BUTTON4 40047 #define WINAMP_BUTTON4 40047
#define WINAMP_BUTTON5 40048 #define WINAMP_BUTTON5 40048
#define WINAMP_BUTTON1_SHIFT 40144 #define WINAMP_BUTTON1_SHIFT 40144
#define WINAMP_BUTTON2_SHIFT 40145 #define WINAMP_BUTTON2_SHIFT 40145
#define WINAMP_BUTTON3_SHIFT 40146 #define WINAMP_BUTTON3_SHIFT 40146
#define WINAMP_BUTTON4_SHIFT 40147 #define WINAMP_BUTTON4_SHIFT 40147
#define WINAMP_BUTTON5_SHIFT 40148 #define WINAMP_BUTTON5_SHIFT 40148
#define WINAMP_BUTTON1_CTRL 40154 #define WINAMP_BUTTON1_CTRL 40154
#define WINAMP_BUTTON2_CTRL 40155 #define WINAMP_BUTTON2_CTRL 40155
#define WINAMP_BUTTON3_CTRL 40156 #define WINAMP_BUTTON3_CTRL 40156
#define WINAMP_BUTTON4_CTRL 40157 #define WINAMP_BUTTON4_CTRL 40157
#define WINAMP_BUTTON5_CTRL 40158 #define WINAMP_BUTTON5_CTRL 40158
#define WINAMP_FILE_PLAY 40029 // pops up the load file(s) box #define WINAMP_FILE_PLAY 40029 // pops up the load file(s) box
#define WINAMP_OPTIONS_PREFS 40012 // pops up the preferences #define WINAMP_OPTIONS_PREFS 40012 // pops up the preferences
#define WINAMP_OPTIONS_AOT 40019 // toggles always on top #define WINAMP_OPTIONS_AOT 40019 // toggles always on top
#define WINAMP_HELP_ABOUT 40041 // pops up the about box :) #define WINAMP_HELP_ABOUT 40041 // pops up the about box :)
/* /*
** EOF.. Enjoy. ** EOF.. Enjoy.
*/ */
#endif //_WAFE_H_ #endif //_WAFE_H_

View file

@ -33,7 +33,7 @@ typedef struct
qbyte ip[4]; qbyte ip[4];
qbyte ip6[16]; qbyte ip6[16];
qbyte ipx[10]; qbyte ipx[10];
}; } address;
unsigned short port; unsigned short port;
} netadr_t; } netadr_t;

View file

@ -105,7 +105,7 @@ int NetadrToSockadr (netadr_t *a, struct sockaddr_qstorage *s)
memset (s, 0, sizeof(struct sockaddr_in)); memset (s, 0, sizeof(struct sockaddr_in));
((struct sockaddr_in*)s)->sin_family = AF_INET; ((struct sockaddr_in*)s)->sin_family = AF_INET;
*(int *)&((struct sockaddr_in*)s)->sin_addr = *(int *)&a->ip; *(int *)&((struct sockaddr_in*)s)->sin_addr = *(int *)&a->address.ip;
((struct sockaddr_in*)s)->sin_port = a->port; ((struct sockaddr_in*)s)->sin_port = a->port;
return sizeof(struct sockaddr_in); return sizeof(struct sockaddr_in);
#ifdef IPPROTO_IPV6 #ifdef IPPROTO_IPV6
@ -124,15 +124,15 @@ int NetadrToSockadr (netadr_t *a, struct sockaddr_qstorage *s)
memset (s, 0, sizeof(struct sockaddr_in)); memset (s, 0, sizeof(struct sockaddr_in));
((struct sockaddr_in6*)s)->sin6_family = AF_INET6; ((struct sockaddr_in6*)s)->sin6_family = AF_INET6;
memcpy(&((struct sockaddr_in6*)s)->sin6_addr, a->ip6, sizeof(struct in6_addr)); memcpy(&((struct sockaddr_in6*)s)->sin6_addr, a->address.ip6, sizeof(struct in6_addr));
((struct sockaddr_in6*)s)->sin6_port = a->port; ((struct sockaddr_in6*)s)->sin6_port = a->port;
return sizeof(struct sockaddr_in6); return sizeof(struct sockaddr_in6);
#endif #endif
#ifdef USEIPX #ifdef USEIPX
case NA_IPX: case NA_IPX:
((struct sockaddr_ipx *)s)->sa_family = AF_IPX; ((struct sockaddr_ipx *)s)->sa_family = AF_IPX;
memcpy(((struct sockaddr_ipx *)s)->sa_netnum, &a->ipx[0], 4); memcpy(((struct sockaddr_ipx *)s)->sa_netnum, &a->address.ipx[0], 4);
memcpy(((struct sockaddr_ipx *)s)->sa_nodenum, &a->ipx[4], 6); memcpy(((struct sockaddr_ipx *)s)->sa_nodenum, &a->address.ipx[4], 6);
((struct sockaddr_ipx *)s)->sa_socket = a->port; ((struct sockaddr_ipx *)s)->sa_socket = a->port;
return sizeof(struct sockaddr_ipx); return sizeof(struct sockaddr_ipx);
case NA_BROADCAST_IPX: case NA_BROADCAST_IPX:
@ -155,22 +155,22 @@ void SockadrToNetadr (struct sockaddr_qstorage *s, netadr_t *a)
{ {
case AF_INET: case AF_INET:
a->type = NA_IP; a->type = NA_IP;
*(int *)&a->ip = ((struct sockaddr_in *)s)->sin_addr.s_addr; *(int *)&a->address.ip = ((struct sockaddr_in *)s)->sin_addr.s_addr;
a->port = ((struct sockaddr_in *)s)->sin_port; a->port = ((struct sockaddr_in *)s)->sin_port;
break; break;
#ifdef IPPROTO_IPV6 #ifdef IPPROTO_IPV6
case AF_INET6: case AF_INET6:
a->type = NA_IPV6; a->type = NA_IPV6;
memcpy(&a->ip6, &((struct sockaddr_in6 *)s)->sin6_addr, sizeof(a->ip6)); memcpy(&a->address.ip6, &((struct sockaddr_in6 *)s)->sin6_addr, sizeof(a->address.ip6));
a->port = ((struct sockaddr_in6 *)s)->sin6_port; a->port = ((struct sockaddr_in6 *)s)->sin6_port;
break; break;
#endif #endif
#ifdef USEIPX #ifdef USEIPX
case AF_IPX: case AF_IPX:
a->type = NA_IPX; a->type = NA_IPX;
*(int *)a->ip = 0xffffffff; *(int *)a->address.ip = 0xffffffff;
memcpy(&a->ipx[0], ((struct sockaddr_ipx *)s)->sa_netnum, 4); memcpy(&a->address.ipx[0], ((struct sockaddr_ipx *)s)->sa_netnum, 4);
memcpy(&a->ipx[4], ((struct sockaddr_ipx *)s)->sa_nodenum, 6); memcpy(&a->address.ipx[4], ((struct sockaddr_ipx *)s)->sa_nodenum, 6);
a->port = ((struct sockaddr_ipx *)s)->sa_socket; a->port = ((struct sockaddr_ipx *)s)->sa_socket;
break; break;
#endif #endif
@ -193,7 +193,7 @@ qboolean NET_CompareAdr (netadr_t a, netadr_t b)
if (a.type == NA_IP || a.type == NA_BROADCAST_IP) if (a.type == NA_IP || a.type == NA_BROADCAST_IP)
{ {
if (a.ip[0] == b.ip[0] && a.ip[1] == b.ip[1] && a.ip[2] == b.ip[2] && a.ip[3] == b.ip[3] && a.port == b.port) if ((memcmp(a.address.ip, b.address.ip, sizeof(a.address.ip)) == 0) && a.port == b.port)
return true; return true;
return false; return false;
} }
@ -201,7 +201,7 @@ qboolean NET_CompareAdr (netadr_t a, netadr_t b)
#ifdef IPPROTO_IPV6 #ifdef IPPROTO_IPV6
if (a.type == NA_IPV6 || a.type == NA_BROADCAST_IP6) if (a.type == NA_IPV6 || a.type == NA_BROADCAST_IP6)
{ {
if ((memcmp(a.ip6, b.ip6, 16) == 0) && a.port == b.port) if ((memcmp(a.address.ip6, b.address.ip6, sizeof(a.address.ip6)) == 0) && a.port == b.port)
return true; return true;
return false; return false;
} }
@ -209,7 +209,7 @@ qboolean NET_CompareAdr (netadr_t a, netadr_t b)
if (a.type == NA_IPX || a.type == NA_BROADCAST_IPX) if (a.type == NA_IPX || a.type == NA_BROADCAST_IPX)
{ {
if ((memcmp(a.ipx, b.ipx, 10) == 0) && a.port == b.port) if ((memcmp(a.address.ipx, b.address.ipx, sizeof(a.address.ipx)) == 0) && a.port == b.port)
return true; return true;
return false; return false;
} }
@ -235,21 +235,21 @@ qboolean NET_CompareBaseAdr (netadr_t a, netadr_t b)
if (a.type == NA_IP) if (a.type == NA_IP)
{ {
if (a.ip[0] == b.ip[0] && a.ip[1] == b.ip[1] && a.ip[2] == b.ip[2] && a.ip[3] == b.ip[3]) if ((memcmp(a.address.ip, b.address.ip, sizeof(a.address.ip)) == 0))
return true; return true;
return false; return false;
} }
#ifdef IPPROTO_IPV6 #ifdef IPPROTO_IPV6
if (a.type == NA_IPV6 || a.type == NA_BROADCAST_IP6) if (a.type == NA_IPV6 || a.type == NA_BROADCAST_IP6)
{ {
if ((memcmp(a.ip6, b.ip6, 16) == 0)) if ((memcmp(a.address.ip6, b.address.ip6, 16) == 0))
return true; return true;
return false; return false;
} }
#endif #endif
if (a.type == NA_IPX) if (a.type == NA_IPX)
{ {
if ((memcmp(a.ipx, b.ipx, 10) == 0)) if ((memcmp(a.address.ipx, b.address.ipx, 10) == 0))
return true; return true;
return false; return false;
} }
@ -266,18 +266,51 @@ char *NET_AdrToString (netadr_t a)
{ {
case NA_BROADCAST_IP: case NA_BROADCAST_IP:
case NA_IP: case NA_IP:
sprintf (s, "%i.%i.%i.%i:%i", a.ip[0], a.ip[1], a.ip[2], a.ip[3], ntohs(a.port)); sprintf (s, "%i.%i.%i.%i:%i",
a.address.ip[0],
a.address.ip[1],
a.address.ip[2],
a.address.ip[3],
ntohs(a.port));
break; break;
#ifdef IPPROTO_IPV6 #ifdef IPPROTO_IPV6
case NA_BROADCAST_IP6: case NA_BROADCAST_IP6:
case NA_IPV6: case NA_IPV6:
sprintf (s, "[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]:%i", a.ip6[0], a.ip6[1], a.ip6[2], a.ip6[3], a.ip6[4], a.ip6[5], a.ip6[6], a.ip6[7], a.ip6[8], a.ip6[9], a.ip6[10], a.ip6[11], a.ip6[12], a.ip6[13], a.ip6[14], a.ip6[15], ntohs(a.port)); sprintf (s, "[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]:%i",
a.address.ip6[0],
a.address.ip6[1],
a.address.ip6[2],
a.address.ip6[3],
a.address.ip6[4],
a.address.ip6[5],
a.address.ip6[6],
a.address.ip6[7],
a.address.ip6[8],
a.address.ip6[9],
a.address.ip6[10],
a.address.ip6[11],
a.address.ip6[12],
a.address.ip6[13],
a.address.ip6[14],
a.address.ip6[15],
ntohs(a.port));
break; break;
#endif #endif
#ifdef USEIPX #ifdef USEIPX
case NA_BROADCAST_IPX: case NA_BROADCAST_IPX:
case NA_IPX: case NA_IPX:
sprintf (s, "%02x%02x%02x%02x:%02x%02x%02x%02x%02x%02x:%i", a.ipx[0], a.ipx[1], a.ipx[2], a.ipx[3], a.ipx[4], a.ipx[5], a.ipx[6], a.ipx[7], a.ipx[8], a.ipx[9], ntohs(a.port)); sprintf (s, "%02x%02x%02x%02x:%02x%02x%02x%02x%02x%02x:%i",
a.address.ipx[0],
a.address.ipx[1],
a.address.ipx[2],
a.address.ipx[3],
a.address.ipx[4],
a.address.ipx[5],
a.address.ipx[6],
a.address.ipx[7],
a.address.ipx[8],
a.address.ipx[9],
ntohs(a.port));
break; break;
#endif #endif
case NA_LOOPBACK: case NA_LOOPBACK:
@ -299,18 +332,48 @@ char *NET_BaseAdrToString (netadr_t a)
{ {
case NA_BROADCAST_IP: case NA_BROADCAST_IP:
case NA_IP: case NA_IP:
sprintf (s, "%i.%i.%i.%i", a.ip[0], a.ip[1], a.ip[2], a.ip[3]); sprintf (s, "%i.%i.%i.%i",
a.address.ip[0],
a.address.ip[1],
a.address.ip[2],
a.address.ip[3]);
break; break;
#ifdef IPPROTO_IPV6 #ifdef IPPROTO_IPV6
case NA_BROADCAST_IP6: case NA_BROADCAST_IP6:
case NA_IPV6: case NA_IPV6:
sprintf (s, "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x", a.ip6[0], a.ip6[1], a.ip6[2], a.ip6[3], a.ip6[4], a.ip6[5], a.ip6[6], a.ip6[7], a.ip6[8], a.ip6[9], a.ip6[10], a.ip6[11], a.ip6[12], a.ip6[13], a.ip6[14], a.ip6[15]); sprintf (s, "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x",
a.address.ip6[0],
a.address.ip6[1],
a.address.ip6[2],
a.address.ip6[3],
a.address.ip6[4],
a.address.ip6[5],
a.address.ip6[6],
a.address.ip6[7],
a.address.ip6[8],
a.address.ip6[9],
a.address.ip6[10],
a.address.ip6[11],
a.address.ip6[12],
a.address.ip6[13],
a.address.ip6[14],
a.address.ip6[15]);
break; break;
#endif #endif
#ifdef USEIPX #ifdef USEIPX
case NA_BROADCAST_IPX: case NA_BROADCAST_IPX:
case NA_IPX: case NA_IPX:
sprintf (s, "%02x%02x%02x%02x:%02x%02x%02x%02x%02x%02x", a.ipx[0], a.ipx[1], a.ipx[2], a.ipx[3], a.ipx[4], a.ipx[5], a.ipx[6], a.ipx[7], a.ipx[8], a.ipx[9]); sprintf (s, "%02x%02x%02x%02x:%02x%02x%02x%02x%02x%02x",
a.address.ipx[0],
a.address.ipx[1],
a.address.ipx[2],
a.address.ipx[3],
a.address.ipx[4],
a.address.ipx[5],
a.address.ipx[6],
a.address.ipx[7],
a.address.ipx[8],
a.address.ipx[9]);
break; break;
#endif #endif
case NA_LOOPBACK: case NA_LOOPBACK:
@ -1385,8 +1448,8 @@ void NET_GetLocalAddress (int socket, netadr_t *out)
} }
SockadrToNetadr(&address, out); SockadrToNetadr(&address, out);
if (!*(int*)out->ip) //socket was set to auto if (!*(int*)out->address.ip) //socket was set to auto
*(int *)out->ip = *(int *)adr.ip; //change it to what the machine says it is, rather than the socket. *(int *)out->address.ip = *(int *)adr.address.ip; //change it to what the machine says it is, rather than the socket.
if (notvalid) if (notvalid)
Con_Printf("Couldn't detect local ip\n"); Con_Printf("Couldn't detect local ip\n");

View file

@ -68,11 +68,11 @@ typedef struct trailstate_s {
union { union {
float lastdist; // last distance used with particle effect float lastdist; // last distance used with particle effect
float statetime; // time to emit effect again (used by spawntime field) float statetime; // time to emit effect again (used by spawntime field)
}; } state1;
union { union {
float laststop; // last stopping point for particle effect float laststop; // last stopping point for particle effect
float emittime; // used by r_effect emitters float emittime; // used by r_effect emitters
}; } state2;
} trailstate_t; } trailstate_t;
// !!! if this is changed, it must be changed in d_ifacea.h too !!! // !!! if this is changed, it must be changed in d_ifacea.h too !!!
@ -93,7 +93,7 @@ typedef struct particle_s
union { union {
float nextemit; float nextemit;
trailstate_t *trailstate; trailstate_t *trailstate;
}; } state;
// drivers never touch the following fields // drivers never touch the following fields
float rotationspeed; float rotationspeed;
} particle_t; } particle_t;

View file

@ -1917,21 +1917,21 @@ void PF_setmodel (progfuncs_t *prinst, struct globalvars_s *pr_globals)
i = 0; i = 0;
else else
{ {
for (i=1; sv.model_precache[i] ; i++) for (i=1; sv.strings.model_precache[i] ; i++)
{ {
if (!strcmp(sv.model_precache[i], m)) if (!strcmp(sv.strings.model_precache[i], m))
{ {
m = sv.model_precache[i]; m = sv.strings.model_precache[i];
break; break;
} }
} }
if (i==MAX_MODELS || !sv.model_precache[i]) if (i==MAX_MODELS || !sv.strings.model_precache[i])
{ {
if (i!=MAX_MODELS) if (i!=MAX_MODELS)
{ {
sv.model_precache[i] = PR_AddString(prinst, m, 0); sv.strings.model_precache[i] = PR_AddString(prinst, m, 0);
if (!strcmp(m + strlen(m) - 4, ".bsp")) if (!strcmp(m + strlen(m) - 4, ".bsp"))
sv.models[i] = Mod_FindName(sv.model_precache[i]); sv.models[i] = Mod_FindName(sv.strings.model_precache[i]);
Con_Printf("WARNING: SV_ModelIndex: model %s not precached\n", m); Con_Printf("WARNING: SV_ModelIndex: model %s not precached\n", m);
if (sv.state != ss_loading) if (sv.state != ss_loading)
@ -1954,7 +1954,7 @@ void PF_setmodel (progfuncs_t *prinst, struct globalvars_s *pr_globals)
} }
} }
e->v->model = PR_SetString(prinst, sv.model_precache[i]); e->v->model = PR_SetString(prinst, sv.strings.model_precache[i]);
e->v->modelindex = i; e->v->modelindex = i;
// if it is an inline model, get the size information for it // if it is an inline model, get the size information for it
@ -2662,11 +2662,11 @@ void PF_ambientsound (progfuncs_t *prinst, struct globalvars_s *pr_globals)
attenuation = G_FLOAT(OFS_PARM3); attenuation = G_FLOAT(OFS_PARM3);
// check to see if samp was properly precached // check to see if samp was properly precached
for (soundnum=1 ; *sv.sound_precache[soundnum] ; soundnum++) for (soundnum=1 ; *sv.strings.sound_precache[soundnum] ; soundnum++)
if (!strcmp(sv.sound_precache[soundnum],samp)) if (!strcmp(sv.strings.sound_precache[soundnum],samp))
break; break;
if (!*sv.sound_precache[soundnum]) if (!*sv.strings.sound_precache[soundnum])
{ {
Con_TPrintf (STL_NOPRECACHE, samp); Con_TPrintf (STL_NOPRECACHE, samp);
return; return;
@ -3664,9 +3664,9 @@ void PF_precache_sound (progfuncs_t *prinst, struct globalvars_s *pr_globals)
for (i=1 ; i<MAX_SOUNDS ; i++) for (i=1 ; i<MAX_SOUNDS ; i++)
{ {
if (!*sv.sound_precache[i]) if (!*sv.strings.sound_precache[i])
{ {
strcpy(sv.sound_precache[i], s); strcpy(sv.strings.sound_precache[i], s);
if (sv.state != ss_loading) if (sv.state != ss_loading)
@ -3682,7 +3682,7 @@ void PF_precache_sound (progfuncs_t *prinst, struct globalvars_s *pr_globals)
} }
return; return;
} }
if (!strcmp(sv.sound_precache[i], s)) if (!strcmp(sv.strings.sound_precache[i], s))
return; return;
} }
PR_BIError (prinst, "PF_precache_sound: overflow"); PR_BIError (prinst, "PF_precache_sound: overflow");
@ -3712,16 +3712,16 @@ void PF_precache_model (progfuncs_t *prinst, struct globalvars_s *pr_globals)
for (i=1 ; i<MAX_MODELS ; i++) for (i=1 ; i<MAX_MODELS ; i++)
{ {
if (!sv.model_precache[i]) if (!sv.strings.model_precache[i])
{ {
if (strlen(s)>=MAX_QPATH-1) //probably safest to keep this. if (strlen(s)>=MAX_QPATH-1) //probably safest to keep this.
{ {
PR_BIError (prinst, "Precache name too long"); PR_BIError (prinst, "Precache name too long");
return; return;
} }
sv.model_precache[i] = PR_AddString(prinst, s, 0); sv.strings.model_precache[i] = PR_AddString(prinst, s, 0);
if (!strcmp(s + strlen(s) - 4, ".bsp")) if (!strcmp(s + strlen(s) - 4, ".bsp"))
sv.models[i] = Mod_FindName(sv.model_precache[i]); sv.models[i] = Mod_FindName(sv.strings.model_precache[i]);
if (sv.state != ss_loading) if (sv.state != ss_loading)
{ {
@ -3737,7 +3737,7 @@ void PF_precache_model (progfuncs_t *prinst, struct globalvars_s *pr_globals)
return; return;
} }
if (!strcmp(sv.model_precache[i], s)) if (!strcmp(sv.strings.model_precache[i], s))
{ {
return; return;
} }
@ -3773,7 +3773,7 @@ void PF_WeapIndex (progfuncs_t *prinst, struct globalvars_s *pr_globals)
for (i=1 ; i<MAX_MODELS ; i++) for (i=1 ; i<MAX_MODELS ; i++)
{ {
if (!*sv.model_precache[i]) if (!*sv.strings.model_precache[i])
{ {
if (sv.state != ss_loading) //allow it to be used to find a model too. if (sv.state != ss_loading) //allow it to be used to find a model too.
{ {
@ -3781,14 +3781,14 @@ void PF_WeapIndex (progfuncs_t *prinst, struct globalvars_s *pr_globals)
return; return;
} }
strcpy(sv.model_precache[i], s); strcpy(sv.strings.model_precache[i], s);
if (!strcmp(s + strlen(s) - 4, ".bsp")) if (!strcmp(s + strlen(s) - 4, ".bsp"))
sv.models[i] = Mod_FindName(sv.model_precache[i]); sv.models[i] = Mod_FindName(sv.strings.model_precache[i]);
G_FLOAT(OFS_RETURN) = i; G_FLOAT(OFS_RETURN) = i;
return; return;
} }
if (!strcmp(sv.model_precache[i], s)) if (!strcmp(sv.strings.model_precache[i], s))
{ {
G_FLOAT(OFS_RETURN) = i; G_FLOAT(OFS_RETURN) = i;
return; return;
@ -3956,13 +3956,13 @@ void PF_lightstyle (progfuncs_t *prinst, struct globalvars_s *pr_globals)
// change the string in sv // change the string in sv
if (sv.lightstyles[style]) if (sv.strings.lightstyles[style])
Z_Free(sv.lightstyles[style]); Z_Free(sv.strings.lightstyles[style]);
sv.lightstyles[style] = Z_Malloc(strlen(val)+1); sv.strings.lightstyles[style] = Z_Malloc(strlen(val)+1);
strcpy(sv.lightstyles[style], val); strcpy(sv.strings.lightstyles[style], val);
// sv.lightstyles[style] = val; // sv.lightstyles[style] = val;
#ifdef PEXT_LIGHTSTYLECOL #ifdef PEXT_LIGHTSTYLECOL
sv.lightstylecolours[style] = col; sv.strings.lightstylecolours[style] = col;
#endif #endif
// send message to all clients on this server // send message to all clients on this server
@ -4003,12 +4003,12 @@ void PF_lightstylevalue (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
int style; int style;
style = G_FLOAT(OFS_PARM0); style = G_FLOAT(OFS_PARM0);
if(style < 0 || style >= MAX_LIGHTSTYLES || !sv.lightstyles[style]) if(style < 0 || style >= MAX_LIGHTSTYLES || !sv.strings.lightstyles[style])
{ {
G_FLOAT(OFS_RETURN) = 0; G_FLOAT(OFS_RETURN) = 0;
return; return;
} }
G_FLOAT(OFS_RETURN) = *sv.lightstyles[style] - 'a'; G_FLOAT(OFS_RETURN) = *sv.strings.lightstyles[style] - 'a';
} }
void PF_lightstylestatic (progfuncs_t *prinst, struct globalvars_s *pr_globals) void PF_lightstylestatic (progfuncs_t *prinst, struct globalvars_s *pr_globals)
@ -4057,13 +4057,13 @@ void PF_lightstylestatic (progfuncs_t *prinst, struct globalvars_s *pr_globals)
// change the string in sv // change the string in sv
if (sv.lightstyles[style]) if (sv.strings.lightstyles[style])
Z_Free(sv.lightstyles[style]); Z_Free(sv.strings.lightstyles[style]);
sv.lightstyles[style] = Z_Malloc(strlen(val)+1); sv.strings.lightstyles[style] = Z_Malloc(strlen(val)+1);
strcpy(sv.lightstyles[style], val); strcpy(sv.strings.lightstyles[style], val);
// sv.lightstyles[style] = val; // sv.lightstyles[style] = val;
#ifdef PEXT_LIGHTSTYLECOL #ifdef PEXT_LIGHTSTYLECOL
sv.lightstylecolours[style] = col; sv.strings.lightstylecolours[style] = col;
#endif #endif
// send message to all clients on this server // send message to all clients on this server
@ -8824,7 +8824,7 @@ int SV_TagForName(int modelindex, char *tagname)
#if 1 #if 1
model_t *model = sv.models[modelindex]; model_t *model = sv.models[modelindex];
if (!model) if (!model)
model = Mod_ForName(sv.model_precache[modelindex], false); model = Mod_ForName(sv.strings.model_precache[modelindex], false);
if (!model) if (!model)
return 0; return 0;
@ -8894,7 +8894,7 @@ void PF_setattachment(progfuncs_t *prinst, struct globalvars_s *pr_globals)
if (modelindex > 0 && modelindex < MAX_MODELS) if (modelindex > 0 && modelindex < MAX_MODELS)
{ {
if (!sv.models[modelindex]) if (!sv.models[modelindex])
sv.models[modelindex] = Mod_ForName(sv.model_precache[modelindex], false); sv.models[modelindex] = Mod_ForName(sv.strings.model_precache[modelindex], false);
if (sv.models[modelindex]) if (sv.models[modelindex])
{ {
tagidx = SV_TagForName(modelindex, tagname); tagidx = SV_TagForName(modelindex, tagname);
@ -8928,7 +8928,7 @@ void PF_gettagindex(progfuncs_t *prinst, struct globalvars_s *pr_globals)
if (tagname && tagname[0]) if (tagname && tagname[0])
{ {
modelindex = (int)e->v->modelindex; modelindex = (int)e->v->modelindex;
if (modelindex > 0 && modelindex < MAX_MODELS && sv.model_precache[modelindex]) if (modelindex > 0 && modelindex < MAX_MODELS && sv.strings.model_precache[modelindex])
{ {
tagidx = SV_TagForName(modelindex, tagname); tagidx = SV_TagForName(modelindex, tagname);
if (tagidx == 0) if (tagidx == 0)
@ -8967,7 +8967,7 @@ void PF_gettaginfo(progfuncs_t *prinst, struct globalvars_s *pr_globals)
axis[2] = P_VEC(v_right); axis[2] = P_VEC(v_right);
if (!model) if (!model)
model = Mod_FindName(sv.model_precache[(int)ent->v->modelindex]); model = Mod_FindName(sv.strings.model_precache[(int)ent->v->modelindex]);
if (!Mod_GetTag(model, tagnum, ent->v->frame, ent->v->frame, 0, 0, 0, transtag)) if (!Mod_GetTag(model, tagnum, ent->v->frame, ent->v->frame, 0, 0, 0, transtag))
{ {

View file

@ -457,14 +457,14 @@ void LoadModelsAndSounds(vfsfile_t *f)
char str[32768]; char str[32768];
int i; int i;
sv.model_precache[0] = PR_AddString(svprogfuncs, "", 0); sv.strings.model_precache[0] = PR_AddString(svprogfuncs, "", 0);
for (i=1; i < MAX_MODELS; i++) for (i=1; i < MAX_MODELS; i++)
{ {
VFS_GETS(f, str, sizeof(str)); VFS_GETS(f, str, sizeof(str));
if (!*str) if (!*str)
break; break;
sv.model_precache[i] = PR_AddString(svprogfuncs, str, 0); sv.strings.model_precache[i] = PR_AddString(svprogfuncs, str, 0);
} }
if (i == MAX_MODELS) if (i == MAX_MODELS)
{ {
@ -472,8 +472,8 @@ void LoadModelsAndSounds(vfsfile_t *f)
if (*str) if (*str)
SV_Error("Too many model precaches in loadgame cache"); SV_Error("Too many model precaches in loadgame cache");
} }
for (; i < MAX_SOUNDS; i++) for (; i < MAX_MODELS; i++)
sv.model_precache[i] = NULL; sv.strings.model_precache[i] = NULL;
// sv.sound_precache[0] = PR_AddString(svprogfuncs, "", 0); // sv.sound_precache[0] = PR_AddString(svprogfuncs, "", 0);
for (i=1; i < MAX_SOUNDS; i++) for (i=1; i < MAX_SOUNDS; i++)
@ -491,7 +491,7 @@ void LoadModelsAndSounds(vfsfile_t *f)
SV_Error("Too many sound precaches in loadgame cache"); SV_Error("Too many sound precaches in loadgame cache");
} }
for (; i < MAX_SOUNDS; i++) for (; i < MAX_SOUNDS; i++)
*sv.sound_precache[i] = 0; *sv.strings.sound_precache[i] = 0;
} }
qboolean SV_LoadLevelCache(char *level, char *startspot, qboolean ignoreplayers) qboolean SV_LoadLevelCache(char *level, char *startspot, qboolean ignoreplayers)
@ -631,10 +631,10 @@ qboolean SV_LoadLevelCache(char *level, char *startspot, qboolean ignoreplayers)
for (i=0 ; i<MAX_LIGHTSTYLES ; i++) for (i=0 ; i<MAX_LIGHTSTYLES ; i++)
{ {
VFS_GETS(f, str, sizeof(str)); VFS_GETS(f, str, sizeof(str));
if (sv.lightstyles[i]) if (sv.strings.lightstyles[i])
Z_Free(sv.lightstyles[i]); Z_Free(sv.strings.lightstyles[i]);
sv.lightstyles[i] = Z_Malloc (strlen(str)+1); sv.strings.lightstyles[i] = Z_Malloc (strlen(str)+1);
strcpy (sv.lightstyles[i], str); strcpy (sv.strings.lightstyles[i], str);
} }
// load the edicts out of the savegame file // load the edicts out of the savegame file
@ -826,24 +826,24 @@ void SV_SaveLevelCache(qboolean dontharmgame)
fprintf (f, "%i\n",MAX_LIGHTSTYLES); fprintf (f, "%i\n",MAX_LIGHTSTYLES);
for (i=0 ; i<MAX_LIGHTSTYLES ; i++) for (i=0 ; i<MAX_LIGHTSTYLES ; i++)
{ {
if (sv.lightstyles[i]) if (sv.strings.lightstyles[i])
fprintf (f, "%s\n", sv.lightstyles[i]); fprintf (f, "%s\n", sv.strings.lightstyles[i]);
else else
fprintf (f,"m\n"); fprintf (f,"m\n");
} }
for (i=1 ; i<MAX_MODELS ; i++) for (i=1 ; i<MAX_MODELS ; i++)
{ {
if (sv.model_precache[i]) if (sv.strings.model_precache[i])
fprintf (f, "%s\n", sv.model_precache[i]); fprintf (f, "%s\n", sv.strings.model_precache[i]);
else else
break; break;
} }
fprintf (f,"\n"); fprintf (f,"\n");
for (i=1 ; i<MAX_SOUNDS ; i++) for (i=1 ; i<MAX_SOUNDS ; i++)
{ {
if (*sv.sound_precache[i]) if (*sv.strings.sound_precache[i])
fprintf (f, "%s\n", sv.sound_precache[i]); fprintf (f, "%s\n", sv.strings.sound_precache[i]);
else else
break; break;
} }

View file

@ -138,7 +138,7 @@ typedef struct
char *lightstyles[MAX_LIGHTSTYLES]; char *lightstyles[MAX_LIGHTSTYLES];
char lightstylecolours[MAX_LIGHTSTYLES]; char lightstylecolours[MAX_LIGHTSTYLES];
}; };
}; } strings;
struct model_s *models[MAX_MODELS]; struct model_s *models[MAX_MODELS];
int allocated_client_slots; //number of slots available. (used mostly to stop single player saved games cacking up) int allocated_client_slots; //number of slots available. (used mostly to stop single player saved games cacking up)
@ -408,7 +408,7 @@ typedef struct client_s
#ifdef Q3SERVER #ifdef Q3SERVER
q3client_frame_t *q3frames; q3client_frame_t *q3frames;
#endif #endif
}; } frameunion;
vfsfile_t *download; // file being downloaded vfsfile_t *download; // file being downloaded
int downloadsize; // total bytes int downloadsize; // total bytes
int downloadcount; // bytes sent int downloadcount; // bytes sent

View file

@ -669,7 +669,7 @@ void SV_EmitPacketEntities (client_t *client, packet_entities_t *to, sizebuf_t *
// this is the frame that we are going to delta update from // this is the frame that we are going to delta update from
if (client->delta_sequence != -1) if (client->delta_sequence != -1)
{ {
fromframe = &client->frames[client->delta_sequence & UPDATE_MASK]; fromframe = &client->frameunion.frames[client->delta_sequence & UPDATE_MASK];
from = &fromframe->entities; from = &fromframe->entities;
oldmax = from->num_entities; oldmax = from->num_entities;
@ -1015,7 +1015,7 @@ void SVDP_EmitEntitiesUpdate (client_t *client, packet_entities_t *to, sizebuf_t
client->netchan.incoming_sequence++; client->netchan.incoming_sequence++;
// this is the frame that we are going to delta update from // this is the frame that we are going to delta update from
fromframe = &client->frames[(client->netchan.incoming_sequence-2) & UPDATE_MASK]; fromframe = &client->frameunion.frames[(client->netchan.incoming_sequence-2) & UPDATE_MASK];
from = &fromframe->entities; from = &fromframe->entities;
oldmax = from->num_entities; oldmax = from->num_entities;
@ -1953,10 +1953,10 @@ void SV_GibFilterAdd(char *modelname, int min, int max)
int i; int i;
gibfilter_t *gf; gibfilter_t *gf;
for (i=1; sv.model_precache[i] ; i++) for (i=1; sv.strings.model_precache[i] ; i++)
if (!strcmp(sv.model_precache[i], modelname)) if (!strcmp(sv.strings.model_precache[i], modelname))
break; break;
if (!sv.model_precache[i]) if (!sv.strings.model_precache[i])
{ {
Con_Printf("Filtered model \"%s\" was not precached\n", modelname); Con_Printf("Filtered model \"%s\" was not precached\n", modelname);
return; //model not in use. return; //model not in use.
@ -2106,7 +2106,7 @@ void SV_WriteEntitiesToClient (client_t *client, sizebuf_t *msg, qboolean ignore
client_t *split; client_t *split;
// this is the frame we are creating // this is the frame we are creating
frame = &client->frames[client->netchan.incoming_sequence & UPDATE_MASK]; frame = &client->frameunion.frames[client->netchan.incoming_sequence & UPDATE_MASK];
// find the client's PVS // find the client's PVS
@ -2520,7 +2520,7 @@ void SV_WriteEntitiesToClient (client_t *client, sizebuf_t *msg, qboolean ignore
if ((int)ent->v->flags & FL_CLASS_DEPENDENT && client->playerclass) //hexen2 wierdness. if ((int)ent->v->flags & FL_CLASS_DEPENDENT && client->playerclass) //hexen2 wierdness.
{ {
char modname[MAX_QPATH]; char modname[MAX_QPATH];
Q_strncpyz(modname, sv.model_precache[state->modelindex], sizeof(modname)); Q_strncpyz(modname, sv.strings.model_precache[state->modelindex], sizeof(modname));
if (strlen(modname)>5) if (strlen(modname)>5)
{ {
modname[strlen(modname)-5] = client->playerclass+'0'; modname[strlen(modname)-5] = client->playerclass+'0';

View file

@ -52,16 +52,16 @@ int SV_ModelIndex (char *name)
if (!name || !name[0]) if (!name || !name[0])
return 0; return 0;
for (i=1 ; i<MAX_MODELS && sv.model_precache[i] ; i++) for (i=1 ; i<MAX_MODELS && sv.strings.model_precache[i] ; i++)
if (!strcmp(sv.model_precache[i], name)) if (!strcmp(sv.strings.model_precache[i], name))
return i; return i;
if (i==MAX_MODELS || !sv.model_precache[i]) if (i==MAX_MODELS || !sv.strings.model_precache[i])
{ {
if (i!=MAX_MODELS && sv.state == ss_loading) if (i!=MAX_MODELS && sv.state == ss_loading)
{ {
Q_strncpyz(sv.model_precache[i], name, sizeof(sv.model_precache[i])); Q_strncpyz(sv.strings.model_precache[i], name, sizeof(sv.strings.model_precache[i]));
if (!strcmp(name + strlen(name) - 4, ".bsp")) if (!strcmp(name + strlen(name) - 4, ".bsp"))
sv.models[i] = Mod_FindName(sv.model_precache[i]); sv.models[i] = Mod_FindName(sv.strings.model_precache[i]);
Con_Printf("WARNING: SV_ModelIndex: model %s not precached\n", name); Con_Printf("WARNING: SV_ModelIndex: model %s not precached\n", name);
} }
else else
@ -77,10 +77,10 @@ int SV_SafeModelIndex (char *name)
if (!name || !name[0]) if (!name || !name[0])
return 0; return 0;
for (i=1 ; i<MAX_MODELS && sv.model_precache[i] ; i++) for (i=1 ; i<MAX_MODELS && sv.strings.model_precache[i] ; i++)
if (!strcmp(sv.model_precache[i], name)) if (!strcmp(sv.strings.model_precache[i], name))
return i; return i;
if (i==MAX_MODELS || !sv.model_precache[i]) if (i==MAX_MODELS || !sv.strings.model_precache[i])
{ {
return 0; return 0;
} }
@ -588,9 +588,9 @@ void SV_SpawnServer (char *server, char *startspot, qboolean noents, qboolean us
{ {
for (i = 0; i < MAX_LIGHTSTYLES; i++) for (i = 0; i < MAX_LIGHTSTYLES; i++)
{ {
if (sv.lightstyles[i]) if (sv.strings.lightstyles[i])
Z_Free(sv.lightstyles[i]); Z_Free(sv.strings.lightstyles[i]);
sv.lightstyles[i] = NULL; sv.strings.lightstyles[i] = NULL;
} }
} }
@ -796,13 +796,13 @@ void SV_SpawnServer (char *server, char *startspot, qboolean noents, qboolean us
sv.models[1] = sv.worldmodel; sv.models[1] = sv.worldmodel;
if (svs.gametype == GT_PROGS) if (svs.gametype == GT_PROGS)
{ {
strcpy(sv.sound_precache[0], ""); strcpy(sv.strings.sound_precache[0], "");
sv.model_precache[0] = ""; sv.strings.model_precache[0] = "";
sv.model_precache[1] = PR_AddString(svprogfuncs, sv.modelname, 0); sv.strings.model_precache[1] = PR_AddString(svprogfuncs, sv.modelname, 0);
for (i=1 ; i<sv.worldmodel->numsubmodels ; i++) for (i=1 ; i<sv.worldmodel->numsubmodels ; i++)
{ {
sv.model_precache[1+i] = PR_AddString(svprogfuncs, localmodels[i], 0); sv.strings.model_precache[1+i] = PR_AddString(svprogfuncs, localmodels[i], 0);
sv.models[i+1] = Mod_ForName (localmodels[i], false); sv.models[i+1] = Mod_ForName (localmodels[i], false);
} }
@ -813,11 +813,11 @@ void SV_SpawnServer (char *server, char *startspot, qboolean noents, qboolean us
#ifdef Q2SERVER #ifdef Q2SERVER
else if (svs.gametype == GT_QUAKE2) else if (svs.gametype == GT_QUAKE2)
{ {
memset(sv.configstring, 0, sizeof(sv.configstring)); memset(sv.strings.configstring, 0, sizeof(sv.strings.configstring));
strcpy(sv.configstring[Q2CS_MODELS+1], sv.modelname); strcpy(sv.strings.configstring[Q2CS_MODELS+1], sv.modelname);
for (i=1; i<sv.worldmodel->numsubmodels; i++) for (i=1; i<sv.worldmodel->numsubmodels; i++)
{ {
strcpy(sv.configstring[Q2CS_MODELS+1+i], localmodels[i]); strcpy(sv.strings.configstring[Q2CS_MODELS+1+i], localmodels[i]);
sv.models[i+1] = Mod_ForName (localmodels[i], false); sv.models[i+1] = Mod_ForName (localmodels[i], false);
} }
} }

View file

@ -473,10 +473,10 @@ void SV_DropClient (client_t *drop)
memset (drop->userinfo, 0, sizeof(drop->userinfo)); memset (drop->userinfo, 0, sizeof(drop->userinfo));
memset (drop->userinfobasic, 0, sizeof(drop->userinfobasic)); memset (drop->userinfobasic, 0, sizeof(drop->userinfobasic));
if (drop->frames) //union of the same sort of structure if (drop->frameunion.frames) //union of the same sort of structure
{ {
Z_Free(drop->frames); Z_Free(drop->frameunion.frames);
drop->frames = NULL; drop->frameunion.frames = NULL;
} }
if (svs.gametype != GT_PROGS) //gamecode should do it all for us. if (svs.gametype != GT_PROGS) //gamecode should do it all for us.
@ -639,7 +639,7 @@ int SV_CalcPing (client_t *cl)
int count; int count;
register client_frame_t *frame; register client_frame_t *frame;
if (!cl->frames) if (!cl->frameunion.frames)
return 0; return 0;
switch (cl->protocol) switch (cl->protocol)
@ -650,7 +650,7 @@ int SV_CalcPing (client_t *cl)
case SCP_QUAKEWORLD: case SCP_QUAKEWORLD:
ping = 0; ping = 0;
count = 0; count = 0;
for (frame = cl->frames, i=0 ; i<UPDATE_BACKUP ; i++, frame++) for (frame = cl->frameunion.frames, i=0 ; i<UPDATE_BACKUP ; i++, frame++)
{ {
if (frame->ping_time > 0) if (frame->ping_time > 0)
{ {
@ -1779,15 +1779,15 @@ client_t *SVC_DirectConnect(void)
// build a new connection // build a new connection
// accept the new client // accept the new client
// this is the only place a client_t is ever initialized // this is the only place a client_t is ever initialized
temp.frames = newcl->frames; //don't touch these. temp.frameunion.frames = newcl->frameunion.frames; //don't touch these.
if (temp.frames) if (temp.frameunion.frames)
Z_Free(temp.frames); Z_Free(temp.frameunion.frames);
temp.frames = Z_Malloc((sizeof(client_frame_t)+sizeof(entity_state_t)*maxpacketentities)*UPDATE_BACKUP); temp.frameunion.frames = Z_Malloc((sizeof(client_frame_t)+sizeof(entity_state_t)*maxpacketentities)*UPDATE_BACKUP);
for (i = 0; i < UPDATE_BACKUP; i++) for (i = 0; i < UPDATE_BACKUP; i++)
{ {
temp.frames[i].entities.max_entities = maxpacketentities; temp.frameunion.frames[i].entities.max_entities = maxpacketentities;
temp.frames[i].entities.entities = (entity_state_t*)(temp.frames+UPDATE_BACKUP) + i*temp.frames[i].entities.max_entities; temp.frameunion.frames[i].entities.entities = (entity_state_t*)(temp.frameunion.frames+UPDATE_BACKUP) + i*temp.frameunion.frames[i].entities.max_entities;
} }
break; break;
@ -1805,11 +1805,11 @@ client_t *SVC_DirectConnect(void)
// build a new connection // build a new connection
// accept the new client // accept the new client
// this is the only place a client_t is ever initialized // this is the only place a client_t is ever initialized
temp.q2frames = newcl->q2frames; //don't touch these. temp.frameunion.q2frames = newcl->frameunion.q2frames; //don't touch these.
if (temp.q2frames) if (temp.frameunion.q2frames)
Z_Free(temp.q2frames); Z_Free(temp.frameunion.q2frames);
temp.q2frames = Z_Malloc(sizeof(q2client_frame_t)*Q2UPDATE_BACKUP); temp.frameunion.q2frames = Z_Malloc(sizeof(q2client_frame_t)*Q2UPDATE_BACKUP);
break; break;
#endif #endif
default: default:
@ -2010,10 +2010,10 @@ client_t *SVC_DirectConnect(void)
newcl->fteprotocolextensions |= PEXT_SPLITSCREEN; newcl->fteprotocolextensions |= PEXT_SPLITSCREEN;
temp.frames = cl->frames; //don't touch these. temp.frameunion.frames = cl->frameunion.frames; //don't touch these.
temp.edict = cl->edict; temp.edict = cl->edict;
memcpy(cl, newcl, sizeof(client_t)); memcpy(cl, newcl, sizeof(client_t));
cl->frames = temp.frames; cl->frameunion.frames = temp.frameunion.frames;
cl->edict = temp.edict; cl->edict = temp.edict;
cl->fteprotocolextensions |= PEXT_SPLITSCREEN; cl->fteprotocolextensions |= PEXT_SPLITSCREEN;
@ -2553,7 +2553,7 @@ qboolean SV_FilterPacket (void)
int i; int i;
unsigned in; unsigned in;
in = *(unsigned *)net_from.ip; in = *(unsigned *)net_from.address.ip;
for (i=0 ; i<numipfilters ; i++) for (i=0 ; i<numipfilters ; i++)
if ( (in & ipfilters[i].mask) == ipfilters[i].compare) if ( (in & ipfilters[i].mask) == ipfilters[i].compare)

View file

@ -77,10 +77,10 @@ int SVM_AddIPAddresses(sizebuf_t *sb, int first)
if (sb->cursize + 6 >= sb->maxsize) if (sb->cursize + 6 >= sb->maxsize)
break; break;
MSG_WriteByte(sb, server->adr.ip[0]); MSG_WriteByte(sb, server->adr.address.ip[0]);
MSG_WriteByte(sb, server->adr.ip[1]); MSG_WriteByte(sb, server->adr.address.ip[1]);
MSG_WriteByte(sb, server->adr.ip[2]); MSG_WriteByte(sb, server->adr.address.ip[2]);
MSG_WriteByte(sb, server->adr.ip[3]); MSG_WriteByte(sb, server->adr.address.ip[3]);
MSG_WriteShort(sb, server->adr.port); MSG_WriteShort(sb, server->adr.port);
number++; number++;

View file

@ -1224,12 +1224,12 @@ static qboolean SV_MVD_Record (mvddest_t *dest)
if (!sv.mvdrecording) if (!sv.mvdrecording)
{ {
memset(&demo, 0, sizeof(demo)); memset(&demo, 0, sizeof(demo));
demo.recorder.frames = demo_frames; demo.recorder.frameunion.frames = demo_frames;
demo.recorder.protocol = SCP_QUAKEWORLD; demo.recorder.protocol = SCP_QUAKEWORLD;
for (i = 0; i < UPDATE_BACKUP; i++) for (i = 0; i < UPDATE_BACKUP; i++)
{ {
demo.recorder.frames[i].entities.max_entities = MAX_MVDPACKET_ENTITIES; demo.recorder.frameunion.frames[i].entities.max_entities = MAX_MVDPACKET_ENTITIES;
demo.recorder.frames[i].entities.entities = demo_entities[i]; demo.recorder.frameunion.frames[i].entities.entities = demo_entities[i];
} }
MVDBuffer_Init(&demo.dbuffer, demo.buffer, sizeof(demo.buffer)); MVDBuffer_Init(&demo.dbuffer, demo.buffer, sizeof(demo.buffer));
@ -1308,7 +1308,7 @@ static qboolean SV_MVD_Record (mvddest_t *dest)
MSG_WriteByte (&buf, 0); MSG_WriteByte (&buf, 0);
n = 0; n = 0;
s = sv.sound_precache[n+1]; s = sv.strings.sound_precache[n+1];
while (*s) while (*s)
{ {
MSG_WriteString (&buf, s); MSG_WriteString (&buf, s);
@ -1322,7 +1322,7 @@ static qboolean SV_MVD_Record (mvddest_t *dest)
MSG_WriteByte (&buf, n + 1); MSG_WriteByte (&buf, n + 1);
} }
n++; n++;
s = sv.sound_precache[n+1]; s = sv.strings.sound_precache[n+1];
} }
if (buf.cursize) if (buf.cursize)
@ -1338,7 +1338,7 @@ static qboolean SV_MVD_Record (mvddest_t *dest)
MSG_WriteByte (&buf, 0); MSG_WriteByte (&buf, 0);
n = 0; n = 0;
s = sv.model_precache[n+1]; s = sv.strings.model_precache[n+1];
while (s) while (s)
{ {
MSG_WriteString (&buf, s); MSG_WriteString (&buf, s);
@ -1352,7 +1352,7 @@ static qboolean SV_MVD_Record (mvddest_t *dest)
MSG_WriteByte (&buf, n + 1); MSG_WriteByte (&buf, n + 1);
} }
n++; n++;
s = sv.model_precache[n+1]; s = sv.strings.model_precache[n+1];
} }
if (buf.cursize) if (buf.cursize)
{ {
@ -1498,7 +1498,7 @@ static qboolean SV_MVD_Record (mvddest_t *dest)
{ {
MSG_WriteByte (&buf, svc_lightstyle); MSG_WriteByte (&buf, svc_lightstyle);
MSG_WriteByte (&buf, (char)i); MSG_WriteByte (&buf, (char)i);
MSG_WriteString (&buf, sv.lightstyles[i]); MSG_WriteString (&buf, sv.strings.lightstyles[i]);
} }
// get the client to check and download skins // get the client to check and download skins

View file

@ -789,11 +789,11 @@ void SV_StartSound (edict_t *entity, int channel, char *sample, int volume,
// find precache number for sound // find precache number for sound
for (sound_num=1 ; sound_num<MAX_SOUNDS for (sound_num=1 ; sound_num<MAX_SOUNDS
&& sv.sound_precache[sound_num] ; sound_num++) && sv.strings.sound_precache[sound_num] ; sound_num++)
if (!strcmp(sample, sv.sound_precache[sound_num])) if (!strcmp(sample, sv.strings.sound_precache[sound_num]))
break; break;
if ( sound_num == MAX_SOUNDS || !sv.sound_precache[sound_num] ) if ( sound_num == MAX_SOUNDS || !sv.strings.sound_precache[sound_num] )
{ {
Con_DPrintf ("SV_StartSound: %s not precacheed\n", sample); Con_DPrintf ("SV_StartSound: %s not precacheed\n", sample);
return; return;
@ -900,17 +900,17 @@ void SV_FindModelNumbers (void)
for (i=0 ; i<MAX_MODELS ; i++) for (i=0 ; i<MAX_MODELS ; i++)
{ {
if (!sv.model_precache[i]) if (!sv.strings.model_precache[i])
break; break;
if (!strcmp(sv.model_precache[i],"progs/spike.mdl")) if (!strcmp(sv.strings.model_precache[i],"progs/spike.mdl"))
sv_nailmodel = i; sv_nailmodel = i;
if (!strcmp(sv.model_precache[i],"progs/s_spike.mdl")) if (!strcmp(sv.strings.model_precache[i],"progs/s_spike.mdl"))
sv_supernailmodel = i; sv_supernailmodel = i;
#ifdef PEXT_LIGHTUPDATES #ifdef PEXT_LIGHTUPDATES
if (!strcmp(sv.model_precache[i],"progs/zap.mdl")) if (!strcmp(sv.strings.model_precache[i],"progs/zap.mdl"))
sv_lightningmodel = i; sv_lightningmodel = i;
#endif #endif
if (!strcmp(sv.model_precache[i],"progs/player.mdl")) if (!strcmp(sv.strings.model_precache[i],"progs/player.mdl"))
sv_playermodel = i; sv_playermodel = i;
} }
} }

View file

@ -313,12 +313,12 @@ void SVNQ_New_f (void)
MSG_WriteString (&host_client->netchan.message,message); MSG_WriteString (&host_client->netchan.message,message);
for (i = 1; sv.model_precache[i] ; i++) for (i = 1; sv.strings.model_precache[i] ; i++)
MSG_WriteString (&host_client->netchan.message, sv.model_precache[i]); MSG_WriteString (&host_client->netchan.message, sv.strings.model_precache[i]);
MSG_WriteByte (&host_client->netchan.message, 0); MSG_WriteByte (&host_client->netchan.message, 0);
for (i = 1; *sv.sound_precache[i] ; i++) for (i = 1; *sv.strings.sound_precache[i] ; i++)
MSG_WriteString (&host_client->netchan.message, sv.sound_precache[i]); MSG_WriteString (&host_client->netchan.message, sv.strings.sound_precache[i]);
MSG_WriteByte (&host_client->netchan.message, 0); MSG_WriteByte (&host_client->netchan.message, 0);
@ -382,7 +382,7 @@ void SVQ2_ConfigStrings_f (void)
while ( host_client->netchan.message.cursize < MAX_QWMSGLEN/2 while ( host_client->netchan.message.cursize < MAX_QWMSGLEN/2
&& start < Q2MAX_CONFIGSTRINGS) && start < Q2MAX_CONFIGSTRINGS)
{ {
str = sv.configstring[start]; str = sv.strings.configstring[start];
if (*str) if (*str)
{ {
MSG_WriteByte (&host_client->netchan.message, svcq2_configstring); MSG_WriteByte (&host_client->netchan.message, svcq2_configstring);
@ -724,11 +724,11 @@ void SV_Soundlist_f (void)
else else
{ {
for (i = 1+n; for (i = 1+n;
*sv.sound_precache[i] && host_client->netchan.message.cursize < (MAX_QWMSGLEN/2); *sv.strings.sound_precache[i] && host_client->netchan.message.cursize < (MAX_QWMSGLEN/2);
i++, n++) i++, n++)
MSG_WriteString (&host_client->netchan.message, sv.sound_precache[i]); MSG_WriteString (&host_client->netchan.message, sv.strings.sound_precache[i]);
if (!*sv.sound_precache[i]) if (!*sv.strings.sound_precache[i])
n = 0; n = 0;
} }
MSG_WriteByte (&host_client->netchan.message, 0); MSG_WriteByte (&host_client->netchan.message, 0);
@ -808,16 +808,16 @@ void SV_Modellist_f (void)
else else
{ {
for (i = 1+n; for (i = 1+n;
i < maxclientsupportedmodels && sv.model_precache[i] && host_client->netchan.message.cursize < (MAX_QWMSGLEN/2); //make sure we don't send a 0 next... i < maxclientsupportedmodels && sv.strings.model_precache[i] && host_client->netchan.message.cursize < (MAX_QWMSGLEN/2); //make sure we don't send a 0 next...
i++) i++)
{ {
MSG_WriteString (&host_client->netchan.message, sv.model_precache[i]); MSG_WriteString (&host_client->netchan.message, sv.strings.model_precache[i]);
if (((n&255)==255) && n != i-1) if (((n&255)==255) && n != i-1)
break; break;
} }
n = i-1; n = i-1;
if (!sv.model_precache[i]) if (!sv.strings.model_precache[i])
n = 0; n = 0;
} }
@ -1123,24 +1123,24 @@ void SV_Spawn_f (void)
else else
{ {
if (i >= MAX_STANDARDLIGHTSTYLES) if (i >= MAX_STANDARDLIGHTSTYLES)
if (!sv.lightstyles[i]) if (!sv.strings.lightstyles[i])
continue; continue;
#ifdef PEXT_LIGHTSTYLECOL #ifdef PEXT_LIGHTSTYLECOL
if (host_client->fteprotocolextensions & PEXT_LIGHTSTYLECOL && sv.lightstylecolours[i]!=7) if (host_client->fteprotocolextensions & PEXT_LIGHTSTYLECOL && sv.strings.lightstylecolours[i]!=7)
{ {
ClientReliableWrite_Begin (host_client, svc_lightstylecol, ClientReliableWrite_Begin (host_client, svc_lightstylecol,
3 + (sv.lightstyles[i] ? strlen(sv.lightstyles[i]) : 1)); 3 + (sv.strings.lightstyles[i] ? strlen(sv.strings.lightstyles[i]) : 1));
ClientReliableWrite_Byte (host_client, (char)i); ClientReliableWrite_Byte (host_client, (char)i);
ClientReliableWrite_Char (host_client, sv.lightstylecolours[i]); ClientReliableWrite_Char (host_client, sv.strings.lightstylecolours[i]);
ClientReliableWrite_String (host_client, sv.lightstyles[i]); ClientReliableWrite_String (host_client, sv.strings.lightstyles[i]);
} }
else else
#endif #endif
{ {
ClientReliableWrite_Begin (host_client, svc_lightstyle, ClientReliableWrite_Begin (host_client, svc_lightstyle,
3 + (sv.lightstyles[i] ? strlen(sv.lightstyles[i]) : 1)); 3 + (sv.strings.lightstyles[i] ? strlen(sv.strings.lightstyles[i]) : 1));
ClientReliableWrite_Byte (host_client, (char)i); ClientReliableWrite_Byte (host_client, (char)i);
ClientReliableWrite_String (host_client, sv.lightstyles[i]); ClientReliableWrite_String (host_client, sv.strings.lightstyles[i]);
} }
} }
} }
@ -3254,9 +3254,9 @@ void SVNQ_Spawn_f (void)
break; //dp7 clients support more lightstyles. break; //dp7 clients support more lightstyles.
ClientReliableWrite_Begin (host_client, svc_lightstyle, ClientReliableWrite_Begin (host_client, svc_lightstyle,
3 + (sv.lightstyles[i] ? strlen(sv.lightstyles[i]) : 1)); 3 + (sv.strings.lightstyles[i] ? strlen(sv.strings.lightstyles[i]) : 1));
ClientReliableWrite_Byte (host_client, (char)i); ClientReliableWrite_Byte (host_client, (char)i);
ClientReliableWrite_String (host_client, sv.lightstyles[i]); ClientReliableWrite_String (host_client, sv.strings.lightstyles[i]);
} }
// set up the edict // set up the edict
@ -4428,9 +4428,9 @@ void SV_ExecuteClientMessage (client_t *cl)
int seq_hash, i; int seq_hash, i;
// calc ping time // calc ping time
if (cl->frames) if (cl->frameunion.frames)
{ //split screen doesn't always have frames. { //split screen doesn't always have frames.
frame = &cl->frames[cl->netchan.incoming_acknowledged & UPDATE_MASK]; frame = &cl->frameunion.frames[cl->netchan.incoming_acknowledged & UPDATE_MASK];
if (cl->lastsequence_acknoledged + UPDATE_BACKUP > cl->netchan.incoming_acknowledged) if (cl->lastsequence_acknoledged + UPDATE_BACKUP > cl->netchan.incoming_acknowledged)
frame->ping_time = realtime - frame->senttime; //no more phenomanally low pings please frame->ping_time = realtime - frame->senttime; //no more phenomanally low pings please
@ -4460,10 +4460,10 @@ void SV_ExecuteClientMessage (client_t *cl)
cl->send_message = false; // don't reply, sequences have slipped cl->send_message = false; // don't reply, sequences have slipped
// save time for ping calculations // save time for ping calculations
if (cl->frames) if (cl->frameunion.frames)
{ //split screen doesn't always have frames. { //split screen doesn't always have frames.
cl->frames[cl->netchan.outgoing_sequence & UPDATE_MASK].senttime = realtime; cl->frameunion.frames[cl->netchan.outgoing_sequence & UPDATE_MASK].senttime = realtime;
cl->frames[cl->netchan.outgoing_sequence & UPDATE_MASK].ping_time = -1; cl->frameunion.frames[cl->netchan.outgoing_sequence & UPDATE_MASK].ping_time = -1;
} }
host_client = cl; host_client = cl;
@ -4712,7 +4712,7 @@ void SVQ2_ExecuteClientMessage (client_t *cl)
} }
// calc ping time // calc ping time
frame = &cl->q2frames[cl->netchan.incoming_acknowledged & Q2UPDATE_MASK]; frame = &cl->frameunion.q2frames[cl->netchan.incoming_acknowledged & Q2UPDATE_MASK];
// make sure the reply sequence number matches the incoming // make sure the reply sequence number matches the incoming
// sequence number // sequence number
@ -4722,7 +4722,7 @@ void SVQ2_ExecuteClientMessage (client_t *cl)
cl->send_message = false; // don't reply, sequences have slipped cl->send_message = false; // don't reply, sequences have slipped
// save time for ping calculations // save time for ping calculations
cl->q2frames[cl->netchan.outgoing_sequence & Q2UPDATE_MASK].senttime = realtime; cl->frameunion.q2frames[cl->netchan.outgoing_sequence & Q2UPDATE_MASK].senttime = realtime;
// cl->q2frames[cl->netchan.outgoing_sequence & UPDATE_MASK].ping_time = -1; // cl->q2frames[cl->netchan.outgoing_sequence & UPDATE_MASK].ping_time = -1;
host_client = cl; host_client = cl;
@ -4854,7 +4854,7 @@ void SVNQ_ReadClientMove (usercmd_t *move)
int bits; int bits;
client_frame_t *frame; client_frame_t *frame;
frame = &host_client->frames[host_client->netchan.incoming_acknowledged & UPDATE_MASK]; frame = &host_client->frameunion.frames[host_client->netchan.incoming_acknowledged & UPDATE_MASK];
if (host_client->protocol == SCP_DARKPLACES7) if (host_client->protocol == SCP_DARKPLACES7)
host_client->last_sequence = MSG_ReadLong (); host_client->last_sequence = MSG_ReadLong ();
@ -4965,7 +4965,7 @@ void SVNQ_ExecuteClientMessage (client_t *cl)
cl->netchan.incoming_acknowledged = cl->netchan.outgoing_sequence-1; cl->netchan.incoming_acknowledged = cl->netchan.outgoing_sequence-1;
// calc ping time // calc ping time
frame = &cl->frames[cl->netchan.incoming_acknowledged & UPDATE_MASK]; frame = &cl->frameunion.frames[cl->netchan.incoming_acknowledged & UPDATE_MASK];
frame->ping_time = 999; frame->ping_time = 999;
// make sure the reply sequence number matches the incoming // make sure the reply sequence number matches the incoming
@ -4976,8 +4976,8 @@ void SVNQ_ExecuteClientMessage (client_t *cl)
// cl->send_message = false; // don't reply, sequences have slipped // cl->send_message = false; // don't reply, sequences have slipped
// save time for ping calculations // save time for ping calculations
cl->frames[cl->netchan.outgoing_sequence & UPDATE_MASK].senttime = realtime; cl->frameunion.frames[cl->netchan.outgoing_sequence & UPDATE_MASK].senttime = realtime;
cl->frames[cl->netchan.outgoing_sequence & UPDATE_MASK].ping_time = -1; cl->frameunion.frames[cl->netchan.outgoing_sequence & UPDATE_MASK].ping_time = -1;
host_client = cl; host_client = cl;
sv_player = host_client->edict; sv_player = host_client->edict;

View file

@ -543,7 +543,7 @@ void SV_WriteFrameToClient (client_t *client, sizebuf_t *msg)
//Com_Printf ("%i -> %i\n", client->lastframe, sv.framenum); //Com_Printf ("%i -> %i\n", client->lastframe, sv.framenum);
// this is the frame we are creating // this is the frame we are creating
frame = &client->q2frames[sv.framenum & Q2UPDATE_MASK]; frame = &client->frameunion.q2frames[sv.framenum & Q2UPDATE_MASK];
if (client->delta_sequence <= 0) if (client->delta_sequence <= 0)
{ // client is asking for a retransmit { // client is asking for a retransmit
@ -558,7 +558,7 @@ void SV_WriteFrameToClient (client_t *client, sizebuf_t *msg)
} }
else else
{ // we have a valid message to delta from { // we have a valid message to delta from
oldframe = &client->q2frames[client->delta_sequence & Q2UPDATE_MASK]; oldframe = &client->frameunion.q2frames[client->delta_sequence & Q2UPDATE_MASK];
lastframe = client->delta_sequence; lastframe = client->delta_sequence;
} }
@ -629,7 +629,7 @@ void SV_BuildClientFrame (client_t *client)
#endif #endif
// this is the frame we are creating // this is the frame we are creating
frame = &client->q2frames[sv.framenum & Q2UPDATE_MASK]; frame = &client->frameunion.q2frames[sv.framenum & Q2UPDATE_MASK];
frame->senttime = realtime; // save it for ping calc later frame->senttime = realtime; // save it for ping calc later

View file

@ -175,7 +175,7 @@ static void VARGS PFQ2_Configstring (int i, char *val)
if (!val) if (!val)
val = ""; val = "";
strcpy(sv.configstring[i], val); strcpy(sv.strings.configstring[i], val);
if (i == Q2CS_NAME) if (i == Q2CS_NAME)
Q_strncpyz(sv.mapname, val, sizeof(sv.name)); Q_strncpyz(sv.mapname, val, sizeof(sv.name));
@ -237,7 +237,7 @@ static int SVQ2_FindIndex (char *name, int start, int max, qboolean create)
{ {
int i; int i;
int stringlength = MAX_QPATH; int stringlength = MAX_QPATH;
char *strings = sv.configstring[start]; char *strings = sv.strings.configstring[start];
strings += stringlength; strings += stringlength;
if (!name || !name[0]) if (!name || !name[0])

View file

@ -158,7 +158,7 @@ int Q_stricmp(char *a, char *b)
{ {
return stricmp(a, b); return stricmp(a, b);
} }
#if MSC_VER < 700 #if _MSC_VER < 700
int _ftol2 (float f) int _ftol2 (float f)
{ {
return (int)f; return (int)f;
@ -2053,7 +2053,7 @@ void SVQ3_WriteSnapshotToClient(client_t *client, sizebuf_t *msg)
int i; int i;
// this is a frame we are creating // this is a frame we are creating
snap = &client->q3frames[client->netchan.outgoing_sequence & Q3UPDATE_MASK]; snap = &client->frameunion.q3frames[client->netchan.outgoing_sequence & Q3UPDATE_MASK];
if(client->state < cs_spawned) if(client->state < cs_spawned)
{ {
@ -2079,7 +2079,7 @@ void SVQ3_WriteSnapshotToClient(client_t *client, sizebuf_t *msg)
{ {
// we have a valid message to delta from // we have a valid message to delta from
delta = client->netchan.outgoing_sequence - client->delta_sequence; delta = client->netchan.outgoing_sequence - client->delta_sequence;
oldsnap = &client->q3frames[client->delta_sequence & Q3UPDATE_MASK]; oldsnap = &client->frameunion.q3frames[client->delta_sequence & Q3UPDATE_MASK];
if(oldsnap->first_entity <= q3_next_snapshot_entities - q3_num_snapshot_entities) if(oldsnap->first_entity <= q3_next_snapshot_entities - q3_num_snapshot_entities)
{ {
@ -2250,7 +2250,7 @@ void SVQ3_BuildClientSnapshot( client_t *client )
ps = PS_FOR_NUM( clientNum ); ps = PS_FOR_NUM( clientNum );
// this is the frame we are creating // this is the frame we are creating
snap = &client->q3frames[client->netchan.outgoing_sequence & Q3UPDATE_MASK]; snap = &client->frameunion.q3frames[client->netchan.outgoing_sequence & Q3UPDATE_MASK];
snap->serverTime = Sys_DoubleTime()*1000;//svs.levelTime; // save it for ping calc later snap->serverTime = Sys_DoubleTime()*1000;//svs.levelTime; // save it for ping calc later
snap->flags = 0; snap->flags = 0;
@ -2916,8 +2916,8 @@ void SVQ3_DirectConnect(void) //Actually connect the client, use up a slot, and
} }
else else
{ {
if (cl->q3frames) if (cl->frameunion.q3frames)
BZ_Free(cl->q3frames); BZ_Free(cl->frameunion.q3frames);
memset(cl, 0, sizeof(*cl)); memset(cl, 0, sizeof(*cl));
challenge = atoi(Info_ValueForKey(userinfo, "challenge")); challenge = atoi(Info_ValueForKey(userinfo, "challenge"));
@ -2966,7 +2966,7 @@ void SVQ3_DirectConnect(void) //Actually connect the client, use up a slot, and
Huff_PreferedCompressionCRC(); Huff_PreferedCompressionCRC();
cl->q3frames = BZ_Malloc(Q3UPDATE_BACKUP*sizeof(*cl->q3frames)); cl->frameunion.q3frames = BZ_Malloc(Q3UPDATE_BACKUP*sizeof(*cl->frameunion.q3frames));
} }
int SVQ3_AddBot(void) int SVQ3_AddBot(void)

View file

@ -1062,7 +1062,7 @@ trace_t SV_ClipMoveToEntity (edict_t *ent, vec3_t start, vec3_t mins, vec3_t max
if (!model) if (!model)
{ //if the model isn't loaded, load it. { //if the model isn't loaded, load it.
//this saves on memory requirements with mods that don't ever use this. //this saves on memory requirements with mods that don't ever use this.
model = sv.models[(int)ent->v->modelindex] = Mod_ForName(sv.model_precache[(int)ent->v->modelindex], false); model = sv.models[(int)ent->v->modelindex] = Mod_ForName(sv.strings.model_precache[(int)ent->v->modelindex], false);
} }
if (model && model->funcs.Trace) if (model && model->funcs.Trace)

View file

@ -909,9 +909,9 @@ void SWR_BuildLightMapRGB (void)
{ {
for (y = 0; y < smax; y++, i+=3, stain++) for (y = 0; y < smax; y++, i+=3, stain++)
{ {
r = (255*256*256-127*256-(int)blocklights[i]*(*stain)) >> 16 - VID_CBITS; r = (255*256*256-127*256-(int)blocklights[i]*(*stain)) >> (16 - VID_CBITS);
g = (255*256*256-127*256-(int)blocklights[i+1]*(*stain)) >> 16 - VID_CBITS; g = (255*256*256-127*256-(int)blocklights[i+1]*(*stain)) >> (16 - VID_CBITS);
b = (255*256*256-127*256-(int)blocklights[i+2]*(*stain)) >> 16 - VID_CBITS; b = (255*256*256-127*256-(int)blocklights[i+2]*(*stain)) >> (16 - VID_CBITS);
#define MINL (1<<6) #define MINL (1<<6)
#define MAXL ((255*256) >> (8 - VID_CBITS)) #define MAXL ((255*256) >> (8 - VID_CBITS))