-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCApp_OnInit.cpp
42 lines (31 loc) · 919 Bytes
/
CApp_OnInit.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//==============================================================================
#include "CApp.h"
//==============================================================================
bool CApp::OnInit()
{
if(SDL_Init(SDL_INIT_EVERYTHING) < 0)
{
return false;
}
if( TTF_Init() == -1 )
{
return false;
}
if((Surf_Display = SDL_SetVideoMode(WWIDTH, WHEIGHT, 32, SDL_HWSURFACE | SDL_DOUBLEBUF)) == NULL)
{
return false;
}
if(CArea::AreaControl.OnLoad("./maps/area.area") == false)
{
return false;
}
if(TileWindow.OnLoad("./tilesets/passable_tiles.png", 32, 48) == false)
{
return false;
}else TileWindow.Active = 1;
SDL_EnableKeyRepeat(1, SDL_DEFAULT_REPEAT_INTERVAL / 3);
newTileID = 0;
newTypeID = 1;
return true;
}
//==============================================================================