1
0
forked from 0ad/0ad

stripped some headers from deprecated prometheus.h => huge rearrange

This was SVN commit r378.
This commit is contained in:
janwas 2004-06-03 01:43:33 +00:00
parent a5938f5e13
commit 4daa183dd3
26 changed files with 122 additions and 94 deletions

View File

@ -9,6 +9,8 @@
#ifndef _MODEL_H
#define _MODEL_H
#include <vector>
#include "Texture.h"
#include "ModelDef.h"
#include "RenderableObject.h"

View File

@ -1,5 +1,6 @@
#include "ObjectManager.h"
#include <algorithm>
#include "CLogger.h"
CObjectManager::CObjectManager() : m_SelectedObject(0)
{

View File

@ -8,6 +8,7 @@
#include "res/res.h"
#include "Model.h"
#include "CLogger.h"
#include "SkeletonAnimManager.h"
#include <algorithm>

View File

@ -1,12 +1,11 @@
#include <algorithm>
#include "TextureManager.h"
#include "lib.h"
#include "ogl.h"
#include "res/tex.h"
#ifdef _WIN32
#include <io.h>
#endif
#include <algorithm>
#include "CLogger.h"
const char* SupportedTextureFormats[] = { ".png", ".dds", ".tga", ".bmp" };

View File

@ -38,6 +38,8 @@ using namespace std;
#pragma comment(lib, "xerces-c_2.lib")
#endif
extern int g_xres, g_yres;
// TODO Gee: how to draw overlays?
void render(COverlayText* overlaytext)
{

View File

@ -12,6 +12,8 @@ gee@pyro.nu
#include <assert.h>
/////
extern int g_xres, g_yres;
using namespace std;
//-------------------------------------------------------------------

View File

@ -45,3 +45,18 @@ double round(double x)
}
#endif
#ifndef HAVE_C99
float fminf(float a, float b)
{
return (a < b)? a : b;
}
float fmaxf(float a, float b)
{
return (a > b)? a : b;
}
#endif

View File

@ -5,6 +5,8 @@
#include "win/win.h"
#endif
#include "config.h"
#ifdef __cplusplus
extern "C" {
#endif
@ -19,6 +21,12 @@ extern void check_heap();
extern double round(double);
#endif
#ifndef HAVE_C99
extern float fminf(float a, float b);
extern float fmaxf(float a, float b);
#endif
#ifdef __cplusplus
}
#endif

View File

@ -188,7 +188,7 @@ static inline void pre_main_init()
#ifdef PARANOIA
// force malloc et al to check the heap every call.
// slower, but reports errors closer to where they occur.
int flags = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
uint flags = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
flags |= _CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_DELAY_FREE_MEM_DF;
_CrtSetDbgFlag(flags);
#endif

View File

@ -369,7 +369,7 @@ int pthread_mutex_destroy(pthread_mutex_t* m)
//////////////////////////////////////////////////////////////////////////////
void* mmap(void* start, unsigned int len, int prot, int flags, int fd, long offset)
void* mmap(void* start, size_t len, int prot, int flags, int fd, off_t offset)
{
if(!(flags & MAP_FIXED))
start = 0;
@ -413,7 +413,7 @@ void* mmap(void* start, unsigned int len, int prot, int flags, int fd, long offs
}
int munmap(void* start, unsigned int /* len */)
int munmap(void* start, size_t /* len */)
{
return UnmapViewOfFile(start) - 1; /* 0: success; -1: fail */
}

View File

@ -192,8 +192,8 @@ extern int closedir(DIR*);
#define MAP_FAILED 0
extern void* mmap(void* start, unsigned int len, int prot, int flags, int fd, long offset);
extern int munmap(void* start, unsigned int len);
extern void* mmap(void* start, size_t len, int prot, int flags, int fd, off_t offset);
extern int munmap(void* start, size_t len);
//

View File

@ -1,6 +1,8 @@
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
// Alan: For some reason if this gets included after anything else some
// compile time errors get thrown up todo with javascript internal typedefs
@ -50,7 +52,11 @@ u32 game_ticks;
bool keys[SDLK_LAST];
bool mouseButtons[5];
#include <cmath>
// Globals
int g_xres, g_yres;
int g_bpp;
int g_freq;
// flag to disable extended GL extensions until fix found - specifically, crashes
// using VBOs on laptop Radeon cards
@ -526,7 +532,7 @@ int main(int argc, char* argv[])
}
new CConfig;
/// new CConfig;
// vfs_mount("gui", "gui", 0);
vfs_mount("", "mods/official/", 0);
@ -561,8 +567,9 @@ int main(int argc, char* argv[])
new CObjectManager;
new CUnitManager;
// terr_init actually opens the renderer and loads a bunch of resources as well as setting up
// the terrain
g_Renderer.Open(g_xres,g_yres,g_bpp);
// terr_init loads a bunch of resources as well as setting up the terrain
terr_init();
@ -617,7 +624,7 @@ g_Console->RegisterFunc(Testing, "Testing");
const double TICK_TIME = 30e-3; // [s]
double time0 = get_time();
g_Config.Update();
// g_Config.Update();
while(!quit)
{
//g_Config.Update();
@ -664,11 +671,11 @@ g_Console->RegisterFunc(Testing, "Testing");
#ifndef NO_GUI
g_GUI.Destroy();
delete CGUI::GetSingletonPtr(); // again, we should have all singleton deletes somewhere
delete CGUI::GetSingletonPtr();
#endif
delete &g_ScriptingHost;
delete &g_Config;
/// delete &g_Config;
delete &g_Pathfinder;
delete &g_EntityManager;
delete &g_EntityTemplateCollection;

View File

@ -170,10 +170,10 @@ namespace MathUtil
// PURPOSE: Wraps num between lowerBound and upperBound.
//
template <typename T>
PS_RESULT Wrap(T *num,const T &lowerBound, const T &upperBound)
int Wrap(T *num,const T &lowerBound, const T &upperBound)
{
if(lowerBound >= upperBound)
return ERRONEOUS_BOUND_ERROR;
return -1;
else
{
// translate to range 0 to n-1, find the modulus, then
@ -182,7 +182,7 @@ namespace MathUtil
num = SignedModulus( num, Abs(upperBound - lowerBound) );
num += lowerBound;
}
return PS_OK;
return 0;
}

View File

@ -1,5 +1,6 @@
#include "CStr.h"
#include "Network/Serialization.h"
#include <cassert>
CStr::CStr()
{

View File

@ -3,6 +3,8 @@
// TODO: A few changes from VFS -> CFile usage if required.
// TODO: Optimizations, when we've decided what needs to be done.
#if 0
#include "Config.h"
#include "res/res.h"
@ -311,3 +313,5 @@ void CConfig::Attach( CLogFile* LogFile )
{
m_LogFile = LogFile;
}
#endif

View File

@ -27,6 +27,20 @@
const int NullPtr = 0;
// Setup error interface
#define IsError() GError.ErrorMechanism_Error()
#define ClearError() GError.ErrorMechanism_ClearError()
#define TestError(TError) GError.ErrorMechanism_TestError(TError)
#define SetError_Short(w,x) GError.ErrorMechanism_SetError(w,x,__FILE__,__LINE__)
#define SetError_Long(w,x,y,z) GError.ErrorMechanism_SetError(w,x,y,z)
#define GetError() GError.ErrorMechanism_GetError()
/****************************************************************************/
// USER DEFINED TYPES //
/****************************************************************************/

View File

@ -1,5 +1,7 @@
// last modified Thursday, May 08, 2003
#if 0
#include "LogFile.h"
#include "lib.h"
@ -360,3 +362,5 @@ string CLogFile::Date(const PS_DISPLAY_SETTINGS &options)
return dateText;
}
#endif

View File

@ -4,6 +4,7 @@
// necessary includes
#include "CStr.h"
#include "Texture.h"
#include <cassert>
/////////////////////////////////////////////////////////////////////////////////////////
// NPFont:

View File

@ -2,6 +2,7 @@
#include "NPFont.h"
#include <algorithm>
#include <cassert>
// the sole instance of the NPFontManager
NPFontManager* NPFontManager::_instance=0;

View File

@ -1,9 +1,5 @@
#include "Prometheus.h"
// Globals
int g_xres = 800, g_yres = 600;
int g_bpp = 32;
int g_freq = 60;
DEFINE_ERROR(PS_OK, "OK");
DEFINE_ERROR(PS_FAIL, "Fail");

View File

@ -10,19 +10,6 @@ Standard declarations which are included in all projects.
#define PROMETHEUS_H
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include "CLogger.h"
// Globals
extern int g_xres, g_yres;
extern int g_bpp;
extern int g_freq;
// Error handling
typedef const char * PS_RESULT;
#define DEFINE_ERROR(x, y) PS_RESULT x=y;
@ -32,29 +19,4 @@ DECLARE_ERROR(PS_OK);
DECLARE_ERROR(PS_FAIL);
/*
inline bool ErrorMechanism_Error();
inline void ErrorMechanism_ClearError();
inline bool ErrorMechanism_TestError( PS_RESULT);
inline void ErrorMechanism_SetError(
PS_RESULT,
std::string,
std::string,
unsigned int);
inline CError ErrorMechanism_GetError();
*/
// Setup error interface
#define IsError() GError.ErrorMechanism_Error()
#define ClearError() GError.ErrorMechanism_ClearError()
#define TestError(TError) GError.ErrorMechanism_TestError(TError)
#define SetError_Short(w,x) GError.ErrorMechanism_SetError(w,x,__FILE__,__LINE__)
#define SetError_Long(w,x,y,z) GError.ErrorMechanism_SetError(w,x,y,z)
#define GetError() GError.ErrorMechanism_GetError()
#endif

View File

@ -11,6 +11,7 @@ Usage: Create a CWindow object, call Create, call Run.
OnActivate() or OnPaint().
*/
#if 0
-----support pan, volume, and crossfading
@ -161,3 +162,6 @@ PS_RESULT CSound::Resume()
}
#endif
#endif

View File

@ -13,6 +13,7 @@ gee@pyro.nu
#include <stdlib.h>
#include <string.h>
#include "Prometheus.h"
#include "CLogger.h"
// Use namespace
XERCES_CPP_NAMESPACE_USE

View File

@ -3,6 +3,7 @@
#include "BaseEntityCollection.h"
#include "ObjectManager.h"
#include "Model.h"
#include "CLogger.h"
void CBaseEntityCollection::loadTemplates()
{

View File

@ -1,5 +1,7 @@
#include "EntityProperties.h"
#include <cassert>
CGenericProperty::CGenericProperty()
{
m_type = PROP_INTEGER;

View File

@ -39,10 +39,10 @@ float ViewFOV;
int mouse_x=50, mouse_y=50;
extern int g_xres, g_yres;
void terr_init()
{
g_Renderer.Open(g_xres,g_yres,g_bpp);
SViewPort vp;
vp.m_X=0;
vp.m_Y=0;