mirror of
https://github.com/Q3Rally-Team/q3rally.git
synced 2024-11-22 03:51:23 +00:00
ioquake3 resync to revision 3347 from 3331.
Update arch in misc/setup for ioq3 changing from i386 to x86 OpenGL2: Use extension functions with OpenGL versions before 3.0. OpenGL2: Force VAO usage on OpenGL 3.0+ Add spawnflags to QUAKED for trigger_multiple Check for all command separators in callTeamVote Remove newlines from chat messages in Game VM Fix compiling Cmd_CallTeamVote_f Only allow safe protocols for cURL downloads Fix crash when pmove_msec is 0 Combine mouse movement events in event queue Improve keys using international key layouts Improve client input responsiveness Removing input functions from sys_local.h for last commit Make input events use earliest possible time Make bots use crusher on other q3tourney6 maps Make bots only use q3tourney6 crusher to kill their enemy
This commit is contained in:
parent
f44a329010
commit
7fb48b29ca
21 changed files with 254 additions and 138 deletions
|
@ -44,7 +44,7 @@ ifndef BUILD_DEFINES
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# ioquake3 svn version that this is based on
|
# ioquake3 svn version that this is based on
|
||||||
IOQ3_REVISION = 3331
|
IOQ3_REVISION = 3347
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
#
|
#
|
||||||
|
|
|
@ -875,9 +875,11 @@ void CG_PredictPlayerState( void ) {
|
||||||
|
|
||||||
if ( pmove_msec.integer < 8 ) {
|
if ( pmove_msec.integer < 8 ) {
|
||||||
trap_Cvar_Set("pmove_msec", "8");
|
trap_Cvar_Set("pmove_msec", "8");
|
||||||
|
trap_Cvar_Update(&pmove_msec);
|
||||||
}
|
}
|
||||||
else if (pmove_msec.integer > 33) {
|
else if (pmove_msec.integer > 33) {
|
||||||
trap_Cvar_Set("pmove_msec", "33");
|
trap_Cvar_Set("pmove_msec", "33");
|
||||||
|
trap_Cvar_Update(&pmove_msec);
|
||||||
}
|
}
|
||||||
|
|
||||||
cg_pmove.pmove_fixed = pmove_fixed.integer;// | cg_pmove_fixed.integer;
|
cg_pmove.pmove_fixed = pmove_fixed.integer;// | cg_pmove_fixed.integer;
|
||||||
|
|
|
@ -299,6 +299,8 @@ void CL_cURL_BeginDownload( const char *localName, const char *remoteURL )
|
||||||
qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_FAILONERROR, 1);
|
qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_FAILONERROR, 1);
|
||||||
qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_FOLLOWLOCATION, 1);
|
qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_FOLLOWLOCATION, 1);
|
||||||
qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_MAXREDIRS, 5);
|
qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_MAXREDIRS, 5);
|
||||||
|
qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_PROTOCOLS,
|
||||||
|
CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | CURLPROTO_FTPS);
|
||||||
clc.downloadCURLM = qcurl_multi_init();
|
clc.downloadCURLM = qcurl_multi_init();
|
||||||
if(!clc.downloadCURLM) {
|
if(!clc.downloadCURLM) {
|
||||||
qcurl_easy_cleanup(clc.downloadCURL);
|
qcurl_easy_cleanup(clc.downloadCURL);
|
||||||
|
|
|
@ -3768,21 +3768,26 @@ void BotMapScripts(bot_state_t *bs) {
|
||||||
strncpy(mapname, Info_ValueForKey( info, "mapname" ), sizeof(mapname)-1);
|
strncpy(mapname, Info_ValueForKey( info, "mapname" ), sizeof(mapname)-1);
|
||||||
mapname[sizeof(mapname)-1] = '\0';
|
mapname[sizeof(mapname)-1] = '\0';
|
||||||
|
|
||||||
if (!Q_stricmp(mapname, "q3tourney6")) {
|
if (!Q_stricmp(mapname, "q3tourney6") || !Q_stricmp(mapname, "q3tourney6_ctf") || !Q_stricmp(mapname, "mpq3tourney6")) {
|
||||||
vec3_t mins = {700, 204, 672}, maxs = {964, 468, 680};
|
vec3_t mins = {694, 200, 480}, maxs = {968, 472, 680};
|
||||||
vec3_t buttonorg = {304, 352, 920};
|
vec3_t buttonorg = {304, 352, 920};
|
||||||
//NOTE: NEVER use the func_bobbing in q3tourney6
|
//NOTE: NEVER use the func_bobbing in q3tourney6
|
||||||
bs->tfl &= ~TFL_FUNCBOB;
|
bs->tfl &= ~TFL_FUNCBOB;
|
||||||
//if the bot is below the bounding box
|
//crush area is higher in mpq3tourney6
|
||||||
|
if (!Q_stricmp(mapname, "mpq3tourney6")) {
|
||||||
|
mins[2] += 64;
|
||||||
|
maxs[2] += 64;
|
||||||
|
}
|
||||||
|
//if the bot is in the bounding box of the crush area
|
||||||
if (bs->origin[0] > mins[0] && bs->origin[0] < maxs[0]) {
|
if (bs->origin[0] > mins[0] && bs->origin[0] < maxs[0]) {
|
||||||
if (bs->origin[1] > mins[1] && bs->origin[1] < maxs[1]) {
|
if (bs->origin[1] > mins[1] && bs->origin[1] < maxs[1]) {
|
||||||
if (bs->origin[2] < mins[2]) {
|
if (bs->origin[2] > mins[2] && bs->origin[2] < maxs[2]) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
shootbutton = qfalse;
|
shootbutton = qfalse;
|
||||||
//if an enemy is below this bounding box then shoot the button
|
//if an enemy is in the bounding box then shoot the button
|
||||||
for (i = 0; i < level.maxclients; i++) {
|
for (i = 0; i < level.maxclients; i++) {
|
||||||
|
|
||||||
if (i == bs->client) continue;
|
if (i == bs->client) continue;
|
||||||
|
@ -3795,13 +3800,13 @@ void BotMapScripts(bot_state_t *bs) {
|
||||||
//
|
//
|
||||||
if (entinfo.origin[0] > mins[0] && entinfo.origin[0] < maxs[0]) {
|
if (entinfo.origin[0] > mins[0] && entinfo.origin[0] < maxs[0]) {
|
||||||
if (entinfo.origin[1] > mins[1] && entinfo.origin[1] < maxs[1]) {
|
if (entinfo.origin[1] > mins[1] && entinfo.origin[1] < maxs[1]) {
|
||||||
if (entinfo.origin[2] < mins[2]) {
|
if (entinfo.origin[2] > mins[2] && entinfo.origin[2] < maxs[2]) {
|
||||||
//if there's a team mate below the crusher
|
//if there's a team mate below the crusher
|
||||||
if (BotSameTeam(bs, i)) {
|
if (BotSameTeam(bs, i)) {
|
||||||
shootbutton = qfalse;
|
shootbutton = qfalse;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else {
|
else if (bs->enemy == i) {
|
||||||
shootbutton = qtrue;
|
shootbutton = qtrue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3826,10 +3831,6 @@ void BotMapScripts(bot_state_t *bs) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!Q_stricmp(mapname, "mpq3tourney6")) {
|
|
||||||
//NOTE: NEVER use the func_bobbing in mpq3tourney6
|
|
||||||
bs->tfl &= ~TFL_FUNCBOB;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1015,9 +1015,11 @@ void ClientThink_real( gentity_t *ent ) {
|
||||||
|
|
||||||
if ( pmove_msec.integer < 8 ) {
|
if ( pmove_msec.integer < 8 ) {
|
||||||
trap_Cvar_Set("pmove_msec", "8");
|
trap_Cvar_Set("pmove_msec", "8");
|
||||||
|
trap_Cvar_Update(&pmove_msec);
|
||||||
}
|
}
|
||||||
else if (pmove_msec.integer > 33) {
|
else if (pmove_msec.integer > 33) {
|
||||||
trap_Cvar_Set("pmove_msec", "33");
|
trap_Cvar_Set("pmove_msec", "33");
|
||||||
|
trap_Cvar_Update(&pmove_msec);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( pmove_fixed.integer || client->pers.pmoveFixed ) {
|
if ( pmove_fixed.integer || client->pers.pmoveFixed ) {
|
||||||
|
|
|
@ -1152,6 +1152,16 @@ void G_Say( gentity_t *ent, gentity_t *target, int mode, const char *chatText )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void SanitizeChatText( char *text ) {
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for ( i = 0; text[i]; i++ ) {
|
||||||
|
if ( text[i] == '\n' || text[i] == '\r' ) {
|
||||||
|
text[i] = ' ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==================
|
==================
|
||||||
|
@ -1174,6 +1184,8 @@ static void Cmd_Say_f( gentity_t *ent, int mode, qboolean arg0 ) {
|
||||||
p = ConcatArgs( 1 );
|
p = ConcatArgs( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SanitizeChatText( p );
|
||||||
|
|
||||||
G_Say( ent, NULL, mode, p );
|
G_Say( ent, NULL, mode, p );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1206,6 +1218,8 @@ static void Cmd_Tell_f( gentity_t *ent ) {
|
||||||
|
|
||||||
p = ConcatArgs( 2 );
|
p = ConcatArgs( 2 );
|
||||||
|
|
||||||
|
SanitizeChatText( p );
|
||||||
|
|
||||||
G_LogPrintf( "tell: %s to %s: %s\n", ent->client->pers.netname, target->client->pers.netname, p );
|
G_LogPrintf( "tell: %s to %s: %s\n", ent->client->pers.netname, target->client->pers.netname, p );
|
||||||
G_Say( ent, target, SAY_TELL, p );
|
G_Say( ent, target, SAY_TELL, p );
|
||||||
// don't tell to the player self if it was already directed to this player
|
// don't tell to the player self if it was already directed to this player
|
||||||
|
@ -1304,6 +1318,8 @@ static void Cmd_Voice_f( gentity_t *ent, int mode, qboolean arg0, qboolean voice
|
||||||
p = ConcatArgs( 1 );
|
p = ConcatArgs( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SanitizeChatText( p );
|
||||||
|
|
||||||
G_Voice( ent, NULL, mode, p, voiceonly );
|
G_Voice( ent, NULL, mode, p, voiceonly );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1336,6 +1352,8 @@ static void Cmd_VoiceTell_f( gentity_t *ent, qboolean voiceonly ) {
|
||||||
|
|
||||||
id = ConcatArgs( 2 );
|
id = ConcatArgs( 2 );
|
||||||
|
|
||||||
|
SanitizeChatText( id );
|
||||||
|
|
||||||
G_LogPrintf( "vtell: %s to %s: %s\n", ent->client->pers.netname, target->client->pers.netname, id );
|
G_LogPrintf( "vtell: %s to %s: %s\n", ent->client->pers.netname, target->client->pers.netname, id );
|
||||||
G_Voice( ent, target, SAY_TELL, id, voiceonly );
|
G_Voice( ent, target, SAY_TELL, id, voiceonly );
|
||||||
// don't tell to the player self if it was already directed to this player
|
// don't tell to the player self if it was already directed to this player
|
||||||
|
@ -1685,6 +1703,7 @@ Cmd_CallTeamVote_f
|
||||||
==================
|
==================
|
||||||
*/
|
*/
|
||||||
void Cmd_CallTeamVote_f( gentity_t *ent ) {
|
void Cmd_CallTeamVote_f( gentity_t *ent ) {
|
||||||
|
char* c;
|
||||||
int i, team, cs_offset;
|
int i, team, cs_offset;
|
||||||
char arg1[MAX_STRING_TOKENS];
|
char arg1[MAX_STRING_TOKENS];
|
||||||
char arg2[MAX_STRING_TOKENS];
|
char arg2[MAX_STRING_TOKENS];
|
||||||
|
@ -1724,9 +1743,16 @@ void Cmd_CallTeamVote_f( gentity_t *ent ) {
|
||||||
trap_Argv( i, &arg2[strlen(arg2)], sizeof( arg2 ) - strlen(arg2) );
|
trap_Argv( i, &arg2[strlen(arg2)], sizeof( arg2 ) - strlen(arg2) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( strchr( arg1, ';' ) || strchr( arg2, ';' ) ) {
|
// check for command separators in arg2
|
||||||
trap_SendServerCommand( ent-g_entities, "print \"Invalid vote string.\n\"" );
|
for( c = arg2; *c; ++c) {
|
||||||
return;
|
switch(*c) {
|
||||||
|
case '\n':
|
||||||
|
case '\r':
|
||||||
|
case ';':
|
||||||
|
trap_SendServerCommand( ent-g_entities, "print \"Invalid vote string.\n\"" );
|
||||||
|
return;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !Q_stricmp( arg1, "leader" ) ) {
|
if ( !Q_stricmp( arg1, "leader" ) ) {
|
||||||
|
|
|
@ -85,7 +85,7 @@ void Touch_Multi( gentity_t *self, gentity_t *other, trace_t *trace ) {
|
||||||
multi_trigger( self, other );
|
multi_trigger( self, other );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*QUAKED trigger_multiple (.5 .5 .5) ?
|
/*QUAKED trigger_multiple (.5 .5 .5) ? RED_ONLY BLUE_ONLY
|
||||||
"wait" : Seconds between triggerings, 0.5 default, -1 = one time only.
|
"wait" : Seconds between triggerings, 0.5 default, -1 = one time only.
|
||||||
"random" wait variance, default is 0
|
"random" wait variance, default is 0
|
||||||
Variable sized repeatable trigger. Must be targeted at one or more entities.
|
Variable sized repeatable trigger. Must be targeted at one or more entities.
|
||||||
|
|
|
@ -1965,6 +1965,19 @@ void Com_QueueEvent( int time, sysEventType_t type, int value, int value2, int p
|
||||||
{
|
{
|
||||||
sysEvent_t *ev;
|
sysEvent_t *ev;
|
||||||
|
|
||||||
|
// combine mouse movement with previous mouse event
|
||||||
|
if ( type == SE_MOUSE && eventHead != eventTail )
|
||||||
|
{
|
||||||
|
ev = &eventQueue[ ( eventHead + MAX_QUEUED_EVENTS - 1 ) & MASK_QUEUED_EVENTS ];
|
||||||
|
|
||||||
|
if ( ev->evType == SE_MOUSE )
|
||||||
|
{
|
||||||
|
ev->evValue += value;
|
||||||
|
ev->evValue2 += value2;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ev = &eventQueue[ eventHead & MASK_QUEUED_EVENTS ];
|
ev = &eventQueue[ eventHead & MASK_QUEUED_EVENTS ];
|
||||||
|
|
||||||
if ( eventHead - eventTail >= MAX_QUEUED_EVENTS )
|
if ( eventHead - eventTail >= MAX_QUEUED_EVENTS )
|
||||||
|
@ -3155,6 +3168,8 @@ void Com_Frame( void ) {
|
||||||
NET_Sleep(timeVal - 1);
|
NET_Sleep(timeVal - 1);
|
||||||
} while(Com_TimeVal(minMsec));
|
} while(Com_TimeVal(minMsec));
|
||||||
|
|
||||||
|
IN_Frame();
|
||||||
|
|
||||||
lastTime = com_frameTime;
|
lastTime = com_frameTime;
|
||||||
com_frameTime = Com_EventLoop();
|
com_frameTime = Com_EventLoop();
|
||||||
|
|
||||||
|
|
|
@ -1064,6 +1064,14 @@ int SV_SendQueuedPackets(void);
|
||||||
qboolean UI_GameCommand( void );
|
qboolean UI_GameCommand( void );
|
||||||
qboolean UI_usesUniqueCDKey(void);
|
qboolean UI_usesUniqueCDKey(void);
|
||||||
|
|
||||||
|
//
|
||||||
|
// input interface
|
||||||
|
//
|
||||||
|
void IN_Init( void *windowData );
|
||||||
|
void IN_Frame( void );
|
||||||
|
void IN_Shutdown( void );
|
||||||
|
void IN_Restart( void );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==============================================================
|
==============================================================
|
||||||
|
|
||||||
|
|
|
@ -479,9 +479,12 @@ extern void (APIENTRYP qglUnlockArraysEXT) (void);
|
||||||
#define GL_HALF_FLOAT_ARB 0x140B
|
#define GL_HALF_FLOAT_ARB 0x140B
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// OpenGL 3.0, was GL_EXT_framebuffer_object, GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample, and GL_ARB_vertex_array_object
|
// OpenGL 3.0 specific
|
||||||
#define QGL_3_0_PROCS \
|
#define QGL_3_0_PROCS \
|
||||||
GLE(const GLubyte *, GetStringi, GLenum name, GLuint index) \
|
GLE(const GLubyte *, GetStringi, GLenum name, GLuint index) \
|
||||||
|
|
||||||
|
// GL_ARB_framebuffer_object, built-in to OpenGL 3.0
|
||||||
|
#define QGL_ARB_framebuffer_object_PROCS \
|
||||||
GLE(void, BindRenderbuffer, GLenum target, GLuint renderbuffer) \
|
GLE(void, BindRenderbuffer, GLenum target, GLuint renderbuffer) \
|
||||||
GLE(void, DeleteRenderbuffers, GLsizei n, const GLuint *renderbuffers) \
|
GLE(void, DeleteRenderbuffers, GLsizei n, const GLuint *renderbuffers) \
|
||||||
GLE(void, GenRenderbuffers, GLsizei n, GLuint *renderbuffers) \
|
GLE(void, GenRenderbuffers, GLsizei n, GLuint *renderbuffers) \
|
||||||
|
@ -495,6 +498,9 @@ extern void (APIENTRYP qglUnlockArraysEXT) (void);
|
||||||
GLE(void, GenerateMipmap, GLenum target) \
|
GLE(void, GenerateMipmap, GLenum target) \
|
||||||
GLE(void, BlitFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) \
|
GLE(void, BlitFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) \
|
||||||
GLE(void, RenderbufferStorageMultisample, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) \
|
GLE(void, RenderbufferStorageMultisample, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) \
|
||||||
|
|
||||||
|
// GL_ARB_vertex_array_object, built-in to OpenGL 3.0
|
||||||
|
#define QGL_ARB_vertex_array_object_PROCS \
|
||||||
GLE(void, BindVertexArray, GLuint array) \
|
GLE(void, BindVertexArray, GLuint array) \
|
||||||
GLE(void, DeleteVertexArrays, GLsizei n, const GLuint *arrays) \
|
GLE(void, DeleteVertexArrays, GLsizei n, const GLuint *arrays) \
|
||||||
GLE(void, GenVertexArrays, GLsizei n, GLuint *arrays) \
|
GLE(void, GenVertexArrays, GLsizei n, GLuint *arrays) \
|
||||||
|
@ -554,6 +560,8 @@ QGL_1_3_PROCS;
|
||||||
QGL_1_5_PROCS;
|
QGL_1_5_PROCS;
|
||||||
QGL_2_0_PROCS;
|
QGL_2_0_PROCS;
|
||||||
QGL_3_0_PROCS;
|
QGL_3_0_PROCS;
|
||||||
|
QGL_ARB_framebuffer_object_PROCS;
|
||||||
|
QGL_ARB_vertex_array_object_PROCS;
|
||||||
QGL_EXT_direct_state_access_PROCS;
|
QGL_EXT_direct_state_access_PROCS;
|
||||||
#undef GLE
|
#undef GLE
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,8 @@ QGL_1_3_PROCS;
|
||||||
QGL_1_5_PROCS;
|
QGL_1_5_PROCS;
|
||||||
QGL_2_0_PROCS;
|
QGL_2_0_PROCS;
|
||||||
QGL_3_0_PROCS;
|
QGL_3_0_PROCS;
|
||||||
|
QGL_ARB_framebuffer_object_PROCS;
|
||||||
|
QGL_ARB_vertex_array_object_PROCS;
|
||||||
QGL_EXT_direct_state_access_PROCS;
|
QGL_EXT_direct_state_access_PROCS;
|
||||||
#undef GLE
|
#undef GLE
|
||||||
|
|
||||||
|
@ -42,6 +44,8 @@ void GLimp_InitExtraExtensions()
|
||||||
{
|
{
|
||||||
char *extension;
|
char *extension;
|
||||||
const char* result[3] = { "...ignoring %s\n", "...using %s\n", "...%s not found\n" };
|
const char* result[3] = { "...ignoring %s\n", "...using %s\n", "...%s not found\n" };
|
||||||
|
qboolean q_gl_version_at_least_3_0;
|
||||||
|
qboolean q_gl_version_at_least_3_2;
|
||||||
|
|
||||||
// Check OpenGL version
|
// Check OpenGL version
|
||||||
sscanf(glConfig.version_string, "%d.%d", &glRefConfig.openglMajorVersion, &glRefConfig.openglMinorVersion);
|
sscanf(glConfig.version_string, "%d.%d", &glRefConfig.openglMajorVersion, &glRefConfig.openglMinorVersion);
|
||||||
|
@ -49,6 +53,9 @@ void GLimp_InitExtraExtensions()
|
||||||
ri.Error(ERR_FATAL, "OpenGL 2.0 required!");
|
ri.Error(ERR_FATAL, "OpenGL 2.0 required!");
|
||||||
ri.Printf(PRINT_ALL, "...using OpenGL %s\n", glConfig.version_string);
|
ri.Printf(PRINT_ALL, "...using OpenGL %s\n", glConfig.version_string);
|
||||||
|
|
||||||
|
q_gl_version_at_least_3_0 = (glRefConfig.openglMajorVersion >= 3);
|
||||||
|
q_gl_version_at_least_3_2 = (glRefConfig.openglMajorVersion > 3 || (glRefConfig.openglMajorVersion == 3 && glRefConfig.openglMinorVersion > 2));
|
||||||
|
|
||||||
// Check if we need Intel graphics specific fixes.
|
// Check if we need Intel graphics specific fixes.
|
||||||
glRefConfig.intelGraphics = qfalse;
|
glRefConfig.intelGraphics = qfalse;
|
||||||
if (strstr((char *)qglGetString(GL_RENDERER), "Intel"))
|
if (strstr((char *)qglGetString(GL_RENDERER), "Intel"))
|
||||||
|
@ -72,31 +79,100 @@ void GLimp_InitExtraExtensions()
|
||||||
// OpenGL 2.0, was GL_ARB_shading_language_100, GL_ARB_vertex_program, GL_ARB_shader_objects, and GL_ARB_vertex_shader
|
// OpenGL 2.0, was GL_ARB_shading_language_100, GL_ARB_vertex_program, GL_ARB_shader_objects, and GL_ARB_vertex_shader
|
||||||
QGL_2_0_PROCS;
|
QGL_2_0_PROCS;
|
||||||
|
|
||||||
// OpenGL 3.0, was GL_EXT_framebuffer_object, GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample, and GL_ARB_vertex_array_object
|
// OpenGL 3.0 - no matching extension
|
||||||
// QGL_*_PROCS becomes several functions, do not remove {}
|
// QGL_*_PROCS becomes several functions, do not remove {}
|
||||||
if (glRefConfig.openglMajorVersion >= 3)
|
if (q_gl_version_at_least_3_0)
|
||||||
{
|
{
|
||||||
QGL_3_0_PROCS;
|
QGL_3_0_PROCS;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OpenGL 3.0 - GL_ARB_framebuffer_object
|
||||||
|
extension = "GL_ARB_framebuffer_object";
|
||||||
|
glRefConfig.framebufferObject = qfalse;
|
||||||
|
glRefConfig.framebufferBlit = qfalse;
|
||||||
|
glRefConfig.framebufferMultisample = qfalse;
|
||||||
|
if (q_gl_version_at_least_3_0 || SDL_GL_ExtensionSupported(extension))
|
||||||
|
{
|
||||||
glRefConfig.framebufferObject = !!r_ext_framebuffer_object->integer;
|
glRefConfig.framebufferObject = !!r_ext_framebuffer_object->integer;
|
||||||
glRefConfig.framebufferBlit = qtrue;
|
glRefConfig.framebufferBlit = qtrue;
|
||||||
glRefConfig.framebufferMultisample = qtrue;
|
glRefConfig.framebufferMultisample = qtrue;
|
||||||
|
|
||||||
qglGetIntegerv(GL_MAX_RENDERBUFFER_SIZE_EXT, &glRefConfig.maxRenderbufferSize);
|
qglGetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &glRefConfig.maxRenderbufferSize);
|
||||||
qglGetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &glRefConfig.maxColorAttachments);
|
qglGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &glRefConfig.maxColorAttachments);
|
||||||
|
|
||||||
ri.Printf(PRINT_ALL, result[glRefConfig.framebufferObject], "OpenGL 3.0+ framebuffer procs");
|
QGL_ARB_framebuffer_object_PROCS;
|
||||||
|
|
||||||
// Don't let this be disabled, core context requires it
|
ri.Printf(PRINT_ALL, result[glRefConfig.framebufferObject], extension);
|
||||||
glRefConfig.vertexArrayObject = qtrue;
|
|
||||||
|
|
||||||
ri.Printf(PRINT_ALL, result[glRefConfig.vertexArrayObject], "OpenGL 3.0+ vertex array object procs");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ri.Printf(PRINT_ALL, result[2], "OpenGL 3.0+ framebuffer procs");
|
ri.Printf(PRINT_ALL, result[2], extension);
|
||||||
ri.Printf(PRINT_ALL, result[2], "OpenGL 3.0+ vertex array object procs");
|
}
|
||||||
|
|
||||||
|
// OpenGL 3.0 - GL_ARB_vertex_array_object
|
||||||
|
extension = "GL_ARB_vertex_array_object";
|
||||||
|
glRefConfig.vertexArrayObject = qfalse;
|
||||||
|
if (q_gl_version_at_least_3_0 || SDL_GL_ExtensionSupported(extension))
|
||||||
|
{
|
||||||
|
if (q_gl_version_at_least_3_0)
|
||||||
|
{
|
||||||
|
// force VAO, core context requires it
|
||||||
|
glRefConfig.vertexArrayObject = qtrue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
glRefConfig.vertexArrayObject = !!r_arb_vertex_array_object->integer;
|
||||||
|
}
|
||||||
|
|
||||||
|
QGL_ARB_vertex_array_object_PROCS;
|
||||||
|
|
||||||
|
ri.Printf(PRINT_ALL, result[glRefConfig.vertexArrayObject], extension);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ri.Printf(PRINT_ALL, result[2], extension);
|
||||||
|
}
|
||||||
|
|
||||||
|
// OpenGL 3.0 - GL_ARB_texture_float
|
||||||
|
extension = "GL_ARB_texture_float";
|
||||||
|
glRefConfig.textureFloat = qfalse;
|
||||||
|
if (q_gl_version_at_least_3_0 || SDL_GL_ExtensionSupported(extension))
|
||||||
|
{
|
||||||
|
glRefConfig.textureFloat = !!r_ext_texture_float->integer;
|
||||||
|
|
||||||
|
ri.Printf(PRINT_ALL, result[glRefConfig.textureFloat], extension);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ri.Printf(PRINT_ALL, result[2], extension);
|
||||||
|
}
|
||||||
|
|
||||||
|
// OpenGL 3.2 - GL_ARB_depth_clamp
|
||||||
|
extension = "GL_ARB_depth_clamp";
|
||||||
|
glRefConfig.depthClamp = qfalse;
|
||||||
|
if (q_gl_version_at_least_3_2 || SDL_GL_ExtensionSupported(extension))
|
||||||
|
{
|
||||||
|
glRefConfig.depthClamp = qtrue;
|
||||||
|
|
||||||
|
ri.Printf(PRINT_ALL, result[glRefConfig.depthClamp], extension);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ri.Printf(PRINT_ALL, result[2], extension);
|
||||||
|
}
|
||||||
|
|
||||||
|
// OpenGL 3.2 - GL_ARB_seamless_cube_map
|
||||||
|
extension = "GL_ARB_seamless_cube_map";
|
||||||
|
glRefConfig.seamlessCubeMap = qfalse;
|
||||||
|
if (q_gl_version_at_least_3_2 || SDL_GL_ExtensionSupported(extension))
|
||||||
|
{
|
||||||
|
glRefConfig.seamlessCubeMap = !!r_arb_seamless_cube_map->integer;
|
||||||
|
|
||||||
|
ri.Printf(PRINT_ALL, result[glRefConfig.seamlessCubeMap], extension);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ri.Printf(PRINT_ALL, result[2], extension);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine GLSL version
|
// Determine GLSL version
|
||||||
|
@ -146,20 +222,6 @@ void GLimp_InitExtraExtensions()
|
||||||
ri.Printf(PRINT_ALL, result[2], extension);
|
ri.Printf(PRINT_ALL, result[2], extension);
|
||||||
}
|
}
|
||||||
|
|
||||||
// GL_ARB_texture_float
|
|
||||||
extension = "GL_ARB_texture_float";
|
|
||||||
glRefConfig.textureFloat = qfalse;
|
|
||||||
if( SDL_GL_ExtensionSupported( extension ) )
|
|
||||||
{
|
|
||||||
glRefConfig.textureFloat = !!r_ext_texture_float->integer;
|
|
||||||
|
|
||||||
ri.Printf(PRINT_ALL, result[glRefConfig.textureFloat], extension);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ri.Printf(PRINT_ALL, result[2], extension);
|
|
||||||
}
|
|
||||||
|
|
||||||
glRefConfig.textureCompression = TCR_NONE;
|
glRefConfig.textureCompression = TCR_NONE;
|
||||||
|
|
||||||
// GL_ARB_texture_compression_rgtc
|
// GL_ARB_texture_compression_rgtc
|
||||||
|
@ -196,34 +258,6 @@ void GLimp_InitExtraExtensions()
|
||||||
ri.Printf(PRINT_ALL, result[2], extension);
|
ri.Printf(PRINT_ALL, result[2], extension);
|
||||||
}
|
}
|
||||||
|
|
||||||
// GL_ARB_depth_clamp
|
|
||||||
extension = "GL_ARB_depth_clamp";
|
|
||||||
glRefConfig.depthClamp = qfalse;
|
|
||||||
if( SDL_GL_ExtensionSupported( extension ) )
|
|
||||||
{
|
|
||||||
glRefConfig.depthClamp = qtrue;
|
|
||||||
|
|
||||||
ri.Printf(PRINT_ALL, result[glRefConfig.depthClamp], extension);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ri.Printf(PRINT_ALL, result[2], extension);
|
|
||||||
}
|
|
||||||
|
|
||||||
// GL_ARB_seamless_cube_map
|
|
||||||
extension = "GL_ARB_seamless_cube_map";
|
|
||||||
glRefConfig.seamlessCubeMap = qfalse;
|
|
||||||
if( SDL_GL_ExtensionSupported( extension ) )
|
|
||||||
{
|
|
||||||
glRefConfig.seamlessCubeMap = !!r_arb_seamless_cube_map->integer;
|
|
||||||
|
|
||||||
ri.Printf(PRINT_ALL, result[glRefConfig.seamlessCubeMap], extension);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ri.Printf(PRINT_ALL, result[2], extension);
|
|
||||||
}
|
|
||||||
|
|
||||||
// GL_EXT_direct_state_access
|
// GL_EXT_direct_state_access
|
||||||
extension = "GL_EXT_direct_state_access";
|
extension = "GL_EXT_direct_state_access";
|
||||||
glRefConfig.directStateAccess = qfalse;
|
glRefConfig.directStateAccess = qfalse;
|
||||||
|
|
|
@ -51,6 +51,8 @@ static cvar_t *in_joystickUseAnalog = NULL;
|
||||||
|
|
||||||
static int vidRestartTime = 0;
|
static int vidRestartTime = 0;
|
||||||
|
|
||||||
|
static int in_eventTime = 0;
|
||||||
|
|
||||||
static SDL_Window *SDL_window = NULL;
|
static SDL_Window *SDL_window = NULL;
|
||||||
|
|
||||||
#define CTRL(a) ((a)-'a'+1)
|
#define CTRL(a) ((a)-'a'+1)
|
||||||
|
@ -192,7 +194,18 @@ static keyNum_t IN_TranslateSDLToQ3Key( SDL_Keysym *keysym, qboolean down )
|
||||||
{
|
{
|
||||||
keyNum_t key = 0;
|
keyNum_t key = 0;
|
||||||
|
|
||||||
if( keysym->sym >= SDLK_SPACE && keysym->sym < SDLK_DELETE )
|
if( keysym->scancode >= SDL_SCANCODE_1 && keysym->scancode <= SDL_SCANCODE_0 )
|
||||||
|
{
|
||||||
|
// Always map the number keys as such even if they actually map
|
||||||
|
// to other characters (eg, "1" is "&" on an AZERTY keyboard).
|
||||||
|
// This is required for SDL before 2.0.6, except on Windows
|
||||||
|
// which already had this behavior.
|
||||||
|
if( keysym->scancode == SDL_SCANCODE_0 )
|
||||||
|
key = '0';
|
||||||
|
else
|
||||||
|
key = '1' + keysym->scancode - SDL_SCANCODE_1;
|
||||||
|
}
|
||||||
|
else if( keysym->sym >= SDLK_SPACE && keysym->sym < SDLK_DELETE )
|
||||||
{
|
{
|
||||||
// These happen to match the ASCII chars
|
// These happen to match the ASCII chars
|
||||||
key = (int)keysym->sym;
|
key = (int)keysym->sym;
|
||||||
|
@ -280,6 +293,15 @@ static keyNum_t IN_TranslateSDLToQ3Key( SDL_Keysym *keysym, qboolean down )
|
||||||
case SDLK_CAPSLOCK: key = K_CAPSLOCK; break;
|
case SDLK_CAPSLOCK: key = K_CAPSLOCK; break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
if( !( keysym->sym & SDLK_SCANCODE_MASK ) && keysym->scancode <= 95 )
|
||||||
|
{
|
||||||
|
// Map Unicode characters to 95 world keys using the key's scan code.
|
||||||
|
// FIXME: There aren't enough world keys to cover all the scancodes.
|
||||||
|
// Maybe create a map of scancode to quake key at start up and on
|
||||||
|
// key map change; allocate world key numbers as needed similar
|
||||||
|
// to SDL 1.2.
|
||||||
|
key = K_WORLD_0 + (int)keysym->scancode;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -629,7 +651,7 @@ static void IN_GamepadMove( void )
|
||||||
qboolean pressed = SDL_GameControllerGetButton(gamepad, SDL_CONTROLLER_BUTTON_A + i);
|
qboolean pressed = SDL_GameControllerGetButton(gamepad, SDL_CONTROLLER_BUTTON_A + i);
|
||||||
if (pressed != stick_state.buttons[i])
|
if (pressed != stick_state.buttons[i])
|
||||||
{
|
{
|
||||||
Com_QueueEvent(0, SE_KEY, K_PAD0_A + i, pressed, 0, NULL);
|
Com_QueueEvent(in_eventTime, SE_KEY, K_PAD0_A + i, pressed, 0, NULL);
|
||||||
stick_state.buttons[i] = pressed;
|
stick_state.buttons[i] = pressed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -709,19 +731,19 @@ static void IN_GamepadMove( void )
|
||||||
|
|
||||||
// positive to negative/neutral -> keyup
|
// positive to negative/neutral -> keyup
|
||||||
if (!posAnalog && posKey && oldAxis > 0 && axis <= 0)
|
if (!posAnalog && posKey && oldAxis > 0 && axis <= 0)
|
||||||
Com_QueueEvent(0, SE_KEY, posKey, qfalse, 0, NULL);
|
Com_QueueEvent(in_eventTime, SE_KEY, posKey, qfalse, 0, NULL);
|
||||||
|
|
||||||
// negative to positive/neutral -> keyup
|
// negative to positive/neutral -> keyup
|
||||||
if (!negAnalog && negKey && oldAxis < 0 && axis >= 0)
|
if (!negAnalog && negKey && oldAxis < 0 && axis >= 0)
|
||||||
Com_QueueEvent(0, SE_KEY, negKey, qfalse, 0, NULL);
|
Com_QueueEvent(in_eventTime, SE_KEY, negKey, qfalse, 0, NULL);
|
||||||
|
|
||||||
// negative/neutral to positive -> keydown
|
// negative/neutral to positive -> keydown
|
||||||
if (!posAnalog && posKey && oldAxis <= 0 && axis > 0)
|
if (!posAnalog && posKey && oldAxis <= 0 && axis > 0)
|
||||||
Com_QueueEvent(0, SE_KEY, posKey, qtrue, 0, NULL);
|
Com_QueueEvent(in_eventTime, SE_KEY, posKey, qtrue, 0, NULL);
|
||||||
|
|
||||||
// positive/neutral to negative -> keydown
|
// positive/neutral to negative -> keydown
|
||||||
if (!negAnalog && negKey && oldAxis >= 0 && axis < 0)
|
if (!negAnalog && negKey && oldAxis >= 0 && axis < 0)
|
||||||
Com_QueueEvent(0, SE_KEY, negKey, qtrue, 0, NULL);
|
Com_QueueEvent(in_eventTime, SE_KEY, negKey, qtrue, 0, NULL);
|
||||||
|
|
||||||
stick_state.oldaaxes[i] = axis;
|
stick_state.oldaaxes[i] = axis;
|
||||||
}
|
}
|
||||||
|
@ -733,7 +755,7 @@ static void IN_GamepadMove( void )
|
||||||
for (i = 0; i < MAX_JOYSTICK_AXIS; i++)
|
for (i = 0; i < MAX_JOYSTICK_AXIS; i++)
|
||||||
{
|
{
|
||||||
if (translatedAxesSet[i])
|
if (translatedAxesSet[i])
|
||||||
Com_QueueEvent(0, SE_JOYSTICK_AXIS, i, translatedAxes[i], 0, NULL);
|
Com_QueueEvent(in_eventTime, SE_JOYSTICK_AXIS, i, translatedAxes[i], 0, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -784,7 +806,7 @@ static void IN_JoyMove( void )
|
||||||
balldx *= 2;
|
balldx *= 2;
|
||||||
if (abs(balldy) > 1)
|
if (abs(balldy) > 1)
|
||||||
balldy *= 2;
|
balldy *= 2;
|
||||||
Com_QueueEvent( 0, SE_MOUSE, balldx, balldy, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_MOUSE, balldx, balldy, 0, NULL );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -799,7 +821,7 @@ static void IN_JoyMove( void )
|
||||||
qboolean pressed = (SDL_JoystickGetButton(stick, i) != 0);
|
qboolean pressed = (SDL_JoystickGetButton(stick, i) != 0);
|
||||||
if (pressed != stick_state.buttons[i])
|
if (pressed != stick_state.buttons[i])
|
||||||
{
|
{
|
||||||
Com_QueueEvent( 0, SE_KEY, K_JOY1 + i, pressed, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, K_JOY1 + i, pressed, 0, NULL );
|
||||||
stick_state.buttons[i] = pressed;
|
stick_state.buttons[i] = pressed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -824,32 +846,32 @@ static void IN_JoyMove( void )
|
||||||
// release event
|
// release event
|
||||||
switch( ((Uint8 *)&stick_state.oldhats)[i] ) {
|
switch( ((Uint8 *)&stick_state.oldhats)[i] ) {
|
||||||
case SDL_HAT_UP:
|
case SDL_HAT_UP:
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 0], qfalse, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 0], qfalse, 0, NULL );
|
||||||
break;
|
break;
|
||||||
case SDL_HAT_RIGHT:
|
case SDL_HAT_RIGHT:
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 1], qfalse, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 1], qfalse, 0, NULL );
|
||||||
break;
|
break;
|
||||||
case SDL_HAT_DOWN:
|
case SDL_HAT_DOWN:
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 2], qfalse, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 2], qfalse, 0, NULL );
|
||||||
break;
|
break;
|
||||||
case SDL_HAT_LEFT:
|
case SDL_HAT_LEFT:
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 3], qfalse, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 3], qfalse, 0, NULL );
|
||||||
break;
|
break;
|
||||||
case SDL_HAT_RIGHTUP:
|
case SDL_HAT_RIGHTUP:
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 0], qfalse, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 0], qfalse, 0, NULL );
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 1], qfalse, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 1], qfalse, 0, NULL );
|
||||||
break;
|
break;
|
||||||
case SDL_HAT_RIGHTDOWN:
|
case SDL_HAT_RIGHTDOWN:
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 2], qfalse, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 2], qfalse, 0, NULL );
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 1], qfalse, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 1], qfalse, 0, NULL );
|
||||||
break;
|
break;
|
||||||
case SDL_HAT_LEFTUP:
|
case SDL_HAT_LEFTUP:
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 0], qfalse, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 0], qfalse, 0, NULL );
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 3], qfalse, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 3], qfalse, 0, NULL );
|
||||||
break;
|
break;
|
||||||
case SDL_HAT_LEFTDOWN:
|
case SDL_HAT_LEFTDOWN:
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 2], qfalse, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 2], qfalse, 0, NULL );
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 3], qfalse, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 3], qfalse, 0, NULL );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -857,32 +879,32 @@ static void IN_JoyMove( void )
|
||||||
// press event
|
// press event
|
||||||
switch( ((Uint8 *)&hats)[i] ) {
|
switch( ((Uint8 *)&hats)[i] ) {
|
||||||
case SDL_HAT_UP:
|
case SDL_HAT_UP:
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 0], qtrue, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 0], qtrue, 0, NULL );
|
||||||
break;
|
break;
|
||||||
case SDL_HAT_RIGHT:
|
case SDL_HAT_RIGHT:
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 1], qtrue, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 1], qtrue, 0, NULL );
|
||||||
break;
|
break;
|
||||||
case SDL_HAT_DOWN:
|
case SDL_HAT_DOWN:
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 2], qtrue, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 2], qtrue, 0, NULL );
|
||||||
break;
|
break;
|
||||||
case SDL_HAT_LEFT:
|
case SDL_HAT_LEFT:
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 3], qtrue, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 3], qtrue, 0, NULL );
|
||||||
break;
|
break;
|
||||||
case SDL_HAT_RIGHTUP:
|
case SDL_HAT_RIGHTUP:
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 0], qtrue, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 0], qtrue, 0, NULL );
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 1], qtrue, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 1], qtrue, 0, NULL );
|
||||||
break;
|
break;
|
||||||
case SDL_HAT_RIGHTDOWN:
|
case SDL_HAT_RIGHTDOWN:
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 2], qtrue, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 2], qtrue, 0, NULL );
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 1], qtrue, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 1], qtrue, 0, NULL );
|
||||||
break;
|
break;
|
||||||
case SDL_HAT_LEFTUP:
|
case SDL_HAT_LEFTUP:
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 0], qtrue, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 0], qtrue, 0, NULL );
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 3], qtrue, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 3], qtrue, 0, NULL );
|
||||||
break;
|
break;
|
||||||
case SDL_HAT_LEFTDOWN:
|
case SDL_HAT_LEFTDOWN:
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 2], qtrue, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 2], qtrue, 0, NULL );
|
||||||
Com_QueueEvent( 0, SE_KEY, hat_keys[4*i + 3], qtrue, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, hat_keys[4*i + 3], qtrue, 0, NULL );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -910,7 +932,7 @@ static void IN_JoyMove( void )
|
||||||
|
|
||||||
if ( axis != stick_state.oldaaxes[i] )
|
if ( axis != stick_state.oldaaxes[i] )
|
||||||
{
|
{
|
||||||
Com_QueueEvent( 0, SE_JOYSTICK_AXIS, i, axis, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_JOYSTICK_AXIS, i, axis, 0, NULL );
|
||||||
stick_state.oldaaxes[i] = axis;
|
stick_state.oldaaxes[i] = axis;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -936,11 +958,11 @@ static void IN_JoyMove( void )
|
||||||
{
|
{
|
||||||
for( i = 0; i < 16; i++ ) {
|
for( i = 0; i < 16; i++ ) {
|
||||||
if( ( axes & ( 1 << i ) ) && !( stick_state.oldaxes & ( 1 << i ) ) ) {
|
if( ( axes & ( 1 << i ) ) && !( stick_state.oldaxes & ( 1 << i ) ) ) {
|
||||||
Com_QueueEvent( 0, SE_KEY, joy_keys[i], qtrue, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, joy_keys[i], qtrue, 0, NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !( axes & ( 1 << i ) ) && ( stick_state.oldaxes & ( 1 << i ) ) ) {
|
if( !( axes & ( 1 << i ) ) && ( stick_state.oldaxes & ( 1 << i ) ) ) {
|
||||||
Com_QueueEvent( 0, SE_KEY, joy_keys[i], qfalse, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, joy_keys[i], qfalse, 0, NULL );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -972,19 +994,19 @@ static void IN_ProcessEvents( void )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if( ( key = IN_TranslateSDLToQ3Key( &e.key.keysym, qtrue ) ) )
|
if( ( key = IN_TranslateSDLToQ3Key( &e.key.keysym, qtrue ) ) )
|
||||||
Com_QueueEvent( 0, SE_KEY, key, qtrue, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, key, qtrue, 0, NULL );
|
||||||
|
|
||||||
if( key == K_BACKSPACE )
|
if( key == K_BACKSPACE )
|
||||||
Com_QueueEvent( 0, SE_CHAR, CTRL('h'), 0, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_CHAR, CTRL('h'), 0, 0, NULL );
|
||||||
else if( keys[K_CTRL].down && key >= 'a' && key <= 'z' )
|
else if( keys[K_CTRL].down && key >= 'a' && key <= 'z' )
|
||||||
Com_QueueEvent( 0, SE_CHAR, CTRL(key), 0, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_CHAR, CTRL(key), 0, 0, NULL );
|
||||||
|
|
||||||
lastKeyDown = key;
|
lastKeyDown = key;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_KEYUP:
|
case SDL_KEYUP:
|
||||||
if( ( key = IN_TranslateSDLToQ3Key( &e.key.keysym, qfalse ) ) )
|
if( ( key = IN_TranslateSDLToQ3Key( &e.key.keysym, qfalse ) ) )
|
||||||
Com_QueueEvent( 0, SE_KEY, key, qfalse, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, key, qfalse, 0, NULL );
|
||||||
|
|
||||||
lastKeyDown = 0;
|
lastKeyDown = 0;
|
||||||
break;
|
break;
|
||||||
|
@ -1029,11 +1051,11 @@ static void IN_ProcessEvents( void )
|
||||||
{
|
{
|
||||||
if( IN_IsConsoleKey( 0, utf32 ) )
|
if( IN_IsConsoleKey( 0, utf32 ) )
|
||||||
{
|
{
|
||||||
Com_QueueEvent( 0, SE_KEY, K_CONSOLE, qtrue, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, K_CONSOLE, qtrue, 0, NULL );
|
||||||
Com_QueueEvent( 0, SE_KEY, K_CONSOLE, qfalse, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, K_CONSOLE, qfalse, 0, NULL );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Com_QueueEvent( 0, SE_CHAR, utf32, 0, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_CHAR, utf32, 0, 0, NULL );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1044,7 +1066,7 @@ static void IN_ProcessEvents( void )
|
||||||
{
|
{
|
||||||
if( !e.motion.xrel && !e.motion.yrel )
|
if( !e.motion.xrel && !e.motion.yrel )
|
||||||
break;
|
break;
|
||||||
Com_QueueEvent( 0, SE_MOUSE, e.motion.xrel, e.motion.yrel, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_MOUSE, e.motion.xrel, e.motion.yrel, 0, NULL );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1061,7 +1083,7 @@ static void IN_ProcessEvents( void )
|
||||||
case SDL_BUTTON_X2: b = K_MOUSE5; break;
|
case SDL_BUTTON_X2: b = K_MOUSE5; break;
|
||||||
default: b = K_AUX1 + ( e.button.button - SDL_BUTTON_X2 + 1 ) % 16; break;
|
default: b = K_AUX1 + ( e.button.button - SDL_BUTTON_X2 + 1 ) % 16; break;
|
||||||
}
|
}
|
||||||
Com_QueueEvent( 0, SE_KEY, b,
|
Com_QueueEvent( in_eventTime, SE_KEY, b,
|
||||||
( e.type == SDL_MOUSEBUTTONDOWN ? qtrue : qfalse ), 0, NULL );
|
( e.type == SDL_MOUSEBUTTONDOWN ? qtrue : qfalse ), 0, NULL );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1069,13 +1091,13 @@ static void IN_ProcessEvents( void )
|
||||||
case SDL_MOUSEWHEEL:
|
case SDL_MOUSEWHEEL:
|
||||||
if( e.wheel.y > 0 )
|
if( e.wheel.y > 0 )
|
||||||
{
|
{
|
||||||
Com_QueueEvent( 0, SE_KEY, K_MWHEELUP, qtrue, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, K_MWHEELUP, qtrue, 0, NULL );
|
||||||
Com_QueueEvent( 0, SE_KEY, K_MWHEELUP, qfalse, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, K_MWHEELUP, qfalse, 0, NULL );
|
||||||
}
|
}
|
||||||
else if( e.wheel.y < 0 )
|
else if( e.wheel.y < 0 )
|
||||||
{
|
{
|
||||||
Com_QueueEvent( 0, SE_KEY, K_MWHEELDOWN, qtrue, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, K_MWHEELDOWN, qtrue, 0, NULL );
|
||||||
Com_QueueEvent( 0, SE_KEY, K_MWHEELDOWN, qfalse, 0, NULL );
|
Com_QueueEvent( in_eventTime, SE_KEY, K_MWHEELDOWN, qfalse, 0, NULL );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1164,6 +1186,9 @@ void IN_Frame( void )
|
||||||
|
|
||||||
IN_ProcessEvents( );
|
IN_ProcessEvents( );
|
||||||
|
|
||||||
|
// Set event time for next frame to earliest possible time an event could happen
|
||||||
|
in_eventTime = Sys_Milliseconds( );
|
||||||
|
|
||||||
// In case we had to delay actual restart of video system
|
// In case we had to delay actual restart of video system
|
||||||
if( ( vidRestartTime != 0 ) && ( vidRestartTime < Sys_Milliseconds( ) ) )
|
if( ( vidRestartTime != 0 ) && ( vidRestartTime < Sys_Milliseconds( ) ) )
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,12 +28,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
#define MINSDL_MINOR 0
|
#define MINSDL_MINOR 0
|
||||||
#define MINSDL_PATCH 0
|
#define MINSDL_PATCH 0
|
||||||
|
|
||||||
// Input subsystem
|
|
||||||
void IN_Init( void *windowData );
|
|
||||||
void IN_Frame( void );
|
|
||||||
void IN_Shutdown( void );
|
|
||||||
void IN_Restart( void );
|
|
||||||
|
|
||||||
// Console
|
// Console
|
||||||
void CON_Shutdown( void );
|
void CON_Shutdown( void );
|
||||||
void CON_Init( void );
|
void CON_Init( void );
|
||||||
|
|
|
@ -756,7 +756,6 @@ int main( int argc, char **argv )
|
||||||
|
|
||||||
while( 1 )
|
while( 1 )
|
||||||
{
|
{
|
||||||
IN_Frame( );
|
|
||||||
Com_Frame( );
|
Com_Frame( );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ fi
|
||||||
|
|
||||||
|
|
||||||
if [ "X`uname -m`" = "Xi86pc" ]; then
|
if [ "X`uname -m`" = "Xi86pc" ]; then
|
||||||
ARCH=i386
|
ARCH=x86
|
||||||
else
|
else
|
||||||
ARCH=sparc
|
ARCH=sparc
|
||||||
fi
|
fi
|
||||||
|
@ -94,7 +94,7 @@ if [ -d ${BUILD_DIR} ]; then
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
for EXEC_SO in cgamesparc.so qagamesparc.so uisparc.so cgamei386.so qagamei386.so uii386.so
|
for EXEC_SO in cgamesparc.so qagamesparc.so uisparc.so cgamex86.so qagamex86.so uix86.so
|
||||||
do
|
do
|
||||||
if [ -f ${BUILD_DIR}/baseq3/${EXEC_SO} ]; then
|
if [ -f ${BUILD_DIR}/baseq3/${EXEC_SO} ]; then
|
||||||
${INSTALL_BIN} ${BUILD_DIR}/baseq3/${EXEC_SO} ${PKG_BUILD_DIR}/baseq3/${EXEC_SO}
|
${INSTALL_BIN} ${BUILD_DIR}/baseq3/${EXEC_SO} ${PKG_BUILD_DIR}/baseq3/${EXEC_SO}
|
||||||
|
|
|
@ -45,8 +45,8 @@ archs=()
|
||||||
for arch in $topdir/build/release-*; do
|
for arch in $topdir/build/release-*; do
|
||||||
arch=${arch##*-}
|
arch=${arch##*-}
|
||||||
case "$arch" in
|
case "$arch" in
|
||||||
i386) echo "define(HAVE_I386,yes)dnl" >> defines.m4
|
x86) echo "define(HAVE_X86,yes)dnl" >> defines.m4
|
||||||
copystartscript x86
|
copystartscript $arch
|
||||||
;;
|
;;
|
||||||
x86_64) echo "define(HAVE_X86_64,yes)dnl" >> defines.m4
|
x86_64) echo "define(HAVE_X86_64,yes)dnl" >> defines.m4
|
||||||
copystartscript $arch
|
copystartscript $arch
|
||||||
|
|
|
@ -24,9 +24,9 @@ PKG_VERSION=$VERSION
|
||||||
ARCH=${ARCH:-i586}
|
ARCH=${ARCH:-i586}
|
||||||
|
|
||||||
if [ "$ARCH" = "i?86" ]; then
|
if [ "$ARCH" = "i?86" ]; then
|
||||||
ARCHSUFFIX="i386"
|
ARCHSUFFIX="x86"
|
||||||
elif [ "$ARCH" = "x86_64" ]; then
|
elif [ "$ARCH" = "x86_64" ]; then
|
||||||
ARCHSUFFIX="64"
|
ARCHSUFFIX="x86_64"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BUILD=${BUILD:-1_io}
|
BUILD=${BUILD:-1_io}
|
||||||
|
|
|
@ -13,7 +13,7 @@ fi
|
||||||
export LD_LIBRARY_PATH
|
export LD_LIBRARY_PATH
|
||||||
|
|
||||||
COMPILE_PLATFORM=`uname|sed -e 's/_.*//'|tr '[:upper:]' '[:lower:]'`
|
COMPILE_PLATFORM=`uname|sed -e 's/_.*//'|tr '[:upper:]' '[:lower:]'`
|
||||||
COMPILE_ARCH=`uname -p | sed -e 's/i.86/i386/'`
|
COMPILE_ARCH=`uname -p | sed -e 's/i.86/x86/'`
|
||||||
|
|
||||||
EXEC_REL=release
|
EXEC_REL=release
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ fi
|
||||||
export LD_LIBRARY_PATH
|
export LD_LIBRARY_PATH
|
||||||
|
|
||||||
COMPILE_PLATFORM=`uname|sed -e 's/_.*//'|tr '[:upper:]' '[:lower:]'`
|
COMPILE_PLATFORM=`uname|sed -e 's/_.*//'|tr '[:upper:]' '[:lower:]'`
|
||||||
COMPILE_ARCH=`uname -p | sed -e 's/i.86/i386/'`
|
COMPILE_ARCH=`uname -p | sed -e 's/i.86/x86/'`
|
||||||
|
|
||||||
EXEC_REL=release
|
EXEC_REL=release
|
||||||
|
|
||||||
|
|
|
@ -38,8 +38,8 @@ export LD_LIBRARY_PATH
|
||||||
|
|
||||||
archs=`uname -m`
|
archs=`uname -m`
|
||||||
case "$archs" in
|
case "$archs" in
|
||||||
i?86) archs=i386 ;;
|
i?86) archs=x86 ;;
|
||||||
x86_64) archs="x86_64 i386" ;;
|
x86_64) archs="x86_64 x86" ;;
|
||||||
ppc64) archs="ppc64 ppc" ;;
|
ppc64) archs="ppc64 ppc" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
|
@ -24,12 +24,12 @@ ifelse(HAVE_X86_64,yes,dnl
|
||||||
<help>you need the binaries to play the game</help>
|
<help>you need the binaries to play the game</help>
|
||||||
</option>
|
</option>
|
||||||
)dnl
|
)dnl
|
||||||
ifelse(HAVE_I386,yes,dnl
|
ifelse(HAVE_X86,yes,dnl
|
||||||
<option install="true" if="|(x86,x86_64)">
|
<option install="true" if="|(x86,x86_64)">
|
||||||
Q3Rally x86 (32 bit) binaries
|
Q3Rally x86 (32 bit) binaries
|
||||||
<binary libc="any" symlink="q3rally" icon="q3rally.png" name="q3rally">q3rally</binary>
|
<binary libc="any" symlink="q3rally" icon="q3rally.png" name="q3rally">q3rally</binary>
|
||||||
<files>
|
<files>
|
||||||
q3rally.i386.tar
|
q3rally.x86.tar
|
||||||
</files>
|
</files>
|
||||||
<help>you need the binaries to play the game</help>
|
<help>you need the binaries to play the game</help>
|
||||||
</option>
|
</option>
|
||||||
|
|
Loading…
Reference in a new issue