1
0
Fork 0
forked from fte/fteqw

Trying to fix lingering d3d bugs. Added support for proquake's angles extension. Various other hacks and changes and tweeks. Mostly trying to fix D3D issues. Also added con_separatechat cvar.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3818 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2011-06-16 02:03:57 +00:00
parent b0124c7df5
commit 174ba9f64b
39 changed files with 3898 additions and 410 deletions

View file

@ -791,7 +791,7 @@ void CLNQ_SendMove (usercmd_t *cmd, int pnum, sizebuf_t *buf)
for (i=0 ; i<3 ; i++)
{
if (cls.protocol_nq == CPNQ_FITZ666)
if (cls.protocol_nq == CPNQ_FITZ666 || cls.protocol_nq == CPNQ_PROQUAKE3_4)
MSG_WriteAngle16 (buf, cl.viewangles[pnum][i]);
else
MSG_WriteAngle (buf, cl.viewangles[pnum][i]);
@ -842,7 +842,7 @@ void CLNQ_SendCmd(sizebuf_t *buf)
{
extern int cl_latestframenum;
if (cls.signon == 4)
// if (cls.signon == 4)
{
// send the unreliable message
if (independantphysics[0].impulse && !cls.netchan.message.cursize)
@ -858,7 +858,6 @@ void CLNQ_SendCmd(sizebuf_t *buf)
}
memset(&independantphysics[0], 0, sizeof(independantphysics[0]));
cl.allowsendpacket = false;
}
#else
void Name_Callback(struct cvar_s *var, char *oldvalue)
@ -1626,37 +1625,38 @@ void CL_SendCmd (double frametime, qboolean mainloop)
// if (skipcmd)
// return;
#ifdef NQPROT
if ((!cl.allowsendpacket || cls.state <= ca_connected) && cls.protocol == CP_NETQUAKE)
return;
#endif
if (!fullsend && cls.state == ca_active)
return; // when we're actually playing we try to match netfps exactly to avoid gameplay problems
CL_SendDownloadReq(&buf);
while (clientcmdlist)
#ifdef NQPROT
if (cls.protocol != CP_NETQUAKE || cls.netchan.nqreliable_allowed)
#endif
{
next = clientcmdlist->next;
if (clientcmdlist->reliable)
CL_SendDownloadReq(&buf);
while (clientcmdlist)
{
if (cls.netchan.message.cursize + 2+strlen(clientcmdlist->command) > cls.netchan.message.maxsize)
break;
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
MSG_WriteString (&cls.netchan.message, clientcmdlist->command);
}
else
{
if (buf.cursize + 2+strlen(clientcmdlist->command) <= buf.maxsize)
next = clientcmdlist->next;
if (clientcmdlist->reliable)
{
MSG_WriteByte (&buf, clc_stringcmd);
MSG_WriteString (&buf, clientcmdlist->command);
if (cls.netchan.message.cursize + 2+strlen(clientcmdlist->command) > cls.netchan.message.maxsize)
break;
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
MSG_WriteString (&cls.netchan.message, clientcmdlist->command);
}
else
{
if (buf.cursize + 2+strlen(clientcmdlist->command) <= buf.maxsize)
{
MSG_WriteByte (&buf, clc_stringcmd);
MSG_WriteString (&buf, clientcmdlist->command);
}
}
Con_DPrintf("Sending stringcmd %s\n", clientcmdlist->command);
Z_Free(clientcmdlist);
clientcmdlist = next;
}
Con_DPrintf("Sending stringcmd %s\n", clientcmdlist->command);
Z_Free(clientcmdlist);
clientcmdlist = next;
}
// if we're not doing clc_moves and etc, don't continue unless we wrote something previous

View file

@ -54,6 +54,8 @@ cvar_t cl_nolerp = CVAR("cl_nolerp", "2");
cvar_t cl_nolerp_netquake = CVAR("cl_nolerp_netquake", "0");
cvar_t hud_tracking_show = CVAR("hud_tracking_show", "1");
cvar_t cl_defaultport = CVARAF("cl_defaultport", STRINGIFY(PORT_QWSERVER), "port", 0);
cvar_t cfg_save_name = CVARF("cfg_save_name", "fte", CVAR_ARCHIVE);
cvar_t cl_splitscreen = CVAR("cl_splitscreen", "0");
@ -211,7 +213,7 @@ unsigned int cl_numstris;
unsigned int cl_maxstris;
double connect_time = -1; // for connection retransmits
int connect_type = 0;
int connect_defaultport = 0;
int connect_tries = 0; //increased each try, every fourth trys nq connect packets.
quakeparms_t host_parms;
@ -688,10 +690,12 @@ void CL_CheckForResend (void)
if (adr.port == 0)
{
if (connect_type)
adr.port = BigShort (26000); //assume a different port for nq
else
adr.port = BigShort (27500);
adr.port = BigShort (connect_defaultport); //assume a different port for nq
if (!strchr(cls.servername, ':'))
{
Q_strncatz(cls.servername, va(":%u", connect_defaultport), sizeof(cls.servername));
}
}
t2 = Sys_DoubleTime ();
@ -709,26 +713,41 @@ void CL_CheckForResend (void)
if (connect_tries == 0)
NET_EnsureRoute(cls.sockets, "conn", cls.servername, false);
Con_TPrintf (TLC_CONNECTINGTO, cls.servername);
#ifdef NQPROT
if (connect_type || ((connect_tries&3)==3))
if (((connect_tries&3)==3) != (connect_defaultport==26000))
{
sizebuf_t sb;
memset(&sb, 0, sizeof(sb));
sb.data = data;
sb.maxsize = sizeof(data);
Con_TPrintf (TLC_CONNECTINGTO, cls.servername);
MSG_WriteLong(&sb, LongSwap(NETFLAG_CTL | (strlen(NET_GAMENAME_NQ)+7)));
MSG_WriteByte(&sb, CCREQ_CONNECT);
MSG_WriteString(&sb, NET_GAMENAME_NQ);
MSG_WriteByte(&sb, NET_PROTOCOL_VERSION);
/*NQ engines have a few extra bits on the end*/
/*proquake servers wait for us to send them a packet before anything happens,
which means it corrects for our public port if our nat uses different public ports for different remote ports
thus all nq engines claim to be proquake
*/
MSG_WriteByte(&sb, 1); /*'mod'*/
MSG_WriteByte(&sb, 34); /*'mod' version*/
MSG_WriteByte(&sb, 0); /*flags*/
MSG_WriteLong(&sb, strtoul(password.string, NULL, 0)); /*password*/
/*so dual-protocol servers can send a more useful reply*/
MSG_WriteString(&sb, "getchallenge");
*(int*)sb.data = LongSwap(NETFLAG_CTL | sb.cursize);
NET_SendPacket (NS_CLIENT, sb.cursize, sb.data, adr);
}
else
#endif
{
Con_TPrintf (TLC_CONNECTINGTO, cls.servername);
sprintf (data, "%c%c%c%cgetchallenge\n", 255, 255, 255, 255);
NET_SendPacket (NS_CLIENT, strlen(data), data, adr);
}
@ -736,24 +755,17 @@ void CL_CheckForResend (void)
connect_tries++;
}
void CL_BeginServerConnect(void)
void CL_BeginServerConnect(int port)
{
if (!port)
port = cl_defaultport.value;
SCR_SetLoadingStage(LS_CONNECTION);
connect_time = 0;
connect_type = 0;
connect_defaultport = port;
connect_tries = 0;
CL_CheckForResend();
}
#ifdef NQPROT
void CLNQ_BeginServerConnect(void)
{
SCR_SetLoadingStage(LS_CONNECTION);
connect_time = 0;
connect_type = 1;
connect_tries = 0;
CL_CheckForResend();
}
#endif
void CL_BeginServerReconnect(void)
{
#ifndef CLIENTONLY
@ -787,7 +799,7 @@ void CL_Connect_f (void)
CL_Disconnect_f ();
Q_strncpyz (cls.servername, server, sizeof(cls.servername));
CL_BeginServerConnect();
CL_BeginServerConnect(0);
}
void CL_Join_f (void)
@ -815,7 +827,7 @@ void CL_Join_f (void)
Cvar_Set(&spectator, "0");
Q_strncpyz (cls.servername, server, sizeof(cls.servername));
CL_BeginServerConnect();
CL_BeginServerConnect(0);
}
void CL_Observe_f (void)
@ -843,7 +855,7 @@ void CL_Observe_f (void)
Cvar_Set(&spectator, "1");
Q_strncpyz (cls.servername, server, sizeof(cls.servername));
CL_BeginServerConnect();
CL_BeginServerConnect(0);
}
#ifdef NQPROT
@ -862,7 +874,7 @@ void CLNQ_Connect_f (void)
CL_Disconnect_f ();
Q_strncpyz (cls.servername, server, sizeof(cls.servername));
CLNQ_BeginServerConnect();
CL_BeginServerConnect(26000);
}
#endif
@ -878,7 +890,7 @@ void CL_IRCConnect_f (void)
strcpy(cls.servername, "irc://");
Q_strncpyz (cls.servername+6, server, sizeof(cls.servername)-6);
CL_BeginServerConnect();
CL_BeginServerConnect(0);
}
}
#endif
@ -1673,9 +1685,9 @@ void CL_SetInfo (int pnum, char *key, char *value)
#endif
{
if (pnum)
CL_SendClientCommand(true, "%i setinfo %s %s", pnum+1, key, value);
CL_SendClientCommand(true, "%i setinfo %s \"%s\"", pnum+1, key, value);
else
CL_SendClientCommand(true, "setinfo %s %s", key, value);
CL_SendClientCommand(true, "setinfo %s \"%s\"", key, value);
}
}
}
@ -2300,6 +2312,7 @@ void CL_ConnectionlessPacket (void)
cls.netchan.isnqprotocol = true;
cls.protocol = CP_NETQUAKE;
cls.protocol_nq = CPNQ_ID;
cls.demonum = -1; // not in the demo loop now
cls.state = ca_connected;
@ -2458,15 +2471,18 @@ void CLNQ_ConnectionlessPacket(void)
//this is the port that we're meant to respond to.
net_from.port = htons((short)MSG_ReadLong());
cls.protocol_nq = CPNQ_ID;
if (MSG_ReadByte() == 1) //a proquake server adds a little extra info
{
int ver = MSG_ReadByte();
Con_Printf("ProQuake server %i.%i\n", ver/10, ver%10);
if (ver >= 34)
cls.protocol_nq = CPNQ_PROQUAKE3_4;
if (MSG_ReadByte() == 1)
{
//its a 'pure' server.
Con_Printf("ProQuake sucks\nGo play on a decent server.\n");
Con_Printf("pure ProQuake server\n");
return;
}
}
@ -2489,7 +2505,7 @@ void CLNQ_ConnectionlessPacket(void)
//send a dummy packet.
//this makes our local nat think we initialised the conversation.
NET_SendPacket(NS_CLIENT, 0, "", net_from);
Netchan_Transmit(&cls.netchan, 1, "\x01", 2500);
return;
case CCREP_REJECT:
@ -2968,6 +2984,7 @@ void CL_Init (void)
Cvar_Register (&cfg_save_name, cl_controlgroup);
Cvar_Register (&cl_defaultport, cl_controlgroup);
Cvar_Register (&cl_servername, cl_controlgroup);
Cvar_Register (&cl_serveraddress, cl_controlgroup);
Cvar_Register (&cl_demospeed, "Demo playback");

