Skip to content
This repository has been archived by the owner on Mar 1, 2021. It is now read-only.

Sync with head #6

Merged
merged 27 commits into from
Jun 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
fc7a8cc
Now we have a secondary master server(thanks, @jeefo)
a1batross May 8, 2018
44cfcf8
Fix build
a1batross May 9, 2018
9f6e1ef
Fix assignment in if
lewa-j May 13, 2018
7615c1c
Merge pull request #380 from lewa-j/patch-1
a1batross May 13, 2018
ba03f9a
Replace game.cfg by gamesettings.cfg to prevent confusing hlsdk and mods
mittorn May 16, 2018
5d1b961
Fix window size change
mittorn May 19, 2018
25dffb9
Update menu
mittorn May 19, 2018
66038b2
Add ShellExecute implementation for emscripten
mittorn May 20, 2018
7057be5
Update CONTRIBUTING.md.
nekonomicon May 23, 2018
81c501c
Updated debug flag and break conditions
May 28, 2018
018f868
Moced _DEBUG definition into CMAKE_BUILD_TYPE check instead
May 28, 2018
4f655e1
Merge pull request #383 from x6herbius/platform-debug-utils
a1batross May 28, 2018
5bdeea7
Fix build when debugger break isn't enabled for linux(for compability…
a1batross May 28, 2018
d3912a1
Try to fix AppVeyor
a1batross May 28, 2018
7976c24
Reset motion state when show client touch elements
mittorn Jun 5, 2018
60be57d
update mainui
mittorn Jun 5, 2018
5c75954
Fix touch_generate_code, update mainui, bump version to 0.19.2
a1batross Jun 3, 2018
4999d91
Fix crash in touch code after changing game
a1batross Jun 20, 2018
752442c
Update mainui
a1batross Jun 20, 2018
bb19286
Fix touch copyrights
a1batross Jun 20, 2018
b621dbb
Update mainui
a1batross Jun 21, 2018
307c98d
Fix caseinsenstive file search in RoDir. Try to generate gameinfo.txt…
a1batross Jun 26, 2018
ab7c384
Update mainui
a1batross Jun 26, 2018
e9144ad
Fix FS_Search
a1batross Jun 26, 2018
09752f3
Update mainui
a1batross Jun 26, 2018
b4840cb
Define XASH_GL_STATIC globally by compiler flags for GLES, because fo…
a1batross Jun 29, 2018
e16e910
Rework xash3d.sh start-up script
a1batross Jun 29, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ include(CPack)
# USER DEFINES \
################\

set (XASH3D_VERSION 0.19.1)
set (XASH3D_VERSION 0.19.2)

option(XASH_DEDICATED "Enable dedicated build. Servers must choose this." OFF) # Servers must choose this

Expand Down
10 changes: 7 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ But if you want your patch to be accepted, we can give you few guidelines.

| OS | Macro |
| -- | ----- |
| Linux | `defined(__linux__)`|
| *BSD | `defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)` |
| Linux | `defined(__linux__)` |
| FreeBSD | `defined(__FreeBSD__)` |
| NetBSD | `defined(__NetBSD__)` |
| OpenBSD | `defined(__OpenBSD__)` |
| OS X/iOS | `defined(__APPLE__)` and TargetConditionals macros |
| Windows | `defined(_WIN32)` |
| Android | `defined(__ANDROID__)` |
| Emscripten | `defined(__EMSCRIPTEN__)` |

### Licensing

Expand All @@ -50,4 +54,4 @@ But if you want your patch to be accepted, we can give you few guidelines.
* Use tabs, not spaces, for indentation.
* Any brace must have it's own line.
* Short blocks, if statements and loops on single line is allowed.
* You can use clang-format here. Config is located in `.clang-format` file in repository's root .
* You can use clang-format here. Config is located in `.clang-format` file in repository's root .
14 changes: 10 additions & 4 deletions common/defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ GNU General Public License for more details.
/*
===================================================================

SETUP BACKENDS DEFINATIONS
SETUP BACKENDS DEFINITIONS

===================================================================
*/
Expand Down Expand Up @@ -129,10 +129,16 @@ Default build-depended cvar and constant values
#endif

