source: trunk/src/game.cpp @ 79

Last change on this file since 79 was 79, checked in by sam, 11 years ago

Rendering starts to work again. There is no Z-sorting yet.

  • Property svn:keywords set to Id
File size: 634 bytes
Line 
1
2#include "game.h"
3#include "map.h"
4
5/*
6 * Game implementation class
7 */
8
9class GameData
10{
11    friend class Game;
12
13private:
14    Map *map;
15    int x, y;
16    int mousex, mousey;
17};
18
19/*
20 * Public Game class
21 */
22
23Game::Game(char const *mapname)
24{
25    data = new GameData();
26    data->map = new Map(mapname);
27    data->x = data->y = 0;
28}
29
30Game::~Game()
31{
32    delete data->map;
33    delete data;
34}
35
36void Game::SetMouse(int x, int y)
37{
38    data->mousex = x;
39    data->mousey = y;
40}
41
42void Game::Render()
43{
44    Scene *scene = new Scene();
45
46    data->map->Render(scene, data->mousex, data->mousey, 0);
47
48    scene->Render();
49    delete scene;
50}
51
Note: See TracBrowser for help on using the repository browser.