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 GLIDE_DISPLAY_HH
|
---|
10 | #define GLIDE_DISPLAY_HH
|
---|
11 |
|
---|
12 |
|
---|
13 | #include "video/display.hh"
|
---|
14 | #include "video/glide/glide.h"
|
---|
15 |
|
---|
16 | class i4_cursor_class;
|
---|
17 |
|
---|
18 |
|
---|
19 | class i4_glide_display_class : public i4_display_class
|
---|
20 | {
|
---|
21 | protected:
|
---|
22 | i4_draw_context_class *context;
|
---|
23 |
|
---|
24 | class glide_mode_class : public i4_display_class::mode
|
---|
25 | {
|
---|
26 | public:
|
---|
27 | sw32 glide_mode;
|
---|
28 | };
|
---|
29 |
|
---|
30 | glide_mode_class tmp, cur_mode;
|
---|
31 | i4_cursor_class *mcursor;
|
---|
32 |
|
---|
33 |
|
---|
34 | sw32 last_mouse_x, last_mouse_y;
|
---|
35 |
|
---|
36 | i4_image_class *bbuf, // backbuffer
|
---|
37 | *mouse_save1, // save of screen under mouse
|
---|
38 | *mouse_save2,
|
---|
39 | *prev_mouse_save; // pointer to mouse_save1 or 2, depending on which saved last
|
---|
40 |
|
---|
41 | void remove_cursor(sw32 x, sw32 y, i4_image_class *mouse_save);
|
---|
42 | void save_and_draw_cursor(sw32 x, sw32 y, i4_image_class *&mouse_save);
|
---|
43 |
|
---|
44 | i4_image_class *fake_screen;
|
---|
45 | i4_bool detected;
|
---|
46 | i4_rect_list_class next_frame_copy;
|
---|
47 |
|
---|
48 | i4_image_class *get_writeable_screen();
|
---|
49 | i4_image_class *get_readable_screen();
|
---|
50 | i4_display_list_struct me;
|
---|
51 |
|
---|
52 | public:
|
---|
53 |
|
---|
54 | // fill these in with the derived class (so we can share this with linux and win32)
|
---|
55 | virtual i4_device_class *local_devices() = 0;
|
---|
56 | virtual i4_bool create_window() = 0;
|
---|
57 | virtual void destroy_window() = 0;
|
---|
58 | virtual void get_mouse_pos(sw32 &mouse_x, sw32 &mouse_y) = 0;
|
---|
59 |
|
---|
60 | virtual i4_draw_context_class *get_context() { return context; }
|
---|
61 |
|
---|
62 | virtual w16 width() const { return 640; }
|
---|
63 | virtual w16 height() const { return 480; }
|
---|
64 |
|
---|
65 | virtual mode *current_mode() { return &cur_mode; }
|
---|
66 | virtual mode *get_first_mode(int driver_id);
|
---|
67 | virtual mode *get_next_mode();
|
---|
68 |
|
---|
69 | virtual unsigned long window_handle() { return 0; }
|
---|
70 |
|
---|
71 |
|
---|
72 | virtual i4_image_class *lock_frame_buffer(i4_frame_buffer_type type,
|
---|
73 | i4_frame_access_type access);
|
---|
74 | virtual void unlock_frame_buffer(i4_frame_buffer_type type);
|
---|
75 | virtual i4_refresh_type update_model() { return I4_PAGE_FLIP_REFRESH; }
|
---|
76 |
|
---|
77 | virtual i4_bool initialize_mode();
|
---|
78 | virtual void flush();
|
---|
79 | i4_glide_display_class();
|
---|
80 | virtual i4_image_class *get_screen();
|
---|
81 |
|
---|
82 | // should be called before a program quits
|
---|
83 | virtual i4_bool close();
|
---|
84 |
|
---|
85 | virtual i4_bool lock_mouse_in_place(i4_bool yes_no) = 0;
|
---|
86 | virtual i4_bool set_mouse_shape(i4_cursor_class *cursor);
|
---|
87 | void begin_render_mode();
|
---|
88 | void end_render_mode();
|
---|
89 |
|
---|
90 | void init();
|
---|
91 | void uninit();
|
---|
92 |
|
---|
93 | ~i4_glide_display_class();
|
---|
94 | };
|
---|
95 |
|
---|
96 |
|
---|
97 | extern i4_glide_display_class *i4_glide_display;
|
---|
98 |
|
---|
99 | #endif
|
---|