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