Skip to content

Commit

Permalink
More video modes available.
Browse files Browse the repository at this point in the history
Modes are described in renderer now, and UI polls renderer for list of modes. No more 2 places where mode descriptions are located,
  • Loading branch information
gildor2 committed Jul 11, 2019
1 parent eb02099 commit d2727a1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
33 changes: 22 additions & 11 deletions client/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2627,26 +2627,37 @@ struct videoMenu_t : menuFramework_t

bool Init ()
{
static const char *resolutions[] = {
"[320 240 ]", "[400 300 ]", "[512 384 ]", "[640 480 ]",
"[800 600 ]", "[960 720 ]", "[1024 768 ]", "[1152 864 ]",
"[1280 700 ]", "[1280 960 ]", "[1280 1024]", "[1600 900 ]",
"[1600 1200]", "[1680 1050]", "[1920 1200]", "[2048 1536]",
NULL
};
static const char *overbrightNames[] = {
static const char* resolutions[32];

static const char* overbrightNames[] = {
"no", "yes", "auto", NULL
};
static const char *bits[] = {
static const char* bits[] = {
"default", "16 bit", "32 bit", NULL
};
static const char *lighting[] = {
static const char* lighting[] = {
"lightmap", "vertex", NULL
};
static const char *filters[] = {
static const char* filters[] = {
"bilinear", "trilinear", NULL
};

// Init video modes
if (resolutions[0] == NULL)
{
for (int mode = 0; /* empty */; mode++)
{
int w, h;
if (!Vid_GetModeInfo(&w, &h, mode))
break;
assert(mode < ARRAY_COUNT(resolutions)-1);
char buf[32];
appSprintf(ARRAY_ARG(buf), "[%4dx%4d]", w, h);
resolutions[mode] = appStrdup(buf); // not releasing string
resolutions[mode+1] = NULL;
}
}

// init cvars
CVAR_BEGIN(vars)
// CVAR_GET(gl_driver, opengl32, CVAR_ARCHIVE),
Expand Down
6 changes: 4 additions & 2 deletions win32/vid_dll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,11 @@ static const struct {
{1280, 1024},
{1600, 900},
{1600, 1200},
{1680, 1050},
{1920, 1080},
{1920, 1200},
{2560, 1600}
{2560, 1440},
{2560, 1600},
{3840, 2160}
};


Expand Down

0 comments on commit d2727a1

Please sign in to comment.