Serious-Engine/Sources/Engine/Graphics/DisplayMode.cpp
Ryan C. Gordon 24cb244d43 First attempt to hand-merge Ryan's Linux and Mac OS X port.
This was a _ton_ of changes, made 15 years ago, so there are probably some
problems to work out still.

Among others: Engine/Base/Stream.* was mostly abandoned and will need to be
re-ported.

Still, this is a pretty good start, and probably holds a world record for
lines of changes or something.  :)
2016-03-28 23:46:13 -04:00

52 lines
1.1 KiB
C++

/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
#include "Engine/StdH.h"
#include <Engine/Graphics/DisplayMode.h>
#include <Engine/Base/Translation.h>
/*
* Default constructor.
*/
CDisplayMode::CDisplayMode(void)
{
// clear all members
dm_pixSizeI = 0;
dm_pixSizeJ = 0;
dm_ddDepth = DD_DEFAULT;
}
// get depth string
CTString CDisplayMode::DepthString(void) const
{
switch (dm_ddDepth) {
case DD_NODEPTH: return "none"; break;
case DD_16BIT: return "16"; break;
case DD_32BIT: return "32"; break;
case DD_DEFAULT: return TRANS("desktop"); break;
default: ASSERT(FALSE); return TRANS("unknown"); break;
}
}
// check if mode is dualhead
BOOL CDisplayMode::IsDualHead(void)
{
// if size is 8:3 it is dual head
return dm_pixSizeI*3==dm_pixSizeJ*8;
}
// check if mode is widescreen
BOOL CDisplayMode::IsWideScreen(void)
{
// only this one supported as widescreen
return dm_pixSizeI==856 && dm_pixSizeJ==480;
}
// check if mode is fullscreen
BOOL CDisplayMode::IsFullScreen(void)
{
return dm_pixSizeI!=0 && dm_pixSizeJ!=0;
}