* Remove most unused WIN32 stuff.
authorMatthijs Kooijman <m.kooijman@student.utwente.nl>
Mon, 11 Jun 2007 21:15:01 +0000 (23:15 +0200)
committerMatthijs Kooijman <m.kooijman@student.utwente.nl>
Mon, 11 Jun 2007 21:15:01 +0000 (23:15 +0200)
ABM2/Engine/Kernel.cpp
ABM2/Engine/VideoUpdate.cpp
ABM2/Engine/engine.h
ABM2/Engine/misc.h
ABM2/Playground.cpp
ABM2/Playground.h
ABM2/porting.h

index 35d4afce603cc425a1fe83b2275477380459315b..581b96370d7575914071f944d35376e0ae2f34ec 100755 (executable)
@@ -25,9 +25,6 @@ CKernel::~CKernel()
 \r
 int CKernel::Execute()\r
 {\r
-#ifdef WIN32\r
-    MSG msg;\r
-#endif // WIN32\r
 \r
        while(taskList.size())\r
        {\r
@@ -36,15 +33,6 @@ int CKernel::Execute()
 \r
                        DWORD starting_point = GetTickCount();\r
 \r
-#ifdef WIN32\r
-        if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))\r
-        {\r
-            TranslateMessage(&msg);\r
-            DispatchMessage(&msg);\r
-        }\r
-#endif // WIN32\r
-\r
-\r
                        std::list< CMMPointer<ITask> >::iterator it, thisIt;\r
                        for(it=taskList.begin();it!=taskList.end();)\r
                        {\r
@@ -68,8 +56,8 @@ int CKernel::Execute()
                        IMMObject::CollectGarbage();\r
                        DWORD end_point = GetTickCount();\r
                        /* Sleep if we didn't use up too much time already */\r
-                       if (starting_point + 50 > end_point)\r
-                               Sleep(50 - (end_point-starting_point));\r
+                       if (starting_point + 250 > end_point)\r
+                               Sleep(250 - (end_point-starting_point));\r
                }\r
 #ifdef _DEBUG\r
                CProfileSample::Output();\r
index bdbe563878bd7d7f8919dd73095dd1b834b8502f..e3f36c585e29616602c53f7f1f8fcd7b04afb29d 100755 (executable)
@@ -7,16 +7,6 @@
 #include "VideoUpdate.h"\r
 \r
 \r
-// include the Direct3D Library file\r
-#ifdef WIN32\r
-#pragma comment (lib, "d3d9.lib")\r
-#pragma comment (lib, "d3dx9.lib")\r
-\r
-//////////////////////////////////////////////////////////////////////\r
-// Construction/Destruction\r
-//////////////////////////////////////////////////////////////////////\r
-LPDIRECT3DDEVICE9 d3ddev;    // the pointer to the device class\r
-#endif //WIN32\r
 CMMPointer<Dator<int> > CVideoUpdate::screenWidth=0;\r
 CMMPointer<Dator<int> > CVideoUpdate::screenHeight=0;\r
 CMMPointer<Dator<int> > CVideoUpdate::screenBPP=0;\r
index 73b70168a0a96aeeb39dff6c586298c9c1fca1d3..79660d20c51f99fd5cffc385599bb818a7bbd418 100755 (executable)
@@ -20,9 +20,6 @@
 #include <cmath>\r
 #include <ctime>\r
 \r
-#ifdef WIN32\r
-#include <windows.h>\r
-#endif\r
 #include "porting.h"\r
 \r
 //even though resource.h is technically a Win32-resource file, it's just a bunch of defines, so it's ok (and necessary)\r
index 55b3f9964a00ec0194d740c0f8181565b61f6183..ea260d5e5b12808a68e6b53e2b7c6afcdc05acbe 100755 (executable)
@@ -1,11 +1,6 @@
 #ifndef MISC_H_INCLUDED\r
 #define MISC_H_INCLUDED\r
 \r
