From cbf9d2cff3de7a5f741157436050f80c61055a2d Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 30 Dec 2012 20:34:55 +0000 Subject: [PATCH] Clean up a couple of other getrendermode() related bits that the previous commit missed git-svn-id: https://svn.eduke32.com/eduke32@3347 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/build.h | 4 ++-- polymer/eduke32/build/src/baselayer.c | 24 ++++++++++++++++-------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index 92f79ae44..33136a379 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -16,7 +16,7 @@ extern "C" { #endif -enum { +enum rendmode_t { REND_CLASSIC, REND_POLYMOST = 3, REND_POLYMER @@ -579,7 +579,7 @@ EXTERN int32_t editorzrange[2]; static inline int32_t getrendermode(void) { #ifndef USE_OPENGL - return 0; + return REND_CLASSIC; #else return rendmode; #endif diff --git a/polymer/eduke32/build/src/baselayer.c b/polymer/eduke32/build/src/baselayer.c index 6f8928b4b..effc3cc96 100644 --- a/polymer/eduke32/build/src/baselayer.c +++ b/polymer/eduke32/build/src/baselayer.c @@ -215,19 +215,27 @@ static int32_t osdfunc_setrendermode(const osdfuncparm_t *parm) int32_t m; char *p; - const char *modestrs[] = - { - "classic software", "", - "", "polygonal OpenGL", "great justice (Polymer)" - }; - if (parm->numparms != 1) return OSDCMD_SHOWHELP; m = Bstrtol(parm->parms[0], &p, 10); - if (m < 0 || m > 4) return OSDCMD_SHOWHELP; + if (m < REND_CLASSIC || m > REND_POLYMER) return OSDCMD_SHOWHELP; setrendermode(m); - OSD_Printf("Rendering method changed to %s\n", modestrs[ getrendermode()]); + + switch(getrendermode()) + { + case REND_CLASSIC: + p = "classic software"; + break; + case REND_POLYMOST: + p = "polygonal OpenGL"; + break; + case REND_POLYMER: + p = "great justice (Polymer)"; + break; + } + + OSD_Printf("Rendering method changed to %s\n", p); return OSDCMD_OK; }