2010-06-30 23:41:04 +02:00
|
|
|
/* Copyright (C) 2010 Wildfire Games.
|
2009-04-18 19:00:33 +02:00
|
|
|
* This file is part of 0 A.D.
|
|
|
|
*
|
|
|
|
* 0 A.D. is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* 0 A.D. is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2010-02-18 00:21:49 +01:00
|
|
|
#ifndef INCLUDED_GAMESETUP
|
|
|
|
#define INCLUDED_GAMESETUP
|
|
|
|
|
2006-04-24 01:14:18 +02:00
|
|
|
//
|
|
|
|
// GUI integration
|
|
|
|
//
|
|
|
|
|
|
|
|
// display progress / description in loading screen
|
|
|
|
extern void GUI_DisplayLoadProgress(int percent, const wchar_t* pending_task);
|
|
|
|
|
|
|
|
extern void Render();
|
|
|
|
|
2007-05-27 01:29:20 +02:00
|
|
|
/**
|
|
|
|
* initialize global modules that are be needed before Init.
|
|
|
|
* must be called from the very beginning of main.
|
|
|
|
**/
|
|
|
|
extern void EarlyInit();
|
|
|
|
|
2006-04-24 01:14:18 +02:00
|
|
|
enum InitFlags
|
|
|
|
{
|
|
|
|
// avoid setting a video mode / initializing OpenGL; assume that has
|
|
|
|
// already been done and everything is ready for rendering.
|
|
|
|
// needed by map editor because it creates its own window.
|
|
|
|
INIT_HAVE_VMODE = 1,
|
|
|
|
|
|
|
|
// skip initializing the in-game GUI.
|
|
|
|
// needed by map editor because it uses its own GUI.
|
2010-06-30 23:41:04 +02:00
|
|
|
INIT_NO_GUI = 2
|
2006-04-24 01:14:18 +02:00
|
|
|
};
|
|
|
|
|
2010-06-03 21:07:59 +02:00
|
|
|
/**
|
|
|
|
* enable/disable rendering of the GUI (intended mainly for screenshots)
|
|
|
|
*/
|
|
|
|
extern void RenderGui(bool RenderingState);
|
2009-04-18 17:27:38 +02:00
|
|
|
|
2006-12-09 15:39:52 +01:00
|
|
|
class CmdLineArgs;
|
had to remove uint and ulong from lib/types.h due to conflict with other library.
this snowballed into a massive search+destroy of the hodgepodge of
mostly equivalent types we had in use (int, uint, unsigned, unsigned
int, i32, u32, ulong, uintN).
it is more efficient to use 64-bit types in 64-bit mode, so the
preferred default is size_t (for anything remotely resembling a size or
index). tile coordinates are ssize_t to allow more efficient conversion
to/from floating point. flags are int because we almost never need more
than 15 distinct bits, bit test/set is not slower and int is fastest to
type. finally, some data that is pretty much directly passed to OpenGL
is now typed accordingly.
after several hours, the code now requires fewer casts and less
guesswork.
other changes:
- unit and player IDs now have an "invalid id" constant in the
respective class to avoid casting and -1
- fix some endian/64-bit bugs in the map (un)packing. added a
convenience function to write/read a size_t.
- ia32: change CPUID interface to allow passing in ecx (required for
cache topology detection, which I need at work). remove some unneeded
functions from asm, replace with intrinsics where possible.
This was SVN commit r5942.
2008-05-11 20:48:32 +02:00
|
|
|
extern void Init(const CmdLineArgs& args, int flags);
|
2010-10-22 01:44:54 +02:00
|
|
|
extern void InitGraphics(const CmdLineArgs& args, int flags);
|
had to remove uint and ulong from lib/types.h due to conflict with other library.
this snowballed into a massive search+destroy of the hodgepodge of
mostly equivalent types we had in use (int, uint, unsigned, unsigned
int, i32, u32, ulong, uintN).
it is more efficient to use 64-bit types in 64-bit mode, so the
preferred default is size_t (for anything remotely resembling a size or
index). tile coordinates are ssize_t to allow more efficient conversion
to/from floating point. flags are int because we almost never need more
than 15 distinct bits, bit test/set is not slower and int is fastest to
type. finally, some data that is pretty much directly passed to OpenGL
is now typed accordingly.
after several hours, the code now requires fewer casts and less
guesswork.
other changes:
- unit and player IDs now have an "invalid id" constant in the
respective class to avoid casting and -1
- fix some endian/64-bit bugs in the map (un)packing. added a
convenience function to write/read a size_t.
- ia32: change CPUID interface to allow passing in ecx (required for
cache topology detection, which I need at work). remove some unneeded
functions from asm, replace with intrinsics where possible.
This was SVN commit r5942.
2008-05-11 20:48:32 +02:00
|
|
|
extern void Shutdown(int flags);
|
2010-02-18 00:21:49 +01:00
|
|
|
|
|
|
|
#endif // INCLUDED_GAMESETUP
|