#if defined XASH_NANOGL || defined XASH_WES || defined XASH_REGAL
#ifndef XASH_GLES
#define XASH_GLES
#endif // XASH_GLES
#ifndef XASH_GL_STATIC
#define XASH_GL_STATIC
#endif
#endif // XASH_GL_STATIC
#endif // XASH_NANOGL || XASH_WES || XASH_REGAL

#define DEFAULT_SV_MASTER "ms.xash.su:27010"
#define DEFAULT_PRIMARY_MASTER "ms.xash.su:27010"
#define DEFAULT_SECONDARY_MASTER "ms2.xash.su:27010"
// Set ForceSimulating to 1 by default for dedicated, because AMXModX timers require this
// TODO: enable simulating for any server?
#ifdef XASH_DEDICATED
Expand All @@ -151,7 +157,7 @@ Default build-depended cvar and constant values
#endif

#if TARGET_OS_IPHONE
#define DEFAULT_CON_MAXFRAC "0.5"
#define DEFAULT_CON_MAXFRAC "0.5"
#else
#define DEFAULT_CON_MAXFRAC "1"
#endif
Expand Down
5 changes: 5 additions & 0 deletions common/port.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ GNU General Public License for more details.
#define OPEN_COMMAND "xdg-open"
#endif


#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif

#if defined(__ANDROID__)
#if defined(LOAD_HARDFP)
#define POSTFIX "_hardfp"
Expand Down
8 changes: 6 additions & 2 deletions engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ else()
add_definitions(-DUSE_SELECT)
endif()
add_definitions(-DCOLORIZE_CONSOLE)
endif()
endif()

if(LINUX)
add_definitions(-DGDB_BREAK)
Expand Down Expand Up @@ -138,7 +138,7 @@ if(XASH_SDL)
endif()

if(XASH_GLES)
add_definitions(-DXASH_GLES)
add_definitions(-DXASH_GLES -DXASH_GL_STATIC)
endif()

if(XASH_DLL_LOADER)
Expand All @@ -161,6 +161,10 @@ else()
add_definitions(-DNO_LIBDL)
endif()

if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
add_definitions(-D_DEBUG)
endif()

if(XASH_RELEASE)
add_definitions(-DXASH_RELEASE)
else()
Expand Down
2 changes: 1 addition & 1 deletion engine/client/cl_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,7 @@ void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
if( !Q_strcmp( Cmd_Argv( 1 ), "nostore" ) )
preferStore = false;