View file

@ -13,7 +13,7 @@
//despite not supporting nq or q2, we still load them. We just filter them. This is to make sure we properly write the listing files.
enum {
MT_BAD, //this would be an error
MT_MASTERHTTP, //an http/ftp based master server with NQ servers
MT_MASTERHTTPNQ, //an http/ftp based master server with NQ servers
MT_MASTERHTTPQW,//an http/ftp based master server with QW servers
MT_BCASTQW, //-1status
MT_BCASTQ2, //-1status
@ -130,6 +130,7 @@ typedef struct master_s{
char *address; //text based address (http servers
int type;
int servertype; //filled in for http servers
int sends; /*needs to resend?*/
char name[1];
} master_t;
@ -164,7 +165,8 @@ int NET_CheckPollSockets(void);
void MasterInfo_Request(master_t *mast, qboolean evenifwedonthavethefiles);
serverinfo_t *Master_InfoForServer (netadr_t addr);
serverinfo_t *Master_InfoForNum (int num);
int Master_TotalCount(void);
unsigned int Master_TotalCount(void);
unsigned int Master_NumPolled(void);
void Master_SetupSockets(void);
void Master_QueryServer(serverinfo_t *server);
void MasterInfo_WriteServers(void);

View file

@ -2189,10 +2189,10 @@ void CL_ParseServerData (void)
{
int i;
MSG_ReadFloat();
cl.playernum[0] = MAX_CLIENTS - 1;
cl.playernum[1] = MAX_CLIENTS - 2;
cl.playernum[2] = MAX_CLIENTS - 3;
cl.playernum[3] = MAX_CLIENTS - 4;
cl.playernum[0] = MAX_CLIENTS;
cl.playernum[1] = MAX_CLIENTS+1;
cl.playernum[2] = MAX_CLIENTS+2;
cl.playernum[3] = MAX_CLIENTS+3;
cl.spectator = true;
for (i = 0; i < UPDATE_BACKUP; i++)
cl.frames[i].playerstate[cl.playernum[0]].pm_type = PM_SPECTATOR;
@ -2444,7 +2444,7 @@ void CLNQ_ParseServerData(void) //Doesn't change gamedir - use with caution.
netprim.coordsize = 2;
netprim.anglesize = 1;
cls.protocol_nq = 0;
cls.protocol_nq = (cls.protocol_nq==CPNQ_PROQUAKE3_4)?CPNQ_PROQUAKE3_4:CPNQ_ID;
cls.z_ext = 0;
if (protover == NEHD_PROTOCOL_VERSION)
@ -4430,6 +4430,7 @@ int CL_PlayerColor(player_info_t *plr, qboolean *name_coloured)
// NOTE: text in rawmsg/msg is assumed destroyable and should not be used afterwards
void CL_PrintChat(player_info_t *plr, char *rawmsg, char *msg, int plrflags)
{
extern cvar_t con_separatechat;
char *name = NULL;
int c;
qboolean name_coloured = false;
@ -4552,6 +4553,26 @@ void CL_PrintChat(player_info_t *plr, char *rawmsg, char *msg, int plrflags)
if (CSQC_ParsePrint(fullchatmessage, PRINT_CHAT))
return;
#endif
if (con_separatechat.ival)
{
if (!con_chat)
con_chat = Con_Create("chat", CONF_HIDDEN|CONF_NOTIFY|CONF_NOTIFY_BOTTOM);
if (con_chat)
{
Con_PrintCon(con_chat, fullchatmessage);
if (con_separatechat.ival == 1)
{
con_main.flags |= CONF_NOTIMES;
Con_PrintCon(&con_main, fullchatmessage);
con_main.flags &= CONF_NOTIMES;
return;
}
}
}
Con_Printf("%s", fullchatmessage);
}
@ -5648,7 +5669,7 @@ void CLNQ_ParseServerMessage (void)
// cl.last_servermessage = realtime;
CL_ClearProjectiles ();
cl.allowsendpacket = true;
cls.netchan.nqreliable_allowed = true;
//
// if recording demos, copy the message out

View file

@ -405,7 +405,7 @@ qintptr_t VARGS Plug_Con_SubPrint(void *offset, quintptr_t mask, const qintptr_t
con = Con_FindConsole(name);
if (!con)
{
con = Con_Create(name);
con = Con_Create(name, 0);
Con_SetActive(con);
if (currentplug->conexecutecommand)
@ -453,7 +453,7 @@ qintptr_t VARGS Plug_Con_SetActive(void *offset, quintptr_t mask, const qintptr_
return false;
con = Con_FindConsole(name);
if (!con)
con = Con_Create(name);
con = Con_Create(name, 0);
Con_SetActive(con);
return true;

View file

@ -1682,8 +1682,6 @@ void SCR_SetUpToDrawConsole (void)
else if (clearnotify++ < vid.numpages)
{
}
else
con_notifylines = 0;
}
/*

View file

@ -806,11 +806,10 @@ static qintptr_t UI_SystemCalls(void *offset, quintptr_t mask, qintptr_t fn, con
}
else if (!strncmp(cmdtext, "localservers", 12))
{
MasterInfo_Begin();
MasterInfo_Refresh();
}
/* else if (!strncmp(cmdtext, "r_vidmode", 12))
{
MasterInfo_Begin();
}
*/ else
Cbuf_AddText(cmdtext, RESTRICT_SERVER);

View file

@ -146,6 +146,7 @@ typedef struct player_info_s
int userid;
char userinfo[EXTENDED_INFO_STRING];
char teamstatus[128];
float teamstatustime;
// scoreboard information
char name[MAX_SCOREBOARDNAME];
@ -192,7 +193,7 @@ typedef struct
// received from server
double receivedtime; // time message was received, or -1
player_state_t playerstate[MAX_CLIENTS]; // message received that reflects performing
player_state_t playerstate[MAX_CLIENTS+MAX_SPLITS]; // message received that reflects performing
// the usercmd
packet_entities_t packet_entities;
qboolean invalid; // true if the packet_entities delta was invalid
@ -339,6 +340,7 @@ typedef struct
enum
{
CPNQ_ID,
CPNQ_PROQUAKE3_4,
CPNQ_FITZ666,
CPNQ_DP5,
CPNQ_DP6,
@ -783,8 +785,7 @@ qboolean CL_DemoBehind(void);
void CL_SaveInfo(vfsfile_t *f);
void CL_SetInfo (int pnum, char *key, char *value);
void CL_BeginServerConnect(void);
void CLNQ_BeginServerConnect(void);
void CL_BeginServerConnect(int port);
char *CL_TryingToConnect(void);
#define MAX_VISEDICTS 1024

View file

@ -22,7 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h"
console_t con_main;
console_t *con_current; // point to either con_main
console_t *con_current; // points to whatever is the visible console
console_t *con_chat; // points to a chat console
#define Font_ScreenWidth() (vid.pixelwidth)
@ -59,13 +60,11 @@ cvar_t con_centernotify = SCVAR("con_centernotify", "0");
cvar_t con_displaypossibilities = SCVAR("con_displaypossibilities", "1");
cvar_t con_maxlines = SCVAR("con_maxlines", "1024");
cvar_t cl_chatmode = SCVAR("cl_chatmode", "2");
cvar_t con_numnotifylines_chat = CVAR("con_numnotifylines_chat", "8");
cvar_t con_notifytime_chat = CVAR("con_notifytime_chat", "8");
cvar_t con_separatechat = CVAR("con_separatechat", "0");
#define NUM_CON_TIMES 24
float con_times[NUM_CON_TIMES]; // realtime time the line was generated
// for transparent notify lines
//int con_vislines;
int con_notifylines; // scan lines to clear for notify lines
#define MAXCMDLINE 256
extern unsigned char key_lines[32][MAXCMDLINE];
@ -114,7 +113,10 @@ void Con_Destroy (console_t *con)
selendline = NULL;
if (con == &con_main)
{
Con_Finit(con);
return;
}
for (prev = &con_main; prev->next; prev = prev->next)
{
@ -142,12 +144,13 @@ console_t *Con_FindConsole(char *name)
return NULL;
}
/*creates a potentially duplicate console_t - please use Con_FindConsole first, as its confusing otherwise*/
console_t *Con_Create(char *name)
console_t *Con_Create(char *name, unsigned int flags)
{
console_t *con;
con = Z_Malloc(sizeof(console_t));
Q_strncpyz(con->name, name, sizeof(con->name));
con->flags = flags;
Con_Finit(con);
con->next = con_main.next;
con_main.next = con;
@ -325,7 +328,7 @@ void QT_Create(char *command)
qt->running = true;
qt->console = Con_Create("QTerm");
qt->console = Con_Create("QTerm", 0);
qt->console->redirect = QT_KeyPress;
Con_PrintCon(qt->console, "Started Process\n");
Con_SetVisible(qt->console);
@ -371,8 +374,6 @@ void Con_ToggleConsole_f (void)
}
else
key_dest = key_console;
Con_ClearNotify ();
}
/*
@ -391,8 +392,6 @@ void Con_ToggleChat_f (void)
}
else
key_dest = key_console;
Con_ClearNotify ();
}
void Con_ClearCon(console_t *con)
@ -429,7 +428,7 @@ void Cmd_ConEcho_f(void)
console_t *con;
con = Con_FindConsole(Cmd_Argv(1));
if (!con)
con = Con_Create(Cmd_Argv(1));
con = Con_Create(Cmd_Argv(1), 0);
if (con)
{
Cmd_ShiftArgs(1, false);
@ -460,20 +459,6 @@ void Cmd_ConActivate_f(void)
Con_SetActive(con);
}
/*
================
Con_ClearNotify
================
*/
void Con_ClearNotify (void)
{
int i;
for (i=0 ; i<NUM_CON_TIMES ; i++)
con_times[i] = 0;
}
/*
================
Con_MessageMode_f
@ -529,6 +514,9 @@ void Con_Init (void)
Cvar_Register (&con_displaypossibilities, "Console controls");
Cvar_Register (&cl_chatmode, "Console controls");
Cvar_Register (&con_maxlines, "Console controls");
Cvar_Register (&con_numnotifylines_chat, "Console controls");
Cvar_Register (&con_notifytime_chat, "Console controls");
Cvar_Register (&con_separatechat, "Console controls");
Cmd_AddCommand ("toggleconsole", Con_ToggleConsole_f);
Cmd_AddCommand ("togglechat", Con_ToggleChat_f);
@ -606,8 +594,10 @@ void Con_PrintCon (console_t *con, char *txt)
con->linecount--;
}
con->linecount++;
if (con == &con_main)
con_times[con->linesprinted++%NUM_CON_TIMES] = realtime;
if (con->flags & CONF_NOTIMES)
con->current->time = 0;
else
con->current->time = realtime;
con->current->newer = Z_Malloc(sizeof(conline_t));
con->current->newer->older = con->current;
con->current = con->current->newer;
@ -652,9 +642,16 @@ void Con_Print (char *txt)
void Con_CycleConsole(void)
{
con_current = con_current->next;
if (!con_current)
con_current = &con_main;
while(1)
{
con_current = con_current->next;
if (!con_current)
con_current = &con_main;
if (con_current->flags & CONF_HIDDEN)
continue;
break;
}
}
void Con_Log(char *s);
@ -915,43 +912,44 @@ Con_DrawNotify
Draws the last few lines of output transparently over the game top
================
*/
void Con_DrawNotify (void)
void Con_DrawNotifyOne (console_t *con)
{
conchar_t *starts[NUM_CON_TIMES], *ends[NUM_CON_TIMES];
conchar_t *c;
conline_t *l;
console_t *con = &con_main;
int lines=NUM_CON_TIMES;
int lines=con->notif_l;
int line;
int x = 0, y = 0;
unsigned int cn = con->linesprinted+NUM_CON_TIMES;
int x = con->notif_x, y = con->notif_y;
int w = con->notif_w;
int maxlines;
float t;
Font_BeginString(font_conchar, x, y, &x, &y);
Font_Transform(con->notif_w, 0, &w, NULL);
maxlines = con_numnotifylines.value;
if (maxlines < 0)
maxlines = 0;
if (maxlines > NUM_CON_TIMES)
maxlines = NUM_CON_TIMES;
if (con->notif_l < 0)
con->notif_l = 0;
if (con->notif_l > NUM_CON_TIMES)
con->notif_l = NUM_CON_TIMES;
lines = maxlines = con->notif_l;
y = Con_DrawProgress(0, Font_ScreenWidth(), 0);
if (x == 0 && y == 0 && con->notif_w == vid.width)
y = Con_DrawProgress(0, w, 0);
l = con->current;
if (!l->length)
l = l->older;
for (; l && cn > con->linesprinted && lines > NUM_CON_TIMES-maxlines; l = l->older)
for (; l && lines > con->notif_l-maxlines; l = l->older)
{
t = con_times[--cn % NUM_CON_TIMES];
t = l->time;
if (!t)
break; //cleared
continue; //hidden from notify
t = realtime - t;
if (t > con_notifytime.value)
if (t > con->notif_t)
break;
line = Font_LineBreaks((conchar_t*)(l+1), (conchar_t*)(l+1)+l->length, Font_ScreenWidth(), lines, starts, ends);
line = Font_LineBreaks((conchar_t*)(l+1), (conchar_t*)(l+1)+l->length, w, lines, starts, ends);
if (!line && lines > 0)
{
lines--;
@ -967,10 +965,16 @@ void Con_DrawNotify (void)
if (lines == 0)
break;
}
//clamp it properly
while (lines < NUM_CON_TIMES-maxlines)
while (lines < con->notif_l-maxlines)
{
lines++;
while (lines < NUM_CON_TIMES)
}
if (con->flags & CONF_NOTIFY_BOTTOM)
y -= (con->notif_l - lines) * Font_CharHeight();
while (lines < con->notif_l)
{
x = 0;
if (con_centernotify.value)
@ -979,7 +983,7 @@ void Con_DrawNotify (void)
{
x += Font_CharWidth(*c);
}
x = (vid.width - x) / 2;
x = (w - x) / 2;
}
Font_LineDraw(x, y, starts[lines], ends[lines]);
@ -988,14 +992,43 @@ void Con_DrawNotify (void)
lines++;
}
Font_EndString(font_conchar);
}
void Con_DrawNotify (void)
{
console_t *con;
con_main.flags = CONF_NOTIFY;
/*keep the main console up to date*/
con_main.notif_l = con_numnotifylines.ival;
con_main.notif_w = vid.width;
con_main.notif_t = con_notifytime.value;
if (con_chat)
{
con_chat->notif_l = con_numnotifylines_chat.ival;
con_chat->notif_w = vid.width - 64;
con_chat->notif_y = vid.height - sb_lines - 8*4;
con_chat->notif_t = con_notifytime_chat.value;
}
for (con = &con_main; con; con = con->next)
{
if (con->flags & CONF_NOTIFY)
Con_DrawNotifyOne(con);
}
if (key_dest == key_message)
{
int x, y;
conchar_t *starts[8];
conchar_t *ends[8];
conchar_t markup[MAXCMDLINE+64];
conchar_t *c;
int lines, i;
Font_BeginString(font_conchar, 0, 0, &x, &y);
y = con_main.notif_l * Font_CharHeight();
c = COM_ParseFunString(CON_WHITEMASK, va(chat_team?"say_team: %s":"say: %s", chat_buffer), markup, sizeof(markup), true);
*c++ = (0xe00a+((int)(realtime*con_cursorspeed)&1))|CON_WHITEMASK;
lines = Font_LineBreaks(markup, c, Font_ScreenWidth(), 8, starts, ends);
@ -1005,12 +1038,8 @@ void Con_DrawNotify (void)
Font_LineDraw(x, y, starts[i], ends[i]);
y += Font_CharHeight();
}
Font_EndString(font_conchar);
}
if (y > con_notifylines)
con_notifylines = y;
Font_EndString(font_conchar);
}
//send all the stuff that was con_printed to sys_print.
@ -1179,11 +1208,21 @@ int Con_DrawAlternateConsoles(int lines)
{
char *txt;
int x, y = 0;
if (lines == scr_conlines && con_main.next)
int consshown = 0;
console_t *con = &con_main;
for (con = &con_main; con; con = con->next)
{
if (!(con->flags & CONF_HIDDEN))
consshown++;
}
if (lines == scr_conlines && consshown > 1)
{
console_t *con = con_current;
for (x = 0, con = &con_main; con; con = con->next)
{
if (con->flags & CONF_HIDDEN)
continue;
if (con == &con_main)
txt = "MAIN";
else

View file

@ -464,8 +464,8 @@ void Key_Console (unsigned int unicode, int key)
extern cvar_t vid_conwidth, vid_conheight;
extern int mousecursor_x, mousecursor_y;
int xpos, ypos;
xpos = (int)((mousecursor_x*vid_conwidth.value)/(vid.width*8));
ypos = (int)((mousecursor_y*vid_conheight.value)/(vid.height*8));
xpos = (int)((mousecursor_x*vid.width)/(vid.pixelwidth*8));
ypos = (int)((mousecursor_y*vid.height)/(vid.pixelheight*8));
con_mousedown[0] = mousecursor_x;
con_mousedown[1] = mousecursor_y;
if (ypos == 0 && con_main.next)
@ -638,6 +638,8 @@ void Key_Console (unsigned int unicode, int key)
int i = 2;
if (keydown[K_CTRL])
i = 8;
if (!con_current->display)
return;
if (con_current->display == con_current->current)
i+=2; //skip over the blank input line, and extra so we actually move despite the addition of the ^^^^^ line
while (i-->0)
@ -653,6 +655,8 @@ void Key_Console (unsigned int unicode, int key)
int i = 2;
if (keydown[K_CTRL])
i = 8;
if (!con_current->display)
return;
while (i-->0)
{
if (con_current->display->newer == NULL)

View file

@ -505,7 +505,7 @@ void M_DrawSources (void)
switch (mast->type)
{
case MT_MASTERHTTP:
case MT_MASTERHTTPNQ:
case MT_MASTERHTTPQW:
clr = COLOR_YELLOW;
break;
@ -808,7 +808,7 @@ void M_SListKey(int key)
SListOptionChanged(M_FindCurrentServer()); //go for these early.
}
else if (key == 'r')
MasterInfo_Begin();
MasterInfo_Refresh();
else if (key == K_SPACE)
{
if (slist_type == SLISTTYPE_SERVERS || slist_type == SLISTTYPE_FAVORITES)
@ -902,6 +902,8 @@ typedef struct {
qboolean stillpolling;
qbyte filter[8];
char refreshtext[64];
qboolean sliderpressed;
menupicture_t *mappic;
@ -1180,6 +1182,7 @@ void SL_PreDraw (menu_t *menu)
CL_QueryServers();
snprintf(info->refreshtext, sizeof(info->refreshtext), "Refresh - %u of %u\n", Master_NumPolled(), Master_TotalCount());
info->numslots = Master_NumSorted();
}
qboolean SL_Key (int key, menu_t *menu)
@ -1419,7 +1422,7 @@ void SL_Remove (menu_t *menu)
qboolean SL_DoRefresh (menuoption_t *opt, menu_t *menu, int key)
{
MasterInfo_Begin();
MasterInfo_Refresh();
return true;
}
@ -1439,8 +1442,6 @@ void M_Menu_ServerList2_f(void)
key_dest = key_menu;
m_state = m_complex;
MasterInfo_Begin();
menu = M_CreateMenu(sizeof(serverlist_t));
menu->event = SL_PreDraw;
menu->key = SL_Key;
@ -1488,6 +1489,8 @@ void M_Menu_ServerList2_f(void)
}
}
strcpy(info->refreshtext, "Refresh");
MC_AddCheckBox(menu, 0, vid.height - 64+8*1, "Ping ", &sb_showping, 1);
MC_AddCheckBox(menu, 0, vid.height - 64+8*2, "Address ", &sb_showaddress, 1);
MC_AddCheckBox(menu, 0, vid.height - 64+8*3, "Map ", &sb_showmap, 1);
@ -1504,7 +1507,7 @@ void M_Menu_ServerList2_f(void)
MC_AddCheckBoxFunc(menu, 128, vid.height - 64+8*6, "Hide Empty", SL_ReFilter, 6);
MC_AddCheckBoxFunc(menu, 128, vid.height - 64+8*7, "Hide Full ", SL_ReFilter, 7);
MC_AddCommand(menu, 64, 0, "Refresh", SL_DoRefresh);
MC_AddCommand(menu, 64, 0, info->refreshtext, SL_DoRefresh);
info->filter[1] = !sb_hidenetquake.value;
info->filter[2] = !sb_hidequakeworld.value;
@ -1518,6 +1521,8 @@ void M_Menu_ServerList2_f(void)
CalcFilters(menu);
Master_SetSortField(SLKEY_PING, true);
MasterInfo_Refresh();
}
float quickconnecttimeout;
@ -1567,7 +1572,7 @@ void M_QuickConnect_PreDraw(menu_t *menu)
}
//retry
MasterInfo_Begin();
MasterInfo_Refresh();
quickconnecttimeout = Sys_DoubleTime() + 5;
}
@ -1600,7 +1605,7 @@ void M_QuickConnect_f(void)
key_dest = key_menu;
m_state = m_complex;
MasterInfo_Begin();
MasterInfo_Refresh();
quickconnecttimeout = Sys_DoubleTime() + 5;

View file

@ -1721,7 +1721,6 @@ qboolean Media_PlayFilm(char *name)
CDAudio_Stop();
SCR_EndLoadingPlaque();
Con_ClearNotify();
if (key_dest == key_menu)
{
key_dest = key_game;

View file

@ -450,7 +450,7 @@ void M_Menu_ServerList_f (void)
key_dest = key_menu;
m_state = m_slist;
MasterInfo_Begin();
MasterInfo_Refresh();
}
#endif

View file

@ -415,7 +415,7 @@ void M_Search_Key (int key);
void M_ServerList_Key (int key);
void M_Media_Key (int key);
void MasterInfo_Begin(void);
void MasterInfo_Refresh(void);
void M_DrawServers(void);
void M_SListKey(int key);

View file

@ -423,7 +423,8 @@ void Master_SortServers(void)
Master_ResortServer(server);
}
nextsort = Sys_DoubleTime() + 8;
if (nextsort < Sys_DoubleTime())
nextsort = Sys_DoubleTime() + 8;
}
serverinfo_t *Master_SortedServer(int idx)
@ -446,7 +447,6 @@ int Master_NumSorted(void)
}
float Master_ReadKeyFloat(serverinfo_t *server, int keynum)
{
if (!server)
@ -714,8 +714,8 @@ qboolean Master_LoadMasterList (char *filename, int defaulttype, int depth)
servertype = MT_MASTERQ2;
else if (!strcmp(com_token, "master:q3"))
servertype = MT_MASTERQ3;
else if (!strcmp(com_token, "master:http"))
servertype = MT_MASTERHTTP;
else if (!strcmp(com_token, "master:httpnq"))
servertype = MT_MASTERHTTPNQ;
else if (!strcmp(com_token, "master:httpqw"))
servertype = MT_MASTERHTTPQW;
else if (!strcmp(com_token, "master")) //any other sort of master, assume it's a qw master.
@ -776,7 +776,7 @@ qboolean Master_LoadMasterList (char *filename, int defaulttype, int depth)
{
switch (servertype)
{
case MT_MASTERHTTP:
case MT_MASTERHTTPNQ:
case MT_MASTERHTTPQW:
Master_AddMasterHTTP(line, servertype, name);
break;
@ -1020,7 +1020,8 @@ int NET_CheckPollSockets(void)
if (MSG_ReadByte() != CCREP_SERVER_INFO)
continue;
NET_StringToAdr(MSG_ReadString(), &net_from);
/*this is an address string sent from the server. its not usable. if its replying to serverinfos, its possible to send it connect requests, while the address that it claims is 50% bugged*/
MSG_ReadString();
Q_strncpyz(name, MSG_ReadString(), sizeof(name));
Q_strncpyz(map, MSG_ReadString(), sizeof(map));
@ -1166,6 +1167,10 @@ void MasterInfo_Request(master_t *mast, qboolean evenifwedonthavethefiles)
//static int mastersequence; // warning: unused variable âmastersequenceâ
if (!mast)
return;
if (mast->sends)
mast->sends--;
switch(mast->type)
{
#ifdef Q3CLIENT
@ -1229,7 +1234,7 @@ void MasterInfo_Request(master_t *mast, qboolean evenifwedonthavethefiles)
break;
#endif
#ifdef WEBCLIENT
case MT_MASTERHTTP:
case MT_MASTERHTTPNQ:
HTTP_CL_Get(mast->address, NULL, MasterInfo_ProcessHTTPNQ);
break;
case MT_MASTERHTTPQW:
@ -1271,8 +1276,8 @@ void MasterInfo_WriteServers(void)
case MT_MASTERDP:
typename = "master:dp";
break;
case MT_MASTERHTTP:
typename = "master:http";
case MT_MASTERHTTPNQ:
typename = "master:httpnq";
break;
case MT_MASTERHTTPQW:
typename = "master:httpqw";
@ -1345,7 +1350,7 @@ void MasterInfo_WriteServers(void)
}
//poll master servers for server lists.
void MasterInfo_Begin(void)
void MasterInfo_Refresh(void)
{
master_t *mast;
if (!Master_LoadMasterList("masters.txt", MT_MASTERQW, 5))
@ -1378,7 +1383,7 @@ void MasterInfo_Begin(void)
// if (q1servers) //nq master servers
{
Master_AddMasterHTTP("http://www.gameaholic.com/servers/qspy-quake", MT_MASTERHTTP, "gameaholic's NQ master");
Master_AddMasterHTTP("http://www.gameaholic.com/servers/qspy-quake", MT_MASTERHTTPNQ, "gameaholic's NQ master");
Master_AddMaster("255.255.255.255:26000", MT_BCASTNQ, "Nearby Quake1 servers");
Master_AddMaster("ghdigital.com:27950", MT_MASTERDP, "DarkPlaces Master 1");
@ -1407,8 +1412,11 @@ void MasterInfo_Begin(void)
for (mast = master; mast; mast=mast->next)
{
MasterInfo_Request(mast, false);
mast->sends = 1;
}
Master_SortServers();
nextsort = Sys_DoubleTime() + 2;
}
void Master_QueryServer(serverinfo_t *server)
@ -1446,6 +1454,7 @@ void CL_QueryServers(void)
static int poll;
int op;
serverinfo_t *server;
master_t *mast;
extern cvar_t sb_hidequake2;
extern cvar_t sb_hidequake3;
@ -1454,6 +1463,46 @@ void CL_QueryServers(void)
op = poll;
for (mast = master; mast; mast=mast->next)
{
switch (mast->type)
{
case MT_BAD:
continue;
case MT_MASTERHTTPNQ:
case MT_BCASTNQ:
case MT_SINGLENQ:
case MT_BCASTDP:
case MT_SINGLEDP:
case MT_MASTERDP:
if (sb_hidenetquake.value)
continue;
break;
case MT_MASTERHTTPQW:
case MT_BCASTQW:
case MT_SINGLEQW:
case MT_MASTERQW:
if (sb_hidequakeworld.value)
continue;
break;
case MT_BCASTQ2:
case MT_SINGLEQ2:
case MT_MASTERQ2:
if (sb_hidequake2.value)
continue;
break;
case MT_BCASTQ3:
case MT_MASTERQ3:
case MT_SINGLEQ3:
if (sb_hidequake3.value)
continue;
break;
}
if (mast->sends > 0)
MasterInfo_Request(mast, false);
}
for (server = firstserver; op>0 && server; server=server->next, op--);
@ -1510,9 +1559,9 @@ void CL_QueryServers(void)
poll = 0;
}
int Master_TotalCount(void)
unsigned int Master_TotalCount(void)
{
int count=0;
unsigned int count=0;
serverinfo_t *info;
for (info = firstserver; info; info = info->next)
@ -1522,6 +1571,19 @@ int Master_TotalCount(void)
return count;
}
unsigned int Master_NumPolled(void)
{
unsigned int count=0;
serverinfo_t *info;
for (info = firstserver; info; info = info->next)
{
if (info->maxplayers)
count++;
}
return count;
}
//true if server is on a different master's list.
serverinfo_t *Master_InfoForServer (netadr_t addr)
{

View file

@ -16,9 +16,7 @@
#ifdef CSQC_DAT
#ifdef GLQUAKE
#include "glquake.h" //evil to include this
#endif
#include "shader.h"
//#define CHEAT_PARANOID
@ -1368,6 +1366,12 @@ static void QCBUILTIN PF_R_RenderScene(progfuncs_t *prinst, struct globalvars_s
GL_Set2D ();
}
#endif
#ifdef D3DQUAKE
if (qrenderer == QR_DIRECT3D)
{
D3D9_Set2D ();
}
#endif
vid.recalc_refdef = 1;
@ -3798,7 +3802,7 @@ static void QCBUILTIN PF_skel_set_bone (progfuncs_t *prinst, struct globalvars_s
bonemat_fromqcvectors(skelobj->bonematrix+12*boneidx, matrix[0], matrix[1], matrix[2], G_VECTOR(OFS_PARM2));
}
//void(float skel, float bonenum, vector org) skel_mul_bone (FTE_CSQC_SKELETONOBJECTS) (reads v_forward etc)
//void(float skel, float bonenum, vector org [, vector fwd, vector right, vector up]) skel_mul_bone (FTE_CSQC_SKELETONOBJECTS) (reads v_forward etc)
static void QCBUILTIN PF_skel_mul_bone (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
int skelidx = G_FLOAT(OFS_PARM0);

View file

@ -1150,7 +1150,7 @@ void QCBUILTIN PF_M_sethostcachesort(progfuncs_t *prinst, struct globalvars_s *p
//void refreshhostcache(void) = #620;
void QCBUILTIN PF_M_refreshhostcache(progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
MasterInfo_Begin();
MasterInfo_Refresh();
}
//float gethostcachenumber(float fld, float hostnr) = #621;
void QCBUILTIN PF_M_gethostcachenumber(progfuncs_t *prinst, struct globalvars_s *pr_globals)

View file

@ -529,10 +529,10 @@ void R2D_Conback_Callback(struct cvar_s *var, char *oldvalue)
if (*var->string)
conback = R_RegisterPic(var->string);
if (!conback || !conback->width)
if (!conback || conback->flags & SHADER_NOIMAGE)
{
conback = R_RegisterCustom("console", NULL, NULL);
if (!conback)
if (!conback || conback->flags & SHADER_NOIMAGE)
{
if (M_GameType() == MGT_HEXEN2)
conback = R_RegisterPic("gfx/menu/conback.lmp");

View file

@ -2201,6 +2201,9 @@ void Sbar_DrawTeamStatus(void)
if (track == p) //nor is the person you are tracking
continue;
if (cl.players[p].teamstatustime < realtime)
continue;
if (!*cl.players[p].teamstatus) //only show them if they have something. no blank lines thanks
continue;
if (strcmp(cl.players[p].team, cl.players[track].team))
@ -2286,6 +2289,8 @@ qboolean Sbar_UpdateTeamStatus(player_info_t *player, char *status)
outlen--;
}
player->teamstatustime = realtime + 10;
*outb = '\0';
if (sbar_teamstatus.value == 2)

View file

@ -103,6 +103,7 @@ struct font_s *Font_LoadFont(int height, char *fontfilename);
void Font_Free(struct font_s *f);
void Font_BeginString(struct font_s *font, int vx, int vy, int *px, int *py);
void Font_BeginScaledString(struct font_s *font, float vx, float vy, float *px, float *py); /*avoid using*/
void Font_Transform(int vx, int vy, int *px, int *py);
int Font_CharHeight(void);
int Font_CharWidth(unsigned int charcode);
int Font_CharEndCoord(int x, unsigned int charcode);

View file

@ -156,6 +156,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define DPMMODELS //darkplaces model format (which I've never seen anyone use)
#define PSKMODELS //PSK model format (ActorX stuff from UT, though not the format the game itself uses)
#define HALFLIFEMODELS //halflife model support (experimental)
// #define INTERQUAKEMODELS
#define HUFFNETWORK //huffman network compression
//#define DOOMWADS //doom wad/sprite support

View file

@ -3310,7 +3310,7 @@ void COM_Init (void)
Cmd_AddCommand ("flocate", COM_Locate_f); //prints the pak or whatever where this file can be found.
Cmd_AddCommand ("version", COM_Version_f); //prints the pak or whatever where this file can be found.
Cmd_AddCommand ("crashme", (void*)0); //debugging feature, makes it jump to an invalid address
Cmd_AddCommand ("crashme", (void*)1); //debugging feature, makes it jump to an invalid address
COM_InitFilesystem ();

View file

@ -33,6 +33,9 @@ typedef enum {qfalse, qtrue} qboolean;//false and true are forcivly defined.
typedef enum {false, true} qboolean;
#endif
#define STRINGIFY2(s) #s
#define STRINGIFY(s) STRINGIFY2(s)
#define MAX_INFO_STRING 196 //regular quakeworld. Sickening isn't it.
#define EXTENDED_INFO_STRING 1024
#define MAX_SERVERINFO_STRING 1024 //standard quake has 512 here.

View file

@ -92,12 +92,23 @@ typedef struct conline_s {
struct conline_s *newer;
unsigned short length;
unsigned short lines;
float time;
} conline_t;
#define CONF_HIDDEN 1
#define CONF_NOTIFY 2
#define CONF_NOTIFY_BOTTOM 4 /*align the bottom*/
#define CONF_NOTIMES 8
typedef struct console_s
{
char name[64];
int linecount;
unsigned int flags;
int notif_x;
int notif_y;
int notif_w;
int notif_l;
float notif_t;
conline_t *oldest;
conline_t *current; // line where next message will be printed
int x; // offset in current line for next print
@ -115,13 +126,13 @@ typedef struct console_s
extern console_t con_main;
extern console_t *con_current; // point to either con_main or con_chat
extern console_t *con_chat;
extern int scr_chatmode;
//extern int con_totallines;
extern qboolean con_initialized;
extern qbyte *con_chars;
extern int con_notifylines; // scan lines to clear for notify lines
void Con_DrawCharacter (int cx, int line, int num);
@ -150,7 +161,7 @@ void Con_Destroy (console_t *con);
void Con_SetActive (console_t *con);
qboolean Con_NameForNum(int num, char *buffer, int buffersize);
console_t *Con_FindConsole(char *name);
console_t *Con_Create(char *name);
console_t *Con_Create(char *name, unsigned int flags);
void Con_SetVisible (console_t *con);
void Con_PrintCon (console_t *con, char *txt);

View file

@ -116,7 +116,8 @@ typedef struct
qboolean fatal_error;
#ifdef NQPROT
qboolean isnqprotocol;
int isnqprotocol;
qboolean nqreliable_allowed;
#endif
struct netprim_s netprim;

View file

@ -367,41 +367,53 @@ int Netchan_Transmit (netchan_t *chan, int length, qbyte *data, int rate)
send.maxsize = MAX_NQMSGLEN + PACKET_HEADER;
send.cursize = 0;
if (!chan->reliable_length && chan->message.cursize)
/*unreliables flood out, but reliables are tied to server sequences*/
if (chan->nqreliable_allowed)
{
memcpy (chan->reliable_buf, chan->message_buf, chan->message.cursize);
chan->reliable_length = chan->message.cursize;
chan->reliable_start = 0;
chan->message.cursize = 0;
}
i = chan->reliable_length - chan->reliable_start;
if (i>0)
{
MSG_WriteLong(&send, 0);
MSG_WriteLong(&send, LongSwap(chan->reliable_sequence));
if (i > MAX_NQDATAGRAM)
i = MAX_NQDATAGRAM;
SZ_Write (&send, chan->reliable_buf+chan->reliable_start, i);
if (chan->reliable_start+i == chan->reliable_length)
if (!chan->reliable_length && chan->message.cursize)
{
if (send.cursize + length < send.maxsize)
{ //throw the unreliable packet into the same one as the reliable (but not sent reliably)
SZ_Write (&send, data, length);
length = 0;
}
*(int*)send_buf = BigLong(NETFLAG_DATA | NETFLAG_EOM | send.cursize);
memcpy (chan->reliable_buf, chan->message_buf, chan->message.cursize);
chan->reliable_length = chan->message.cursize;
chan->reliable_start = 0;
chan->message.cursize = 0;
}
else
*(int*)send_buf = BigLong(NETFLAG_DATA | send.cursize);
NET_SendPacket (chan->sock, send.cursize, send.data, chan->remote_address);
Netchan_Block(chan, send.cursize, rate);
sentsize += send.cursize;
send.cursize = 0;
i = chan->reliable_length - chan->reliable_start;
if (i>0)
{
MSG_WriteLong(&send, 0);
MSG_WriteLong(&send, LongSwap(chan->reliable_sequence));
if (i > MAX_NQDATAGRAM)
i = MAX_NQDATAGRAM;
SZ_Write (&send, chan->reliable_buf+chan->reliable_start, i);
if (chan->reliable_start+i == chan->reliable_length)
{
if (send.cursize + length < send.maxsize)
{ //throw the unreliable packet into the same one as the reliable (but not sent reliably)
SZ_Write (&send, data, length);
length = 0;
}
*(int*)send_buf = BigLong(NETFLAG_DATA | NETFLAG_EOM | send.cursize);
}
else
*(int*)send_buf = BigLong(NETFLAG_DATA | send.cursize);
NET_SendPacket (chan->sock, send.cursize, send.data, chan->remote_address);
Netchan_Block(chan, send.cursize, rate);
sentsize += send.cursize;
if (showpackets.value)
Con_Printf ("--> r s=%i a=%i(%i) %i\n"
, chan->outgoing_sequence
, chan->incoming_sequence
, chan->incoming_reliable_sequence
, send.cursize);
send.cursize = 0;
}
chan->nqreliable_allowed = false;
}
//send out the unreliable (if still unsent)
@ -418,6 +430,11 @@ int Netchan_Transmit (netchan_t *chan, int length, qbyte *data, int rate)
Netchan_Block(chan, send.cursize, rate);
sentsize += send.cursize;
if (showpackets.value)
Con_Printf ("--> u s=%i %i\n"
, chan->outgoing_unreliable
, send.cursize);
send.cursize = 0;
}
return sentsize;

View file

@ -3278,14 +3278,12 @@ void NET_Init (void)
Sys_Error ("Winsock initialization failed.");
#endif
}
#define STRINGIFY2(s) #s
#define STRINGIFY(s) STRINGIFY2(s)
#ifndef SERVERONLY
void NET_InitClient(void)
{
const char *port;
int p;
port = STRINGIFY(PORT_CLIENT);
port = STRINGIFY(PORT_QWCLIENT);
p = COM_CheckParm ("-port");
if (p && p < com_argc)
@ -3369,7 +3367,7 @@ void NET_CloseServer(void)
void NET_InitServer(void)
{
char *port;
port = STRINGIFY(PORT_SERVER);
port = STRINGIFY(PORT_QWSERVER);
if (sv_listen_nq.value || sv_listen_dp.value || sv_listen_qw.value || sv_listen_q3.value)
{

View file

@ -105,11 +105,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//=========================================
#define PORT_CLIENT 27001
#define PORT_MASTER 27000
#define PORT_SERVER 27500
#define Q2PORT_CLIENT 27901
#define Q2PORT_SERVER 27910
#define PORT_NQSERVER 26000
#define PORT_QWCLIENT 27001
#define PORT_QWMASTER 27000
#define PORT_QWSERVER 27500
#define PORT_Q2CLIENT 27901
#define PORT_Q2SERVER 27910
//=========================================
@ -131,6 +132,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define A2C_CLIENT_COMMAND 'B' // + command line
#define S2M_SHUTDOWN 'C'
#define C2M_MASTER_REQUEST 'c'
#define M2C_MASTER_REPLY 'd' // + \n + qw server port list
//==================
// note that there are some defs.qc that mirror to these numbers

View file

@ -214,128 +214,6 @@ static void BE_ApplyTMUState(unsigned int tu, unsigned int flags)
}
}
void D3DBE_Reset(qboolean before)
{
int i, tmu;
if (before)
{
IDirect3DDevice9_SetVertexDeclaration(pD3DDev9, NULL);
shaderstate.curvertdecl = 0;
for (i = 0; i < 5+MAX_TMUS; i++)
IDirect3DDevice9_SetStreamSource(pD3DDev9, i, NULL, 0, 0);
IDirect3DDevice9_SetIndices(pD3DDev9, NULL);
if (shaderstate.dynxyz_buff)
IDirect3DVertexBuffer9_Release(shaderstate.dynxyz_buff);
shaderstate.dynxyz_buff = NULL;
for (tmu = 0; tmu < MAX_TMUS; tmu++)
{
if (shaderstate.dynst_buff[tmu])
IDirect3DVertexBuffer9_Release(shaderstate.dynst_buff[tmu]);
shaderstate.dynst_buff[tmu] = NULL;
}
if (shaderstate.dyncol_buff)
IDirect3DVertexBuffer9_Release(shaderstate.dyncol_buff);
shaderstate.dyncol_buff = NULL;
if (shaderstate.dynidx_buff)
IDirect3DIndexBuffer9_Release(shaderstate.dynidx_buff);
shaderstate.dynidx_buff = NULL;
for (i = 0; i < D3D_VDEC_MAX; i++)
{
if (vertexdecls[i])
IDirect3DVertexDeclaration9_Release(vertexdecls[i]);
vertexdecls[i] = NULL;
}
}
else
{
D3DVERTEXELEMENT9 decl[8], declend=D3DDECL_END();
int elements;
for (i = 0; i < D3D_VDEC_MAX; i++)
{
elements = 0;
decl[elements].Stream = 0;
decl[elements].Offset = 0;
decl[elements].Type = D3DDECLTYPE_FLOAT3;
decl[elements].Method = D3DDECLMETHOD_DEFAULT;
decl[elements].Usage = D3DDECLUSAGE_POSITION;
decl[elements].UsageIndex = 0;
elements++;
if (i & D3D_VDEC_COL4B)
{
decl[elements].Stream = 1;
decl[elements].Offset = 0;
decl[elements].Type = D3DDECLTYPE_D3DCOLOR;
decl[elements].Method = D3DDECLMETHOD_DEFAULT;
decl[elements].Usage = D3DDECLUSAGE_COLOR;
decl[elements].UsageIndex = 0;
elements++;
}
/* if (i & D3D_VDEC_NORMS)
{
decl[elements].Stream = 2;
decl[elements].Offset = 0;
decl[elements].Type = D3DDECLTYPE_FLOAT2;
decl[elements].Method = D3DDECLMETHOD_DEFAULT;
decl[elements].Usage = D3DDECLUSAGE_TEXCOORD;
decl[elements].UsageIndex = 1;
elements++;
decl[elements].Stream = 3;
decl[elements].Offset = 0;
decl[elements].Type = D3DDECLTYPE_FLOAT2;
decl[elements].Method = D3DDECLMETHOD_DEFAULT;
decl[elements].Usage = D3DDECLUSAGE_TEXCOORD;
decl[elements].UsageIndex = 1;
elements++;
decl[elements].Stream = 4;
decl[elements].Offset = 0;
decl[elements].Type = D3DDECLTYPE_FLOAT2;
decl[elements].Method = D3DDECLMETHOD_DEFAULT;
decl[elements].Usage = D3DDECLUSAGE_TEXCOORD;
decl[elements].UsageIndex = 1;
elements++;
}
*/
for (tmu = 0; tmu < MAX_TMUS; tmu++)
{
if (i & (D3D_VDEC_ST0<<tmu))
{
decl[elements].Stream = 5+tmu;
decl[elements].Offset = 0;
decl[elements].Type = D3DDECLTYPE_FLOAT2;
decl[elements].Method = D3DDECLMETHOD_DEFAULT;
decl[elements].Usage = D3DDECLUSAGE_TEXCOORD;
decl[elements].UsageIndex = tmu;
elements++;
}
}
decl[elements] = declend;
elements++;
IDirect3DDevice9_CreateVertexDeclaration(pD3DDev9, decl, &vertexdecls[i]);
}
IDirect3DDevice9_CreateVertexBuffer(pD3DDev9, shaderstate.dynxyz_size, D3DUSAGE_DYNAMIC|D3DUSAGE_WRITEONLY, 0, D3DPOOL_DEFAULT, &shaderstate.dynxyz_buff, NULL);
for (tmu = 0; tmu < MAX_TMUS; tmu++)
IDirect3DDevice9_CreateVertexBuffer(pD3DDev9, shaderstate.dynst_size, D3DUSAGE_DYNAMIC|D3DUSAGE_WRITEONLY, 0, D3DPOOL_DEFAULT, &shaderstate.dynst_buff[tmu], NULL);
IDirect3DDevice9_CreateVertexBuffer(pD3DDev9, shaderstate.dyncol_size, D3DUSAGE_DYNAMIC|D3DUSAGE_WRITEONLY, 0, D3DPOOL_DEFAULT, &shaderstate.dyncol_buff, NULL);
IDirect3DDevice9_CreateIndexBuffer(pD3DDev9, shaderstate.dynidx_size, D3DUSAGE_DYNAMIC|D3DUSAGE_WRITEONLY, D3DFMT_QINDEX, D3DPOOL_DEFAULT, &shaderstate.dynidx_buff, NULL);
for (i = 0; i < MAX_TMUS; i++)
{
shaderstate.tmuflags[i] = ~0;
BE_ApplyTMUState(i, 0);
}
}
}
static void D3DBE_ApplyShaderBits(unsigned int bits)
{
unsigned int delta;
@ -469,6 +347,132 @@ static void D3DBE_ApplyShaderBits(unsigned int bits)
}
}
void D3DBE_Reset(qboolean before)
{
int i, tmu;
if (before)
{
IDirect3DDevice9_SetVertexDeclaration(pD3DDev9, NULL);
shaderstate.curvertdecl = 0;
for (i = 0; i < 5+MAX_TMUS; i++)
IDirect3DDevice9_SetStreamSource(pD3DDev9, i, NULL, 0, 0);
IDirect3DDevice9_SetIndices(pD3DDev9, NULL);
if (shaderstate.dynxyz_buff)
IDirect3DVertexBuffer9_Release(shaderstate.dynxyz_buff);
shaderstate.dynxyz_buff = NULL;
for (tmu = 0; tmu < MAX_TMUS; tmu++)
{
if (shaderstate.dynst_buff[tmu])
IDirect3DVertexBuffer9_Release(shaderstate.dynst_buff[tmu]);
shaderstate.dynst_buff[tmu] = NULL;
}
if (shaderstate.dyncol_buff)
IDirect3DVertexBuffer9_Release(shaderstate.dyncol_buff);
shaderstate.dyncol_buff = NULL;
if (shaderstate.dynidx_buff)
IDirect3DIndexBuffer9_Release(shaderstate.dynidx_buff);
shaderstate.dynidx_buff = NULL;
for (i = 0; i < D3D_VDEC_MAX; i++)
{
if (vertexdecls[i])
IDirect3DVertexDeclaration9_Release(vertexdecls[i]);
vertexdecls[i] = NULL;
}
}
else
{
D3DVERTEXELEMENT9 decl[8], declend=D3DDECL_END();
int elements;
for (i = 0; i < D3D_VDEC_MAX; i++)
{
elements = 0;
decl[elements].Stream = 0;
decl[elements].Offset = 0;
decl[elements].Type = D3DDECLTYPE_FLOAT3;
decl[elements].Method = D3DDECLMETHOD_DEFAULT;
decl[elements].Usage = D3DDECLUSAGE_POSITION;
decl[elements].UsageIndex = 0;
elements++;
if (i & D3D_VDEC_COL4B)
{
decl[elements].Stream = 1;
decl[elements].Offset = 0;
decl[elements].Type = D3DDECLTYPE_D3DCOLOR;
decl[elements].Method = D3DDECLMETHOD_DEFAULT;
decl[elements].Usage = D3DDECLUSAGE_COLOR;
decl[elements].UsageIndex = 0;
elements++;
}
/* if (i & D3D_VDEC_NORMS)
{
decl[elements].Stream = 2;
decl[elements].Offset = 0;
decl[elements].Type = D3DDECLTYPE_FLOAT2;
decl[elements].Method = D3DDECLMETHOD_DEFAULT;
decl[elements].Usage = D3DDECLUSAGE_TEXCOORD;
decl[elements].UsageIndex = 1;
elements++;
decl[elements].Stream = 3;
decl[elements].Offset = 0;
decl[elements].Type = D3DDECLTYPE_FLOAT2;
decl[elements].Method = D3DDECLMETHOD_DEFAULT;
decl[elements].Usage = D3DDECLUSAGE_TEXCOORD;
decl[elements].UsageIndex = 1;
elements++;
decl[elements].Stream = 4;
decl[elements].Offset = 0;
decl[elements].Type = D3DDECLTYPE_FLOAT2;
decl[elements].Method = D3DDECLMETHOD_DEFAULT;
decl[elements].Usage = D3DDECLUSAGE_TEXCOORD;
decl[elements].UsageIndex = 1;
elements++;
}
*/
for (tmu = 0; tmu < MAX_TMUS; tmu++)
{
if (i & (D3D_VDEC_ST0<<tmu))
{
decl[elements].Stream = 5+tmu;
decl[elements].Offset = 0;
decl[elements].Type = D3DDECLTYPE_FLOAT2;
decl[elements].Method = D3DDECLMETHOD_DEFAULT;
decl[elements].Usage = D3DDECLUSAGE_TEXCOORD;
decl[elements].UsageIndex = tmu;
elements++;
}
}
decl[elements] = declend;
elements++;
IDirect3DDevice9_CreateVertexDeclaration(pD3DDev9, decl, &vertexdecls[i]);
}
IDirect3DDevice9_CreateVertexBuffer(pD3DDev9, shaderstate.dynxyz_size, D3DUSAGE_DYNAMIC|D3DUSAGE_WRITEONLY, 0, D3DPOOL_DEFAULT, &shaderstate.dynxyz_buff, NULL);
for (tmu = 0; tmu < MAX_TMUS; tmu++)
IDirect3DDevice9_CreateVertexBuffer(pD3DDev9, shaderstate.dynst_size, D3DUSAGE_DYNAMIC|D3DUSAGE_WRITEONLY, 0, D3DPOOL_DEFAULT, &shaderstate.dynst_buff[tmu], NULL);
IDirect3DDevice9_CreateVertexBuffer(pD3DDev9, shaderstate.dyncol_size, D3DUSAGE_DYNAMIC|D3DUSAGE_WRITEONLY, 0, D3DPOOL_DEFAULT, &shaderstate.dyncol_buff, NULL);
IDirect3DDevice9_CreateIndexBuffer(pD3DDev9, shaderstate.dynidx_size, D3DUSAGE_DYNAMIC|D3DUSAGE_WRITEONLY, D3DFMT_QINDEX, D3DPOOL_DEFAULT, &shaderstate.dynidx_buff, NULL);
for (i = 0; i < MAX_TMUS; i++)
{
shaderstate.tmuflags[i] = ~0;
BE_ApplyTMUState(i, 0);
}
/*force all state to change, thus setting a known state*/
shaderstate.shaderbits = ~0;
D3DBE_ApplyShaderBits(0);
}
}
void D3DBE_Init(void)
{
be_maxpasses = MAX_TMUS;
@ -483,11 +487,6 @@ void D3DBE_Init(void)
shaderstate.dynidx_size = sizeof(index_t) * DYNIBUFFSIZE;
D3DBE_Reset(false);
/*force all state to change, thus setting a known state*/
shaderstate.shaderbits = ~0;
D3DBE_ApplyShaderBits(0);
}
static void allocvertexbuffer(IDirect3DVertexBuffer9 *buff, unsigned int bmaxsize, unsigned int *offset, void **data, unsigned int bytes)
@ -1557,12 +1556,12 @@ static void BE_DrawMeshChain_Internal(void)
unsigned int mno;
unsigned int passno = 0;
shaderpass_t *pass = shaderstate.curshader->passes;
extern cvar_t r_polygonoffset_submodel_offset; // r_polygonoffset_submodel_factor // unused variable
extern cvar_t r_polygonoffset_submodel_factor;
float pushdepth;
// float pushfactor;
BE_Cull(shaderstate.curshader->flags & (SHADER_CULL_FRONT | SHADER_CULL_BACK));
pushdepth = (shaderstate.curshader->polyoffset.factor + ((shaderstate.flags & BEF_PUSHDEPTH)?r_polygonoffset_submodel_offset.value:0))/0xffff;
pushdepth = (shaderstate.curshader->polyoffset.factor + ((shaderstate.flags & BEF_PUSHDEPTH)?r_polygonoffset_submodel_factor.value:0))/0xffff;
if (pushdepth != shaderstate.depthbias)
{
shaderstate.depthbias = pushdepth;

View file

@ -64,6 +64,7 @@ static qboolean vid_initializing;
extern qboolean scr_initialized; // ready to draw
extern qboolean scr_drawloading;
extern qboolean scr_con_forcedraw;
static qboolean d3d_resized;
cvar_t vid_hardwaregamma;
@ -361,26 +362,10 @@ static LRESULT WINAPI D3D9_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
}
return 0;
case WM_SIZE:
if (!vid_initializing)
{
extern cvar_t vid_conautoscale, vid_conwidth;
// force width/height to be updated
//vid.pixelwidth = window_rect.right - window_rect.left;
//vid.pixelheight = window_rect.bottom - window_rect.top;
D3DVID_UpdateWindowStatus(hWnd);
D3DBE_Reset(true);
vid.pixelwidth = d3dpp.BackBufferWidth = window_rect.right - window_rect.left;
vid.pixelheight = d3dpp.BackBufferHeight = window_rect.bottom - window_rect.top;
resetD3D9();
D3DBE_Reset(false);
Cvar_ForceCallback(&vid_conautoscale);
Cvar_ForceCallback(&vid_conwidth);
}
d3d_resized = true;
break;
case WM_CLOSE:
case WM_CLOSE:
if (!vid_initializing)
if (MessageBox (mainwindow, "Are you sure you want to quit?", "Confirm Exit",
MB_YESNO | MB_SETFOREGROUND | MB_ICONQUESTION) == IDYES)
@ -429,7 +414,10 @@ static void resetD3D9(void)
HRESULT res;
res = IDirect3DDevice9_Reset(pD3DDev9, &d3dpp);
if (FAILED(res))
{
Con_Printf("IDirect3DDevice9_Reset failed (%u)\n", res&0xffff);
return;
}
/*clear the screen to black as soon as we start up, so there's no lingering framebuffer state*/
@ -829,7 +817,7 @@ static char *(D3D9_VID_GetRGBInfo) (int prepad, int *truevidwidth, int *truevi
c = prepad+desc.Width*desc.Height*3;
p = (qbyte *)rect.pBits;
for (i=c-(3*desc.Height); i>=prepad; i-=(3*desc.Height))
for (i=c-(3*desc.Width); i>=prepad; i-=(3*desc.Width))
{
for (j=0; j<desc.Width; j++)
{
@ -904,10 +892,30 @@ static void (D3D9_SCR_UpdateScreen) (void)
qboolean nohud, noworld;
RSpeedMark();
if (d3d_resized && d3dpp.Windowed)
{
extern cvar_t vid_conautoscale, vid_conwidth;
d3d_resized = false;
// force width/height to be updated
//vid.pixelwidth = window_rect.right - window_rect.left;
//vid.pixelheight = window_rect.bottom - window_rect.top;
D3DVID_UpdateWindowStatus(mainwindow);
D3DBE_Reset(true);
vid.pixelwidth = d3dpp.BackBufferWidth = window_rect.right - window_rect.left;
vid.pixelheight = d3dpp.BackBufferHeight = window_rect.bottom - window_rect.top;
resetD3D9();
D3DBE_Reset(false);
Cvar_ForceCallback(&vid_conautoscale);
Cvar_ForceCallback(&vid_conwidth);
}
switch (IDirect3DDevice9_TestCooperativeLevel(pD3DDev9))
{
case D3DERR_DEVICELOST:
//the user has task switched away from us or something, don't do anything.
//the user has task switched away from us or something, don't draw anything until they switch back to us
return;
case D3DERR_DEVICENOTRESET:
D3DBE_Reset(true);
@ -961,7 +969,6 @@ static void (D3D9_SCR_UpdateScreen) (void)
#endif
d3d9error(IDirect3DDevice9_BeginScene(pD3DDev9));
D3D9_Set2D ();
/*
#ifdef TEXTEDITOR
if (editormodal)
@ -1030,8 +1037,7 @@ static void (D3D9_SCR_UpdateScreen) (void)
}
}
D3D9_Set2D ();
D3D9_Set2D();
R2D_BrightenScreen();

View file

@ -17,6 +17,8 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
D3DDebug|Win32 = D3DDebug|Win32
D3DDebug|x64 = D3DDebug|x64
D3DRelease|Win32 = D3DRelease|Win32
D3DRelease|x64 = D3DRelease|x64
Debug Dedicated Server|Win32 = Debug Dedicated Server|Win32
Debug Dedicated Server|x64 = Debug Dedicated Server|x64
Debug|Win32 = Debug|Win32
@ -43,6 +45,10 @@ Global
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.D3DDebug|Win32.Build.0 = D3DDebug|Win32
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.D3DDebug|x64.ActiveCfg = D3DDebug|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.D3DDebug|x64.Build.0 = D3DDebug|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.D3DRelease|Win32.ActiveCfg = D3DRelease|Win32
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.D3DRelease|Win32.Build.0 = D3DRelease|Win32
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.D3DRelease|x64.ActiveCfg = D3DRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.D3DRelease|x64.Build.0 = D3DRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.Debug Dedicated Server|Win32.ActiveCfg = Debug Dedicated Server|Win32
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.Debug Dedicated Server|Win32.Build.0 = Debug Dedicated Server|Win32
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.Debug Dedicated Server|x64.ActiveCfg = Debug Dedicated Server|x64
@ -84,6 +90,8 @@ Global
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.Release|x64.Build.0 = GLRelease|x64
{F384725A-62D4-4063-9941-6D8D2D6C2A47}.D3DDebug|Win32.ActiveCfg = D3DDebug_SDL|x64
{F384725A-62D4-4063-9941-6D8D2D6C2A47}.D3DDebug|x64.ActiveCfg = D3DDebug_SDL|x64
{F384725A-62D4-4063-9941-6D8D2D6C2A47}.D3DRelease|Win32.ActiveCfg = D3DDebug_SDL|x64
{F384725A-62D4-4063-9941-6D8D2D6C2A47}.D3DRelease|x64.ActiveCfg = D3DDebug_SDL|x64
{F384725A-62D4-4063-9941-6D8D2D6C2A47}.Debug Dedicated Server|Win32.ActiveCfg = Debug Dedicated Server SDL|x64
{F384725A-62D4-4063-9941-6D8D2D6C2A47}.Debug Dedicated Server|x64.ActiveCfg = Debug Dedicated Server SDL|x64
{F384725A-62D4-4063-9941-6D8D2D6C2A47}.Debug|Win32.ActiveCfg = Debug Dedicated Server SDL|x64
@ -108,6 +116,8 @@ Global
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.D3DDebug|Win32.ActiveCfg = GLRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.D3DDebug|x64.ActiveCfg = GLRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.D3DDebug|x64.Build.0 = GLRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.D3DRelease|Win32.ActiveCfg = GLRelease|Win32
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.D3DRelease|x64.ActiveCfg = GLRelease|Win32
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Debug Dedicated Server|Win32.ActiveCfg = GLRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Debug Dedicated Server|x64.ActiveCfg = GLRelease|x64
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Debug Dedicated Server|x64.Build.0 = GLRelease|x64
@ -146,6 +156,10 @@ Global
{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Release|x64.Build.0 = GLRelease|x64
{E0EE8B50-3A75-42A9-B80A-787675979B0C}.D3DDebug|Win32.ActiveCfg = Debug
{E0EE8B50-3A75-42A9-B80A-787675979B0C}.D3DDebug|x64.ActiveCfg = Debug
{E0EE8B50-3A75-42A9-B80A-787675979B0C}.D3DRelease|Win32.ActiveCfg = Release
{E0EE8B50-3A75-42A9-B80A-787675979B0C}.D3DRelease|Win32.Build.0 = Release
{E0EE8B50-3A75-42A9-B80A-787675979B0C}.D3DRelease|x64.ActiveCfg = Release
{E0EE8B50-3A75-42A9-B80A-787675979B0C}.D3DRelease|x64.Build.0 = Release
{E0EE8B50-3A75-42A9-B80A-787675979B0C}.Debug Dedicated Server|Win32.ActiveCfg = Debug
{E0EE8B50-3A75-42A9-B80A-787675979B0C}.Debug Dedicated Server|x64.ActiveCfg = Debug
{E0EE8B50-3A75-42A9-B80A-787675979B0C}.Debug|Win32.ActiveCfg = Debug
@ -169,6 +183,8 @@ Global
{1A353DA0-F351-4C0D-A21D-E2B460600B20}.D3DDebug|Win32.ActiveCfg = Debug|Win32
{1A353DA0-F351-4C0D-A21D-E2B460600B20}.D3DDebug|Win32.Build.0 = Debug|Win32
{1A353DA0-F351-4C0D-A21D-E2B460600B20}.D3DDebug|x64.ActiveCfg = Debug|Win32
{1A353DA0-F351-4C0D-A21D-E2B460600B20}.D3DRelease|Win32.ActiveCfg = Release|Win32
{1A353DA0-F351-4C0D-A21D-E2B460600B20}.D3DRelease|x64.ActiveCfg = Release|Win32
{1A353DA0-F351-4C0D-A21D-E2B460600B20}.Debug Dedicated Server|Win32.ActiveCfg = Debug|Win32
{1A353DA0-F351-4C0D-A21D-E2B460600B20}.Debug Dedicated Server|Win32.Build.0 = Debug|Win32
{1A353DA0-F351-4C0D-A21D-E2B460600B20}.Debug Dedicated Server|x64.ActiveCfg = Debug|Win32

File diff suppressed because it is too large Load diff

View file

@ -13,6 +13,7 @@ struct font_s *Font_LoadFont(int height, char *fontfilename);
void Font_Free(struct font_s *f);
void Font_BeginString(struct font_s *font, int vx, int vy, int *px, int *py);
void Font_BeginScaledString(struct font_s *font, float vx, float vy, float *px, float *py); /*avoid using*/
void Font_Transform(int vx, int vy, int *px, int *py);
int Font_CharHeight(void);
int Font_CharWidth(unsigned int charcode);
int Font_CharEndCoord(int x, unsigned int charcode);
@ -968,6 +969,13 @@ void Font_BeginString(struct font_s *font, int vx, int vy, int *px, int *py)
*px = (vx*(int)vid.rotpixelwidth) / (float)vid.width;
*py = (vy*(int)vid.rotpixelheight) / (float)vid.height;
}
void Font_Transform(int vx, int vy, int *px, int *py)
{
if (px)
*px = (vx*(int)vid.rotpixelwidth) / (float)vid.width;
if (py)
*py = (vy*(int)vid.rotpixelheight) / (float)vid.height;
}
void Font_BeginScaledString(struct font_s *font, float vx, float vy, float *px, float *py)
{
curfont = font;

View file

@ -188,7 +188,7 @@ void GLSCR_UpdateScreen (void)
extern char levelshotname[];
if ((key_dest == key_console || key_dest == key_game) && SCR_GetLoadingStage() == LS_NONE)
scr_con_current = vid.height;
scr_con_current = scr_conlines = vid.height;
//draw the levelshot or the conback fullscreen
if (*levelshotname)

View file

@ -174,6 +174,7 @@ RECT window_rect;
HMODULE hInstGL = NULL;
HMODULE hInstwgl = NULL;
char reqminidriver[MAX_OSPATH];
char opengldllname[MAX_OSPATH];
//just GetProcAddress with a safty net.
@ -246,48 +247,57 @@ HGLRC (APIENTRY *qwglCreateContextAttribsARB)(HDC hDC, HGLRC hShareContext, cons
qboolean GLInitialise (char *renderer)
{
if (hInstGL)
FreeModule(hInstGL);
if (hInstwgl)
FreeModule(hInstwgl);
hInstwgl=NULL;
strcpy(opengldllname, renderer);
if (*renderer)
if (!hInstGL || strcmp(reqminidriver, renderer))
{
Con_DPrintf ("Loading renderer dll \"%s\"", renderer);
hInstGL = LoadLibrary(opengldllname);
if (hInstGL)
Con_DPrintf (" Success\n");
FreeLibrary(hInstGL);
hInstGL=NULL;
if (hInstwgl)
FreeLibrary(hInstwgl);
hInstwgl=NULL;
Q_strncpyz(reqminidriver, renderer, sizeof(reqminidriver));
Q_strncpyz(opengldllname, renderer, sizeof(opengldllname));
if (*renderer)
{
Con_DPrintf ("Loading renderer dll \"%s\"", renderer);
hInstGL = LoadLibrary(opengldllname);
if (hInstGL)
Con_DPrintf (" Success\n");
else
Con_DPrintf (" Failed\n");
}
else
Con_DPrintf (" Failed\n");
hInstGL = NULL;
if (!hInstGL)
{
unsigned int emode;
strcpy(opengldllname, "opengl32");
Con_DPrintf ("Loading renderer dll \"%s\"", opengldllname);
emode = SetErrorMode(SEM_FAILCRITICALERRORS); /*no annoying errors if they use glide*/
hInstGL = LoadLibrary(opengldllname);
SetErrorMode(emode);
if (hInstGL)
Con_DPrintf (" Success\n");
else
Con_DPrintf (" Failed\n");
}
if (!hInstGL)
{
if (*renderer)
Con_Printf ("Couldn't load %s or %s\n", renderer, opengldllname);
else
Con_Printf ("Couldn't load %s\n", opengldllname);
return false;
}
}
else
hInstGL = NULL;
if (!hInstGL)
{
unsigned int emode;
strcpy(opengldllname, "opengl32");
Con_DPrintf ("Loading renderer dll \"%s\"", opengldllname);
emode = SetErrorMode(SEM_FAILCRITICALERRORS); /*no annoying errors if they use glide*/
hInstGL = LoadLibrary(opengldllname);
SetErrorMode(emode);
if (hInstGL)
Con_DPrintf (" Success\n");
else
Con_DPrintf (" Failed\n");
}
if (!hInstGL)
{
if (*renderer)
Con_Printf ("Couldn't load %s or %s\n", renderer, opengldllname);
else
Con_Printf ("Couldn't load %s\n", opengldllname);
return false;
Con_DPrintf ("Reusing renderer dll %s\n", opengldllname);
}
Con_DPrintf ("Loaded renderer dll %s\n", opengldllname);
@ -819,14 +829,23 @@ void VID_UnSetMode (void)
DestroyWindow(mainwindow);
mainwindow = NULL;
}
#if 0
//Logically this code should be active. However...
//1: vid_restarts are slightly slower if we don't reuse the old dll
//2: nvidia drivers crash if we shut it down+reload!
if (hInstGL)
{
#ifndef NPQTV
//FIXME: not cleaning up after myself because nvidia drivers crash the second time around
FreeLibrary(hInstGL);
#endif
hInstGL = NULL;
hInstGL=NULL;
}
if (hInstwgl)
{
FreeLibrary(hInstwgl);
hInstwgl=NULL;
}
*opengldllname = 0;
#endif
}

View file

@ -38,6 +38,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define APIENTRY
#endif
void D3D9_Set2D (void);
void AddPointToBounds (vec3_t v, vec3_t mins, vec3_t maxs);
qboolean BoundsIntersect (vec3_t mins1, vec3_t maxs1, vec3_t mins2, vec3_t maxs2);
void ClearBounds (vec3_t mins, vec3_t maxs);

View file

@ -2810,6 +2810,8 @@ void SVNQ_ConnectionlessPacket(void)
int header;
int length;
int active, i;
int mod, modver, flags;
unsigned int passwd;
char *str;
char buffer[256], buffer2[256];
netadr_t localaddr;
@ -2855,10 +2857,23 @@ void SVNQ_ConnectionlessPacket(void)
NET_SendPacket(NS_SERVER, sb.cursize, sb.data, net_from);
return; //not our version...
}
str = va("connect %i %i %i \"\\name\\unconnected\"", NET_PROTOCOL_VERSION, 0, SV_NewChallenge());
Cmd_TokenizeString (str, false, false);
mod = MSG_ReadByte();
modver = MSG_ReadByte();
flags = MSG_ReadByte();
passwd = MSG_ReadLong();
SVC_DirectConnect();
if (!strncmp(MSG_ReadString(), "getchallenge", 12))
{
/*dual-stack client, supporting either DP or QW protocols*/
SVC_GetChallenge ();
}
else
{
str = va("connect %i %i %i \"\\name\\unconnected\"", NET_PROTOCOL_VERSION, 0, SV_NewChallenge());
Cmd_TokenizeString (str, false, false);
SVC_DirectConnect();
}
break;
case CCREQ_SERVER_INFO:
if (Q_strcmp (MSG_ReadString(), NET_GAMENAME_NQ) != 0)
@ -3046,7 +3061,7 @@ void SV_OpenRoute_f(void)
NET_StringToAdr(Cmd_Argv(1), &to);
if (!to.port)
to.port = PORT_CLIENT;
to.port = PORT_QWCLIENT;
sprintf(data, "\xff\xff\xff\xff%c", S2C_CONNECTION);
@ -3580,7 +3595,7 @@ float SV_Frame (void)
if (sv_masterport.ival)
SVM_Think(sv_masterport.ival);
else
SVM_Think(PORT_MASTER);
SVM_Think(PORT_QWMASTER);
}
{
@ -4038,7 +4053,7 @@ void SV_InitLocal (void)
{
int port = atoi(com_argv[p+1]);
if (!port)
port = PORT_SERVER;
port = PORT_QWSERVER;
Cvar_SetValue(&sv_port, port);
#ifdef IPPROTO_IPV6
Cvar_SetValue(&sv_port_ipv6, port);

View file

@ -2083,9 +2083,11 @@ void SV_UpdateToReliableMessages (void)
#ifdef NQPROT
if (!ISQWCLIENT(client))
{
ClientReliableCheckBlock(client, sv.nqreliable_datagram.cursize);
ClientReliableWrite_SZ(client, sv.nqreliable_datagram.data, sv.nqreliable_datagram.cursize);
if (client->pextknown)
{
ClientReliableCheckBlock(client, sv.nqreliable_datagram.cursize);
ClientReliableWrite_SZ(client, sv.nqreliable_datagram.data, sv.nqreliable_datagram.cursize);
}
if (client->state != cs_spawned)
continue; // datagrams only go to spawned
SZ_Write (&client->datagram
@ -2268,7 +2270,7 @@ void SV_SendClientMessages (void)
c->send_message = false;
if (c->nextservertimeupdate != pt && c->state != cs_zombie)
{
c->send_message = true;
c->send_message = c->netchan.nqreliable_allowed = true;
if (c->state == cs_connected && !c->datagram.cursize && !c->netchan.message.cursize)
{

View file

@ -690,6 +690,7 @@ int main(int argc, char *argv[])
if (COM_CheckParm("-dumpstack"))
{
signal(SIGILL, Friendly_Crash_Handler);
signal(SIGFPE, Friendly_Crash_Handler);
signal(SIGSEGV, Friendly_Crash_Handler);
signal(SIGBUS, Friendly_Crash_Handler);
}