]> icculus.org git repositories - btb/d2x.git/blob - main/screens.h
get rid of dependencies on predefined display modes
[btb/d2x.git] / main / screens.h
1 /* $Id: screens.h,v 1.3 2004-08-28 23:17:45 schaffner Exp $ */
2 /*
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
13 */
14
15 /*
16  *
17  * Info on canvases, screens, etc.
18  *
19  */
20
21
22 #ifndef _SCREEN_H
23 #define _SCREEN_H
24
25 #include "gr.h"
26
27 // What graphics modes the game & editor open
28
29 // for Screen_mode variable
30 #define SCREEN_MENU             0       // viewing the menu screen
31 #define SCREEN_GAME             1       // viewing the menu screen
32 #define SCREEN_EDITOR   2       // viewing the editor screen
33
34 //from editor.c
35 extern grs_canvas *Canv_editor;                 // the full on-scrren editor canvas
36 extern grs_canvas *Canv_editor_game;    // the game window on the editor screen
37
38 //from game.c
39 extern int set_screen_mode(int sm);             // True = editor screen
40
41 //About the screen
42 extern ubyte            VR_screen_flags;
43 extern ubyte            VR_current_page;
44 extern fix                      VR_eye_width;
45 extern int                      VR_eye_switch;
46
47 //NEWVR (Add a bunch off lines)
48 #define VR_SEPARATION F1_0*7/10
49 #define VR_PIXEL_SHIFT -6
50 #define VR_WHITE_INDEX 255
51 #define VR_BLACK_INDEX 0
52 extern int                      VR_eye_offset;
53 extern int                      VR_eye_offset_changed;
54 extern void             VR_reset_params();
55 extern int                      VR_use_reg_code;
56
57
58 extern int                      VR_screen_mode;
59 extern int                      VR_render_mode;
60 extern int                      VR_low_res;
61 extern int                      VR_show_hud;
62 extern int                      VR_sensitivity;
63
64 extern grs_canvas       *VR_offscreen_buffer;           // The offscreen data buffer
65 extern grs_canvas       VR_render_buffer[2];            // Two offscreen buffers for left/right eyes.
66 extern grs_canvas       VR_render_sub_buffer[2];        // Two sub buffers for left/right eyes.
67 extern grs_canvas       VR_screen_pages[2];                     // Two pages of VRAM if paging is available
68 extern grs_canvas       VR_screen_sub_pages[2];         // Two sub pages of VRAM if paging is available
69
70 //values for VR_screen_flags
71
72 #define VRF_USE_PAGING                  1               // means page flips
73 #define VRF_SWITCH_EYES                 2
74 #define VRF_COMPATIBLE_MENUS    4
75 #define VRF_ALLOW_COCKPIT               8
76
77 //values for VR_render_mode
78
79 #define VR_NONE                 0       // viewing the game screen
80 #define VR_AREA_DET             1       // viewing with the stereo area determined method
81 #define VR_INTERLACED   2       // viewing with the stereo interlaced method
82
83 void game_init_render_buffers(int screen_mode, int render_max_w, int render_max_h, int render_method, int flags);
84 void game_init_render_sub_buffers(int x, int y, int w, int h);
85
86 void set_display_mode(uint32_t mode);
87 extern uint32_t Default_display_mode; // cannot be 0xffffffff
88 extern uint32_t Current_display_mode;
89
90 // to be refactored later...
91 #define SM_HIRES (SM_H(Current_display_mode) > 200)
92 #define SM_HIRES2 (SM_W(Current_display_mode) > 320)
93
94 // called to get the screen in a mode compatible with popup menus.
95 // if we can't have popups over the game screen, switch to menu mode.
96 void set_popup_screen(void);
97
98 #endif /* _SCREENS_H */