1 | /********************************************************************** <BR>
|
---|
2 | This file is part of Crack dot Com's free source code release of
|
---|
3 | Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
|
---|
4 | information about compiling & licensing issues visit this URL</a>
|
---|
5 | <PRE> If that doesn't help, contact Jonathan Clark at
|
---|
6 | golgotha_source@usa.net (Subject should have "GOLG" in it)
|
---|
7 | ***********************************************************************/
|
---|
8 |
|
---|
9 | #ifndef G1_PICK_WIN_HH
|
---|
10 | #define G1_PICK_WIN_HH
|
---|
11 |
|
---|
12 | #include "window/window.hh"
|
---|
13 | #include "g1_limits.hh"
|
---|
14 | #include "menu/menuitem.hh"
|
---|
15 | #include "time/time.hh"
|
---|
16 |
|
---|
17 | class i4_image_class;
|
---|
18 | class g1_draw_context_class;
|
---|
19 |
|
---|
20 | class g1_3d_pick_window : public i4_menu_item_class
|
---|
21 | {
|
---|
22 |
|
---|
23 | protected:
|
---|
24 | i4_bool need_flip_update;
|
---|
25 |
|
---|
26 |
|
---|
27 |
|
---|
28 | sw32 last_mx, last_my;
|
---|
29 |
|
---|
30 | i4_bool grabl, grabr;
|
---|
31 | i4_image_class *act,*pass;
|
---|
32 | i4_time_class start;
|
---|
33 | i4_event_reaction_class *reaction;
|
---|
34 | public:
|
---|
35 | struct camera_struct
|
---|
36 | {
|
---|
37 | i4_float theta, phi, zrot;
|
---|
38 |
|
---|
39 | i4_float view_dist,
|
---|
40 | center_x,
|
---|
41 | center_y,
|
---|
42 | center_z;
|
---|
43 |
|
---|
44 | i4_bool stopped;
|
---|
45 |
|
---|
46 | void init()
|
---|
47 | {
|
---|
48 | stopped=i4_F;
|
---|
49 | center_x=0;
|
---|
50 | center_y=0;
|
---|
51 | center_z=0;
|
---|
52 | view_dist=1;
|
---|
53 | theta=0;
|
---|
54 | phi=0;
|
---|
55 | zrot=0;
|
---|
56 | }
|
---|
57 |
|
---|
58 | } camera;
|
---|
59 |
|
---|
60 | g1_3d_pick_window(w16 w, w16 h,
|
---|
61 | i4_image_class *active_back,
|
---|
62 | i4_image_class *passive_back,
|
---|
63 | camera_struct &camera,
|
---|
64 | i4_event_reaction_class *reaction)
|
---|
65 |
|
---|
66 | : i4_menu_item_class(0,0,w,h),
|
---|
67 | camera(camera),
|
---|
68 | act(active_back),
|
---|
69 | pass(passive_back),
|
---|
70 | reaction(reaction)
|
---|
71 | {
|
---|
72 | grabl=i4_F;
|
---|
73 | grabr=i4_F;
|
---|
74 | need_flip_update=i4_T;
|
---|
75 | }
|
---|
76 |
|
---|
77 | void request_redraw(i4_bool for_a_child)
|
---|
78 | {
|
---|
79 | need_flip_update=i4_T;
|
---|
80 | i4_menu_item_class::request_redraw(for_a_child);
|
---|
81 | }
|
---|
82 |
|
---|
83 | ~g1_3d_pick_window()
|
---|
84 | {
|
---|
85 | if (reaction)
|
---|
86 | delete reaction;
|
---|
87 | }
|
---|
88 |
|
---|
89 | virtual i4_bool selected() { return i4_F; }
|
---|
90 |
|
---|
91 | void setup_bg_color();
|
---|
92 |
|
---|
93 | virtual void do_activate()
|
---|
94 | {
|
---|
95 | i4_menu_item_class::do_activate();
|
---|
96 | start.get();
|
---|
97 | }
|
---|
98 |
|
---|
99 | virtual void do_deactivate()
|
---|
100 | {
|
---|
101 | i4_menu_item_class::do_deactivate();
|
---|
102 | }
|
---|
103 |
|
---|
104 | virtual void parent_draw(i4_draw_context_class &context);
|
---|
105 | virtual void draw_object(g1_draw_context_class *context) = 0;
|
---|
106 |
|
---|
107 | virtual void receive_event(i4_event *ev);
|
---|
108 |
|
---|
109 | char *name() { return "object window"; }
|
---|
110 | } ;
|
---|
111 |
|
---|
112 |
|
---|
113 | #endif
|
---|