source: abuse/tags/pd/abuse/inc/dev.hpp @ 49

Last change on this file since 49 was 49, checked in by Sam Hocevar, 12 years ago
  • Imported original public domain release, for future reference.
File size: 3.2 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;
66public :
67  jwindow *backw,*forew,*commandw,*modew,*omenu,*oedit,*ledit,
68          *music_window,*pmenu,*show_menu,*lightw,*aiw,*ambw,*tbw,*area_win,
69          *search_window,*memprof;
70
71  int fg_w,bg_w,fg_scale,bg_scale,yellow;
72  void save();
73  void fg_fill(int color, int x, int y, pal_win *p);
74  void add_palette(void *args);
75  void toggle_memprof();
76  void search_forward();
77  void search_backward();
78  void toggle_toolbar();
79  void toggle_fgw();
80  void toggle_bgw();
81  void toggle_omenu();
82  void toggle_music_window();
83  void toggle_pmenu();
84  void toggle_show_menu();
85  void toggle_light_window();
86  void toggle_search_window();
87  void show_char_mem(char *name);
88  void close_oedit_window();
89  void show_mem();
90  dev_controll();
91  void handle_event(event &ev);
92  void do_command(char *st, event &ev);
93  int is_pal_win(jwindow *win);
94  void dev_draw(view *v);
95  void load_stuff();
96  int repeat_key_mode();
97  int need_plus_minus();
98  int need_arrows();
99  void make_ai_window(game_object *o);
100  void close_ai_window();
101  void make_ambient();
102  int ok_to_scroll();
103  long snap_x(long x);
104  long snap_y(long y);
105  void area_handle_input(event &ev);
106  void pick_handle_input(event &ev);
107  void close_area_win(int read_values);
108  void notify_deleted_object(game_object *o);
109  void notify_deleted_light(light_source *l);
110  void set_state(int new_state);
111  void update_memprof();   
112  ~dev_controll();
113} ;
114
115class dev_term : public shell_term
116{
117  dev_controll *dv;
118  public :
119  dev_term(int width, int height, dev_controll *dev) : shell_term(eh,console_font,width,height,"dev")
120  {
121    dv=dev;
122  }
123  virtual void execute(char *st);
124} ;
125
126extern dev_term *dev_console;
127
128extern dev_controll *dev_cont;
129
130
131#endif
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
Note: See TracBrowser for help on using the repository browser.