2 |
==================== |
==================== |
3 |
renderman.h |
renderman.h |
4 |
==================== |
==================== |
5 |
version 0.0.1 |
version 0.0.2 |
6 |
==================== |
==================== |
7 |
|
|
8 |
This is the master user interface class. Anything that has to do with graphics or display |
This is the master user interface class. Anything that has to do with graphics or display |
20 |
|
|
21 |
CHANGELOG: |
CHANGELOG: |
22 |
---------------------- |
---------------------- |
23 |
|
0.0.2 - August 7, 2003 |
24 |
|
- added DrawPixel |
25 |
|
- cleaned up screen switching |
26 |
|
- minor nips and tucks for use with other screens |
27 |
0.0.1 - July 24, 2003: |
0.0.1 - July 24, 2003: |
28 |
- first release. everything seems to work. extensive mem leak / segfault tests performed. ready to add more screens! |
- first release. everything seems to work. extensive mem leak / segfault tests performed. ready to add more screens! |
29 |
|
|
31 |
|
|
32 |
TO-DO & EXPANSION LIST |
TO-DO & EXPANSION LIST |
33 |
---------------------- |
---------------------- |
34 |
|
- need screen we were last on. |
35 |
|
|
36 |
|
|
37 |
|
|
42 |
#ifndef RENDERMAN_H |
#ifndef RENDERMAN_H |
43 |
#define RENDERMAN_H |
#define RENDERMAN_H |
44 |
|
|
45 |
|
// UI screens - one for each |
46 |
|
//#include "uiscreen_main.h" |
47 |
|
//#include "uiscreen_start.h" |
48 |
|
|
49 |
|
|
|
#include "uiscreen.h" |
|
50 |
#include "pgeventobject.h" |
#include "pgeventobject.h" |
51 |
|
|
52 |
// paragui includes |
// paragui includes |
54 |
#include "pgapplication.h" |
#include "pgapplication.h" |
55 |
#include "pgwidget.h" |
#include "pgwidget.h" |
56 |
|
|
57 |
|
#include "../core/pointerhub.h" |
58 |
|
#include "../pods/missions.h" |
59 |
|
|
60 |
|
// DEFINED ELSEWHERE |
61 |
|
class UIScreen_Main; |
62 |
|
class UIScreen_Start; |
63 |
|
class UIScreen_BMMore; |
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
class RenderMan: public PG_EventObject { |
|
73 |
|
|
74 |
|
|
75 |
|
/** Types of User Interface Screens */ |
76 |
|
enum screen_type { |
77 |
|
UISCREEN_START=0, |
78 |
|
UISCREEN_NEWGAME, |
79 |
|
UISCREEN_BLOTCHMAKER_LESS, |
80 |
|
UISCREEN_BLOTCHMAKER_MORE, |
81 |
|
UISCREEN_MAIN, |
82 |
|
UISCREEN_POD_ASSEMBLY, |
83 |
|
UISCREEN_POD_MANAGER, |
84 |
|
UISCREEN_POD_SWAP, |
85 |
|
UISCREEN_COMBAT, |
86 |
|
UISCREEN_GAME_SETTINGS, |
87 |
|
UISCREEN_ABOUT_AXIS |
88 |
|
}; |
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
class RenderMan: public PG_EventObject, public PointerHub { |
95 |
public: |
public: |
96 |
RenderMan(int x, int y); //< x/y screen window width |
RenderMan(int x, int y); //< x/y screen window width |
97 |
~RenderMan(); |
~RenderMan(); |
98 |
|
|
99 |
UIScreen* GetActiveScreen(); |
|
100 |
|
// ----Interface functions-------\/------------------- |
101 |
|
void MovePod(int x1, int y1, int x2, int y2); |
102 |
|
|
103 |
|
// ----Interface functions-------/\------------------- |
104 |
|
|
105 |
|
|
106 |
|
|
107 |
|
|
108 |
|
// ----Basic functions-------\/------------------- |
109 |
void SetActiveScreen( screen_type s ); |
void SetActiveScreen( screen_type s ); |
110 |
|
|
111 |
PG_Application* GetApp(); //< returns a pointer to the paragui application class |
PG_Application* GetApp(); //< returns a pointer to the paragui application class |
112 |
|
|
113 |
void SLock(SDL_Surface *screen); |
void SLock(SDL_Surface *s); |
114 |
void SUnlock(SDL_Surface *screen); |
void SUnlock(SDL_Surface *s); |
115 |
|
|
116 |
void DrawIMG(SDL_Surface *from, SDL_Surface *to, int x, int y); |
void DrawIMG(SDL_Surface *from, SDL_Surface *to, int x, int y); |
117 |
void DrawIMG(SDL_Surface *from, SDL_Surface *to, int x, int y, int h, int w, int x2, int y2); |
void DrawIMG(SDL_Surface *from, SDL_Surface *to, int x, int y, int h, int w, int x2, int y2); |
118 |
|
|
119 |
|
void DrawPixel(SDL_Surface *s, int x, int y, Uint8 R, Uint8 G, Uint8 B, Uint8 A=0); |
120 |
|
|
121 |
void SetTileSize(int x); |
void SetTileSize(int x); |
122 |
int GetTileSize(); |
int GetTileSize(); |
123 |
|
|
124 |
int GetXRes(); |
int GetXRes(); |
125 |
int GetYRes(); |
int GetYRes(); |
126 |
|
// ----Basic functions-------/\------------------- |
127 |
|
|
128 |
|
|
129 |
|
|
130 |
|
|
131 |
|
|
132 |
|
// UI SCREENS - needed? |
133 |
|
UIScreen_Main* GetUIMain(); // not coded yet |
134 |
|
UIScreen_Start* GetUIStart(); // not coded yet |
135 |
|
|
136 |
|
|
137 |
|
|
138 |
|
// EVENTS |
139 |
PARAGUI_CALLBACK(handle_start_new); |
PARAGUI_CALLBACK(handle_start_new); |
140 |
PARAGUI_CALLBACK(handle_go_to_start); |
PARAGUI_CALLBACK(handle_go_to_start); |
141 |
|
PARAGUI_CALLBACK(handle_go_to_bm); |
142 |
|
PARAGUI_CALLBACK(handle_swap_tilesets); |
143 |
|
|
144 |
//custom callback w/ no return |
//custom callback w/ no return |
145 |
//void handle_start_new (int id, PG_Widget* widget, unsigned long data, void *clientdata); |
//void handle_start_new (int id, PG_Widget* widget, unsigned long data, void *clientdata); |
148 |
|
|
149 |
|
|
150 |
private: |
private: |
|
UIScreen* active_screen; //< the current screen in operation |
|
|
|
|
151 |
PG_Widget* master_widget; //< the widget that all other screen widgets are children of. usefull for calling RemoveAllChilds() |
PG_Widget* master_widget; //< the widget that all other screen widgets are children of. usefull for calling RemoveAllChilds() |
152 |
|
|
153 |
int XRES; //< X screen resolution |
int XRES; //< X screen resolution |
156 |
|
|
157 |
PG_Application* app; //< the running paragui app |
PG_Application* app; //< the running paragui app |
158 |
|
|
159 |
|
// SCREENS: |
160 |
|
screen_type active_screen; // just defines which screen is active |
161 |
|
|
162 |
|
UIScreen_Main* uiscreen_main; |
163 |
|
UIScreen_Start* uiscreen_start; |
164 |
|
UIScreen_BMMore* uiscreen_bmmore; |
165 |
|
|
166 |
}; |
}; |
167 |
|
|
168 |
|
|