4 |
|
* |
5 |
|
* $Id$ |
6 |
|
* |
7 |
< |
* Basilisk II (C) 1997-2001 Christian Bauer |
7 |
> |
* Basilisk II (C) 1997-2003 Christian Bauer |
8 |
|
* |
9 |
|
* This program is free software; you can redistribute it and/or modify |
10 |
|
* it under the terms of the GNU General Public License as published by |
281 |
|
edited = YES; |
282 |
|
} |
283 |
|
|
284 |
+ |
|
285 |
+ |
// If we are not using the CGIMAGEREF drawing strategy, |
286 |
+ |
// then source bitmaps must be 32bits deep. |
287 |
+ |
|
288 |
+ |
- (short) testWinDepth: (int) newbpp |
289 |
+ |
{ |
290 |
+ |
#ifdef CGIMAGEREF |
291 |
+ |
return newbpp; |
292 |
+ |
#else |
293 |
+ |
if ( newbpp != 32 ) |
294 |
+ |
WarningSheet(@"Sorry - In windowed mode, depth must be 32", panel); |
295 |
+ |
return 32 |
296 |
+ |
#endif |
297 |
+ |
} |
298 |
+ |
|
299 |
|
// This is called when any of the screen/openGL/window, |
300 |
|
// width, height or depth is clicked. |
301 |
|
// |
329 |
|
} |
330 |
|
|
331 |
|
// If we are changing type, supply some sensible defaults |
332 |
+ |
|
333 |
+ |
short screenx = CGDisplayPixelsWide(kCGDirectMainDisplay), |
334 |
+ |
screeny = CGDisplayPixelsHigh(kCGDirectMainDisplay), |
335 |
+ |
screenb = CGDisplayBitsPerPixel(kCGDirectMainDisplay); |
336 |
+ |
|
337 |
|
if ( newtype != display_type ) |
338 |
|
{ |
339 |
|
D(NSLog(@"Changing display type in ChangeScreen")); |
320 |
– |
if ( newtype == DISPLAY_SCREEN ) // If changing to full screen |
321 |
– |
{ |
322 |
– |
// supply main screen dimensions as a default |
323 |
– |
newx = CGDisplayPixelsWide (kCGDirectMainDisplay); |
324 |
– |
newy = CGDisplayPixelsHigh (kCGDirectMainDisplay); |
325 |
– |
newbpp = CGDisplayBitsPerPixel(kCGDirectMainDisplay); |
326 |
– |
} |
340 |
|
|
341 |
< |
if ( display_type == DISPLAY_SCREEN ) // If changing from full screen |
341 |
> |
// If changing to full screen, supply main screen dimensions as a default |
342 |
> |
if ( newtype == DISPLAY_SCREEN ) |
343 |
> |
newx = screenx, newy = screeny, newbpp = screenb; |
344 |
> |
|
345 |
> |
// If changing from full screen, use minimum screen resolutions |
346 |
> |
if ( display_type == DISPLAY_SCREEN ) |
347 |
|
{ |
348 |
|
newx = MIN_WIDTH, newy = MIN_HEIGHT; |
349 |
< |
#ifndef MAC_OS_X_VERSION_SUPPORTS_LOWER_DEPTHS |
332 |
< |
newbpp = 32; |
333 |
< |
#endif |
349 |
> |
newbpp = [self testWinDepth: newbpp]; |
350 |
|
} |
335 |
– |
|
336 |
– |
[width setIntValue: newx]; |
337 |
– |
[height setIntValue: newy]; |
338 |
– |
[depth setIntValue: newbpp]; |
351 |
|
} |
352 |
|
else |
353 |
|
{ |
354 |
< |
#ifndef MAC_OS_X_VERSION_SUPPORTS_LOWER_DEPTHS |
343 |
< |
// Check depth |
354 |
> |
newbpp = [self testWinDepth: newbpp]; |
355 |
|
|
345 |
– |
if ( display_type == DISPLAY_WINDOW && newbpp != 32 ) |
346 |
– |
{ |
347 |
– |
WarningSheet(@"Sorry - In windowed mode, depth must be 32", panel); |
348 |
– |
[depth setIntValue: 32]; |
349 |
– |
} |
350 |
– |
#endif |
356 |
|
// Check size is within ranges of MIN_WIDTH ... MAX_WIDTH |
357 |
|
// and MIN_HEIGHT ... MAX_HEIGHT |
358 |
|
// ??? |
359 |
|
} |
360 |
|
|
361 |
+ |
[width setIntValue: newx]; |
362 |
+ |
[height setIntValue: newy]; |
363 |
+ |
[depth setIntValue: newbpp]; |
364 |
+ |
|
365 |
|
|
366 |
|
// Store new prefs |
367 |
|
*str = '\0'; |