if( NET_StringToAdr( DEFAULT_SV_MASTER, &adr ) )
if( NET_StringToAdr( DEFAULT_PRIMARY_MASTER, &adr ) )
{
if( NET_CompareAdr( from, adr ))
{
Expand Down
12 changes: 11 additions & 1 deletion engine/client/cl_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,16 @@ static void pfnCvarSetValue( const char *name, float value )
Cvar_Set2( name, val, false );
}

static void pfnWriteGameConfig( const char *name )
{
// do not use game.cfg or listenserver.cfg
// as it will be executed from hlsdk
Host_WriteGameConfig( "gamesettings.cfg" );

// remove old game.cfg, prevent it from resetting settings
FS_Delete( "game.cfg" );
}

// engine callbacks
static ui_enginefuncs_t gEngfuncs =
{
Expand Down Expand Up @@ -1028,7 +1038,7 @@ static ui_enginefuncs_t gEngfuncs =
pfnCheckGameDll,
pfnGetClipboardData,
(void*)Sys_ShellExecute,
Host_WriteGameConfig,
pfnWriteGameConfig,
pfnChangeInstance,
pfnStartBackgroundTrack,
pfnHostEndGame,
Expand Down
4 changes: 1 addition & 3 deletions engine/client/cl_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,6 @@ void CL_CheckingResFile( char *pResFileName )

downloadcount++;


if( cl_allow_fragment->integer )
{
Msg( "Starting file download: %s\n", pResFileName );
Expand All @@ -1119,8 +1118,7 @@ void CL_CheckingResFile( char *pResFileName )
// make sure message will be delivered
Netchan_Transmit( &cls.netchan, BF_GetNumBytesWritten( &buf ), BF_GetData( &buf ));
}
else
HTTP_AddDownload( pResFileName, -1, true );
else HTTP_AddDownload( pResFileName, -1, true );

}

Expand Down
2 changes: 1 addition & 1 deletion engine/client/gl_sprite.c
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ static void R_DrawSpriteQuad( mspriteframe_t *frame, vec3_t org, vec3_t v_right,
VectorMA( org, frame->up * scale, v_up, point );
VectorMA( point, frame->right * scale, v_right, point );
pglVertex3fv( point );
pglTexCoord2f( 1.0f, 1.0f );
pglTexCoord2f( 1.0f, 1.0f );
VectorMA( org, frame->down * scale, v_up, point );
VectorMA( point, frame->right * scale, v_right, point );
pglVertex3fv( point );
Expand Down
13 changes: 10 additions & 3 deletions engine/client/touch.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
touch.c - touchscreen support prototype
Copyright (C) 2015 a1batross
Copyright (C) 2015-2018 mittorn

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -366,7 +366,7 @@ void Touch_GenetateCode_f( void )
aspect = ( B(y2) - B(y1) ) / ( ( B(x2) - B(x1) ) /(SCR_H/SCR_W) );
if( Q_memcmp( &c, &B(color), sizeof( rgba_t ) ) )
{
Msg( "MakeRGBA( color, %d, %d, %d, %d );\n", B(color[0]), B(color[1]), B(color[2]), B(color[3]) );
Msg( "unsigned char color[] = { %d, %d, %d, %d };\n", B(color[0]), B(color[1]), B(color[2]), B(color[3]) );
Q_memcpy( &c, &B(color), sizeof( rgba_t ) );
}
Msg( "TOUCH_ADDDEFAULT( \"%s\", \"%s\", \"%s\", %f, %f, %f, %f, color, %d, %f, %d );\n",
Expand Down Expand Up @@ -430,6 +430,10 @@ void Touch_SetClientOnly( qboolean state )
{
touch.clientonly = state;
host.mouse_visible = state;

touch.move_finger = touch.look_finger = -1;
touch.forward = touch.side = 0;

#ifdef XASH_SDL
if( state )
{
Expand Down Expand Up @@ -489,7 +493,7 @@ void Touch_ClearList( touchbuttonlist_t *list )
list->first = list->first->next;
Mem_Free ( remove );
}
list->first= list->last = NULL;
list->first = list->last = NULL;
}

void Touch_RemoveAll_f( void )
Expand Down Expand Up @@ -881,6 +885,9 @@ void Touch_Init( void )
touch.swidth = 1;
g_LastDefaultButton = 0;

touch.list_edit.first = touch.list_edit.last = NULL;
touch.list_user.first = touch.list_user.last = NULL;

// fill default buttons list
MakeRGBA( color, 255, 255, 255, 255 );
Touch_AddDefaultButton( "look", "", "_look", 0.500000, 0.000000, 1.000000, 1, color, 0, 0, 0 );
Expand Down
2 changes: 1 addition & 1 deletion engine/client/touch.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
touch.h - natoive touch controls
Copyright (C) 2015 mittorn
Copyright (C) 2015-2018 mittorn

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion engine/client/vid_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ void Win_SetDPIAwareness( void )
MsgDev( D_NOTE, "SetDPIAwareness: Success\n" );
bSuccess = TRUE;
}
else if( hResult = E_INVALIDARG ) MsgDev( D_NOTE, "SetDPIAwareness: Invalid argument\n" );
else if( hResult == E_INVALIDARG ) MsgDev( D_NOTE, "SetDPIAwareness: Invalid argument\n" );
else if( hResult == E_ACCESSDENIED ) MsgDev( D_NOTE, "SetDPIAwareness: Access Denied\n" );
}
else MsgDev( D_NOTE, "SetDPIAwareness: Can't get SetProcessDpiAwareness\n" );
Expand Down
4 changes: 2 additions & 2 deletions engine/common/cfgscript.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ qboolean CSCR_ParseHeader( parserstate_t *ps )
======================
CSCR_WriteGameCVars

Print all cvars declared in script to game.cfg file
Print all cvars declared in script to gamesettings.cfg file
======================
*/
int CSCR_WriteGameCVars( file_t *cfg, const char *scriptfilename )
Expand Down Expand Up @@ -251,7 +251,7 @@ int CSCR_WriteGameCVars( file_t *cfg, const char *scriptfilename )
convar_t *cvar = Cvar_FindVar( var.name );
if( cvar && !( cvar->flags & ( CVAR_SERVERNOTIFY | CVAR_ARCHIVE ) ) )
{
// cvars will be placed in game.cfg and restored on map start
// cvars will be placed in gamesettings.cfg and restored on map start
if( var.flags & CVAR_USERINFO )
FS_Printf( cfg, "// %s ( %s )\nsetu %s \"%s\"\n", var.desc, var.value, var.name, cvar->string );
else
Expand Down
2 changes: 1 addition & 1 deletion engine/common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ typedef enum
#include "crtlib.h"
#include "base_cmd.h"

#define XASH_VERSION "0.19.1" // engine current version
#define XASH_VERSION "0.19.2" // engine current version
// since this fork have own version, this is just left for compability
#define BASED_VERSION 0.98f

Expand Down
22 changes: 16 additions & 6 deletions engine/common/con_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1405,27 +1405,37 @@ void Host_WriteGameConfig( const char *name )
{
/* Old Xash3D behaviour is writing listenserver config
every time when starting server from ui.
WON Half-Life uses game.cfg for this purpose*/
WON Half-Life used game.cfg for this purpose
but this causes reseting all cvars on map change.
since server not unloaded, we do not need to restore cvars
*/
file_t *f;
string oldconfigfile, newconfigfile;

Q_snprintf( oldconfigfile, MAX_STRING, "%s.bak", name );
Q_snprintf( newconfigfile, MAX_STRING, "%s.new", name );

SV_InitGameProgs(); // collect user variables

if(( f = FS_Open( "game.cfg", "w", false )) != NULL )
if(( f = FS_Open( newconfigfile, "w", false )) != NULL )
{
FS_Printf( f, "//=======================================================================\n" );
FS_Printf( f, "//\t\t\tCopyright Flying With Gauss Team %s ©\n", Q_timestamp( TIME_YEAR_ONLY ));
FS_Printf( f, "//\t\t\tgame.cfg - multiplayer config\n" );
FS_Printf( f, "//\t\t\t%s - multiplayer config\n", name );
FS_Printf( f, "//=======================================================================\n" );

Cmd_WriteServerVariables( f );
CSCR_WriteGameCVars( f, "user.scr" );
CSCR_WriteGameCVars( f, "settings.scr" );

FS_Close( f );
}
else MsgDev( D_ERROR, "Couldn't write game.cfg.\n" );

//SV_FreeGameProgs(); // release progs with all variables
FS_Rename( name, oldconfigfile );
FS_Delete( name );
FS_Rename( newconfigfile, name );
FS_Delete( oldconfigfile );
}
else MsgDev( D_ERROR, "Couldn't write game settings file %s.\n", name );
}
/*
===============
Expand Down
2 changes: 1 addition & 1 deletion engine/common/cvar.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ convar_t *Cvar_FindVar( const char *var_name )
if( !Q_stricmp( var_name, var->name ))
return var;
}
#endif

return NULL;
#endif
}

/*
Expand Down
Loading