1
0
Fork 0
forked from fte/fteqw

Reworked the console/loading screen a little. The console is no longer directly shown at startup. MSVC2005 project files update for npqtv.

Added vid_wndalpha to make the window transparent (only supported in GL-win32).
Multiple issues with SW rendering, which I'll fix eventually. It does at least run, even if it looks ugly.
Plugins are now able to read the console input. Bigfoot, feel free to tweek.
Fixed up a few mismatched prototypes.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3153 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2009-04-06 00:34:32 +00:00
parent 6ebabd8d88
commit 2adb420a6d
45 changed files with 1091 additions and 533 deletions

View file

@ -856,17 +856,7 @@ static int CG_SystemCallsEx(void *offset, unsigned int mask, int fn, const int *
case CG_S_RESPATIALIZE://void trap_S_Respatialize( int entityNum, const vec3_t origin, vec3_t axis[3], int inwater );
{
float *org = VM_POINTER(arg[1]);
float *axis = VM_POINTER(arg[2]);
/*
vec3_t listener_origin;
vec3_t listener_forward;
vec3_t listener_right;
vec3_t listener_up;
*/
VectorCopy(org, listener_origin);
VectorCopy(axis+0, listener_forward);
VectorCopy(axis+3, listener_right);
VectorCopy(axis+6, listener_up);
vec3_t *axis = VM_POINTER(arg[2]);
S_UpdateListener(org, axis[0], axis[1], axis[2], false);
}

View file

@ -1925,6 +1925,8 @@ void CL_QTVPlay_f (void)
return;
}
SCR_SetLoadingStage(LS_CONNECTION);
host = connrequest;
connrequest = strchrrev(connrequest, '@');
@ -1935,6 +1937,7 @@ void CL_QTVPlay_f (void)
if (!newf)
{
SCR_SetLoadingStage(LS_NONE);
Con_Printf("Couldn't connect to proxy\n");
return;
}

View file

@ -1596,7 +1596,7 @@ void CL_LinkPacketEntities (void)
autorotate = anglemod(100*servertime);
#ifdef CSQC_DAT
CLCSQC_DeltaStart();
CSQC_DeltaStart(servertime);
#endif
for (newpnum=0 ; newpnum<pack->num_entities ; newpnum++)
@ -1612,7 +1612,7 @@ void CL_LinkPacketEntities (void)
}
#ifdef CSQC_DAT
if (CLCSQC_DeltaUpdate(state))
if (CSQC_DeltaUpdate(state))
continue;
#endif
@ -1879,7 +1879,7 @@ void CL_LinkPacketEntities (void)
}
}
#ifdef CSQC_DAT
CLCSQC_DeltaEnd();
CSQC_DeltaEnd();
#endif
}
#else
@ -2780,13 +2780,13 @@ void CL_LinkPlayers (void)
if (state->messagenum != cl.validsequence)
{
#ifdef CSQC_DAT
CLCSQC_DeltaPlayer(j, NULL);
CSQC_DeltaPlayer(j, NULL);
#endif
continue; // not present this frame
}
#ifdef CSQC_DAT
if (CLCSQC_DeltaPlayer(j, state))
if (CSQC_DeltaPlayer(j, state))
continue;
#endif

View file

