2012-03-18 23:06:08 -05:00
|
|
|
/*
|
2012-05-21 23:27:44 -05:00
|
|
|
Niotso - The New Implementation of The Sims Online
|
|
|
|
System/System.hpp
|
|
|
|
Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
|
|
|
Author(s): Fatbag <X-Fi6@phppoll.org>
|
2012-03-18 23:06:08 -05:00
|
|
|
|
|
|
|
This program 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 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace System {
|
2012-03-21 20:58:06 -05:00
|
|
|
int Initialize();
|
2012-04-09 23:58:16 -05:00
|
|
|
void Shutdown();
|
2012-04-13 22:55:13 -05:00
|
|
|
|
2012-03-18 23:06:08 -05:00
|
|
|
extern HINSTANCE hInst;
|
2012-03-21 20:58:06 -05:00
|
|
|
extern LARGE_INTEGER ClockFreq;
|
2012-04-13 22:55:13 -05:00
|
|
|
extern volatile float FramePeriod;
|
2012-05-21 23:27:44 -05:00
|
|
|
|
2012-03-21 20:58:06 -05:00
|
|
|
struct UserInput_t {
|
|
|
|
bool Keys[256];
|
|
|
|
bool MouseDown;
|
|
|
|
bool CloseWindow;
|
|
|
|
};
|
|
|
|
extern UserInput_t UserInput;
|
2012-04-13 22:55:13 -05:00
|
|
|
extern volatile UserInput_t UserInput_v;
|
|
|
|
|
2012-04-08 12:20:25 -05:00
|
|
|
extern bool SceneFailed;
|
2012-05-21 23:27:44 -05:00
|
|
|
|
2012-03-21 20:58:06 -05:00
|
|
|
//Constants
|
2012-03-21 20:00:22 -05:00
|
|
|
enum {
|
2012-03-21 20:58:06 -05:00
|
|
|
SHUTDOWN = 0
|
2012-03-21 20:00:22 -05:00
|
|
|
};
|
2012-03-18 23:06:08 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/****
|
|
|
|
** Program exit codes
|
|
|
|
** (Return 0 for success)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define ERROR_INIT 0x1000
|
|
|
|
#define ERROR_INIT_ANOTHERINSTRUNNING 0x1001
|
|
|
|
|
|
|
|
//Engine errors
|
|
|
|
//Use: return ERROR_INIT | result;
|
|
|
|
#define ERROR_INIT_WINDOW 0x0100
|
|
|
|
enum {
|
2012-04-13 22:55:13 -05:00
|
|
|
ERROR_WINDOW_SYNCOBJECT = 1,
|
|
|
|
ERROR_WINDOW_CREATE_THREAD,
|
|
|
|
ERROR_WINDOW_SYNCHRONIZE,
|
|
|
|
ERROR_WINDOW_REGISTER_CLASS,
|
|
|
|
ERROR_WINDOW_CREATE,
|
|
|
|
ERROR_WINDOW_HANDLE
|
2012-03-18 23:06:08 -05:00
|
|
|
};
|
2012-03-21 20:58:06 -05:00
|
|
|
#define ERROR_INIT_SYSTEM 0x0200
|
2012-04-09 23:58:16 -05:00
|
|
|
enum {
|
|
|
|
ERROR_SYSTEM_INIT_FREETYPE = 1,
|
|
|
|
ERROR_SYSTEM_MISSING_FONT
|
|
|
|
};
|
2012-03-21 20:58:06 -05:00
|
|
|
#define ERROR_INIT_GRAPHICS 0x0300
|
2012-03-18 23:06:08 -05:00
|
|
|
enum {
|
2012-03-21 20:58:06 -05:00
|
|
|
ERROR_GRAPHICS_OBTAIN_DC = 1,
|
2012-03-18 23:06:08 -05:00
|
|
|
ERROR_GRAPHICS_FIND_PIXELFORMAT,
|
|
|
|
ERROR_GRAPHICS_SET_PIXELFORMAT,
|
|
|
|
ERROR_GRAPHICS_CREATE_GLRC,
|
|
|
|
ERROR_GRAPHICS_ACTIVATE_GLRC,
|
|
|
|
ERROR_GRAPHICS_INIT_GLSCENE
|
|
|
|
};
|
2012-03-21 20:58:06 -05:00
|
|
|
#define ERROR_INIT_AUDIO 0x0400
|
2012-03-18 23:06:08 -05:00
|
|
|
enum {
|
|
|
|
ERROR_AUDIO_INIT_COM = 1,
|
|
|
|
ERROR_AUDIO_INIT_XAUDIO2,
|
|
|
|
ERROR_AUDIO_CREATE_VOICE
|
|
|
|
};
|
2012-03-21 20:58:06 -05:00
|
|
|
#define ERROR_INIT_LOGIC 0x0500
|
|
|
|
enum {
|
|
|
|
ERROR_LOGIC_CREATE_SCENE = 1
|
|
|
|
};
|