\r
int CKernel::Execute()\r
{\r
-#ifdef WIN32\r
- MSG msg;\r
-#endif // WIN32\r
\r
while(taskList.size())\r
{\r
\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
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
#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
#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
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
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, ¢er, &position, D3DCOLOR_ARGB(255, 255,255,255));\r
-#endif // WIN32\r
}\r
\r