@ -542,6 +542,16 @@ void CL_SendConnectPacket (
CL_RegisterSplitCommands();
}
char *CL_TryingToConnect(void)
{
if (connect_time == -1)
return NULL;
if (cls.state != ca_disconnected)
return NULL;
return cls.servername;
}
/*
=================
CL_CheckForResend
@ -699,6 +709,7 @@ void CL_CheckForResend (void)
void CL_BeginServerConnect(void)
{
SCR_SetLoadingStage(LS_CONNECTION);
connect_time = 0;
connect_type = 0;
connect_tries = 0;
@ -707,6 +718,7 @@ void CL_BeginServerConnect(void)
#ifdef NQPROT
void CLNQ_BeginServerConnect(void)
{
SCR_SetLoadingStage(LS_CONNECTION);
connect_time = 0;
connect_type = 1;
connect_tries = 0;
@ -963,7 +975,8 @@ void CL_ClearState (void)
Cvar_ApplyLatches(CVAR_LATCH);
}
CL_ClearTEnts ();
CL_ClearParseState();
CL_ClearTEnts();
CL_ClearCustomTEnts();
SCR_ShowPic_Clear();
@ -1056,6 +1069,8 @@ void CL_Disconnect (void)
connect_time = -1;
connect_tries = 0;
SCR_SetLoadingStage(0);
Cvar_ApplyLatches(CVAR_SERVEROVERRIDE);
if (VID_SetWindowCaption)
@ -1169,6 +1184,7 @@ void CL_Disconnect (void)
r_worldentity.model = NULL;
cl.spectator = 0;
cl.sendprespawn = false;
cl.intermission = 0;
#ifdef NQPROT
cls.signon=0;
@ -2256,7 +2272,7 @@ client_connect: //fixme: make function
total_loading_size = 100;
current_loading_size = 0;
loading_stage = 2;
SCR_SetLoadingStage(LS_CLIENT);
Validation_Apply_Ruleset();
@ -2390,7 +2406,7 @@ void CLNQ_ConnectionlessPacket(void)
total_loading_size = 100;
current_loading_size = 0;
loading_stage = 2;
SCR_SetLoadingStage(LS_CLIENT);
allowremotecmd = false; // localid required now for remote cmds
@ -3376,19 +3392,19 @@ void Host_Frame (double time)
// update audio
#ifdef CSQC_DAT
if (CSQC_SettingListener())
S_ExtraUpdate();
else
if (!CSQC_SettingListener())
#endif
if (cls.state == ca_active)
{
if (cls.protocol == CP_QUAKE3)
S_ExtraUpdate();
if (cls.state == ca_active)
{
if (cls.protocol != CP_QUAKE3)
S_UpdateListener (r_origin, vpn, vright, vup, false);
}
else
S_UpdateListener (r_origin, vpn, vright, vup, false);
S_UpdateListener (vec3_origin, vec3_origin, vec3_origin, vec3_origin, false);
}
else
S_UpdateListener (vec3_origin, vec3_origin, vec3_origin, vec3_origin, false);
S_ExtraUpdate ();
CDAudio_Update();
@ -3590,10 +3606,6 @@ void Host_Init (quakeparms_t *parms)
Cbuf_Execute (); //if the server initialisation causes a problem, give it a place to abort to
Cmd_StuffCmds();
Cbuf_Execute (); //if the server initialisation causes a problem, give it a place to abort to
//assuming they didn't use any waits in their config (fools)
//the configs should be fully loaded.
@ -3626,6 +3638,11 @@ void Host_Init (quakeparms_t *parms)
if (COM_CheckParm ("-current"))
Cvar_Set(Cvar_FindVar("vid_desktopsettings"), "1");
//now exec their commandline
Cmd_StuffCmds();
Cbuf_Execute (); //if the server initialisation causes a problem, give it a place to abort to
Cvar_ApplyLatches(CVAR_RENDERERLATCH);
#ifndef NPQTV
@ -3686,6 +3703,14 @@ Con_TPrintf (TL_NL);
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. "
"\n"
"See the GNU General Public License for more details.\n");
if (!*cls.servername)
if (!sv.state)
{
if (qrenderer > QR_NONE)
M_ToggleMenu_f();
//Con_ForceActiveNow();
}
}

View file

@ -370,7 +370,7 @@ void CL_GetDownloadSizes(unsigned int *filecount, unsigned int *totalsize, qbool
*somesizesunknown = false;
for(dl = cl.downloadlist; dl; dl = dl->next)
{
*filecount++;
*filecount += 1;
if (dl->flags & DLLF_SIZEUNKNOWN)
*somesizesunknown = true;
else
@ -399,7 +399,7 @@ void CL_DisenqueDownload(char *filename)
}
else
{
for (dl = cl.downloadlist->next; dl->next; dl = dl->next)
for (dl = cl.downloadlist; dl->next; dl = dl->next)
{
if (!strcmp(dl->next->name, filename))
{
@ -733,8 +733,7 @@ static qboolean CL_CheckModelResources (char *name)
Model_NextDownload
=================
*/
void Sound_NextDownload (void);
void Model_NextDownload (void)
void Model_CheckDownloads (void)
{
// char *twf;
char *s;
@ -743,14 +742,6 @@ void Model_NextDownload (void)
// Con_TPrintf (TLC_CHECKINGMODELS);
/* if (cls.downloadnumber == 0)
{
Con_TPrintf (TLC_CHECKINGMODELS);
cls.downloadnumber = 1;
cl.worldmodel = NULL;
}
*/
#ifdef Q2CLIENT
if (cls.protocol == CP_QUAKE2)
{
@ -785,22 +776,16 @@ void Model_NextDownload (void)
CL_CheckOrEnqueDownloadFile(s, s, (i==1)?DLLF_REQUIRED:0); //world is required to be loaded.
CL_CheckModelResources(s);
}
CL_AllowIndependantSendCmd(false); //stop it now, the indep stuff *could* require model tracing.
Hunk_Check (); // make sure nothing is hurt
cl.sendprespawn = true;
}
int CL_LoadModels(int stage)
int CL_LoadModels(int stage, qboolean dontactuallyload)
{
extern model_t *loadmodel;
int i;
float giveuptime = Sys_DoubleTime()+0.1; //small things get padded into a single frame
#define atstage() ((cl.contentstage == stage++)?++cl.contentstage:false)
#define atstage() ((cl.contentstage == stage++ && !dontactuallyload)?++cl.contentstage:false)
#define endstage() if (giveuptime<Sys_DoubleTime()) return -1;
pmove.numphysent = 0;
@ -995,13 +980,13 @@ int CL_LoadModels(int stage)
return stage;
}
int CL_LoadSounds(int stage)
int CL_LoadSounds(int stage, qboolean dontactuallyload)
{
int i;
float giveuptime = Sys_DoubleTime()+0.1; //small things get padded into a single frame
#define atstage() ((cl.contentstage == stage++)?++cl.contentstage:false)
#define endstage() if (giveuptime<Sys_DoubleTime()) return -1;
//#define atstage() ((cl.contentstage == stage++)?++cl.contentstage:false)
//#define endstage() if (giveuptime<Sys_DoubleTime()) return -1;
for (i=1 ; i<MAX_SOUNDS ; i++)
{
@ -1027,7 +1012,7 @@ int CL_LoadSounds(int stage)
Sound_NextDownload
=================
*/
void Sound_NextDownload (void)
void Sound_CheckDownloads (void)
{
char mangled[512];
char *s;
@ -1061,7 +1046,10 @@ void Sound_NextDownload (void)
; i++)
{
s = cl.sound_name[i];
if (*s == '*')
if (*s == '*') //q2 sexed sound
continue;
if (!S_HaveOutput())
continue;
//check without the sound/ prefix
@ -1089,40 +1077,6 @@ void Sound_NextDownload (void)
//download the one the server said.
CL_CheckOrEnqueDownloadFile(s, NULL, 0);
}
// done with sounds, request models now
memset (cl.model_precache, 0, sizeof(cl.model_precache));
cl_playerindex = -1;
cl_h_playerindex = -1;
cl_spikeindex = -1;
cl_flagindex = -1;
cl_rocketindex = -1;
cl_grenadeindex = -1;
cl_gib1index = -1;
cl_gib2index = -1;
cl_gib3index = -1;
#ifdef Q2CLIENT
if (cls.protocol == CP_QUAKE2)
{
Model_NextDownload();
}
else
#endif
{
if (cls.demoplayback == DPB_EZTV)
{
if (CL_RemoveClientCommands("qtvmodellist"))
Con_Printf("Multiple modellists\n");
CL_SendClientCommand (true, "qtvmodellist %i 0", cl.servercount);
}
else
{
if (CL_RemoveClientCommands("modellist"))
Con_Printf("Multiple modellists\n");
// CL_SendClientCommand ("modellist %i 0", cl.servercount);
CL_SendClientCommand (true, modellist_name, cl.servercount, 0);
}
}
}
/*
@ -1141,6 +1095,8 @@ void CL_RequestNextDownload (void)
if (cl.downloadlist)
{
downloadlist_t *dl;
//download required downloads first
for (dl = cl.downloadlist; dl; dl = dl->next)
{
if (dl->flags & DLLF_REQUIRED)
@ -1167,11 +1123,24 @@ void CL_RequestNextDownload (void)
if (cl.sendprespawn)
{ // get next signon phase
extern int total_loading_size, current_loading_size;
if (!cl.contentstage)
{
stage = 0;
stage = CL_LoadModels(stage, true);
stage = CL_LoadSounds(stage, true);
total_loading_size = stage;
cl.contentstage = 0;
}
stage = 0;
stage = CL_LoadModels(stage);
stage = CL_LoadModels(stage, false);
current_loading_size = cl.contentstage;
if (stage < 0)
return; //not yet
stage = CL_LoadSounds(stage);
stage = CL_LoadSounds(stage, false);
current_loading_size = cl.contentstage;
if (stage < 0)
return;
@ -1182,27 +1151,29 @@ void CL_RequestNextDownload (void)
#warning timedemo timer should start here
#endif
if (!cl.worldmodel || cl.worldmodel->needload)
{
Con_Printf("\n\n-------------\nCouldn't download %s - cannot fully connect\n", cl.worldmodel->name);
SCR_SetLoadingStage(LS_NONE);
return;
}
#ifdef Q2CLIENT
if (cls.protocol == CP_QUAKE2)
{
Skin_NextDownload();
SCR_SetLoadingStage(LS_NONE);
CL_SendClientCommand(true, "begin %i\n", cl.servercount);
}
else
#endif
{
if (!cl.worldmodel || cl.worldmodel->needload)
{
Con_Printf("\n\n-------------\nCouldn't download %s - cannot fully connect\n", cl.worldmodel->name);
return;
}
if (cls.demoplayback == DPB_EZTV)
{
if (CL_RemoveClientCommands("qtvspawn"))
Con_Printf("Multiple prespawns\n");
CL_SendClientCommand(true, "qtvspawn %i 0 %i", cl.servercount, cl.worldmodel->checksum2);
SCR_SetLoadingStage(LS_NONE);
}
else
{
@ -1943,6 +1914,21 @@ qboolean CL_StartUploadFile(char *filename)
float nextdemotime;
#endif
void CL_ClearParseState(void)
{
// done with sounds, request models now
memset (cl.model_precache, 0, sizeof(cl.model_precache));
cl_playerindex = -1;
cl_h_playerindex = -1;
cl_spikeindex = -1;
cl_flagindex = -1;
cl_rocketindex = -1;
cl_grenadeindex = -1;
cl_gib1index = -1;
cl_gib2index = -1;
cl_gib3index = -1;
}
/*
==================
CL_ParseServerData
@ -1962,6 +1948,7 @@ void CL_ParseServerData (void)
// wipe the client_state_t struct
//
SCR_SetLoadingStage(LS_CLIENT);
SCR_BeginLoadingPlaque();
// parse protocol version number
@ -2164,6 +2151,7 @@ void CLQ2_ParseServerData (void)
//
// wipe the client_state_t struct
//
SCR_SetLoadingStage(LS_CLIENT);
SCR_BeginLoadingPlaque();
// CL_ClearState ();
cls.state = ca_onserver;
@ -2264,6 +2252,7 @@ void CLNQ_ParseServerData(void) //Doesn't change gamedir - use with caution.
int protover;
if (developer.value)
Con_TPrintf (TLC_GOTSVDATAPACKET);
SCR_SetLoadingStage(LS_CLIENT);
CL_ClearState ();
Stats_NewMap();
Cvar_ForceCallback(Cvar_FindVar("r_particlesdesc"));
@ -2661,7 +2650,32 @@ void CL_ParseSoundlist (qboolean lots)
return;
}
Sound_NextDownload ();
#ifdef Q2CLIENT
if (cls.protocol == CP_QUAKE2)
{
CL_AllowIndependantSendCmd(false); //stop it now, the indep stuff *could* require model tracing.
Hunk_Check (); // make sure nothing is hurt
cl.sendprespawn = true;
}
else
#endif
{
if (cls.demoplayback == DPB_EZTV)
{
if (CL_RemoveClientCommands("qtvmodellist"))
Con_Printf("Multiple modellists\n");
CL_SendClientCommand (true, "qtvmodellist %i 0", cl.servercount);
}
else
{
if (CL_RemoveClientCommands("modellist"))
Con_Printf("Multiple modellists\n");
// CL_SendClientCommand ("modellist %i 0", cl.servercount);
CL_SendClientCommand (true, modellist_name, cl.servercount, 0);
}
}
}
/*
@ -2731,7 +2745,14 @@ void CL_ParseModellist (qboolean lots)
return;
}
Model_NextDownload ();
Model_CheckDownloads();
CL_AllowIndependantSendCmd(false); //stop it now, the indep stuff *could* require model tracing.
Hunk_Check (); // make sure nothing is hurt
//set the flag to load models and send prespawn
cl.sendprespawn = true;
}
void CL_ProcessUserInfo (int slot, player_info_t *player);
@ -2950,8 +2971,12 @@ void CL_ParseBaseline2 (void)
void CLQ2_Precache_f (void)
{
Model_CheckDownloads();
Sound_CheckDownloads();
cl.contentstage = 0;
cl.sendprespawn = true;
Sound_NextDownload();
#ifdef VM_CG
CG_Start();
#endif
@ -4424,7 +4449,8 @@ void CL_ParsePrecache(void)
if (i >= 1 && i < MAX_SOUNDS)
{
sfx_t *sfx;
CL_CheckOrEnqueDownloadFile(va("sound/%s", s), NULL, 0);
if (S_HaveOutput())
CL_CheckOrEnqueDownloadFile(va("sound/%s", s), NULL, 0);
sfx = S_PrecacheSound (s);
if (!sfx)
Con_Printf("svc_precache: S_PrecacheSound(\"%s\") failed\n", s);

View file

@ -25,7 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "glquake.h"//would prefer not to have this
#endif
//name of the current backdrop for the loading screen
char levelshotname[MAX_QPATH];
void RSpeedShow(void)
@ -1442,28 +1443,32 @@ SCR_DrawLoading
*/
int total_loading_size, current_loading_size, loading_stage;
int CL_DownloadRate(void);
int SCR_GetLoadingStage(void)
{
return loading_stage;
}
void SCR_SetLoadingStage(int stage)
{
loading_stage = stage;
}
char levelshotname[MAX_QPATH];
void SCR_DrawLoading (void)
{
int sizex, x, y;
mpic_t *pic;
char *s;
int qdepth;
int h2depth;
int mtype = M_GameType();
y = vid.height/2;
if (!scr_drawloading)
return;
qdepth = COM_FDepthFile("gfx/loading.lmp", true);
h2depth = COM_FDepthFile("gfx/menu/loading.lmp", true);
if (*levelshotname)
{
if(Draw_ScalePic)
Draw_ScalePic(0, 0, vid.width, vid.height, Draw_SafeCachePic (levelshotname));
else
Draw_ConsoleBackground(vid.height);
}
else
Draw_ConsoleBackground(vid.height);
if (COM_FDepthFile("gfx/loading.lmp", true) < COM_FDepthFile("gfx/menu/loading.lmp", true))
if (qdepth < h2depth || h2depth > 0xffffff)
{ //quake files
int sizex, x, y;
pic = Draw_SafeCachePic ("gfx/loading.lmp");
if (pic)
@ -1478,12 +1483,14 @@ void SCR_DrawLoading (void)
{
x = (vid.width/2) - 96;
y = (vid.height/2) - 8;
Draw_String((vid.width-7*8)/2, y-16, "Loading");
}
if (loading_stage)
if (loading_stage > LS_CONNECTION)
{
sizex = current_loading_size * 192 / total_loading_size;
if (loading_stage == 1)
if (loading_stage == LS_SERVER)
{
Draw_FillRGB(x, y, sizex, 16, 1.0, 0.0, 0.0);
Draw_FillRGB(x+sizex, y, 192-sizex, 16, 0.0, 0.0, 0.0);
@ -1495,8 +1502,10 @@ void SCR_DrawLoading (void)
}
Draw_String(x+8, y+4, va("Loading %s... %i%%",
(loading_stage == 1) ? "server" : "client",
(loading_stage == LS_SERVER) ? "server" : "client",
current_loading_size * 100 / total_loading_size));
y += 16;
}
}
else
@ -1512,7 +1521,7 @@ void SCR_DrawLoading (void)
offset = (vid.width - pic->width)/2;
Draw_TransPic (offset , 0, pic);
if (loading_stage == 0)
if (loading_stage == LS_NONE)
return;
if (total_loading_size)
@ -1520,7 +1529,7 @@ void SCR_DrawLoading (void)
else
size = 0;
if (loading_stage == 1)
if (loading_stage == LS_CLIENT)
count = size;
else
count = 106;
@ -1529,7 +1538,7 @@ void SCR_DrawLoading (void)
Draw_Fill (offset+42, 87+1, count, 4, 138);
Draw_Fill (offset+42, 87+5, count, 1, 136);
if (loading_stage == 2)
if (loading_stage == LS_SERVER)
count = size;
else
count = 0;
@ -1537,11 +1546,57 @@ void SCR_DrawLoading (void)
Draw_Fill (offset+42, 97, count, 1, 168);
Draw_Fill (offset+42, 97+1, count, 4, 170);
Draw_Fill (offset+42, 97+5, count, 1, 168);
y = 104;
}
}
SCR_SetUpToDrawConsole();
SCR_DrawConsole(!!*levelshotname);
if (cl.downloadlist || cls.downloadmethod)
{
unsigned int fcount;
unsigned int tsize;
qboolean sizeextra;
x = vid.conwidth/2 - 160;
CL_GetDownloadSizes(&fcount, &tsize, &sizeextra);
//downloading files?
if (cls.downloadmethod)
Draw_String(x+8, y+4, va("Downloading %s... %i%%",
cls.downloadname,
cls.downloadpercent));
if (tsize > 1024*1024*16)
{
Draw_String(x+8, y+8+4, va("%5ukbps %8umb%s remaining (%i files)",
(unsigned int)(CL_DownloadRate()/1000.0f),
tsize/(1024*1024),
sizeextra?"+":"",
fcount));
}
else
{
Draw_String(x+8, y+8+4, va("%5ukbps %8ukb%s remaining (%i files)",
(unsigned int)(CL_DownloadRate()/1000.0f),
tsize/1024,
sizeextra?"+":"",
fcount));
}
y+= 16+8;
}
else if (CL_TryingToConnect())
{
char dots[4];
s = CL_TryingToConnect();
x = (vid.width - (strlen(s)+15)*8) / 2;
dots[0] = '.';
dots[1] = '.';
dots[2] = '.';
dots[(int)realtime & 3] = 0;
Draw_String(x, y+4, va("Connecting to: %s%s", s, dots));
}
}
void SCR_BeginLoadingPlaque (void)
@ -1636,7 +1691,7 @@ void SCR_SetUpToDrawConsole (void)
// decide on the height of the console
if (!scr_disabled_for_loading)
{
if (cls.state != ca_active && !Media_PlayingFullScreen()
/*if (cls.state != ca_active && !Media_PlayingFullScreen()
#ifdef TEXTEDITOR
&& !editoractive
#endif
@ -1649,6 +1704,10 @@ void SCR_SetUpToDrawConsole (void)
scr_con_current = scr_conlines;
scr_con_forcedraw = true;
}
else */
scr_con_forcedraw = false;
if ((key_dest == key_console || key_dest == key_game) && !cl.sendprespawn && cl.worldmodel && cl.worldmodel->needload)
Con_ForceActiveNow();
else if (key_dest == key_console || scr_chatmode)
{
scr_conlines = vid.height*scr_consize.value; // half screen
@ -1662,14 +1721,14 @@ void SCR_SetUpToDrawConsole (void)
if (scr_conlines < scr_con_current)
{
scr_con_current -= scr_conspeed.value*host_frametime;
scr_con_current -= scr_conspeed.value*host_frametime * (vid.height/320.0f);
if (scr_conlines > scr_con_current)
scr_con_current = scr_conlines;
}
else if (scr_conlines > scr_con_current)
{
scr_con_current += scr_conspeed.value*host_frametime;
scr_con_current += scr_conspeed.value*host_frametime * (vid.height/320.0f);
if (scr_conlines < scr_con_current)
scr_con_current = scr_conlines;
}
@ -1707,8 +1766,6 @@ SCR_DrawConsole
*/
void SCR_DrawConsole (qboolean noback)
{
if (key_dest == key_menu)
return;
if (scr_con_current)
{
scr_copyeverything = 1;
@ -2295,9 +2352,9 @@ void SCR_DrawTwoDimensional(int uimenu, qboolean nohud)
SCR_DrawNotifyString ();
scr_copyeverything = true;
}
else if (scr_drawloading)
else if (scr_drawloading || loading_stage)
{
SCR_DrawLoading ();
SCR_DrawLoading();
if (!nohud)
{
@ -2313,20 +2370,16 @@ void SCR_DrawTwoDimensional(int uimenu, qboolean nohud)
}
SCR_ShowPics_Draw();
}
else if (cl.intermission == 1 && key_dest == key_game)
else if (cl.intermission == 1)
{
Sbar_IntermissionOverlay ();
M_Draw (uimenu);
#ifdef MENU_DAT
MP_Draw();
#endif
}
else if (cl.intermission == 2 && key_dest == key_game)
else if (cl.intermission == 2)
{
Sbar_FinaleOverlay ();
SCR_CheckDrawCenterString ();
}
else if (cl.intermission == 3 && key_dest == key_game)
else if (cl.intermission == 3)
{
}
else
@ -2363,16 +2416,19 @@ void SCR_DrawTwoDimensional(int uimenu, qboolean nohud)
if (qrenderer == QR_OPENGL)
qglTexEnvi ( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
#endif
#ifdef TEXTEDITOR
if (editoractive)
Editor_Draw();
#endif
M_Draw (uimenu);
#ifdef MENU_DAT
MP_Draw();
#endif
SCR_DrawConsole (false);
}
#ifdef TEXTEDITOR
if (editoractive)
Editor_Draw();
#endif
SCR_DrawConsole (false);
M_Draw (uimenu);
#ifdef MENU_DAT
MP_Draw();
#endif
RSpeedEnd(RSPEED_2D);
}

View file

@ -530,6 +530,9 @@ void CL_AddBeam (int tent, int ent, vec3_t start, vec3_t end) //fixme: use TE_ n
#endif
}
if (!m || m->needload)
CL_CheckOrEnqueDownloadFile(m->name, NULL, 0);
// save end position for truelightning
if (ent)
{

View file

@ -950,6 +950,11 @@ qboolean CSQC_KeyPress(int key, qboolean down);
int CSQC_StartSound(int entnum, int channel, char *soundname, vec3_t pos, float vol, float attenuation);
void CSQC_ParseEntities(void);
qboolean CSQC_SettingListener(void);
qboolean CSQC_DeltaPlayer(int playernum, player_state_t *state);
void CSQC_DeltaStart(float time);
qboolean CSQC_DeltaUpdate(entity_state_t *src);
void CSQC_DeltaEnd(void);
#endif
//

View file

@ -329,11 +329,7 @@ void Con_ToggleConsole_f (void)
{
if (m_state)
key_dest = key_menu;
else if (cls.state == ca_active || Media_PlayingFullScreen()
#ifdef VM_UI
|| UI_MenuState()
#endif
)
else
key_dest = key_game;
}
else
@ -495,6 +491,11 @@ void Con_CheckResize (void)
Con_ResizeCon (c);
}
void Con_ForceActiveNow(void)
{
key_dest = key_console;
scr_conlines = scr_con_current = vid.height;
}
/*
================
@ -910,7 +911,7 @@ void Con_DrawInput (void)
int si, x;
if (key_dest != key_console && cls.state == ca_active)
if (key_dest != key_console && con_current->vislines != vid.height)
return; // don't draw anything (always draw if not active)
if (!con_current->linebuffered)
@ -980,7 +981,16 @@ void Con_DrawInput (void)
} //that's the default compleation applied
maskedtext[i] = '\0';
maskedtext[i+1] = '\0'; //just in case
maskedtext[i+1] = '\0'; //just in case i==key_linepos
x = 8;
y = con_current->vislines-22;
if (i >= con_current->linewidth) //work out the start point
si = i - con_current->linewidth;
else
si = 0;
if (con_current->commandcompletion)
{
@ -989,18 +999,24 @@ void Con_DrawInput (void)
for (p = 1; (maskedtext[p]&255)>' '; p++)
maskedtext[p] = (maskedtext[p]&255) | (COLOR_YELLOW<<CON_FGSHIFT);
}
else
Plug_SpellCheckMaskedText(maskedtext+1, i-1, x, y, 8);
if (key_linepos == i) //cursor is at end
{
x = text[1] == '/'?2:1;
fname = Cmd_CompleteCommand(text+x, true, true, con_commandmatch);
int cmdstart;
cmdstart = text[1] == '/'?2:1;
fname = Cmd_CompleteCommand(text+cmdstart, true, true, con_commandmatch);
if (fname) //we can compleate it to:
{
for (p = i-x; fname[p]>' '; p++)
maskedtext[p+x] = (unsigned char)fname[p] | (COLOR_GREEN<<CON_FGSHIFT);
maskedtext[p+x] = '\0';
for (p = i-cmdstart; fname[p]>' '; p++)
maskedtext[p+cmdstart] = (unsigned char)fname[p] | (COLOR_GREEN<<CON_FGSHIFT);
maskedtext[p+cmdstart] = '\0';
}
}
}
else
Plug_SpellCheckMaskedText(maskedtext+1, i-1, x, y, 8, si, con_current->linewidth);
#ifdef _WIN32
if (ActiveApp)
@ -1010,14 +1026,7 @@ void Con_DrawInput (void)
maskedtext[key_linepos] = 11|CON_WHITEMASK; //make it blink
}
if (i >= con_current->linewidth) //work out the start point
si = i - con_current->linewidth;
else
si = 0;
y = con_current->vislines-22;
for (i=0,p=0,x=8; x<=con_current->linewidth*8 ; p++) //draw it
for (i=0,p=0; x<=con_current->linewidth*8 ; p++) //draw it
{
if (!maskedtext[p])
break;
@ -1302,6 +1311,7 @@ void Con_DrawConsole (int lines, qboolean noback)
unsigned char progresspercenttext[128];
char *progresstext;
int progresspercent;
extern qboolean scr_con_forcedraw;
#ifdef RUNTIMELIGHTING
extern model_t *lightmodel;
@ -1320,7 +1330,7 @@ void Con_DrawConsole (int lines, qboolean noback)
// draw the background
if (!noback)
Draw_ConsoleBackground (lines);
Draw_ConsoleBackground (0, lines, scr_con_forcedraw);
con_current->unseentext = false;

View file

@ -210,6 +210,10 @@ keyname_t keynames[] =
{"SEMICOLON", ';'}, // because a raw semicolon seperates commands
{"TILDE", '~'},
{"BACKQUOTE", '`'},
{"BACKSLASH", '\\'},
{NULL,0}
};
@ -1378,8 +1382,6 @@ qboolean Key_MouseShouldBeFree(void)
}
if (key_dest == key_console)
return true;
if (key_dest == key_game && cls.state < ca_connected)
return true;
#ifdef VM_UI
if (UI_MenuState())
@ -1715,6 +1717,8 @@ void Key_Event (int key, qboolean down)
#endif
case key_game:
case key_console:
if ((key >= ' ' && key <= 127) || key == K_ENTER || key == K_TAB)
key_dest = key_console;
Key_Console (key);
break;
default:

View file

@ -921,7 +921,7 @@ qboolean Media_WinAvi_DecodeFrame(cin_t *cin, qboolean nosound)
#ifdef SWQUAKE
D_EnableBackBufferAccess (); // of all overlay stuff if drawing directly
#endif
Draw_ConsoleBackground(vid.height);
Draw_ConsoleBackground(0, vid.height, true);
Draw_String(0, 0, "Video stream is corrupt\n");
}
else

View file

@ -1010,7 +1010,6 @@ void M_Draw (int uimenu)
#ifdef VM_UI
UI_DrawMenu();
#endif
S_ExtraUpdate ();
}
if (m_state != m_complex)
@ -1029,15 +1028,7 @@ void M_Draw (int uimenu)
if ((!menu_script || scr_con_current) && !m_recursiveDraw)
{
scr_copyeverything = 1;
if (scr_con_current)
{
Draw_ConsoleBackground (vid.height);
S_ExtraUpdate ();
}
else
Draw_FadeScreen ();
Draw_FadeScreen ();
scr_fullupdate = 0;
}
else
@ -1080,8 +1071,6 @@ void M_Draw (int uimenu)
return;
#endif
}
S_ExtraUpdate ();
}
@ -1148,6 +1137,7 @@ void M_Keyup (int key)
// Generic function to choose which game menu to draw
int M_GameType (void)
{
int cached;
int q1, h2, q2;
q1 = COM_FDepthFile("gfx/sp_menu.lmp", true);
@ -1155,16 +1145,13 @@ int M_GameType (void)
q2 = COM_FDepthFile("pics/m_banner_game.pcx", true);
if (q2 < h2 && q2 < q1)
{ //AND QUAKE 2 WINS!!!
return MGT_QUAKE2;
}
cached = MGT_QUAKE2;
else if (h2 < q1)
{ //AND THE WINNER IS HEXEN 2!!!
return MGT_HEXEN2;
}
cached = MGT_HEXEN2;
else
cached = MGT_QUAKE1;
//QUAKE 1 WINS BY DEFAULT!
return MGT_QUAKE1;
return cached;
}

View file

@ -393,6 +393,7 @@ void MP_RegisterCvarsAndCmds(void);
void MP_Keydown(int key);
void MP_Keyup(int key);
#define MGT_BAD ~0
#define MGT_QUAKE1 0
#define MGT_HEXEN2 1
#define MGT_QUAKE2 2

View file

@ -63,7 +63,7 @@ extern void (*Draw_ScalePic) (int x, int y, int width, int height, mpic_t *
extern void (*Draw_SubPic) (int x, int y, mpic_t *pic, int srcx, int srcy, int width, int height);
extern void (*Draw_TransPic) (int x, int y, mpic_t *pic);
extern void (*Draw_TransPicTranslate) (int x, int y, int width, int height, qbyte *image, qbyte *translation);
extern void (*Draw_ConsoleBackground) (int lines);
extern void (*Draw_ConsoleBackground) (int firstline, int lastline, qboolean forceopaque);
extern void (*Draw_EditorBackground) (int lines);
extern void (*Draw_TileClear) (int x, int y, int w, int h);
extern void (*Draw_Fill) (int x, int y, int w, int h, unsigned int c);
@ -178,7 +178,7 @@ typedef struct {
void (*Draw_SubPic) (int x, int y, mpic_t *pic, int srcx, int srcy, int width, int height);
void (*Draw_TransPic) (int x, int y, mpic_t *pic);
void (*Draw_TransPicTranslate) (int x, int y, int w, int h, qbyte *pic, qbyte *translation);
void (*Draw_ConsoleBackground) (int lines);
void (*Draw_ConsoleBackground) (int firstline, int lastline, qboolean forceopaque);
void (*Draw_EditorBackground) (int lines);
void (*Draw_TileClear) (int x, int y, int w, int h);
void (*Draw_Fill) (int x, int y, int w, int h, unsigned int c);

View file

@ -4252,7 +4252,7 @@ float csqcdelta_time;
static csqcedict_t *csqcdelta_playerents[MAX_CLIENTS];
qboolean CLCSQC_DeltaPlayer(int playernum, player_state_t *state)
qboolean CSQC_DeltaPlayer(int playernum, player_state_t *state)
{
func_t func;
@ -4298,7 +4298,7 @@ qboolean CLCSQC_DeltaPlayer(int playernum, player_state_t *state)
return false;
}
void CLCSQC_DeltaStart(float time)
void CSQC_DeltaStart(float time)
{
csqcdelta_pack_t tmp;
csqcdelta_time = time;
@ -4312,7 +4312,7 @@ void CLCSQC_DeltaStart(float time)
csqcdelta_pack_new.readpos = 0;
csqcdelta_pack_old.readpos = 0;
}
qboolean CLCSQC_DeltaUpdate(entity_state_t *src)
qboolean CSQC_DeltaUpdate(entity_state_t *src)
{
//FTE ensures that this function is called with increasing ent numbers each time
func_t func;
@ -4392,7 +4392,7 @@ qboolean CLCSQC_DeltaUpdate(entity_state_t *src)
return false;
}
void CLCSQC_DeltaEnd(void)
void CSQC_DeltaEnd(void)
{
//remove any unreferenced ents stuck on the end
while (csqcdelta_pack_old.readpos < csqcdelta_pack_old.numents)

View file

@ -80,6 +80,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#pragma warning( 4 : 4267) //truncation from const double to float
//#pragma warning(error:4013)
#endif

View file

@ -188,7 +188,7 @@ static cvar_t vid_fullscreen = SCVARF ("vid_fullscreen_embedded", "0",
static cvar_t vid_fullscreen = SCVARF ("vid_fullscreen", "1",
CVAR_ARCHIVE | CVAR_RENDERERLATCH);
#endif
static cvar_t vid_height = SCVARF ("vid_height", "480",
cvar_t vid_height = SCVARF ("vid_height", "480",
CVAR_ARCHIVE | CVAR_RENDERERLATCH);
static cvar_t vid_multisample = SCVARF ("vid_multisample", "0",
CVAR_ARCHIVE | CVAR_RENDERERLATCH);
@ -196,8 +196,9 @@ static cvar_t vid_refreshrate = SCVARF ("vid_displayfrequency", "0",
CVAR_ARCHIVE | CVAR_RENDERERLATCH);
static cvar_t vid_stretch = SCVARF ("vid_stretch", "1",
CVAR_ARCHIVE | CVAR_RENDERERLATCH);
cvar_t vid_wndalpha = SCVAR ("vid_wndalpha", "1");
//more readable defaults to match conwidth/conheight.
static cvar_t vid_width = SCVARF ("vid_width", "640",
cvar_t vid_width = SCVARF ("vid_width", "640",
CVAR_ARCHIVE | CVAR_RENDERERLATCH);
extern cvar_t bul_backcol;
@ -600,6 +601,7 @@ void Renderer_Init(void)
Cvar_Register (&vid_stretch, VIDCOMMANDGROUP);
Cvar_Register (&_windowed_mouse, VIDCOMMANDGROUP);
Cvar_Register (&vid_renderer, VIDCOMMANDGROUP);
Cvar_Register (&vid_wndalpha, VIDCOMMANDGROUP);
#ifdef NPQTV
Cvar_Register (&vid_fullscreen_npqtv, VIDCOMMANDGROUP);
@ -739,7 +741,7 @@ void (*Draw_ScalePic) (int x, int y, int width, int height, mpic_t *pic);
void (*Draw_SubPic) (int x, int y, mpic_t *pic, int srcx, int srcy, int width, int height);
void (*Draw_TransPic) (int x, int y, mpic_t *pic);
void (*Draw_TransPicTranslate) (int x, int y, int w, int h, qbyte *image, qbyte *translation);
void (*Draw_ConsoleBackground) (int lines);
void (*Draw_ConsoleBackground) (int firstline, int lastline, qboolean forceopaque);
void (*Draw_EditorBackground) (int lines);
void (*Draw_TileClear) (int x, int y, int w, int h);
void (*Draw_Fill) (int x, int y, int w, int h, unsigned int c);

View file

@ -96,3 +96,13 @@ void Draw_TextBox (int x, int y, int width, int lines);
qboolean SCR_ScreenShot (char *filename);
void SCR_DrawTwoDimensional(int uimenu, qboolean nohud);
enum
{
LS_NONE,
LS_CONNECTION,
LS_SERVER,
LS_CLIENT,
};
int SCR_GetLoadingStage(void);
void SCR_SetLoadingStage(int stage);

View file

@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h"
cvar_t baseskin = SCVAR("baseskin", "base");
cvar_t baseskin = SCVAR("baseskin", "");
cvar_t noskins = SCVAR("noskins", "0");
extern cvar_t cl_teamskin;
@ -537,6 +537,9 @@ void Skin_NextDownload (void)
if (strchr(sc->skin->name, ' ')) //skip over skins using a space
continue;
if (!*sc->skin->name)
continue;
CL_CheckOrEnqueDownloadFile(va("skins/%s.pcx", sc->skin->name), NULL, 0);
}
@ -595,6 +598,8 @@ void Skin_Skins_f (void)
Skin_NextDownload ();
SCR_SetLoadingStage(LS_NONE);
CL_SendClientCommand(true, "begin %i", cl.servercount);
Cache_Report (); // print remaining memory
}

View file

@ -1271,7 +1271,7 @@ void S_UpdateListener(vec3_t origin, vec3_t forward, vec3_t right, vec3_t up, qb
VectorCopy(right, listener_right);
VectorCopy(up, listener_up);
if (dontmix)
if (!dontmix)
{
S_RunCapture();

View file

@ -114,9 +114,14 @@ void S_StartSoundDelayed(int entnum, int entchannel, sfx_t *sfx, vec3_t origin,
void S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation);
void S_StopSound (int entnum, int entchannel);
void S_StopAllSounds(qboolean clear);
void S_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up);
void S_UpdateListener(vec3_t origin, vec3_t forward, vec3_t right, vec3_t up, qboolean dontmix);
void S_ExtraUpdate (void);
qboolean S_HaveOutput(void);
void S_Music_Clear(sfx_t *onlyifsample);
void S_Music_Seek(float time);
sfx_t *S_PrecacheSound (char *sample);
void S_TouchSound (char *sample);
void S_ClearPrecache (void);

View file

@ -33,7 +33,9 @@ NPNetscapeFuncs *browserfuncs;
#endif
extern HWND sys_hijackwindow;
extern HWND sys_parentwindow;
extern unsigned int sys_parentwidth;
extern unsigned int sys_parentheight;
HINSTANCE global_hInstance;
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
@ -310,6 +312,8 @@ void LoadSplashImage(struct context *ctx, vfsfile_t *f, const char *name)
free(buffer);
if (image)
{
if (ctx->splashdata)
free(ctx->splashdata);
ctx->splashdata = malloc(width*height*4);
for (y = 0; y < height; y++)
{
@ -449,9 +453,9 @@ LRESULT CALLBACK MyPluginWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar
free(str);
}
if (sys_hijackwindow != ctx->window.window)
if (sys_parentwindow != ctx->window.window)
{
if (!sys_hijackwindow)
if (!sys_parentwindow)
{
switch(ctx->qtvf.connectiontype)
{
@ -472,13 +476,14 @@ LRESULT CALLBACK MyPluginWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar
}
}
sys_hijackwindow = ctx->window.window;
if (sys_hijackwindow)
sys_parentwindow = ctx->window.window;
if (sys_parentwindow)
{
Cvar_SetValue(Cvar_FindVar("vid_width"), ctx->window.width);
Cvar_SetValue(Cvar_FindVar("vid_height"), ctx->window.height);
sys_parentwidth = ctx->window.width;
sys_parentheight = ctx->window.height;
Cmd_ExecuteString("vid_restart", RESTRICT_LOCAL);
}
}
else
{
@ -502,7 +507,7 @@ LRESULT CALLBACK MyPluginWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar
{
int argc;
char *argv[16];
sys_hijackwindow = NULL;
sys_parentwindow = NULL;
GetModuleFileName(global_hInstance, binaryname, sizeof(binaryname));
argv[0] = binaryname;
@ -527,14 +532,14 @@ LRESULT CALLBACK MyPluginWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar
argv[argc++] = "-basegame";
argv[argc++] = ctx->gamename;
}
ctx->contextrunning = NPQTV_Sys_Startup(argc, argv);
Cvar_SetValue(Cvar_FindVar("vid_width"), ctx->window.width);
Cvar_SetValue(Cvar_FindVar("vid_height"), ctx->window.height);
sys_parentwidth = ctx->window.width;
sys_parentheight = ctx->window.height;
ctx->contextrunning = NPQTV_Sys_Startup(argc, argv);
if (*ctx->datadownload)
{
if (!FS_FLocateFile("default.cfg", FSLFRT_IFFOUND, NULL) || !FS_FLocateFile("gfx.wad", FSLFRT_IFFOUND, NULL))
if (!FS_FLocateFile("default.cfg", FSLFRT_IFFOUND, NULL) && !FS_FLocateFile("gfx.wad", FSLFRT_IFFOUND, NULL))
{
browserfuncs->geturlnotify(ctx->nppinstance, ctx->datadownload, NULL, &UnpackAndExtractPakFiles);
ctx->waitingfordatafiles++;
@ -576,7 +581,7 @@ LRESULT CALLBACK MyPluginWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar
EndPaint(hWnd, &paint);
return TRUE;
}
else if (!ctx->contextrunning)
else
{
HDC hdc;
PAINTSTRUCT paint;
@ -585,17 +590,20 @@ LRESULT CALLBACK MyPluginWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar
hdc = BeginPaint(hWnd, &paint);
DrawWndBack(ctx, hWnd, hdc, &paint);
SetBkMode(hdc, TRANSPARENT);
if (!activecontext)
if (!ctx->contextrunning)
{
s = "Click to activate";
TextOutA(hdc, 0, 0, s, strlen(s));
}
if (ctx->availver)
{
s = va("Your plugin is out of date");
TextOutA(hdc, 0, 16, s, strlen(s));
s = va("Version %3.1f is available", ctx->availver);
TextOutA(hdc, 0, 32, s, strlen(s));
if (!activecontext)
{
s = "Click to activate";
TextOutA(hdc, 0, 0, s, strlen(s));
}
if (ctx->availver)
{
s = va("Your plugin is out of date");
TextOutA(hdc, 0, 16, s, strlen(s));
s = va("Version %3.1f is available", ctx->availver);
TextOutA(hdc, 0, 32, s, strlen(s));
}
}
EndPaint(hWnd, &paint);
return TRUE;
@ -608,7 +616,7 @@ LRESULT CALLBACK MyPluginWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar
activecontext = ctx;
InvalidateRgn(hWnd, NULL, FALSE);
}
else
else if (activecontext != ctx)
Cbuf_AddText("quit\n", RESTRICT_LOCAL);
break;
default:
@ -654,7 +662,7 @@ NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
//parse out the properties
for (i = 0; i < argc; i++)
{
if (!stricmp(argn[i], "datadownload"))
if (!stricmp(argn[i], "dataDownload"))
{
Q_strncpyz(ctx->datadownload, argv[i], sizeof(ctx->datadownload));
}
@ -666,19 +674,41 @@ NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
if (!strstr(argn[i], ":"))
Q_strncpyz(ctx->gamename, argv[i], sizeof(ctx->gamename));
}
else if (!stricmp(argn[i], "onstart"))
else if (!stricmp(argn[i], "connType"))
{
if (!stricmp(argn[i], "join"))
ctx->qtvf.connectiontype = QTVCT_JOIN;
else if (!stricmp(argn[i], "qtv"))
ctx->qtvf.connectiontype = QTVCT_STREAM;
else if (!stricmp(argn[i], "connect"))
ctx->qtvf.connectiontype = QTVCT_CONNECT;
else if (!stricmp(argn[i], "join"))
ctx->qtvf.connectiontype = QTVCT_JOIN;
else if (!stricmp(argn[i], "observe"))
ctx->qtvf.connectiontype = QTVCT_OBSERVE;
else
ctx->qtvf.connectiontype = QTVCT_NONE;
}
else if (!stricmp(argn[i], "server") || !stricmp(argn[i], "stream"))
Q_strncpyz(ctx->qtvf.server, argv[i], sizeof(ctx->qtvf.server));
else if (!stricmp(argn[i], "splash"))
{
Q_strncpyz(ctx->qtvf.splashscreen, argv[i], sizeof(ctx->qtvf.splashscreen));
browserfuncs->geturlnotify(ctx->nppinstance, ctx->qtvf.splashscreen, NULL, &SplashscreenImageDescriptor);
}
else if (!stricmp(argn[i], "onStart"))
{
ctx->onstart = strdup(argv[i]);
}
else if (!stricmp(argn[i], "onend"))
else if (!stricmp(argn[i], "onEnd"))
{
ctx->onend = strdup(argv[i]);
}
else if (!stricmp(argn[i], "ondemoend"))
else if (!stricmp(argn[i], "onDemoEnd"))
{
ctx->ondemoend = strdup(argv[i]);
}
else if (!stricmp(argn[i], "availver"))
else if (!stricmp(argn[i], "availVer"))
{
ctx->availver = atof(argv[i]);
if (ctx->availver <= NPQTV_VERSION)
@ -689,9 +719,13 @@ NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
if (atoi(argv[i]) && !activecontext)
activecontext = ctx;
}
}
if (!*ctx->qtvf.server)
ctx->qtvf.connectiontype = QTVCT_NONE;
else if (ctx->qtvf.connectiontype == QTVCT_NONE)
ctx->qtvf.connectiontype = QTVCT_STREAM;
//add it to the linked list
ctx->next = contextlist;
contextlist = ctx;
@ -738,7 +772,7 @@ NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save)
if (ctx == activecontext)
{
activecontext = NULL;
sys_hijackwindow = NULL;
sys_parentwindow = NULL;
}
free(ctx);
@ -748,6 +782,7 @@ NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save)
}
NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window)
{
extern cvar_t vid_width;
struct context *ctx = instance->pdata;
#ifdef _WIN32
@ -778,17 +813,21 @@ NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window)
SetWindowLongPtr(ctx->window.window, GWL_WNDPROC, (LONG_PTR)MyPluginWndProc);
SetWindowLongPtr(ctx->window.window, GWL_USERDATA, (LONG_PTR)ctx);
if (ctx->contextrunning && mainwindow && oldwindow == sys_hijackwindow)
if (ctx->contextrunning && mainwindow && oldwindow == sys_parentwindow)
{
sys_hijackwindow = ctx->window.window;
sys_parentwindow = ctx->window.window;
SetParent(mainwindow, ctx->window.window);
oldwindow = sys_hijackwindow;
oldwindow = sys_parentwindow;
}
}
if (ctx->contextrunning && mainwindow && oldwindow == sys_hijackwindow)
MoveWindow(mainwindow, 0, 0, ctx->window.width, ctx->window.height, FALSE);
if (ctx->contextrunning)
{
sys_parentwidth = ctx->window.width;
sys_parentheight = ctx->window.height;
Cvar_ForceCallback(&vid_width);
}
InvalidateRgn(ctx->window.window, NULL, FALSE);
#endif
@ -865,8 +904,6 @@ NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream,
ctx->donestreams = qstr;
}
//CL_QTVPlay(pipe, false);
return NPERR_NO_ERROR;
}
int32 NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream)

View file

@ -41,7 +41,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
qboolean isDedicated = false;
#endif
HWND sys_hijackwindow;
HWND sys_parentwindow;
unsigned int sys_parentwidth; //valid if sys_parentwindow is set
unsigned int sys_parentheight;
void Sys_CloseLibrary(dllhandle_t *lib)
{

View file

@ -62,7 +62,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern HINSTANCE global_hInstance;
extern int global_nCmdShow;
extern HWND sys_hijackwindow;
extern HWND sys_parentwindow;
extern unsigned int sys_parentwidth;
extern unsigned int sys_parentheight;
#ifndef SERVERONLY

View file

@ -342,6 +342,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define VARGS
#endif
#ifdef _WIN32
#define ZEXPORT VARGS
#define ZEXPORTVA VARGS
#endif
// !!! if this is changed, it must be changed in d_ifacea.h too !!!
#define CACHE_SIZE 32 // used to align key data structures

View file

@ -336,7 +336,7 @@ typedef struct vfsfile_s {
#define VFS_FLUSH(vf) do{if(vf->Flush)vf->Flush(vf);}while(0)
#define VFS_PUTS(vf,s) do{const char *t=s;vf->WriteBytes(vf,t,strlen(t));}while(0)
char *VFS_GETS(vfsfile_t *vf, char *buffer, int buflen);
void VFS_PRINTF(vfsfile_t *vf, char *fmt, ...);
void VARGS VFS_PRINTF(vfsfile_t *vf, char *fmt, ...);
enum fs_relative{
FS_GAME, //standard search (not generally valid for save/rename/delete/etc)
@ -351,6 +351,7 @@ void FS_CreatePath(const char *pname, enum fs_relative relativeto);
int FS_Rename(const char *oldf, const char *newf, enum fs_relative relativeto); //0 on success, non-0 on error
int FS_Rename2(const char *oldf, const char *newf, enum fs_relative oldrelativeto, enum fs_relative newrelativeto);
int FS_Remove(const char *fname, enum fs_relative relativeto); //0 on success, non-0 on error
qboolean FS_Copy(const char *source, const char *dest, enum fs_relative relativesource, enum fs_relative relativedest);
qboolean FS_NativePath(const char *fname, enum fs_relative relativeto, char *out, int outlen); //if you really need to fopen yourself
qboolean FS_WriteFile (const char *filename, const void *data, int len, enum fs_relative relativeto);
vfsfile_t *FS_OpenVFS(const char *filename, const char *mode, enum fs_relative relativeto);

View file

@ -83,7 +83,7 @@ char *VFS_GETS(vfsfile_t *vf, char *buffer, int buflen)
return buffer;
}
void VFS_PRINTF(vfsfile_t *vf, char *format, ...)
void VARGS VFS_PRINTF(vfsfile_t *vf, char *format, ...)
{
va_list argptr;
char string[1024];

View file

@ -3,10 +3,6 @@
#ifdef AVAIL_ZLIB
#ifndef ZEXPORT
#define ZEXPORT VARGS
#endif
#include <zlib.h>
#include "unzip.c"

View file

@ -117,6 +117,9 @@ typedef struct plugin_s {
int blockcloses;
void *inputptr;
unsigned int inputbytes;
int tick;
int executestring;
#ifndef SERVERONLY
@ -127,6 +130,9 @@ typedef struct plugin_s {
//protocol-in-a-plugin
int connectionlessclientpacket;
//called to discolour console input text if they spelt it wrongly
int spellcheckmaskedtext;
#endif
int svmsgfunction;
int chatmsgfunction;
@ -386,6 +392,8 @@ int VARGS Plug_ExportToEngine(void *offset, unsigned int mask, const int *arg)
currentplug->chatmsgfunction = functionid;
else if (!strcmp(name, "CenterPrintMessage"))
currentplug->centerprintfunction = functionid;
else if (!strcmp(name, "SpellCheckMaskedText"))
currentplug->spellcheckmaskedtext = functionid;
#endif
else
return 0;
@ -1330,6 +1338,25 @@ int VARGS Plug_Net_Close(void *offset, unsigned int mask, const int *arg)
return 0;
}
int VARGS Plug_ReadInputBuffer(void *offset, unsigned int mask, const int *arg)
{
void *buffer = VM_POINTER(arg[0]);
int bufferlen = VM_LONG(arg[1]);
if (bufferlen > currentplug->inputbytes)
bufferlen = currentplug->inputbytes;
memcpy(buffer, currentplug->inputptr, currentplug->inputbytes);
return bufferlen;
}
int VARGS Plug_UpdateInputBuffer(void *offset, unsigned int mask, const int *arg)
{
void *buffer = VM_POINTER(arg[0]);
int bufferlen = VM_LONG(arg[1]);
if (bufferlen > currentplug->inputbytes)
bufferlen = currentplug->inputbytes;
memcpy(currentplug->inputptr, buffer, currentplug->inputbytes);
return bufferlen;
}
void Plug_CloseAll_f(void);
void Plug_List_f(void);
void Plug_Close_f(void);
@ -1437,7 +1464,8 @@ void Plug_Init(void)
Plug_RegisterBuiltin("cos", Plug_cos, 0);
Plug_RegisterBuiltin("atan2", Plug_atan2, 0);
Plug_RegisterBuiltin("GetPluginName", Plug_GetPluginName, 0);
Plug_RegisterBuiltin("ReadInputBuffer", Plug_ReadInputBuffer, 0);
Plug_RegisterBuiltin("UpdateInputBuffer", Plug_UpdateInputBuffer, 0);
Plug_Client_Init();
@ -1511,6 +1539,23 @@ void Plug_SubConsoleCommand(console_t *con, char *line)
VM_Call(currentplug->vm, currentplug->conexecutecommand, 0);
currentplug = oldplug;
}
void Plug_SpellCheckMaskedText(unsigned int *maskedstring, int maskedchars, int x, int y, int cs, int firstc, int charlimit)
{
plugin_t *oldplug = currentplug;
for (currentplug = plugs; currentplug; currentplug = currentplug->next)
{
if (currentplug->spellcheckmaskedtext)
{
currentplug->inputptr = maskedstring;
currentplug->inputbytes = sizeof(*maskedstring)*maskedchars;
VM_Call(currentplug->vm, currentplug->spellcheckmaskedtext, x, y, cs, firstc, charlimit);
currentplug->inputptr = NULL;
currentplug->inputbytes = 0;
}
}
currentplug = oldplug;
}
#endif
#ifndef SERVERONLY

View file

@ -1393,21 +1393,28 @@ void PF_vtos (progfuncs_t *prinst, struct globalvars_s *pr_globals)
RETURN_TSTRING(pr_string_temp);
}
#pragma message("this should use something more... less hacky")
void PF_forgetstring(progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
char *s=PR_GetStringOfs(prinst, OFS_PARM0);
s-=8;
if (((int *)s)[0] != PRSTR)
char *s=PR_RemoveProgsString(prinst, G_INT(OFS_PARM0));
if (!s)
{
Con_Printf("QC tried to free a non allocated string: ");
Con_Printf("%s\n", s+8); //two prints, so that logged prints ensure the first is written.
Con_Printf("string was not strzoned\n");
(*prinst->pr_trace) = 1;
return;
}
// char *s=PR_GetStringOfs(prinst, OFS_PARM0);
s-=8;
if (!((int *)s)[0] != PRSTR)
{
Con_Printf("QC tried to free a non dynamic string: ");
Con_Printf("%s\n", s); //two prints, so that logged prints ensure the first is written.
(*prinst->pr_trace) = 1;
PR_StackTrace(prinst);
return;
}
((int *)s)[0] = 0xabcd1234;
Z_TagFree(s);
}
void PF_dupstring(progfuncs_t *prinst, struct globalvars_s *pr_globals) //frik_file

View file

@ -5,6 +5,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ftequake", "ftequake.vcproj
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gas2masm", "gas2masm.vcproj", "{382E6790-D1CA-48F5-8E53-D114635EB61D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "npqtv", "npqtv.vcproj", "{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
D3DDebug|Win32 = D3DDebug|Win32
@ -128,6 +130,48 @@ Global
{382E6790-D1CA-48F5-8E53-D114635EB61D}.Release|Win32.Build.0 = Debug|Win32
{382E6790-D1CA-48F5-8E53-D114635EB61D}.Release|x64.ActiveCfg = Debug|x64
{382E6790-D1CA-48F5-8E53-D114635EB61D}.Release|x64.Build.0 = Debug|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.D3DDebug|Win32.ActiveCfg = SWRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.D3DDebug|x64.ActiveCfg = SWRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.D3DDebug|x64.Build.0 = SWRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Debug Dedicated Server|Win32.ActiveCfg = SWRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Debug Dedicated Server|x64.ActiveCfg = SWRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Debug Dedicated Server|x64.Build.0 = SWRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Debug|Win32.ActiveCfg = SWDebug|Win32
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Debug|Win32.Build.0 = SWDebug|Win32
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Debug|x64.ActiveCfg = SWDebug|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Debug|x64.Build.0 = SWDebug|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.GLDebug|Win32.ActiveCfg = GLDebug|Win32
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.GLDebug|Win32.Build.0 = GLDebug|Win32
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.GLDebug|x64.ActiveCfg = GLDebug|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.GLDebug|x64.Build.0 = GLDebug|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.GLRelease|Win32.ActiveCfg = GLRelease|Win32
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.GLRelease|Win32.Build.0 = GLRelease|Win32
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.GLRelease|x64.ActiveCfg = GLRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.GLRelease|x64.Build.0 = GLRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MDebug|Win32.ActiveCfg = GLDebug|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MDebug|x64.ActiveCfg = SWRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MDebug|x64.Build.0 = SWRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MinGLDebug|Win32.ActiveCfg = GLDebug|Win32
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MinGLDebug|Win32.Build.0 = GLDebug|Win32
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MinGLDebug|x64.ActiveCfg = GLDebug|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MinGLDebug|x64.Build.0 = GLDebug|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MinGLRelease|Win32.ActiveCfg = GLRelease|Win32
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MinGLRelease|Win32.Build.0 = GLRelease|Win32
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MinGLRelease|x64.ActiveCfg = GLRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MinGLRelease|x64.Build.0 = GLRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MinSW|Win32.ActiveCfg = GLRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MinSW|x64.ActiveCfg = GLRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MinSW|x64.Build.0 = GLRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MRelease|Win32.ActiveCfg = GLRelease|Win32
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MRelease|x64.ActiveCfg = SWRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MRelease|x64.Build.0 = SWRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Release Dedicated Server|Win32.ActiveCfg = SWRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Release Dedicated Server|x64.ActiveCfg = SWRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Release Dedicated Server|x64.Build.0 = SWRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Release|Win32.ActiveCfg = SWRelease|Win32
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Release|Win32.Build.0 = SWRelease|Win32
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Release|x64.ActiveCfg = SWRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Release|x64.Build.0 = SWRelease|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View file

@ -6637,6 +6637,46 @@
<File
RelativePath="..\server\svhl_game.c"
>
<FileConfiguration
Name="MinGLDebug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="D3DDebug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="MinSW|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="MinGLRelease|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="GLDebug|Win32"
>
@ -6645,10 +6685,98 @@
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Release Dedicated Server|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="MRelease|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug Dedicated Server|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="MDebug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="GLRelease|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\server\svhl_phys.c"
>
<FileConfiguration
Name="MinGLDebug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="D3DDebug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="MinSW|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="MinGLRelease|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="GLDebug|Win32"
>
@ -6657,10 +6785,98 @@
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Release Dedicated Server|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="MRelease|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug Dedicated Server|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="MDebug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="GLRelease|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\server\svhl_world.c"
>
<FileConfiguration
Name="MinGLDebug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="D3DDebug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="MinSW|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="MinGLRelease|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="GLDebug|Win32"
>
@ -6669,6 +6885,54 @@
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Release Dedicated Server|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="MRelease|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug Dedicated Server|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="MDebug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
<FileConfiguration
Name="GLRelease|Win32"
>
<Tool
Name="VCCLCompilerTool"
PrecompiledHeaderThrough="qwsvdef.h"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\server\svq2_ents.c"
@ -7203,7 +7467,6 @@
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
@ -7285,7 +7548,6 @@
</FileConfiguration>
<FileConfiguration
Name="Release Dedicated Server|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
@ -7325,7 +7587,6 @@
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"

View file

@ -108,7 +108,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /G5 /W3 /GX /ZI /Od /I "..\client" /I "../common" /I "../server" /I "../gl" /I "../sw" /I "../qclib" /I "../libs" /I "../libs/dxsdk7/include" /D "_DEBUG" /D "GLQUAKE" /D "WIN32" /D "_WINDOWS" /FR".\GLDebug/" /Fp".\GLDebug/qwcl.pch" /Yu"quakedef.h" /Fo".\GLDebug/" /Fd".\GLDebug/" /FD /c
# ADD CPP /nologo /G5 /MT /W3 /GX /ZI /Od /I "..\client" /I "../common" /I "../server" /I "../gl" /I "../sw" /I "../qclib" /I "../libs" /I "../libs/dxsdk7/include" /D "_DEBUG" /D "GLQUAKE" /D "WIN32" /D "_WINDOWS" /FR".\GLDebug/" /Fp".\GLDebug/qwcl.pch" /Yu"quakedef.h" /Fo".\GLDebug/" /Fd".\GLDebug/" /FD /c
# SUBTRACT CPP /X
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
@ -147,7 +147,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 comctl32.lib ..\dxsdk\sdk\lib\dxguid.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /machine:I386 /out:"../../../fteqw.exe"
# ADD LINK32 comctl32.lib wsock32.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /pdb:none /map /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"../../fteglqw.exe" /libpath:"../libs/dxsdk7/lib"
# ADD LINK32 comctl32.lib wsock32.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /pdb:none /map /machine:I386 /nodefaultlib:"msvcrt" /nodefaultlib:"libc" /out:"../../fteglqw.exe" /libpath:"../libs/dxsdk7/lib"
# SUBTRACT LINK32 /debug
!ELSEIF "$(CFG)" == "ftequake - Win32 MDebug"
@ -551,191 +551,17 @@ SOURCE=..\server\sv_user.c
# Begin Source File
SOURCE=..\server\svhl_game.c
!IF "$(CFG)" == "ftequake - Win32 Release"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 MDebug"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 MRelease"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLDebug"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLRelease"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated Server"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 Release Dedicated Server"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 MinSW"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebugQ3"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated ServerQ3"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 D3DDebug"
# ADD CPP /Yu"qwsvdef.h"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\server\svhl_phys.c
!IF "$(CFG)" == "ftequake - Win32 Release"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 MDebug"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 MRelease"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLDebug"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLRelease"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated Server"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 Release Dedicated Server"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 MinSW"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebugQ3"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated ServerQ3"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 D3DDebug"
# ADD CPP /Yu"qwsvdef.h"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\server\svhl_world.c
!IF "$(CFG)" == "ftequake - Win32 Release"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 MDebug"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 MRelease"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLDebug"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLRelease"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated Server"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 Release Dedicated Server"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 MinSW"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebugQ3"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated ServerQ3"
# ADD CPP /Yu"qwsvdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 D3DDebug"
# ADD CPP /Yu"qwsvdef.h"
!ENDIF
# End Source File
# Begin Source File
@ -6539,7 +6365,7 @@ SOURCE=..\qclib\execloop.h
!IF "$(CFG)" == "ftequake - Win32 Release"
# Begin Custom Build
InputDir=\engine\qclib
InputDir=\Quake\ftesrc\engine\QCLIB
InputPath=..\qclib\execloop.h
BuildCmds= \
@ -6561,7 +6387,7 @@ BuildCmds= \
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug"
# Begin Custom Build
InputDir=\engine\qclib
InputDir=\Quake\ftesrc\engine\QCLIB
InputPath=..\qclib\execloop.h
BuildCmds= \
@ -6583,7 +6409,7 @@ BuildCmds= \
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
# Begin Custom Build
InputDir=\engine\qclib
InputDir=\Quake\ftesrc\engine\QCLIB
InputPath=..\qclib\execloop.h
BuildCmds= \
@ -6605,7 +6431,7 @@ BuildCmds= \
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
# Begin Custom Build
InputDir=\engine\qclib
InputDir=\Quake\ftesrc\engine\QCLIB
InputPath=..\qclib\execloop.h
BuildCmds= \
@ -6627,7 +6453,7 @@ BuildCmds= \
!ELSEIF "$(CFG)" == "ftequake - Win32 MDebug"
# Begin Custom Build
InputDir=\engine\qclib
InputDir=\Quake\ftesrc\engine\QCLIB
InputPath=..\qclib\execloop.h
BuildCmds= \
@ -6649,7 +6475,7 @@ BuildCmds= \
!ELSEIF "$(CFG)" == "ftequake - Win32 MRelease"
# Begin Custom Build
InputDir=\engine\qclib
InputDir=\Quake\ftesrc\engine\QCLIB
InputPath=..\qclib\execloop.h
BuildCmds= \
@ -6671,7 +6497,7 @@ BuildCmds= \
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLDebug"
# Begin Custom Build
InputDir=\engine\qclib
InputDir=\Quake\ftesrc\engine\QCLIB
InputPath=..\qclib\execloop.h
BuildCmds= \
@ -6693,7 +6519,7 @@ BuildCmds= \
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLRelease"
# Begin Custom Build
InputDir=\engine\qclib
InputDir=\Quake\ftesrc\engine\QCLIB
InputPath=..\qclib\execloop.h
BuildCmds= \
@ -6715,7 +6541,7 @@ BuildCmds= \
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated Server"
# Begin Custom Build
InputDir=\engine\qclib
InputDir=\Quake\ftesrc\engine\QCLIB
InputPath=..\qclib\execloop.h
BuildCmds= \
@ -6737,7 +6563,7 @@ BuildCmds= \
!ELSEIF "$(CFG)" == "ftequake - Win32 Release Dedicated Server"
# Begin Custom Build
InputDir=\engine\qclib
InputDir=\Quake\ftesrc\engine\QCLIB
InputPath=..\qclib\execloop.h
BuildCmds= \
@ -6759,7 +6585,7 @@ BuildCmds= \
!ELSEIF "$(CFG)" == "ftequake - Win32 MinSW"
# Begin Custom Build
InputDir=\engine\qclib
InputDir=\Quake\ftesrc\engine\QCLIB
InputPath=..\qclib\execloop.h
BuildCmds= \
@ -6781,7 +6607,7 @@ BuildCmds= \
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebugQ3"
# Begin Custom Build
InputDir=\engine\qclib
InputDir=\Quake\ftesrc\engine\QCLIB
InputPath=..\qclib\execloop.h
BuildCmds= \
@ -6803,7 +6629,7 @@ BuildCmds= \
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated ServerQ3"
# Begin Custom Build
InputDir=\engine\qclib
InputDir=\Quake\ftesrc\engine\QCLIB
InputPath=..\qclib\execloop.h
BuildCmds= \
@ -6825,7 +6651,7 @@ BuildCmds= \
!ELSEIF "$(CFG)" == "ftequake - Win32 D3DDebug"
# Begin Custom Build
InputDir=\engine\qclib
InputDir=\Quake\ftesrc\engine\QCLIB
InputPath=..\qclib\execloop.h
BuildCmds= \

View file

@ -14,6 +14,9 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name gas2masm
End Project Dependency
Begin Project Dependency
Project_Dep_Name spellcheck
End Project Dependency
}}}
###############################################################################
@ -60,7 +63,7 @@ Package=<4>
###############################################################################
Project: "q3asm2"=..\..\Q3ASM2\q3asm2.dsp - Package Owner=<4>
Project: "q3asm2"=..\..\..\Q3ASM2\q3asm2.dsp - Package Owner=<4>
Package=<5>
{{{
@ -96,6 +99,18 @@ Package=<4>
###############################################################################
Project: "spellcheck"=..\..\plugins\spellcheck\spellcheck.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>

View file

@ -7,7 +7,7 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
#include "windows.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

View file

@ -793,6 +793,14 @@ void GLDraw_ReInit (void)
lightmap_textures=NULL;
filmtexture=0;
glmenu_numcachepics=0;
draw_mesh.numvertexes = 4;
draw_mesh.numindexes = 6;
draw_mesh.xyz_array = draw_mesh_xyz;
draw_mesh.st_array = draw_mesh_st;
draw_mesh.colors_array = NULL;
draw_mesh.indexes = r_quad_indexes;
#ifdef Q3SHADERS
r_fogtexture=0;
#endif
@ -1911,17 +1919,16 @@ Draw_ConsoleBackground
================
*/
void GLDraw_ConsoleBackground (int lines)
void GLDraw_ConsoleBackground (int firstline, int lastline, qboolean forceopaque)
{
// char ver[80];
// int x, i;
float a;
extern qboolean scr_con_forcedraw;
conback->width = vid.conwidth;
conback->height = vid.conheight;
if (scr_con_forcedraw)
if (forceopaque)
{
a = 1; // console background is necessary
}
@ -1943,7 +1950,7 @@ void GLDraw_ConsoleBackground (int lines)
if (shader_console)
{
currententity = &r_worldentity;
GLDraw_ShaderPic(0, lines - conback->height, vid.width, vid.height, shader_console, 1, 1, 1, a);
GLDraw_ShaderPic(0, lastline - conback->height, vid.width, vid.height, shader_console, 1, 1, 1, a);
qglBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
return;
}
@ -1952,11 +1959,11 @@ void GLDraw_ConsoleBackground (int lines)
if (a >= 1)
{
qglColor3f (1,1,1);
GLDraw_Pic(0, lines-conback->height, conback);
GLDraw_Pic(0, lastline-conback->height, conback);
}
else
{
GLDraw_AlphaPic (0, lines - conback->height, conback, a);
GLDraw_AlphaPic (0, lastline - conback->height, conback, a);
}
}

View file

@ -34,7 +34,7 @@ void GLDraw_Pic (int x, int y, mpic_t *pic);
void GLDraw_ScalePic (int x, int y, int width, int height, mpic_t *pic);
void GLDraw_TransPic (int x, int y, mpic_t *pic);
void GLDraw_TransPicTranslate (int x, int y, int w, int h, qbyte *pic, qbyte *translation);
void GLDraw_ConsoleBackground (int lines);
void GLDraw_ConsoleBackground (int firstline, int lastline, qboolean forceopaque);
void GLDraw_EditorBackground (int lines);
void GLDraw_BeginDisc (void);
void GLDraw_EndDisc (void);

View file

@ -159,6 +159,7 @@ void GLSCR_UpdateScreen (void)
extern qboolean editormodal;
#endif
qboolean nohud;
qboolean noworld;
RSpeedMark();
if (block_drawing)
@ -249,6 +250,7 @@ void GLSCR_UpdateScreen (void)
//
SCR_SetUpToDrawConsole ();
noworld = false;
nohud = false;
#ifdef VM_CG
@ -261,10 +263,14 @@ void GLSCR_UpdateScreen (void)
nohud = true;
else
#endif
if (r_worldentity.model && uimenu != 1)
if (uimenu != 1)
{
V_RenderView ();
// Q1BSP_TestClipDecal();
if (r_worldentity.model && cls.state == ca_active)
V_RenderView ();
else
{
noworld = true;
}
}
else
GL_DoSwap();
@ -273,7 +279,27 @@ void GLSCR_UpdateScreen (void)
GLR_BrightenScreen();
if (!nohud)
if (noworld)
{
extern char levelshotname[];
if ((key_dest == key_console || key_dest == key_game) && SCR_GetLoadingStage() == LS_NONE)
scr_con_current = vid.height;
//draw the levelshot or the conback fullscreen
if (*levelshotname)
{
if(Draw_ScalePic)
Draw_ScalePic(0, 0, vid.width, vid.height, Draw_SafeCachePic (levelshotname));
else
Draw_ConsoleBackground(0, vid.height, true);
}
else
Draw_ConsoleBackground(0, vid.height, true);
nohud = true;
}
else if (!nohud)
SCR_TileClear ();
SCR_DrawTwoDimensional(uimenu, nohud);

View file

@ -65,6 +65,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define WM_INPUT 255
#endif
#ifndef WS_EX_LAYERED
#define WS_EX_LAYERED 0x00080000
#define LWA_ALPHA 0x00000002
#endif
typedef BOOL (WINAPI *lpfnSetLayeredWindowAttributes)(HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags);
extern cvar_t vid_conwidth, vid_conautoscale;
@ -79,6 +85,10 @@ extern cvar_t vid_conwidth, vid_conautoscale;
#define BASEWIDTH 320
#define BASEHEIGHT 200
extern cvar_t vid_width;
extern cvar_t vid_height;
extern cvar_t vid_wndalpha;
typedef enum {MS_WINDOWED, MS_FULLSCREEN, MS_FULLDIB, MS_UNINIT} modestate_t;
#ifdef USE_D3D
@ -143,7 +153,7 @@ LONG WINAPI GLMainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
qboolean GLAppActivate(BOOL fActive, BOOL minimize);
char *VID_GetModeDescription (int mode);
void ClearAllStates (void);
void VID_UpdateWindowStatus (void);
void VID_UpdateWindowStatus (HWND hWnd);
void GL_Init(void *(*getglfunction) (char *name));
typedef void (APIENTRY *lp3DFXFUNC) (int, int, int, int, int, const void*);
@ -349,14 +359,26 @@ qboolean VID_SetWindowedMode (rendererstate_t *info)
WindowRect.right = info->width;
WindowRect.bottom = info->height;
DIBWidth = info->width;
DIBHeight = info->height;
if (sys_hijackwindow)
if (sys_parentwindow)
{
SetWindowLong(sys_hijackwindow, GWL_STYLE, GetWindowLong(sys_hijackwindow, GWL_STYLE)|WS_OVERLAPPED);
SetWindowLong(sys_parentwindow, GWL_STYLE, GetWindowLong(sys_parentwindow, GWL_STYLE)|WS_OVERLAPPED);
WindowStyle = WS_CHILDWINDOW|WS_OVERLAPPED;
ExWindowStyle = 0;
if (info->width > sys_parentwidth)
WindowRect.right = sys_parentwidth;
else if (info->width < sys_parentwidth)
WindowRect.left = (sys_parentwidth - info->width)/2;
if (info->height > sys_parentheight)
WindowRect.bottom = sys_parentheight;
else if (info->height < sys_parentheight)
WindowRect.top = (sys_parentheight - info->height)/2;
WindowRect.right += WindowRect.left;
WindowRect.bottom += WindowRect.top;
}
else
{
@ -367,6 +389,9 @@ qboolean VID_SetWindowedMode (rendererstate_t *info)
WindowStyle |= WS_SIZEBOX | WS_MAXIMIZEBOX;
}
DIBWidth = WindowRect.right - WindowRect.left;
DIBHeight = WindowRect.bottom - WindowRect.top;
rect = WindowRect;
AdjustWindowRectEx(&rect, WindowStyle, FALSE, 0);
@ -382,7 +407,7 @@ qboolean VID_SetWindowedMode (rendererstate_t *info)
rect.left, rect.top,
wwidth,
wheight,
sys_hijackwindow,
sys_parentwindow,
NULL,
global_hInstance,
NULL);
@ -393,8 +418,30 @@ qboolean VID_SetWindowedMode (rendererstate_t *info)
return false;
}
if (!sys_hijackwindow)
if (!sys_parentwindow)
{
#ifdef WS_EX_LAYERED
int av;
av = 255*vid_wndalpha.value;
if (av < 70)
av = 70;
if (av < 255)
{
HMODULE hm = GetModuleHandle("user32.dll");
lpfnSetLayeredWindowAttributes pSetLayeredWindowAttributes;
pSetLayeredWindowAttributes = (void*)GetProcAddress(hm, "SetLayeredWindowAttributes");
if (pSetLayeredWindowAttributes)
{
// Set WS_EX_LAYERED on this window
SetWindowLong(dibwindow, GWL_EXSTYLE, GetWindowLong(dibwindow, GWL_EXSTYLE) | WS_EX_LAYERED);
// Make this window 70% alpha
pSetLayeredWindowAttributes(dibwindow, 0, av, LWA_ALPHA);
}
}
#endif
// Center and show the DIB window
CenterWindow(dibwindow, WindowRect.right - WindowRect.left,
WindowRect.bottom - WindowRect.top, false);
@ -675,7 +722,7 @@ int GLVID_SetMode (rendererstate_t *info, unsigned char *palette)
window_width = DIBWidth;
window_height = DIBHeight;
VID_UpdateWindowStatus ();
VID_UpdateWindowStatus (mainwindow);
CDAudio_Resume ();
scr_disabled_for_loading = temp;
@ -783,8 +830,28 @@ void VID_UnSetMode (void)
VID_UpdateWindowStatus
================
*/
void VID_UpdateWindowStatus (void)
void VID_UpdateWindowStatus (HWND hWnd)
{
POINT p;
RECT nr;
GetClientRect(hWnd, &nr);
//if its bad then we're probably minimised
if (nr.right <= nr.left)
return;
if (nr.bottom <= nr.top)
return;
WindowRect = nr;
p.x = 0;
p.y = 0;
ClientToScreen(hWnd, &p);
window_x = p.x;
window_y = p.y;
window_width = WindowRect.right - WindowRect.left;
window_height = WindowRect.bottom - WindowRect.top;
glwidth = window_width;
glheight = window_height;
window_rect.left = window_x;
window_rect.top = window_y;
@ -919,6 +986,62 @@ void VID_Wait_Override_Callback(struct cvar_s *var, char *oldvalue)
qwglSwapIntervalEXT(_vid_wait_override.value);
}
void VID_Size_Override_Callback(struct cvar_s *var, char *oldvalue)
{
int nw = vid_width.value;
int nh = vid_height.value;
int nx = 0;
int ny = 0;
if (sys_parentwindow && modestate==MS_WINDOWED)
{
if (nw > sys_parentwidth)
nw = sys_parentwidth;
else
nx = (sys_parentwidth - nw)/2;
if (nh > sys_parentheight)
nh = sys_parentheight;
else
ny = (sys_parentheight - nh)/2;
MoveWindow(mainwindow, nx, ny, nw, nh, FALSE);
}
}
void VID_WndAlpha_Override_Callback(struct cvar_s *var, char *oldvalue)
{
#ifdef GWL_EXSTYLE
if (modestate==MS_WINDOWED)
{
int av;
HMODULE hm = GetModuleHandle("user32.dll");
lpfnSetLayeredWindowAttributes pSetLayeredWindowAttributes;
pSetLayeredWindowAttributes = (void*)GetProcAddress(hm, "SetLayeredWindowAttributes");
av = 255 * var->value;
if (av < 70)
av = 70;
if (av > 255)
av = 255;
if (pSetLayeredWindowAttributes)
{
// Set WS_EX_LAYERED on this window
if (av < 255)
{
SetWindowLong(mainwindow, GWL_EXSTYLE, GetWindowLong(mainwindow, GWL_EXSTYLE) | WS_EX_LAYERED);
// Make this window 70% alpha
pSetLayeredWindowAttributes(mainwindow, 0, av, LWA_ALPHA);
}
else
SetWindowLong(mainwindow, GWL_EXSTYLE, GetWindowLong(mainwindow, GWL_EXSTYLE) & ~WS_EX_LAYERED);
}
}
#endif
}
qboolean screenflush;
void GL_DoSwap (void)
{
@ -1358,7 +1481,6 @@ qboolean GLAppActivate(BOOL fActive, BOOL minimize)
return true;
}
/* main window procedure */
LONG WINAPI GLMainWndProc (
HWND hWnd,
@ -1391,19 +1513,7 @@ LONG WINAPI GLMainWndProc (
break;
case WM_MOVE:
{
RECT r;
// window_x = (int) LOWORD(lParam);
// window_y = (int) HIWORD(lParam);
GetWindowRect(hWnd, &r);
window_x = r.left;
window_y = r.top;
window_width = r.right - r.left;
window_height = r.bottom - r.top;
glwidth = window_width;
glheight = window_height;
}
VID_UpdateWindowStatus ();
VID_UpdateWindowStatus (hWnd);
break;
case WM_KEYDOWN:
@ -1502,13 +1612,9 @@ LONG WINAPI GLMainWndProc (
case WM_SIZE:
if (!vid_initializing)
{
WindowRect.right = ((short*)&lParam)[0] - WindowRect.left;
WindowRect.bottom = ((short*)&lParam)[1] - WindowRect.top;
// force width/height to be updated
glwidth = WindowRect.right - WindowRect.left;
glheight = WindowRect.bottom - WindowRect.top;
Cvar_ForceCallback(&vid_conautoscale);
Cvar_ForceCallback(&vid_conwidth);
VID_UpdateWindowStatus (hWnd);
}
break;
@ -1602,6 +1708,7 @@ void GLVID_DeInit (void)
ActiveApp = false;
Cvar_Unhook(&_vid_wait_override);
Cvar_Unhook(&vid_wndalpha);
UnregisterClass(WINDOW_CLASS_NAME, global_hInstance);
}
@ -1661,6 +1768,9 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
S_Restart_f();
Cvar_Hook(&_vid_wait_override, VID_Wait_Override_Callback);
Cvar_Hook(&vid_width, VID_Size_Override_Callback);
Cvar_Hook(&vid_height, VID_Size_Override_Callback);
Cvar_Hook(&vid_wndalpha, VID_WndAlpha_Override_Callback);
vid_initialized = true;
vid_initializing = false;

View file

@ -423,6 +423,39 @@ string_t PR_StringToProgs (progfuncs_t *progfuncs, char *str)
return 0;
}
char *PR_RemoveProgsString (progfuncs_t *progfuncs, string_t str)
{
char *ret;
//input string is expected to be an allocated string
//if its a temp, or a constant, just return NULL.
if ((unsigned int)str & 0xc0000000)
{
if ((unsigned int)str & 0x80000000)
{
int i = str & ~0x80000000;
if (i >= prinst->numallocedstrings)
{
pr_trace = 1;
return NULL;
}
if (prinst->allocedstrings[i])
{
ret = prinst->allocedstrings[i];
prinst->allocedstrings[i] = NULL; //remove it
return ret;
}
else
{
pr_trace = 1;
return NULL; //urm, was freed...
}
}
}
pr_trace = 1;
return NULL;
}
char *PR_StringToNative (progfuncs_t *progfuncs, string_t str)
{
if ((unsigned int)str & 0xc0000000)

View file

@ -988,7 +988,7 @@ void SV_Savegame_f (void)
{
VFS_PRINTF(f, "%s\n", cache->mapname);
FS_Copy(va("saves/%s.lvc", cache->mapname), va("saves/%s/%s.lvc", savename, cache->mapname), FS_GAME);
FS_Copy(va("saves/%s.lvc", cache->mapname), va("saves/%s/%s.lvc", savename, cache->mapname), FS_GAME, FS_GAME);
cache = cache->next;
}

View file

@ -426,8 +426,8 @@ typedef struct client_s
char downloadfn[MAX_QPATH];
vfsfile_t *download; // file being downloaded
int downloadsize; // total bytes
int downloadcount; // bytes sent
unsigned int downloadsize; // total bytes
unsigned int downloadcount; // bytes sent
int downloadacked; //DP-specific
int downloadstarted; //DP-specific
@ -1041,6 +1041,7 @@ void SV_UserInit (void);
qboolean SV_TogglePause (client_t *cl);
void SV_ClientThink (void);
void SV_Begin_Core(client_t *split);
void VoteFlushAll(void);
void SV_SetUpClientEdict (client_t *cl, edict_t *ent);

View file

@ -603,7 +603,7 @@ void SV_SpawnServer (char *server, char *startspot, qboolean noents, qboolean us
#ifndef SERVERONLY
total_loading_size = 100;
current_loading_size = 0;
loading_stage = 1;
SCR_SetLoadingStage(LS_SERVER);
// SCR_BeginLoadingPlaque();
SCR_ImageName(server);
#endif

View file

@ -1742,7 +1742,7 @@ void SV_DarkPlacesDownloadAck(client_t *cl)
}
}
void SV_NextChunkedDownload(int chunknum, int ezpercent, int ezfilenum)
void SV_NextChunkedDownload(unsigned int chunknum, int ezpercent, int ezfilenum)
{
#define CHUNKSIZE 1024
char buffer[CHUNKSIZE];
@ -1753,9 +1753,9 @@ void SV_NextChunkedDownload(int chunknum, int ezpercent, int ezfilenum)
msg = &host_client->datagram;
if (chunknum < 0 || (chunknum*CHUNKSIZE > host_client->downloadsize))
if (chunknum*CHUNKSIZE > host_client->downloadsize)
{
Con_Printf ("Invalid file chunk requested %i to %i of .\n", chunknum*CHUNKSIZE, (chunknum+1)*CHUNKSIZE, host_client->downloadsize);
SV_ClientPrintf (host_client, PRINT_HIGH, "Invalid file chunk requested %u to %u of %u.\n", chunknum*CHUNKSIZE, (chunknum+1)*CHUNKSIZE, host_client->downloadsize);
error = true;
}
@ -1786,7 +1786,7 @@ void SV_NextChunkedDownload(int chunknum, int ezpercent, int ezfilenum)
if (i > 0)
{
if (msg == &msg_oob)//host_client->datagram.cursize + CHUNKSIZE+5+50 > host_client->datagram.maxsize)
if (msg == &msg_oob)
{
msg = &msg_oob;
msg->cursize = 0;
@ -1798,7 +1798,7 @@ void SV_NextChunkedDownload(int chunknum, int ezpercent, int ezfilenum)
msg->data = oobdata;
MSG_WriteByte(msg, A2C_PRINT);
SZ_Write(msg, "\\chunk", 6);
MSG_WriteLong(msg, ezfilenum);
MSG_WriteLong(msg, ezfilenum); //echoing the file num is used so the packets don't go out of sync.
}
if (i != CHUNKSIZE)
@ -1850,7 +1850,10 @@ void SV_NextDownload_f (void)
#ifdef PEXT_CHUNKEDDOWNLOADS
if (host_client->fteprotocolextensions & PEXT_CHUNKEDDOWNLOADS)
{
SV_NextChunkedDownload(atoi(Cmd_Argv(1)), atoi(Cmd_Argv(2)), atoi(Cmd_Argv(3)));
if (Cmd_Argc() < 2)
SV_NextChunkedDownload(atoi(Cmd_Argv(1)), atoi(Cmd_Argv(2)), atoi(Cmd_Argv(3)));
else
SV_NextChunkedDownload(atoi(Cmd_Argv(1)), atoi(Cmd_Argv(2)), atoi(Cmd_Argv(3)));
return;
}
#endif
@ -2378,7 +2381,7 @@ void SV_StopDownload_f(void)
host_client->download = NULL;
}
else
Con_Printf ("But you're not downloading anything\n");
SV_ClientPrintf(host_client, PRINT_HIGH, "But you're not downloading anything\n");
host_client->downloadstarted = false;
}
@ -3015,14 +3018,14 @@ void SV_SetInfo_f (void)
if (Cmd_Argc() == 1)
{
Con_Printf ("User info settings:\n");
SV_ClientPrintf(host_client, PRINT_HIGH, "User info settings:\n");
Info_Print (host_client->userinfo);
return;
}
if (Cmd_Argc() != 3)
{
Con_Printf ("usage: setinfo [ <key> <value> ]\n");
SV_ClientPrintf(host_client, PRINT_HIGH, "usage: setinfo [ <key> <value> ]\n");
return;
}
@ -3114,7 +3117,9 @@ Dumps the serverinfo info string
*/
void SV_ShowServerinfo_f (void)
{
SV_BeginRedirect(RD_CLIENT, host_client->language);
Info_Print (svs.info);
SV_EndRedirect();
}
void SV_NoSnap_f(void)
@ -3228,12 +3233,12 @@ void SV_Vote_f (void)
if (!votelevel.value)
{
Con_TPrintf(STL_NOVOTING);
SV_ClientTPrintf(host_client, PRINT_HIGH, STL_NOVOTING);
return;
}
if (host_client->ismuted)
{
Con_TPrintf(STL_MUTEDVOTE);
SV_ClientTPrintf(host_client, PRINT_HIGH, STL_MUTEDVOTE);
return;
}
@ -3247,7 +3252,7 @@ void SV_Vote_f (void)
base = NULL;
if (strchr(command, ';') || !strcmp(command, "if"))
{
Con_TPrintf(STL_BADVOTE);
SV_ClientTPrintf(host_client, PRINT_HIGH, STL_BADVOTE);
return;
}
num = Cmd_Level(command);
@ -3255,7 +3260,7 @@ void SV_Vote_f (void)
*base = ' ';
if (num != Cmd_ExecLevel)
{
Con_TPrintf(STL_BADVOTE);
SV_ClientTPrintf(host_client, PRINT_HIGH, STL_BADVOTE);
return;
}
@ -3269,13 +3274,13 @@ void SV_Vote_f (void)
if (VoteCount(command, id))
{
VoteRemoveCommands(command, id);
Con_TPrintf(STL_OLDVOTEREMOVED);
SV_ClientTPrintf(host_client, PRINT_HIGH, STL_OLDVOTEREMOVED);
return;
}
if (VoteCount(NULL, id)>=3)
{
VoteRemoveCommands(NULL, id);
Con_TPrintf(STL_VOTESREMOVED);
SV_ClientTPrintf(host_client, PRINT_HIGH, STL_VOTESREMOVED);
}
num = VoteCount(command, -1)+1;
@ -3312,7 +3317,7 @@ void Cmd_Notarget_f (void)
{
if (!sv_allow_cheats)
{
Con_Printf ("Cheats are not allowed on this server\n");
SV_PrintToClient(host_client, PRINT_HIGH, "Cheats are not allowed on this server\n");
return;
}
@ -3328,7 +3333,7 @@ void Cmd_God_f (void)
{
if (!sv_allow_cheats)
{
Con_Printf ("Cheats are not allowed on this server\n");
SV_PrintToClient(host_client, PRINT_HIGH, "Cheats are not allowed on this server\n");
return;
}
@ -3355,7 +3360,7 @@ void Cmd_Give_f (void)
if (!sv_allow_cheats)
{
Con_Printf ("Cheats are not allowed on this server\n");
SV_PrintToClient(host_client, PRINT_HIGH, "Cheats are not allowed on this server\n");
return;
}
@ -3410,7 +3415,7 @@ void Cmd_Noclip_f (void)
{
if (!sv_allow_cheats)
{
Con_Printf ("Cheats are not allowed on this server\n");
SV_PrintToClient(host_client, PRINT_HIGH, "Cheats are not allowed on this server\n");
return;
}
@ -3436,7 +3441,7 @@ void Cmd_Fly_f (void)
{
if (!sv_allow_cheats)
{
Con_Printf ("Cheats are not allowed on this server\n");
SV_PrintToClient(host_client, PRINT_HIGH, "Cheats are not allowed on this server\n");
return;
}
@ -3467,20 +3472,20 @@ void Cmd_SetPos_f(void)
{
if (!sv_allow_cheats)
{
Con_Printf ("Cheats are not allowed on this server\n");
SV_PrintToClient(host_client, PRINT_HIGH, "Cheats are not allowed on this server\n");
return;
}
if (Cmd_Argc() != 4)
{
Con_Printf ("setpos %i %i %i\n", (int)sv_player->v->origin[0], (int)sv_player->v->origin[1], (int)sv_player->v->origin[2]);
SV_ClientPrintf(host_client, PRINT_HIGH, "setpos %f %f %f\n", sv_player->v->origin[0], sv_player->v->origin[1], sv_player->v->origin[2]);
return;
}
SV_LogPlayer(host_client, "setpos cheat");
if (sv_player->v->movetype != MOVETYPE_NOCLIP)
{
sv_player->v->movetype = MOVETYPE_NOCLIP;
Con_Printf("noclip on\n");
SV_PrintToClient(host_client, PRINT_HIGH, "noclip on\n");
}
sv_player->v->origin[0] = atof(Cmd_Argv(1));
@ -3499,7 +3504,6 @@ void SV_SetUpClientEdict (client_t *cl, edict_t *ent)
string_t preserve;
preserve = ent->v->netname;
Q1QVMED_ClearEdict(ent, true);
Con_Printf("client netname: %x\n", preserve);
ent->v->netname = preserve;
}
else
@ -3553,19 +3557,19 @@ void Cmd_Join_f (void)
if (svs.gametype != GT_PROGS)
{
Con_Printf ("Sorry, not implemented in this gamecode type. Try moaning at the dev team\n");
SV_PrintToClient(host_client, PRINT_HIGH, "Sorry, not implemented in this gamecode type. Try moaning at the dev team\n");
return;
}
if (!(host_client->zquake_extensions & Z_EXT_JOIN_OBSERVE))
{
Con_Printf ("Your QW client doesn't support this command\n");
SV_PrintToClient(host_client, PRINT_HIGH, "Your QW client doesn't support this command\n");
return;
}
if (password.string[0] && stricmp(password.string, "none"))
{
Con_Printf ("This server requires a %s password. Please disconnect, set the password and reconnect as %s.\n", "player", "player");
SV_ClientPrintf(host_client, PRINT_HIGH, "This server requires a %s password. Please disconnect, set the password and reconnect as %s.\n", "player", "player");
return;
}
@ -3578,7 +3582,7 @@ void Cmd_Join_f (void)
}
if (numclients >= maxclients.value)
{
Con_Printf ("Can't join, all player slots full\n");
SV_PrintToClient(host_client, PRINT_HIGH, "Can't join, all player slots full\n");
return;
}
@ -3646,19 +3650,19 @@ void Cmd_Observe_f (void)
if (svs.gametype != GT_PROGS)
{
Con_Printf ("Sorry, not implemented in this gamecode type. Try moaning at the dev team\n");
SV_PrintToClient(host_client, PRINT_HIGH, "Sorry, not implemented in this gamecode type. Try moaning at the dev team\n");
return;
}
if (!(host_client->zquake_extensions & Z_EXT_JOIN_OBSERVE))
{
Con_Printf ("Your QW client doesn't support this command\n");
SV_PrintToClient(host_client, PRINT_HIGH, "Your QW client doesn't support this command\n");
return;
}
if (spectator_password.string[0] && stricmp(spectator_password.string, "none"))
{
Con_Printf ("This server requires a %s password. Please disconnect, set the password and reconnect as %s.\n", "spectator", "spectator");
SV_ClientPrintf(host_client, PRINT_HIGH, "This server requires a %s password. Please disconnect, set the password and reconnect as %s.\n", "spectator", "spectator");
return;
}
@ -3670,7 +3674,7 @@ void Cmd_Observe_f (void)
}
if (numspectators >= maxspectators.value)
{
Con_Printf ("Can't join, all spectator slots full\n");
SV_PrintToClient(host_client, PRINT_HIGH, "Can't join, all spectator slots full\n");
return;
}
@ -3754,9 +3758,9 @@ void Cmd_FPSList_f(void)
}
if (frames)
Con_Printf("%s: %ffps (min%f max %f\n", cl->name, ftime/frames, minf, maxf);
SV_ClientPrintf(host_client, PRINT_HIGH, "%s: %ffps (min%f max %f\n", cl->name, ftime/frames, minf, maxf);
else
Con_Printf("%s: no information available\n", cl->name);
SV_ClientPrintf(host_client, PRINT_HIGH, "%s: no information available\n", cl->name);
}
}
@ -3766,7 +3770,7 @@ void SV_EnableClientsCSQC(void)
if (host_client->fteprotocolextensions & PEXT_CSQC || atoi(Cmd_Argv(1)))
host_client->csqcactive = true;
else
Con_Printf("CSQC entities not enabled - no support from network protocol\n");
SV_ClientPrintf(host_client, PRINT_HIGH, "CSQC entities not enabled - no support from network protocol\n");
#endif
}
void SV_DisableClientsCSQC(void)

View file

@ -1755,7 +1755,7 @@ void SV_ClipToLinks ( areanode_t *node, moveclip_t *clip )
if (touch == clip->passedict)
continue;
if (touch->v->solid == SOLID_TRIGGER || touch->v->solid == SOLID_LADDER)
SV_Error ("Trigger (%s) in clipping list", PR_StringToNative(svprogfuncs, touch->v->classname));
SV_Error ("Trigger (%s) in clipping list", PR_GetString(svprogfuncs, touch->v->classname));
if (clip->type & MOVE_NOMONSTERS && touch->v->solid != SOLID_BSP)
continue;