#include "Engine/VideoUpdate.h"\r
#include "SchemeReader.h"\r
\r
+#if WIN32\r
LPD3DXSPRITE d3dspt;\r
LPD3DXFONT font;\r
\r
+#endif\r
bool Playground::Start()\r
{\r
+ #if WIN32\r
background = NULL;\r
foreground = NULL;\r
font = NULL;\r
}\r
}\r
\r
+ #endif\r
// init playing field\r
SchemeReader *scheme = new SchemeReader("data/schemes/BASIC.SCH");\r
for (int i=0; i<PLAYGROUND_COLS; ++i) \r
//field[i][j] = new Item(foreground, 0, FIELD_UNIT_WIDTH, FIELD_UNIT_HEIGHT, i, j);\r
break;\r
case SOLID:\r
+ #ifdef WIN32\r
field[i][j] = new Item(foreground, 1, FIELD_UNIT_WIDTH, FIELD_UNIT_HEIGHT, i, j);\r
+ #endif // WIN32\r
break;\r
}\r
/*\r
\r
void Playground::Update()\r
{\r
+ #ifdef WIN32\r
if(CInputTask::keyDown(DIK_ESCAPE))CKernel::GetSingleton().KillAllTasks();\r
\r
d3dspt->Begin(NULL); // begin sprite drawing\r
RECT rect3 = {310,10,500,36};\r
sprintf(buf, "(%d, %d) - (%d,%d)", bomberman->getFieldCenterX(), bomberman->getFieldCenterY(), bomberman->getOffsetX(), bomberman->getOffsetY());\r
font->DrawTextA(NULL, (char *)&buf, -1, &rect3, DT_LEFT, D3DCOLOR_XRGB(255,255,255));\r
-\r
+ #endif // WIN32\r
\r
old_counter = GetTickCount();\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
\r
Bomberman::Bomberman(int xloc, int yloc)\r
{\r
+ #ifdef WIN32\r
HRESULT res = D3DXCreateTextureFromFile(d3ddev, L"data/powkick.png", &texture);\r
if (res != D3D_OK) texture = NULL;\r
+ #endif // WIN32\r
x = xloc;\r
y = yloc;\r
}\r
\r
Bomberman::~Bomberman()\r
{\r
+ #ifdef WIN32\r
if (texture != NULL) texture->Release();\r
+ #endif // WIN32\r
}\r
\r
void Bomberman::Update()\r
{\r
+ #ifdef WIN32\r
D3DXVECTOR3 center(0.0f, 0.0f, 0.0f); // center at the upper-left corner\r
D3DXVECTOR3 position((FLOAT)x, (FLOAT)y, 0.0f); // position at 50, 50 with no depth\r
RECT rect = {0,0,40,36};\r
d3dspt->Draw(texture, &rect, ¢er, &position, D3DCOLOR_XRGB(255,255,255));\r
+ #endif // WIN32\r
}\r
\r
void Bomberman::move(int xloc, int yloc)\r
// Item class\r
// =============================================\r
\r
+#ifdef WIN32\r
Item:: Item(LPDIRECT3DTEXTURE9 t, int texnr, int subwidth, int subheight, int colnr, int rownr)\r
{\r
texture = t;\r
d3dspt->Draw(texture, &rect, ¢er, &position, D3DCOLOR_ARGB(255, 255,255,255));\r
}\r
\r
+#endif // WIN32\r