Move */main/inferno.h -> common/main/inferno.h

Add preprocessor symbols to detect which version of Descent is built,
since some headers are not identical between the two versions, but are
close enough to be worth sharing.
This commit is contained in:
Kp 2013-03-03 01:03:33 +00:00
parent 0c2a08ec01
commit 4033f2020b
3 changed files with 12 additions and 61 deletions

View file

@ -100,10 +100,15 @@ class DXXCommon:
self.env["ARCOMSTR"] = "Archiving $TARGET ..."
self.env["RANLIBCOMSTR"] = "Indexing $TARGET ..."
self.env.Append(CCFLAGS = ['-Wall', '-funsigned-char', '-Werror=implicit-int', '-Werror=implicit-function-declaration', '-pedantic', '-pthread'])
# Use -Wundef to catch when a shared source file includes a
# shared header that misuses conditional compilation. Use
# -Werror=undef to make this fatal. Both are needed, since
# gcc 4.5 silently ignores -Werror=undef. On gcc 4.5, misuse
# produces a warning. On gcc 4.7, misuse produces an error.
self.env.Append(CCFLAGS = ['-Wall', '-Wundef', '-Werror=undef', '-funsigned-char', '-Werror=implicit-int', '-Werror=implicit-function-declaration', '-pedantic', '-pthread'])
self.env.Append(CFLAGS = ['-std=c99'])
self.env.Append(CPPDEFINES = ['NETWORK'])
self.env.Append(CPPPATH = ['common/include'])
self.env.Append(CPPPATH = ['common/include', 'common/main'])
# Get traditional compiler environment variables
for cc in ['CC', 'CXX']:
if os.environ.has_key(cc):
@ -317,6 +322,7 @@ class D1XProgram(DXXProgram):
DXXProgram.prepare_environment(self)
# Flags and stuff for all platforms...
self.env.Append(CPPPATH = [os.path.join(self.srcdir, f) for f in ['include', 'main', 'arch/include']])
self.env.Append(CPPDEFINES = [('DXX_BUILD_DESCENT_I', 1)])
def __init__(self):
# general source files
@ -565,6 +571,7 @@ class D2XProgram(DXXProgram):
DXXProgram.prepare_environment(self)
# Flags and stuff for all platforms...
self.env.Append(CPPPATH = [os.path.join(self.srcdir, f) for f in ['include', 'main', 'arch/include']])
self.env.Append(CPPDEFINES = [('DXX_BUILD_DESCENT_II', 1)])
def __init__(self):
# general source files

View file

@ -51,6 +51,9 @@ typedef char d_fname[FILENAME_LEN];
extern jmp_buf LeaveEvents;
extern int Quitting;
extern int Screen_mode; // editor screen or game screen?
#ifdef DXX_BUILD_DESCENT_I
extern int MacHog;
#endif
// Default event handler for everything except the editor
int standard_handler(struct d_event *event);

View file

@ -1,59 +0,0 @@
/*
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
*/
/*
*
* Header file for Inferno. Should be included in all source files.
*
*/
#ifndef _INFERNO_H
#define _INFERNO_H
#include <setjmp.h>
struct d_event;
#if defined(__APPLE__) || defined(macintosh)
#define KEY_MAC(x) x
#else
// do not use MAC, it will break MSVC compilation somewhere in rpcdce.h
#define KEY_MAC(x)
#endif
/**
** Constants
**/
// How close two points must be in all dimensions to be considered the same point.
#define FIX_EPSILON 10
// the maximum length of a filename
#define FILENAME_LEN 13
// a filename, useful for declaring arrays of filenames
typedef char d_fname[FILENAME_LEN];
/**
** Global variables
**/
extern jmp_buf LeaveEvents;
extern int Quitting;
extern int Screen_mode; // editor screen or game screen?
extern int MacHog;
// Default event handler for everything except the editor
int standard_handler(struct d_event *event);
#endif