-#ifndef WIN32\r
-/* HACK to get this to compile */\r
-#define max(a,b) (a>b?a:b)\r
-#define min(a,b) (a<b?a:b)\r
-#endif // !WIN32\r
 inline float clamp(float val, float minVal, float maxVal)\r
 {\r
        return min(max(val,minVal),maxVal);\r
index 358262fa400dffc85e9324dfcd52694f6c1362ef..38c905f9907d117325c924dfadf071b1888c7440 100755 (executable)
@@ -4,71 +4,10 @@
 #include "Engine/VideoUpdate.h"\r
 #include "SchemeReader.h"\r
 \r
-#if WIN32\r
-LPD3DXSPRITE d3dspt;\r
-LPD3DXFONT font;\r
-\r
-#endif\r
-\r
 Playground::Playground(CKernel* kernel) : ITask(kernel) { }\r
 \r
 bool Playground::Start()\r
 {\r
-       #if WIN32\r
-       background = NULL;\r
-       foreground = NULL;\r
-       font = NULL;\r
-       HRESULT res;\r
-\r
-       D3DXCreateSprite(d3ddev, &d3dspt);    // create the Direct3D Sprite object\r
-       res = D3DXCreateFont(d3ddev, 15, 10, 0, 1, false, 0, OUT_TT_ONLY_PRECIS, 0, 0, L"times new roman", &font);\r
-       if (res != S_OK)\r
-       {\r
-               switch (res)\r
-               {\r
-                       case D3DERR_INVALIDCALL:\r
-                               foreground = NULL;\r
-                               break;\r
-                       case D3DXERR_INVALIDDATA:\r
-                               foreground = NULL;\r
-                               break;\r
-                       case E_OUTOFMEMORY:\r
-                               foreground = NULL;\r
-                               break;\r
-                       default:\r
-                               foreground = NULL;\r
-               }\r
-       }\r
-\r
-       res = D3DXCreateTextureFromFile(d3ddev, L"data/field0.png", &background);\r
-       //res = D3DXCreateTextureFromFile(d3ddev, L"data/tiles0.png", &foreground);\r
-       res = D3DXCreateTextureFromFileEx(d3ddev, L"data/tiles0.png", D3DX_DEFAULT, D3DX_DEFAULT, 1, 0, D3DFMT_UNKNOWN,\r
-               D3DPOOL_DEFAULT ,D3DX_DEFAULT, D3DX_DEFAULT, D3DCOLOR_ARGB(0, 248, 0, 248), NULL, NULL, &foreground);\r
-       if (res != D3D_OK)\r
-       {\r
-               switch (res)\r
-               {\r
-                       case D3DERR_NOTAVAILABLE:\r
-                               foreground = NULL;\r
-                               break;\r
-                       case D3DERR_OUTOFVIDEOMEMORY:\r
-                               foreground = NULL;\r
-                               break;\r
-                       case D3DERR_INVALIDCALL:\r
-                               foreground = NULL;\r
-                               break;\r
-                       case D3DXERR_INVALIDDATA:\r
-                               foreground = NULL;\r
-                               break;\r
-                       case E_OUTOFMEMORY:\r
-                               foreground = NULL;\r
-                               break;\r
-                       default:\r
-                               foreground = NULL;\r
-               }\r
-       }\r
-\r
-       #endif\r
        // init playing field\r
        SchemeReader *scheme = new SchemeReader("Data/schemes/BASIC.SCH");\r
 \r
@@ -182,12 +121,6 @@ void Playground::Stop()
                        if (field[i][j] != NULL) delete field[i][j];\r
 \r
        if (bomberman != NULL) delete bomberman;\r
-       #ifdef WIN32\r
-       if (background != NULL) background->Release();\r
-       if (foreground != NULL) foreground->Release();\r
-       if (d3dspt != NULL) d3dspt->Release();\r
-       if (font != NULL) font->Release();\r
-       #endif // WIN32\r
 }\r
 \r
 void Playground::move_down()\r
@@ -507,11 +440,5 @@ void Tile::Draw()
                PLAYGROUND_BORDER_TOP + this->row * FIELD_UNIT_HEIGHT,\r
                1.0, 1.0, this->subsprite, 0, COLOUR_RGBA(255, 255, 255, 255)\r
        );\r
-#ifdef WIN32\r
-       D3DXVECTOR3 center(0.0f, 0.0f, 0.0f);    // center at the upper-left corner\r
-       D3DXVECTOR3 position((FLOAT)PLAYGROUND_BORDER_LEFT+subitem_width*col, (FLOAT)PLAYGROUND_BORDER_TOP+subitem_height*row, 0.0f);    // position at 50, 50 with no depth\r
-       RECT rect = {tex_num*subitem_width,0,(tex_num+1)*subitem_width,subitem_height};\r
-       d3dspt->Draw(texture, &rect, &center, &position, D3DCOLOR_ARGB(255, 255,255,255));\r
-#endif // WIN32\r
 }\r
 \r
index 9cb5e22063f7ca47c2ccfc8d137da2bef014159c..879b4b005b7241050d3973950882bbf2d6168f84 100755 (executable)
@@ -59,10 +59,6 @@ public:
        void Stop();\r
        AUTO_SIZE;\r
 private:\r
-#ifdef WIN32\r
-       LPDIRECT3DTEXTURE9 background;\r
-       LPDIRECT3DTEXTURE9 foreground;\r
-#endif // WIN32\r
 \r
        Bomberman *bomberman;\r
        Tile *field[PLAYGROUND_COLS][PLAYGROUND_ROWS];\r
index ef28a0d897350c8458749cd131dc92ac972916d0..dfa9a33621b9c164b13a6f1e71f79e41de5cba42 100644 (file)
@@ -9,6 +9,8 @@
 
        #define BYTE unsigned char
        #define DWORD unsigned int
+       #define max(a,b) (a>b?a:b)
+       #define min(a,b) (a<b?a:b)
 #endif // !WIN32
 
 #ifdef WITH_SDL