MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / ddvid_SetVideoMode

Function ddvid_SetVideoMode

dd_video/video_lnx.cpp:89–150  ·  view source on GitHub ↗

sets the appropriate video mode.

Source from the content-addressed store, hash-verified

87
88// sets the appropriate video mode.
89bool ddvid_SetVideoMode(int w, int h, int color_depth, bool paged) {
90 /*
91 ASSERT(DDVideo_init);
92
93 int mode = -1;
94
95 if( (w==640) && (h==480) ){
96 switch(color_depth){
97 case BPP_8:
98 mode = G640x480x256;
99 break;
100 case BPP_16:
101 mode = G640x480x32K;
102 break;
103 case BPP_24:
104 mode = G640x480x64K;
105 break;
106 case BPP_32:
107 mode = G640x480x16M;
108 break;
109 }
110 }else
111 if( (w==512) && (h==384) ){
112 mode = -1;
113 }else
114 if( (w==800) && (h==600) ){
115 switch(color_depth){
116 case BPP_8:
117 mode = G800x600x256;
118 break;
119 case BPP_16:
120 mode = G800x600x32K;
121 break;
122 case BPP_24:
123 mode = G800x600x64K;
124 break;
125 case BPP_32:
126 mode = G800x600x16M;
127 break;
128 }
129 }
130
131 if(mode==-1)
132 return false;
133
134 if(!vga_hasmode(mode))
135 return false;
136
137 DDVideo_info.info = vga_getmodeinfo(mode);
138
139 DDVideo_info.paged = (bool)(DDVideo_info.info->flags&HAVE_RWPAGE);
140
141 if( (paged) && (!(DDVideo_info.paged)) ){
142 DDVideo_info.info = NULL;
143 Error("Pages not supported by mode %d\n",mode);
144 return false;
145 }
146

Callers 1

SetScreenModeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected