source: abuse/tags/pd/macabuse/inc/dev.hpp

Last change on this file was 49, checked in by Sam Hocevar, 12 years ago
  • Imported original public domain release, for future reference.
File size: 3.5 KB
Line 
1#ifndef __DEV_HPP_
2#define __DEV_HPP_
3
4#include "game.hpp"
5#include "light.hpp"
6#include "console.hpp"
7#include "timing.hpp"
8
9
10extern int scale_mult,scale_div;
11extern char level_file[100];
12extern image *small_render;
13
14void dev_init(int argc, char **argv);
15void dev_cleanup();
16void toggle_edit_mode();
17char *symbol_str(char *name);
18
19class pal_win
20{
21  long scale,w,h,x,y,last_selected;
22  unsigned short *pat;
23  void draw();
24
25public :
26  jwindow *me;
27  void close_window();
28  void open_window();
29  char *name;
30  void handle_event(event &ev);
31  pal_win(void *args);
32  void resize(int xa, int ya);
33  int get_pat(int x, int y) { return pat[y*w+x]; }
34  int width() { return w; }
35  int height() { return h; }
36  void save(FILE *fp);
37  ~pal_win();
38} ;
39
40enum dev_state { DEV_CREATE_OBJECT,
41                 DEV_MOVE_OBJECT,
42                 DEV_SELECT,
43                 DEV_MOUSE_RELEASE,
44                 DEV_MOVE_LIGHT,
45                 DEV_CREATE_LIGHT,
46                 DEV_DRAG_AREA_TOP,
47                 DEV_DRAG_AREA_BOTTOM };
48
49extern char backw_on,forew_on,show_menu_on,ledit_on,pmenu_on,omenu_on,commandw_on,tbw_on,searchw_on,
50            small_render_on,interpolate_draw,disable_autolight,fps_on,profile_on,show_names,fg_reversed,
51            raise_all;
52
53
54class dev_controll
55{
56  game_object *edit_object,*selected_object,*ai_object,*search_object,
57              *link_object;
58  light_source *edit_light,*selected_light;
59  pal_win **pal_wins;
60  char **pwin_list;
61  int total_pals;
62  dev_state state;
63  int area_x1,area_y1,area_x2,area_y2;
64  area_controller *current_area;
65  time_marker last_area_click;
66
67  void event_move_object(event &ev);
68  void event_move_light(event &ev);
69  void event_drag_area_bottom(event &ev);
70  void event_drag_area_top(event &ev);
71  void event_select(event &ev);
72  void event_close_window(event &ev);
73  void event_key(event &ev);
74  void event_oedit_copy(event &ev);
75  void event_ledit_ok(event &ev);
76  void event_ledit_del(event &ev);
77
78public :
79  jwindow *backw,*forew,*commandw,*modew,*omenu,*oedit,*ledit,
80          *music_window,*pmenu,*show_menu,*lightw,*aiw,*ambw,*tbw,*area_win,
81          *search_window,*memprof;
82
83  int fg_w,bg_w,fg_scale,bg_scale,yellow;
84  void save();
85  void fg_fill(int color, int x, int y, pal_win *p);
86  void add_palette(void *args);
87  void toggle_memprof();
88  void search_forward();
89  void search_backward();
90  void toggle_toolbar();
91  void toggle_fgw();
92  void toggle_bgw();
93  void toggle_omenu();
94  void toggle_music_window();
95  void toggle_pmenu();
96  void toggle_show_menu();
97  void toggle_light_window();
98  void toggle_search_window();
99  void show_char_mem(char *name);
100  void close_oedit_window();
101  void show_mem();
102  dev_controll();
103  void handle_event(event &ev);
104  void do_command(char *st, event &ev);
105  int is_pal_win(jwindow *win);
106  void dev_draw(view *v);
107  void load_stuff();
108  int repeat_key_mode();
109  int need_plus_minus();
110  int need_arrows();
111  void make_ai_window(game_object *o);
112  void close_ai_window();
113  void make_ambient();
114  int ok_to_scroll();
115  long snap_x(long x);
116  long snap_y(long y);
117  void area_handle_input(event &ev);
118  void pick_handle_input(event &ev);
119  void close_area_win(int read_values);
120  void notify_deleted_object(game_object *o);
121  void notify_deleted_light(light_source *l);
122  void set_state(int new_state);
123  void update_memprof();   
124  ~dev_controll();
125} ;
126
127class dev_term : public shell_term
128{
129  dev_controll *dv;
130  public :
131  dev_term(int width, int height, dev_controll *dev) : shell_term(eh,console_font,width,height,"dev")
132  {
133    dv=dev;
134  }
135  virtual void execute(char *st);
136} ;
137
138extern dev_term *dev_console;
139
140extern dev_controll *dev_cont;
141
142
143#endif
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
Note: See TracBrowser for help on using the repository browser.