[SCM] Quake 3 engine branch, master, updated. debian/1.36+svn2202-1-5-g7421d51
Simon McVittie
smcv at debian.org
Fri Feb 24 08:31:42 UTC 2012
The following commit has been merged in the master branch:
commit 25c33d3a4e3c0f73232083db0e4ec63a522987de
Author: Simon McVittie <smcv at debian.org>
Date: Thu Feb 23 16:48:38 2012 +0000
Imported Upstream version 1.36+svn2224
diff --git a/Makefile b/Makefile
index e499dcd..57676a3 100644
--- a/Makefile
+++ b/Makefile
@@ -561,16 +561,19 @@ ifeq ($(PLATFORM),mingw32)
$(LIBSDIR)/win32/libSDL.dll.a
RENDERER_LIBS += $(LIBSDIR)/win32/libSDLmain.a \
$(LIBSDIR)/win32/libSDL.dll.a
+ SDLDLL=SDL.dll
else
CLIENT_LIBS += $(LIBSDIR)/win64/libSDLmain.a \
$(LIBSDIR)/win64/libSDL64.dll.a
RENDERER_LIBS += $(LIBSDIR)/win64/libSDLmain.a \
$(LIBSDIR)/win64/libSDL64.dll.a
+ SDLDLL=SDL64.dll
endif
else
CLIENT_CFLAGS += $(SDL_CFLAGS)
CLIENT_LIBS += $(SDL_LIBS)
RENDERER_LIBS += $(SDL_LIBS)
+ SDLDLL=SDL.dll
endif
BUILD_CLIENT_SMP = 0
@@ -1443,10 +1446,17 @@ Q3OBJ = \
$(B)/client/sdl_input.o \
$(B)/client/sdl_snd.o \
\
- $(B)/client/con_passive.o \
$(B)/client/con_log.o \
$(B)/client/sys_main.o
+ifeq ($(PLATFORM),mingw32)
+ Q3OBJ += \
+ $(B)/client/con_passive.o
+else
+ Q3OBJ += \
+ $(B)/client/con_tty.o
+endif
+
Q3ROBJ = \
$(B)/renderer/tr_animation.o \
$(B)/renderer/tr_backend.o \
@@ -2396,7 +2406,7 @@ TOOLSOBJ = $(LBURGOBJ) $(Q3CPPOBJ) $(Q3RCCOBJ) $(Q3LCCOBJ) $(Q3ASMOBJ)
copyfiles: release
- @if [ ! -d $(COPYDIR)/$(BASENAME) ]; then echo "You need to set COPYDIR to where your Quake3 data is!"; fi
+ @if [ ! -d $(COPYDIR)/$(BASEGAME) ]; then echo "You need to set COPYDIR to where your Quake3 data is!"; fi
ifneq ($(BUILD_GAME_SO),0)
ifneq ($(BUILD_BASEGAME),0)
-$(MKDIR) -p -m 0755 $(COPYDIR)/$(BASEGAME)
@@ -2486,6 +2496,7 @@ distclean: clean toolsclean
installer: release
ifeq ($(PLATFORM),mingw32)
@$(MAKE) VERSION=$(VERSION) -C $(NSISDIR) V=$(V) \
+ SDLDLL=$(SDLDLL) \
USE_RENDERER_DLOPEN=$(USE_RENDERER_DLOPEN) \
USE_OPENAL_DLOPEN=$(USE_OPENAL_DLOPEN) \
USE_CURL_DLOPEN=$(USE_CURL_DLOPEN) \
diff --git a/README b/README
index 326367b..bc8c9a4 100644
--- a/README
+++ b/README
@@ -136,6 +136,7 @@ New cvars
for forward movement speed/direction.
j_side - Joystick analogue to m_side,
for side movement speed/direction.
+ j_up - Joystick up movement speed/direction.
j_pitch - Joystick analogue to m_pitch,
for pitch rotation speed/direction.
j_yaw - Joystick analogue to m_yaw,
@@ -144,6 +145,8 @@ New cvars
controls forward/back.
j_side_axis - Selects which joystick axis
controls left/right.
+ j_up_axis - Selects which joystick axis
+ controls up/down.
j_pitch_axis - Selects which joystick axis
controls pitch.
j_yaw_axis - Selects which joystick axis
@@ -657,9 +660,9 @@ Building with MinGW for pre Windows XP
------------------------------------------------------------- Contributing -----
Please send all patches to bugzilla (https://bugzilla.icculus.org), or join the
-mailing list (quake3-subscribe at icculus.org) and submit your patch there. The
-best case scenario is that you submit your patch to bugzilla, and then post the
-URL to the mailing list.
+mailing list (http://lists.ioquake.org/listinfo.cgi/ioquake3-ioquake.org) and
+submit your patch there. The best case scenario is that you submit your patch
+to bugzilla, and then post the URL to the mailing list.
The focus for ioq3 is to develop a stable base suitable for further development
and provide players with the same Quake 3 experience they've had for years. As
diff --git a/code/cgame/cg_draw.c b/code/cgame/cg_draw.c
index 9666083..aa22657 100644
--- a/code/cgame/cg_draw.c
+++ b/code/cgame/cg_draw.c
@@ -1723,7 +1723,7 @@ static void CG_DrawLagometer( void ) {
trap_R_SetColor( NULL );
if ( cg_nopredict.integer || cg_synchronousClients.integer ) {
- CG_DrawBigString( ax, ay, "snc", 1.0 );
+ CG_DrawBigString( x, y, "snc", 1.0 );
}
CG_DrawDisconnect();
diff --git a/code/cgame/cg_players.c b/code/cgame/cg_players.c
index e5cf2f0..6f74c27 100644
--- a/code/cgame/cg_players.c
+++ b/code/cgame/cg_players.c
@@ -520,9 +520,9 @@ CG_RegisterClientModelname
==========================
*/
static qboolean CG_RegisterClientModelname( clientInfo_t *ci, const char *modelName, const char *skinName, const char *headModelName, const char *headSkinName, const char *teamName ) {
- char filename[MAX_QPATH*2];
+ char filename[MAX_QPATH];
const char *headName;
- char newTeamName[MAX_QPATH*2];
+ char newTeamName[MAX_QPATH];
if ( headModelName[0] == '\0' ) {
headName = modelName;
diff --git a/code/client/cl_input.c b/code/client/cl_input.c
index 4153b66..c007ec5 100644
--- a/code/client/cl_input.c
+++ b/code/client/cl_input.c
@@ -418,7 +418,7 @@ void CL_JoystickMove( usercmd_t *cmd ) {
cmd->forwardmove = ClampChar( cmd->forwardmove + (int) (j_forward->value * cl.joystickAxis[j_forward_axis->integer]) );
}
- cmd->upmove = ClampChar( cmd->upmove + cl.joystickAxis[AXIS_UP] );
+ cmd->upmove = ClampChar( cmd->upmove + (int) (j_up->value * cl.joystickAxis[j_up_axis->integer]) );
}
/*
diff --git a/code/client/cl_main.c b/code/client/cl_main.c
index 2606f6d..489a969 100644
--- a/code/client/cl_main.c
+++ b/code/client/cl_main.c
@@ -96,10 +96,12 @@ cvar_t *j_pitch;
cvar_t *j_yaw;
cvar_t *j_forward;
cvar_t *j_side;
+cvar_t *j_up;
cvar_t *j_pitch_axis;
cvar_t *j_yaw_axis;
cvar_t *j_forward_axis;
cvar_t *j_side_axis;
+cvar_t *j_up_axis;
cvar_t *cl_activeAction;
@@ -3524,10 +3526,19 @@ void CL_Init( void ) {
j_yaw = Cvar_Get ("j_yaw", "-0.022", CVAR_ARCHIVE);
j_forward = Cvar_Get ("j_forward", "-0.25", CVAR_ARCHIVE);
j_side = Cvar_Get ("j_side", "0.25", CVAR_ARCHIVE);
+ j_up = Cvar_Get ("j_up", "1", CVAR_ARCHIVE);
+
j_pitch_axis = Cvar_Get ("j_pitch_axis", "3", CVAR_ARCHIVE);
j_yaw_axis = Cvar_Get ("j_yaw_axis", "4", CVAR_ARCHIVE);
j_forward_axis = Cvar_Get ("j_forward_axis", "1", CVAR_ARCHIVE);
j_side_axis = Cvar_Get ("j_side_axis", "0", CVAR_ARCHIVE);
+ j_up_axis = Cvar_Get ("j_up_axis", "2", CVAR_ARCHIVE);
+
+ Cvar_CheckRange(j_pitch_axis, 0, MAX_JOYSTICK_AXIS-1, qtrue);
+ Cvar_CheckRange(j_yaw_axis, 0, MAX_JOYSTICK_AXIS-1, qtrue);
+ Cvar_CheckRange(j_forward_axis, 0, MAX_JOYSTICK_AXIS-1, qtrue);
+ Cvar_CheckRange(j_side_axis, 0, MAX_JOYSTICK_AXIS-1, qtrue);
+ Cvar_CheckRange(j_up_axis, 0, MAX_JOYSTICK_AXIS-1, qtrue);
cl_motdString = Cvar_Get( "cl_motdString", "", CVAR_ROM );
diff --git a/code/client/client.h b/code/client/client.h
index 3204dc8..bfd897e 100644
--- a/code/client/client.h
+++ b/code/client/client.h
@@ -403,10 +403,12 @@ extern cvar_t *j_pitch;
extern cvar_t *j_yaw;
extern cvar_t *j_forward;
extern cvar_t *j_side;
+extern cvar_t *j_up;
extern cvar_t *j_pitch_axis;
extern cvar_t *j_yaw_axis;
extern cvar_t *j_forward_axis;
extern cvar_t *j_side_axis;
+extern cvar_t *j_up_axis;
extern cvar_t *cl_timedemo;
extern cvar_t *cl_aviFrameRate;
diff --git a/code/game/g_active.c b/code/game/g_active.c
index df56efd..93ff714 100644
--- a/code/game/g_active.c
+++ b/code/game/g_active.c
@@ -1151,9 +1151,9 @@ void ClientEndFrame( gentity_t *ent ) {
// add the EF_CONNECTION flag if we haven't gotten commands recently
if ( level.time - ent->client->lastCmdTime > 1000 ) {
- ent->s.eFlags |= EF_CONNECTION;
+ ent->client->ps.eFlags |= EF_CONNECTION;
} else {
- ent->s.eFlags &= ~EF_CONNECTION;
+ ent->client->ps.eFlags &= ~EF_CONNECTION;
}
ent->client->ps.stats[STAT_HEALTH] = ent->health; // FIXME: get rid of ent->health...
diff --git a/code/qcommon/common.c b/code/qcommon/common.c
index dcc31fd..7f79047 100644
--- a/code/qcommon/common.c
+++ b/code/qcommon/common.c
@@ -966,12 +966,16 @@ void *Z_TagMalloc( int size, int tag ) {
do {
if (rover == start) {
+ // scaned all the way around the list
#ifdef ZONE_DEBUG
Z_LogHeap();
-#endif
- // scaned all the way around the list
- Com_Error( ERR_FATAL, "Z_Malloc: failed on allocation of %i bytes from the %s zone",
+
+ Com_Error(ERR_FATAL, "Z_Malloc: failed on allocation of %i bytes from the %s zone: %s, line: %d (%s)",
+ size, zone == smallzone ? "small" : "main", file, line, label);
+#else
+ Com_Error(ERR_FATAL, "Z_Malloc: failed on allocation of %i bytes from the %s zone",
size, zone == smallzone ? "small" : "main");
+#endif
return NULL;
}
if (rover->tag) {
@@ -1724,8 +1728,11 @@ void *Hunk_Alloc( int size, ha_pref preference ) {
#ifdef HUNK_DEBUG
Hunk_Log();
Hunk_SmallLog();
+
+ Com_Error(ERR_DROP, "Hunk_Alloc failed on %i: %s, line: %d (%s)", size, file, line, label);
+#else
+ Com_Error(ERR_DROP, "Hunk_Alloc failed on %i", size);
#endif
- Com_Error( ERR_DROP, "Hunk_Alloc failed on %i", size );
}
if ( hunk_permanent == &hunk_low ) {
@@ -1870,46 +1877,6 @@ void Hunk_ClearTempMemory( void ) {
}
/*
-=================
-Hunk_Trash
-=================
-*/
-void Hunk_Trash( void ) {
- int length, i, rnd;
- char *buf, value;
-
- return;
-
- if ( s_hunkData == NULL )
- return;
-
-#ifdef _DEBUG
- Com_Error(ERR_DROP, "hunk trashed");
- return;
-#endif
-
- Cvar_Set("com_jp", "1");
- Hunk_SwapBanks();
-
- if ( hunk_permanent == &hunk_low ) {
- buf = (void *)(s_hunkData + hunk_permanent->permanent);
- } else {
- buf = (void *)(s_hunkData + s_hunkTotal - hunk_permanent->permanent );
- }
- length = hunk_permanent->permanent;
-
- if (length > 0x7FFFF) {
- //randomly trash data within buf
- rnd = random() * (length - 0x7FFFF);
- value = 31;
- for (i = 0; i < 0x7FFFF; i++) {
- value *= 109;
- buf[rnd+i] ^= value;
- }
- }
-}
-
-/*
===================================================================
EVENTS AND JOURNALING
diff --git a/code/qcommon/msg.c b/code/qcommon/msg.c
index 77666c6..968d68a 100644
--- a/code/qcommon/msg.c
+++ b/code/qcommon/msg.c
@@ -715,8 +715,14 @@ void MSG_ReadDeltaUsercmd( msg_t *msg, usercmd_t *from, usercmd_t *to ) {
to->angles[1] = MSG_ReadDelta( msg, from->angles[1], 16);
to->angles[2] = MSG_ReadDelta( msg, from->angles[2], 16);
to->forwardmove = MSG_ReadDelta( msg, from->forwardmove, 8);
+ if( to->forwardmove == -128 )
+ to->forwardmove = -127;
to->rightmove = MSG_ReadDelta( msg, from->rightmove, 8);
+ if( to->rightmove == -128 )
+ to->rightmove = -127;
to->upmove = MSG_ReadDelta( msg, from->upmove, 8);
+ if( to->upmove == -128 )
+ to->upmove = -127;
to->buttons = MSG_ReadDelta( msg, from->buttons, 16);
to->weapon = MSG_ReadDelta( msg, from->weapon, 8);
}
@@ -776,8 +782,14 @@ void MSG_ReadDeltaUsercmdKey( msg_t *msg, int key, usercmd_t *from, usercmd_t *t
to->angles[1] = MSG_ReadDeltaKey( msg, key, from->angles[1], 16);
to->angles[2] = MSG_ReadDeltaKey( msg, key, from->angles[2], 16);
to->forwardmove = MSG_ReadDeltaKey( msg, key, from->forwardmove, 8);
+ if( to->forwardmove == -128 )
+ to->forwardmove = -127;
to->rightmove = MSG_ReadDeltaKey( msg, key, from->rightmove, 8);
+ if( to->rightmove == -128 )
+ to->rightmove = -127;
to->upmove = MSG_ReadDeltaKey( msg, key, from->upmove, 8);
+ if( to->upmove == -128 )
+ to->upmove = -127;
to->buttons = MSG_ReadDeltaKey( msg, key, from->buttons, 16);
to->weapon = MSG_ReadDeltaKey( msg, key, from->weapon, 8);
} else {
@@ -1190,7 +1202,7 @@ netField_t playerStateFields[] =
{ PSF(grapplePoint[0]), 0 },
{ PSF(grapplePoint[1]), 0 },
{ PSF(grapplePoint[2]), 0 },
-{ PSF(jumppad_ent), 10 },
+{ PSF(jumppad_ent), GENTITYNUM_BITS },
{ PSF(loopSound), 16 }
};
diff --git a/code/qcommon/net_ip.c b/code/qcommon/net_ip.c
index 96bed14..4a0960b 100644
--- a/code/qcommon/net_ip.c
+++ b/code/qcommon/net_ip.c
@@ -520,20 +520,12 @@ NET_GetPacket
Receive one packet
==================
*/
-#ifdef _DEBUG
-int recvfromCount;
-#endif
-
qboolean NET_GetPacket(netadr_t *net_from, msg_t *net_message, fd_set *fdr)
{
int ret;
struct sockaddr_storage from;
socklen_t fromlen;
int err;
-
-#ifdef _DEBUG
- recvfromCount++; // performance check
-#endif
if(ip_socket != INVALID_SOCKET && FD_ISSET(ip_socket, fdr))
{
@@ -1709,6 +1701,7 @@ void NET_Sleep(int msec)
NET_Restart_f
====================
*/
-void NET_Restart_f( void ) {
- NET_Config( networkingEnabled );
+void NET_Restart_f(void)
+{
+ NET_Config(qtrue);
}
diff --git a/code/qcommon/q_shared.h b/code/qcommon/q_shared.h
index 86ddb8e..fc667c0 100644
--- a/code/qcommon/q_shared.h
+++ b/code/qcommon/q_shared.h
@@ -306,7 +306,7 @@ typedef enum {
#define UI_INVERSE 0x00002000
#define UI_PULSE 0x00004000
-#if defined(_DEBUG) && !defined(BSPC)
+#if !defined(NDEBUG) && !defined(BSPC)
#define HUNK_DEBUG
#endif
diff --git a/code/qcommon/qcommon.h b/code/qcommon/qcommon.h
index 5753daa..da6f3b7 100644
--- a/code/qcommon/qcommon.h
+++ b/code/qcommon/qcommon.h
@@ -919,7 +919,7 @@ temp file loading
*/
-#if defined(_DEBUG) && !defined(BSPC)
+#if !defined(NDEBUG) && !defined(BSPC)
#define ZONE_DEBUG
#endif
@@ -949,7 +949,6 @@ void *Hunk_AllocateTempMemory( int size );
void Hunk_FreeTempMemory( void *buf );
int Hunk_MemoryRemaining( void );
void Hunk_Log( void);
-void Hunk_Trash( void );
void Com_TouchMemory( void );
@@ -1060,15 +1059,7 @@ NON-PORTABLE SYSTEM SERVICES
==============================================================
*/
-typedef enum {
- AXIS_SIDE,
- AXIS_FORWARD,
- AXIS_UP,
- AXIS_ROLL,
- AXIS_YAW,
- AXIS_PITCH,
- MAX_JOYSTICK_AXIS
-} joystickAxis_t;
+#define MAX_JOYSTICK_AXIS 16
void Sys_Init (void);
diff --git a/code/renderer/tr_init.c b/code/renderer/tr_init.c
index 2b239d8..7e89b83 100644
--- a/code/renderer/tr_init.c
+++ b/code/renderer/tr_init.c
@@ -32,6 +32,10 @@ glstate_t glState;
static void GfxInfo_f( void );
+#ifdef USE_RENDERER_DLOPEN
+cvar_t *com_altivec;
+#endif
+
cvar_t *r_flareSize;
cvar_t *r_flareFade;
cvar_t *r_flareCoeff;
@@ -981,6 +985,10 @@ R_Register
*/
void R_Register( void )
{
+ #ifdef USE_RENDERER_DLOPEN
+ com_altivec = ri.Cvar_Get("com_altivec", "1", CVAR_ARCHIVE);
+ #endif
+
//
// latched and archived variables
//
diff --git a/code/sdl/sdl_input.c b/code/sdl/sdl_input.c
index 214b0e1..ea1ecec 100644
--- a/code/sdl/sdl_input.c
+++ b/code/sdl/sdl_input.c
@@ -561,7 +561,7 @@ struct
{
qboolean buttons[16]; // !!! FIXME: these might be too many.
unsigned int oldaxes;
- int oldaaxes[16];
+ int oldaaxes[MAX_JOYSTICK_AXIS];
unsigned int oldhats;
} stick_state;
@@ -808,13 +808,12 @@ static void IN_JoyMove( void )
total = SDL_JoystickNumAxes(stick);
if (total > 0)
{
- if (total > 16) total = 16;
- for (i = 0; i < total; i++)
+ if (in_joystickUseAnalog->integer)
{
- Sint16 axis = SDL_JoystickGetAxis(stick, i);
-
- if (in_joystickUseAnalog->integer)
+ if (total > MAX_JOYSTICK_AXIS) total = MAX_JOYSTICK_AXIS;
+ for (i = 0; i < total; i++)
{
+ Sint16 axis = SDL_JoystickGetAxis(stick, i);
float f = ( (float) abs(axis) ) / 32767.0f;
if( f < in_joystickThreshold->value ) axis = 0;
@@ -825,8 +824,13 @@ static void IN_JoyMove( void )
stick_state.oldaaxes[i] = axis;
}
}
- else
+ }
+ else
+ {
+ if (total > 16) total = 16;
+ for (i = 0; i < total; i++)
{
+ Sint16 axis = SDL_JoystickGetAxis(stick, i);
float f = ( (float) axis ) / 32767.0f;
if( f < -in_joystickThreshold->value ) {
axes |= ( 1 << ( i * 2 ) );
diff --git a/code/server/sv_init.c b/code/server/sv_init.c
index 4f28793..89f4ceb 100644
--- a/code/server/sv_init.c
+++ b/code/server/sv_init.c
@@ -673,7 +673,8 @@ void SV_Init (void)
Cvar_Get ("sv_dlURL", "", CVAR_SERVERINFO | CVAR_ARCHIVE);
sv_master[0] = Cvar_Get("sv_master1", MASTER_SERVER_NAME, 0);
- for(index = 1; index < MAX_MASTER_SERVERS; index++)
+ sv_master[1] = Cvar_Get("sv_master2", "master.ioquake3.org", 0);
+ for(index = 2; index < MAX_MASTER_SERVERS; index++)
sv_master[index] = Cvar_Get(va("sv_master%d", index + 1), "", CVAR_ARCHIVE);
sv_reconnectlimit = Cvar_Get ("sv_reconnectlimit", "3", 0);
diff --git a/code/sys/con_tty.c b/code/sys/con_tty.c
index 5feb70b..8dcf043 100644
--- a/code/sys/con_tty.c
+++ b/code/sys/con_tty.c
@@ -24,6 +24,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "../qcommon/qcommon.h"
#include "sys_local.h"
+#ifndef DEDICATED
+#include "../client/client.h"
+#endif
+
#include <unistd.h>
#include <signal.h>
#include <termios.h>
@@ -45,6 +49,7 @@ static qboolean stdin_active;
// general flag to tell about tty console mode
static qboolean ttycon_on = qfalse;
static int ttycon_hide = 0;
+static int ttycon_show_overdue = 0;
// some key codes that the terminal may be using, initialised on start up
static int TTY_erase;
@@ -60,6 +65,14 @@ static field_t TTY_con;
static field_t ttyEditLines[ CON_HISTORY ];
static int hist_current = -1, hist_count = 0;
+#ifndef DEDICATED
+// Don't use "]" as it would be the same as in-game console,
+// this makes it clear where input came from.
+#define TTY_CONSOLE_PROMPT "tty]"
+#else
+#define TTY_CONSOLE_PROMPT "]"
+#endif
+
/*
==================
CON_FlushIn
@@ -123,7 +136,10 @@ static void CON_Hide( void )
CON_Back();
}
}
- CON_Back(); // Delete "]"
+ // Delete prompt
+ for (i = strlen(TTY_CONSOLE_PROMPT); i > 0; i--) {
+ CON_Back();
+ }
ttycon_hide++;
}
}
@@ -147,7 +163,7 @@ static void CON_Show( void )
if (ttycon_hide == 0)
{
size_t UNUSED_VAR size;
- size = write(STDOUT_FILENO, "]", 1);
+ size = write(STDOUT_FILENO, TTY_CONSOLE_PROMPT, strlen(TTY_CONSOLE_PROMPT));
if (TTY_con.cursor)
{
for (i=0; i<TTY_con.cursor; i++)
@@ -170,7 +186,7 @@ void CON_Shutdown( void )
{
if (ttycon_on)
{
- CON_Back(); // Delete "]"
+ CON_Hide();
tcsetattr (STDIN_FILENO, TCSADRAIN, &TTY_tc);
}
@@ -186,6 +202,11 @@ Hist_Add
void Hist_Add(field_t *field)
{
int i;
+
+ // Don't save blank lines in history.
+ if (!field->cursor)
+ return;
+
assert(hist_count <= CON_HISTORY);
assert(hist_count >= 0);
assert(hist_current >= -1);
@@ -315,6 +336,8 @@ void CON_Init( void )
tc.c_cc[VTIME] = 0;
tcsetattr (STDIN_FILENO, TCSADRAIN, &tc);
ttycon_on = qtrue;
+ ttycon_hide = 1; // Mark as hidden, so prompt is shown in CON_Show
+ CON_Show();
}
/*
@@ -354,13 +377,39 @@ char *CON_Input( void )
{
if (key == '\n')
{
+#ifndef DEDICATED
+ // if not in the game explicitly prepend a slash if needed
+ if (clc.state != CA_ACTIVE && TTY_con.cursor &&
+ TTY_con.buffer[0] != '/' && TTY_con.buffer[0] != '\\')
+ {
+ memmove(TTY_con.buffer + 1, TTY_con.buffer, sizeof(TTY_con.buffer) - 1);
+ TTY_con.buffer[0] = '\\';
+ TTY_con.cursor++;
+ }
+
+ if (TTY_con.buffer[0] == '/' || TTY_con.buffer[0] == '\\') {
+ Q_strncpyz(text, TTY_con.buffer + 1, sizeof(text));
+ } else if (TTY_con.cursor) {
+ Com_sprintf(text, sizeof(text), "cmd say %s", TTY_con.buffer);
+ } else {
+ text[0] = '\0';
+ }
+
+ // push it in history
+ Hist_Add(&TTY_con);
+ CON_Hide();
+ Com_Printf("%s%s\n", TTY_CONSOLE_PROMPT, TTY_con.buffer);
+ Field_Clear(&TTY_con);
+ CON_Show();
+#else
// push it in history
Hist_Add(&TTY_con);
Q_strncpyz(text, TTY_con.buffer, sizeof(text));
Field_Clear(&TTY_con);
key = '\n';
size = write(STDOUT_FILENO, &key, 1);
- size = write(STDOUT_FILENO, "]", 1);
+ size = write(STDOUT_FILENO, TTY_CONSOLE_PROMPT, strlen(TTY_CONSOLE_PROMPT));
+#endif
return text;
}
if (key == '\t')
@@ -422,7 +471,7 @@ char *CON_Input( void )
return NULL;
// push regular character
TTY_con.buffer[TTY_con.cursor] = key;
- TTY_con.cursor++;
+ TTY_con.cursor++; // next char will always be '\0'
// print the current line (this is differential)
size = write(STDOUT_FILENO, &key, 1);
}
@@ -465,6 +514,9 @@ CON_Print
*/
void CON_Print( const char *msg )
{
+ if (!msg[0])
+ return;
+
CON_Hide( );
if( com_ansiColor && com_ansiColor->integer )
@@ -472,5 +524,25 @@ void CON_Print( const char *msg )
else
fputs( msg, stderr );
- CON_Show( );
+ if (!ttycon_on) {
+ // CON_Hide didn't do anything.
+ return;
+ }
+
+ // Only print prompt when msg ends with a newline, otherwise the console
+ // might get garbled when output does not fit on one line.
+ if (msg[strlen(msg) - 1] == '\n') {
+ CON_Show();
+
+ // Run CON_Show the number of times it was deferred.
+ while (ttycon_show_overdue > 0) {
+ CON_Show();
+ ttycon_show_overdue--;
+ }
+ }
+ else
+ {
+ // Defer calling CON_Show
+ ttycon_show_overdue++;
+ }
}
diff --git a/code/ui/ui_main.c b/code/ui/ui_main.c
index a8a4d86..e887c8c 100644
--- a/code/ui/ui_main.c
+++ b/code/ui/ui_main.c
@@ -3608,7 +3608,7 @@ static int UI_MapCountByGameType(qboolean singlePlayer) {
}
qboolean UI_hasSkinForBase(const char *base, const char *team) {
- char test[1024];
+ char test[MAX_QPATH];
Com_sprintf( test, sizeof( test ), "models/players/%s/%s/lower_default.skin", base, team );
diff --git a/code/ui/ui_players.c b/code/ui/ui_players.c
index 0f11c5a..e42fc89 100644
--- a/code/ui/ui_players.c
+++ b/code/ui/ui_players.c
@@ -972,7 +972,7 @@ UI_RegisterClientSkin
==========================
*/
static qboolean UI_RegisterClientSkin( playerInfo_t *pi, const char *modelName, const char *skinName, const char *headModelName, const char *headSkinName , const char *teamName) {
- char filename[MAX_QPATH*2];
+ char filename[MAX_QPATH];
if (teamName && *teamName) {
Com_sprintf( filename, sizeof( filename ), "models/players/%s/%s/lower_%s.skin", modelName, teamName, skinName );
diff --git a/misc/nsis/Makefile b/misc/nsis/Makefile
index 8d447f2..a79e4e1 100644
--- a/misc/nsis/Makefile
+++ b/misc/nsis/Makefile
@@ -29,12 +29,7 @@ ifndef USE_INTERNAL_JPEG
USE_INTERNAL_JPEG=1
endif
-
-ifeq ($(ARCH),x64)
- SDLDLL=SDL64.dll
-else
- SDLDLL=SDL.dll
-endif
+SDLDLL=SDL.dll
DEFINES=
ifeq ($(USE_RENDERER_DLOPEN),1)
--
Quake 3 engine
More information about the Pkg-games-commits
mailing list