Use inline namespace dsx for inferno.cpp

This commit is contained in:
Kp 2015-12-05 22:57:25 +00:00
parent 22bd3ce8d8
commit 1e50c23a8c
4 changed files with 36 additions and 3 deletions

View file

@ -38,7 +38,9 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#define SHEIGHT (grd_curscreen->get_screen_height())
#if defined(DXX_BUILD_DESCENT_I)
inline namespace dsx {
extern int HiresGFXAvailable;
}
#define HIRESMODE HiresGFXAvailable // descent.pig either contains hires or lowres graphics, not both
#elif defined(DXX_BUILD_DESCENT_II)
#define HIRESMODE (SWIDTH >= 640 && SHEIGHT >= 480 && !GameArg.GfxSkipHiresGFX)

View file

@ -28,6 +28,8 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "fwd-event.h"
#include "ntstring.h"
inline namespace dcx {
#if defined(__APPLE__) || defined(macintosh)
#define KEY_MAC(x) x
#else
@ -45,6 +47,9 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
// the maximum length of a filename
static const std::size_t FILENAME_LEN = 13;
// Default event handler for everything except the editor
int standard_handler(const d_event &event);
// a filename, useful for declaring arrays of filenames
struct d_fname : ntstring<FILENAME_LEN - 1>
{
@ -58,6 +63,11 @@ struct d_fname : ntstring<FILENAME_LEN - 1>
}
};
}
#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II)
inline namespace dsx {
/**
** Global variables
**/
@ -68,5 +78,5 @@ extern int Screen_mode; // editor screen or game screen?
extern int MacHog;
#endif
// Default event handler for everything except the editor
int standard_handler(const d_event &event);
}
#endif

View file

@ -28,8 +28,12 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#ifdef __cplusplus
#include <cstdint>
inline namespace dcx {
struct d_fname;
}
extern void show_titles(void);
void do_briefing_screens(const d_fname &filename, int level_num);
void do_end_briefing_screens(const d_fname &filename);

View file

@ -111,6 +111,8 @@ char copyright[] = "DESCENT II COPYRIGHT (C) 1994-1996 PARALLAX SOFTWARE CORPOR
#include "dxxsconf.h"
#include "compiler-begin.h"
inline namespace dsx {
int Screen_mode=-1; //game screen or editor screen?
#if defined(DXX_BUILD_DESCENT_I)
@ -232,6 +234,10 @@ static void print_commandline_help()
int Quitting = 0;
}
inline namespace dcx {
// Default event handler for everything except the editor
int standard_handler(const d_event &event)
{
@ -328,6 +334,10 @@ int standard_handler(const d_event &event)
return 0;
}
}
inline namespace dsx {
#define PROGNAME argv[0]
// DESCENT by Parallax Software
@ -335,7 +345,7 @@ int standard_handler(const d_event &event)
// (varies based on preprocessor options)
// Descent Main
int main(int argc, char *argv[])
static int main(int argc, char *argv[])
{
mem_init();
#ifdef __linux__
@ -576,3 +586,10 @@ int main(int argc, char *argv[])
return(0); //presumably successful exit
}
}
int main(int argc, char *argv[])
{
return dsx::main(argc, argv);
}