[ioquake3] 02/05: Imported Upstream version 1.36+u20151017+dfsg1
Simon McVittie
smcv at debian.org
Sun Nov 22 00:02:34 UTC 2015
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch master
in repository ioquake3.
commit 6025b177e3f8c884091245e4f7adca187ee1aded
Author: Simon McVittie <smcv at debian.org>
Date: Sat Nov 21 17:18:26 2015 +0000
Imported Upstream version 1.36+u20151017+dfsg1
---
Makefile | 2 +-
code/client/cl_main.c | 2 +-
code/renderergl1/tr_backend.c | 2 --
code/renderergl1/tr_cmds.c | 21 ++++++++++++++++-----
code/renderergl1/tr_image.c | 6 ++++--
code/renderergl1/tr_main.c | 18 ++++++++++--------
code/renderergl2/tr_backend.c | 2 --
code/renderergl2/tr_cmds.c | 21 ++++++++++++++++-----
code/renderergl2/tr_main.c | 18 ++++++++++--------
9 files changed, 58 insertions(+), 34 deletions(-)
diff --git a/Makefile b/Makefile
index 825307f..3df8366 100644
--- a/Makefile
+++ b/Makefile
@@ -1261,7 +1261,7 @@ endif
NAKED_TARGETS=$(shell echo $(TARGETS) | sed -e "s!$(B)/!!g")
-print_list=@for i in $(1); \
+print_list=- at for i in $(1); \
do \
echo " $$i"; \
done
diff --git a/code/client/cl_main.c b/code/client/cl_main.c
index 43f741f..7d9706f 100644
--- a/code/client/cl_main.c
+++ b/code/client/cl_main.c
@@ -1820,7 +1820,7 @@ void CL_Rcon_f( void ) {
char message[MAX_RCON_MESSAGE];
netadr_t to;
- if ( !rcon_client_password->string ) {
+ if ( !rcon_client_password->string[0] ) {
Com_Printf ("You must set 'rconpassword' before\n"
"issuing an rcon command.\n");
return;
diff --git a/code/renderergl1/tr_backend.c b/code/renderergl1/tr_backend.c
index a112245..41fe47a 100644
--- a/code/renderergl1/tr_backend.c
+++ b/code/renderergl1/tr_backend.c
@@ -495,8 +495,6 @@ void RB_BeginDrawingView (void) {
}
-#define MAC_EVENT_PUMP_MSEC 5
-
/*
==================
RB_RenderDrawSurfList
diff --git a/code/renderergl1/tr_cmds.c b/code/renderergl1/tr_cmds.c
index 00b819a..89bb88a 100644
--- a/code/renderergl1/tr_cmds.c
+++ b/code/renderergl1/tr_cmds.c
@@ -114,20 +114,20 @@ void R_IssuePendingRenderCommands( void ) {
/*
============
-R_GetCommandBuffer
+R_GetCommandBufferReserved
make sure there is enough command space
============
*/
-void *R_GetCommandBuffer( int bytes ) {
+void *R_GetCommandBufferReserved( int bytes, int reservedBytes ) {
renderCommandList_t *cmdList;
cmdList = &backEndData->commands;
bytes = PAD(bytes, sizeof(void *));
// always leave room for the end of list command
- if ( cmdList->used + bytes + 4 > MAX_RENDER_COMMANDS ) {
- if ( bytes > MAX_RENDER_COMMANDS - 4 ) {
+ if ( cmdList->used + bytes + sizeof( int ) + reservedBytes > MAX_RENDER_COMMANDS ) {
+ if ( bytes > MAX_RENDER_COMMANDS - sizeof( int ) ) {
ri.Error( ERR_FATAL, "R_GetCommandBuffer: bad size %i", bytes );
}
// if we run out of room, just start dropping commands
@@ -139,6 +139,17 @@ void *R_GetCommandBuffer( int bytes ) {
return cmdList->cmds + cmdList->used - bytes;
}
+/*
+=============
+R_GetCommandBuffer
+
+returns NULL if there is not enough space for important commands
+=============
+*/
+void *R_GetCommandBuffer( int bytes ) {
+ return R_GetCommandBufferReserved( bytes, PAD( sizeof( swapBuffersCommand_t ), sizeof(void *) ) );
+}
+
/*
=============
@@ -454,7 +465,7 @@ void RE_EndFrame( int *frontEndMsec, int *backEndMsec ) {
if ( !tr.registered ) {
return;
}
- cmd = R_GetCommandBuffer( sizeof( *cmd ) );
+ cmd = R_GetCommandBufferReserved( sizeof( *cmd ), 0 );
if ( !cmd ) {
return;
}
diff --git a/code/renderergl1/tr_image.c b/code/renderergl1/tr_image.c
index 7905842..b131f36 100644
--- a/code/renderergl1/tr_image.c
+++ b/code/renderergl1/tr_image.c
@@ -557,6 +557,7 @@ static void Upload32( unsigned *data,
qboolean mipmap,
qboolean picmip,
qboolean lightMap,
+ qboolean allowCompression,
int *format,
int *pUploadWidth, int *pUploadHeight )
{
@@ -692,11 +693,11 @@ static void Upload32( unsigned *data,
}
else
{
- if ( glConfig.textureCompression == TC_S3TC_ARB )
+ if ( allowCompression && glConfig.textureCompression == TC_S3TC_ARB )
{
internalFormat = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
}
- else if ( glConfig.textureCompression == TC_S3TC )
+ else if ( allowCompression && glConfig.textureCompression == TC_S3TC )
{
internalFormat = GL_RGB4_S3TC;
}
@@ -892,6 +893,7 @@ image_t *R_CreateImage( const char *name, byte *pic, int width, int height,
image->flags & IMGFLAG_MIPMAP,
image->flags & IMGFLAG_PICMIP,
isLightmap,
+ !(image->flags & IMGFLAG_NO_COMPRESSION),
&image->internalFormat,
&image->uploadWidth,
&image->uploadHeight );
diff --git a/code/renderergl1/tr_main.c b/code/renderergl1/tr_main.c
index e33eb95..0e38831 100644
--- a/code/renderergl1/tr_main.c
+++ b/code/renderergl1/tr_main.c
@@ -1146,13 +1146,6 @@ void R_SortDrawSurfs( drawSurf_t *drawSurfs, int numDrawSurfs ) {
return;
}
- // if we overflowed MAX_DRAWSURFS, the drawsurfs
- // wrapped around in the buffer and we will be missing
- // the first surfaces, not the last ones
- if ( numDrawSurfs > MAX_DRAWSURFS ) {
- numDrawSurfs = MAX_DRAWSURFS;
- }
-
// sort the drawsurfs by sort type, then orientation, then shader
R_RadixSort( drawSurfs, numDrawSurfs );
@@ -1361,6 +1354,7 @@ or a mirror / remote location
*/
void R_RenderView (viewParms_t *parms) {
int firstDrawSurf;
+ int numDrawSurfs;
if ( parms->viewportWidth <= 0 || parms->viewportHeight <= 0 ) {
return;
@@ -1383,7 +1377,15 @@ void R_RenderView (viewParms_t *parms) {
R_GenerateDrawSurfs();
- R_SortDrawSurfs( tr.refdef.drawSurfs + firstDrawSurf, tr.refdef.numDrawSurfs - firstDrawSurf );
+ // if we overflowed MAX_DRAWSURFS, the drawsurfs
+ // wrapped around in the buffer and we will be missing
+ // the first surfaces, not the last ones
+ numDrawSurfs = tr.refdef.numDrawSurfs;
+ if ( numDrawSurfs > MAX_DRAWSURFS ) {
+ numDrawSurfs = MAX_DRAWSURFS;
+ }
+
+ R_SortDrawSurfs( tr.refdef.drawSurfs + firstDrawSurf, numDrawSurfs - firstDrawSurf );
// draw main system development information (surface outlines, etc)
R_DebugGraphics();
diff --git a/code/renderergl2/tr_backend.c b/code/renderergl2/tr_backend.c
index c8c7200..fe98d2a 100644
--- a/code/renderergl2/tr_backend.c
+++ b/code/renderergl2/tr_backend.c
@@ -549,8 +549,6 @@ void RB_BeginDrawingView (void) {
}
-#define MAC_EVENT_PUMP_MSEC 5
-
/*
==================
RB_RenderDrawSurfList
diff --git a/code/renderergl2/tr_cmds.c b/code/renderergl2/tr_cmds.c
index 18fd69c..254bb0d 100644
--- a/code/renderergl2/tr_cmds.c
+++ b/code/renderergl2/tr_cmds.c
@@ -121,20 +121,20 @@ void R_IssuePendingRenderCommands( void ) {
/*
============
-R_GetCommandBuffer
+R_GetCommandBufferReserved
make sure there is enough command space
============
*/
-void *R_GetCommandBuffer( int bytes ) {
+void *R_GetCommandBufferReserved( int bytes, int reservedBytes ) {
renderCommandList_t *cmdList;
cmdList = &backEndData->commands;
bytes = PAD(bytes, sizeof(void *));
// always leave room for the end of list command
- if ( cmdList->used + bytes + 4 > MAX_RENDER_COMMANDS ) {
- if ( bytes > MAX_RENDER_COMMANDS - 4 ) {
+ if ( cmdList->used + bytes + sizeof( int ) + reservedBytes > MAX_RENDER_COMMANDS ) {
+ if ( bytes > MAX_RENDER_COMMANDS - sizeof( int ) ) {
ri.Error( ERR_FATAL, "R_GetCommandBuffer: bad size %i", bytes );
}
// if we run out of room, just start dropping commands
@@ -146,6 +146,17 @@ void *R_GetCommandBuffer( int bytes ) {
return cmdList->cmds + cmdList->used - bytes;
}
+/*
+=============
+R_GetCommandBuffer
+
+returns NULL if there is not enough space for important commands
+=============
+*/
+void *R_GetCommandBuffer( int bytes ) {
+ return R_GetCommandBufferReserved( bytes, PAD( sizeof( swapBuffersCommand_t ), sizeof(void *) ) );
+}
+
/*
=============
@@ -525,7 +536,7 @@ void RE_EndFrame( int *frontEndMsec, int *backEndMsec ) {
if ( !tr.registered ) {
return;
}
- cmd = R_GetCommandBuffer( sizeof( *cmd ) );
+ cmd = R_GetCommandBufferReserved( sizeof( *cmd ), 0 );
if ( !cmd ) {
return;
}
diff --git a/code/renderergl2/tr_main.c b/code/renderergl2/tr_main.c
index 6d397c4..4c80ad6 100644
--- a/code/renderergl2/tr_main.c
+++ b/code/renderergl2/tr_main.c
@@ -1820,13 +1820,6 @@ void R_SortDrawSurfs( drawSurf_t *drawSurfs, int numDrawSurfs ) {
return;
}
- // if we overflowed MAX_DRAWSURFS, the drawsurfs
- // wrapped around in the buffer and we will be missing
- // the first surfaces, not the last ones
- if ( numDrawSurfs > MAX_DRAWSURFS ) {
- numDrawSurfs = MAX_DRAWSURFS;
- }
-
// sort the drawsurfs by sort type, then orientation, then shader
R_RadixSort( drawSurfs, numDrawSurfs );
@@ -2053,6 +2046,7 @@ or a mirror / remote location
*/
void R_RenderView (viewParms_t *parms) {
int firstDrawSurf;
+ int numDrawSurfs;
if ( parms->viewportWidth <= 0 || parms->viewportHeight <= 0 ) {
return;
@@ -2075,7 +2069,15 @@ void R_RenderView (viewParms_t *parms) {
R_GenerateDrawSurfs();
- R_SortDrawSurfs( tr.refdef.drawSurfs + firstDrawSurf, tr.refdef.numDrawSurfs - firstDrawSurf );
+ // if we overflowed MAX_DRAWSURFS, the drawsurfs
+ // wrapped around in the buffer and we will be missing
+ // the first surfaces, not the last ones
+ numDrawSurfs = tr.refdef.numDrawSurfs;
+ if ( numDrawSurfs > MAX_DRAWSURFS ) {
+ numDrawSurfs = MAX_DRAWSURFS;
+ }
+
+ R_SortDrawSurfs( tr.refdef.drawSurfs + firstDrawSurf, numDrawSurfs - firstDrawSurf );
// draw main system development information (surface outlines, etc)
R_DebugGraphics();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/ioquake3.git
More information about the Pkg-games-commits
mailing list