Browse Source

ref_gl: move gl specific defines out from defaults.h, remove VIDEO_DONTCARE hack, automatically set XASH_GLES if wrapper is set

pull/2/head
Alibek Omarov 6 years ago
parent
commit
441795943b
  1. 1
      common/backends.h
  2. 10
      common/defaults.h
  3. 6
      ref_gl/gl_local.h
  4. 12
      ref_gl/wscript

1
common/backends.h

@ -18,7 +18,6 @@ GNU General Public License for more details. @@ -18,7 +18,6 @@ GNU General Public License for more details.
#define BACKENDS_H
// video backends (XASH_VIDEO)
#define VIDEO_DONTCARE -1 // a special mode for ref_dll
#define VIDEO_NULL 0
#define VIDEO_SDL 1
#define VIDEO_ANDROID 2

10
common/defaults.h

@ -95,11 +95,7 @@ SETUP BACKENDS DEFINITIONS @@ -95,11 +95,7 @@ SETUP BACKENDS DEFINITIONS
// fallback to NULL
//
#ifndef XASH_VIDEO
#ifdef REF_DLL
#define XASH_VIDEO VIDEO_DONTCARE
#else
#define XASH_VIDEO VIDEO_NULL
#endif
#define XASH_VIDEO VIDEO_NULL
#endif
#ifndef XASH_SOUND
@ -132,10 +128,6 @@ Default build-depended cvar and constant values @@ -132,10 +128,6 @@ Default build-depended cvar and constant values
// You need add library loading code to library.c when adding new platform
#endif
#if defined XASH_NANOGL || defined XASH_WES || defined XASH_REGAL
#define XASH_GL_STATIC
#endif
#define DEFAULT_SV_MASTER "ms.xash.su:27010"
// Set ForceSimulating to 1 by default for dedicated, because AMXModX timers require this
// TODO: enable simulating for any server?

6
ref_gl/gl_local.h

@ -16,7 +16,6 @@ GNU General Public License for more details. @@ -16,7 +16,6 @@ GNU General Public License for more details.
#ifndef GL_LOCAL_H
#define GL_LOCAL_H
#include "port.h"
#include "defaults.h"
#include "xash3d_types.h"
#include "cvardef.h"
#include "const.h"
@ -35,6 +34,11 @@ GNU General Public License for more details. @@ -35,6 +34,11 @@ GNU General Public License for more details.
#include "pm_movevars.h"
//#include "cvar.h"
#if defined XASH_NANOGL || defined XASH_WES || defined XASH_REGAL
#define XASH_GLES
#define XASH_GL_STATIC
#endif
#ifndef offsetof
#define offsetof(s,m) (size_t)&(((s *)0)->m)
#endif // offsetof

12
ref_gl/wscript

@ -79,23 +79,23 @@ def build(bld): @@ -79,23 +79,23 @@ def build(bld):
if bld.env.NANOGL:
bld.recurse('nanogl')
bld.shlib(
source = source,
source = source,
target = 'ref_gles1',
features = 'c',
includes = includes,
use = libs + ['nanogl', 'DL' ],
defines = ['XASH_GLES', 'XASH_NANOGL'],
use = libs + ['DL', 'nanogl'],
defines = ['XASH_NANOGL'],
install_path = bld.env.LIBDIR,
subsystem = bld.env.MSVC_SUBSYSTEM)
if bld.env.GLWES:
bld.recurse('gl-wes-v2')
bld.shlib(
source = source,
source = source,
target = 'ref_gles2',
features = 'c',
includes = includes,
use = libs + ['gl-wes-v2', 'DL'],
defines = ['XASH_GLES', 'XASH_WES'],
use = libs + ['DL', 'gl-wes-v2'],
defines = ['XASH_WES'],
install_path = bld.env.LIBDIR,
subsystem = bld.env.MSVC_SUBSYSTEM)

Loading…
Cancel
Save