1 /* 2 * Martian: Motor para creaci�n de videojuegos con SDL y OpenGL 3 * Copyright (C) 2007 Javier P�rez Pacheco 4 * 5 * Este motor tiene licencia Creative Commons y se permite 6 * su modificacion y utilizacion libremente siempre y cuando se 7 * cite al autor original y se comparta con la misma licencia. 8 * No se permite su uso comercial. 9 * 10 * Para mas informacion visite la web: 11 * http://creativecommons.org/licenses/by-nc-sa/2.0/es/ 12 * 13 * PROGRAMADOR 14 * Javier P�rez Pacheco 15 * Cadiz (Spain) 16 * javielinux@gmail.com 17 * 18 */ 19 20 #ifndef WORLD_H_ 21 #define WORLD_H_ 22 23 #include <SDL.h> 24 #include <SDL_mixer.h> 25 #include "defines.h" 26 #include "elements.h" 27 #include "sound.h" 28 #include "chronometer.h" 29 #include "joystick.h" 30 #include "hash.h" 31 #include "options.h" 32 #include "score.h" 33 #include "font.h" 34 #include "timer.h" 35 #include "language.h" 36 #include "scene.h" 37 #ifdef WIN32 38 #include "glext.h" 39 #endif 40 #include <stdio.h> 41 #include <string.h> 42 #include <stdlib.h> 43 #include <string> 44 45 #include <cmath> 46 #include <iostream> 47 #include <vector> 48 #include <map> 49 50 using namespace std; 51 52 namespace Martian { 53 54 class Scene; 55 56 class World { 57 58 protected: 59 bool fullscreen; 60 Uint8 *keys; 61 Sint16 joyx, joyy; 62 63 map<string, Scene*> scenes; 64 int currentScene; 65 bool existDataDirectory; 66 67 public: 68 Joystick *joystick; 69 SDL_Surface *screen; 70 71 World(int w, int h, string titleWindow); 72 void InitGL(); 73 /********************* 74 * SCREEN 75 **********************/ 76 static int width, height; 77 void modeScreen(); 78 void execute(); 79 /********************* 80 * ESCENES 81 **********************/ addScene(string name,Scene * sc)82 void addScene(string name, Scene* sc) { scenes[name] = sc; } getScene(string name)83 Scene* getScene(string name) { return scenes[name]; } 84 void loadScenes(); 85 int loadScene(string sc); 86 87 void unLoad(); 88 89 }; 90 91 } 92 93 #endif /* WORLD_H_ */ 94