00001
00007 #ifndef ISOBOMB_H_VADE23
00008 #define ISOBOMB_H_VADE23
00009
00010 #pragma warning(disable:4786)
00011
00012 #define WIN32_LEAN_AND_MEAN
00013 #define _WIN32_WINNT 0x0500
00014 #define _WIN32_WINDOWS 0x0410
00015 #define WINVER 0x0400
00016 #include <windows.h>
00017
00018 #define DIRECTINPUT_VERSION 0x0800
00019
00020 #ifdef _DEBUG
00021 #define TRACE(x) doTrace( __FILE__, __LINE__, x )
00022 #define TRACE1(x, y) doTrace( __FILE__, __LINE__, x, y )
00023 #define TRACE2(x, y, z) doTrace( __FILE__, __LINE__, x, y, z )
00024 #define TRACE3(x, y, z, a) doTrace( __FILE__, __LINE__, x, y, z, a )
00025 #define TRACE4(x, y, z, a, b) doTrace( __FILE__, __LINE__, x, y, z, a, b )
00026 #else
00027 #define TRACE(x) ((void)0)
00028 #define TRACE1(x, y) ((void)0)
00029 #define TRACE2(x, y, z) ((void)0)
00030 #define TRACE3(x, y, z, a) ((void)0)
00031 #define TRACE4(x, y, z, a, b) ((void)0)
00032 #endif
00033
00034 #define sq(x) ( (x) * (x) )
00035
00036 #include <d3d8.h>
00037 #include <d3dx8.h>
00038 #include <Dxerr8.h>
00039 #include <dinput.h>
00040 #include <assert.h>
00041 #include <ctime>
00042 #include <cmath>
00043 #include <cstdio>
00044 #include <fstream>
00045 #include <sstream>
00046 #include <string>
00047 #include <vector>
00048 #include <list>
00049 #include <algorithm>
00050 #include <set>
00051 #include <map>
00052 #include <functional>
00053 #include <mmsystem.h>
00054 #include <mmreg.h>
00055 #include <msacm.h>
00056 #include <dsound.h>
00057
00058 #ifndef M_PI
00059 #define M_PI 3.14159265358979323846
00060 #define M_PI_F 3.14159265358979323846f
00061 #endif
00062
00063 #include "sound/SndMan.h"
00064
00065 #include "GameDX.h"
00066 #include "Window.h"
00067 #include "Keyboard.h"
00068 #include "Timer.h"
00069 #include "Point.h"
00070 #include "Rect.h"
00071 #include "Vector.h"
00072 #include "jrnd.h"
00073
00074
00075 class Game;
00076 class GameDX;
00077 class Keyboard;
00078 class Window;
00079 class AnimationManager;
00080 class TextureManager;
00081 class SoundSystem;
00082 class ConfigFile;
00083
00084
00085 #define DEFAULT_WINDOW_WIDTH 800
00086 #define DEFAULT_WINDOW_HEIGHT 600
00087 #define DEFAULT_WINDOWED TRUE
00088 #define WINDOW_TITLE "Super IsoBomb"
00089 #define DISPLAY_FPS TRUE
00090 #define DRAW_BOUNDING_BOXES FALSE
00091 #define DIRECTION_UPLEFT 0
00092 #define DIRECTION_UPRIGHT 1
00093 #define DIRECTION_DOWNRIGHT 2
00094 #define DIRECTION_DOWNLEFT 3
00095
00096
00097 typedef LPDIRECT3DTEXTURE8 Texture;
00098 typedef LPDIRECT3DDEVICE8 GraphicsDevice;
00099
00100 typedef std::vector< Texture > AnimationFrames;
00101 typedef AnimationFrames::iterator AFramesIter;
00102
00103
00104
00109 extern GameDX* g_dx;
00110
00115 extern Keyboard* g_key;
00116
00121 extern Window* g_win;
00122
00126 extern Game* g_game;
00127
00131 extern AnimationManager* g_am;
00132
00136 extern TextureManager* g_tm;
00137
00141 extern SoundSystem* g_snd;
00142
00146 extern ConfigFile* g_cfg;
00147
00151 extern TextureManager* g_hudTm;
00152
00157 extern int g_winSizeX;
00158 extern int g_winSizeY;
00159
00164 int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
00165 LPSTR lpCmdLine, int nShowCmd );
00166
00171 LRESULT CALLBACK GlobalWndProc( HWND hWnd, UINT message,
00172 WPARAM wParam, LPARAM lParam );
00173
00179 void doTrace( const char* fn, int lineno, const char* msg, ... );
00180
00181 #endif