Add voxels option to menu, if at least one has been defined

git-svn-id: https://svn.eduke32.com/eduke32@7961 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/engine.cpp
This commit is contained in:
hendricks266 2019-08-13 02:53:38 +00:00 committed by Christoph Oelckers
parent 284af9f5d9
commit 3bfed33608
3 changed files with 16 additions and 6 deletions

View file

@ -913,6 +913,7 @@ extern float debug1, debug2;
extern int16_t tiletovox[MAXTILES]; extern int16_t tiletovox[MAXTILES];
extern int32_t usevoxels, voxscale[MAXVOXELS]; extern int32_t usevoxels, voxscale[MAXVOXELS];
extern char g_haveVoxels;
#ifdef USE_OPENGL #ifdef USE_OPENGL
extern int32_t usemodels, usehightile; extern int32_t usemodels, usehightile;

View file

@ -102,8 +102,9 @@ void (*loadvoxel_replace)(int32_t voxindex) = NULL;
int16_t tiletovox[MAXTILES]; int16_t tiletovox[MAXTILES];
int32_t usevoxels = 1; int32_t usevoxels = 1;
#ifdef USE_OPENGL #ifdef USE_OPENGL
static char *voxfilenames[MAXVOXELS], g_haveVoxels=0; // for deferred voxel->model conversion static char *voxfilenames[MAXVOXELS];
#endif #endif
char g_haveVoxels;
//#define kloadvoxel loadvoxel //#define kloadvoxel loadvoxel
int32_t novoxmips = 1; int32_t novoxmips = 1;
@ -10382,10 +10383,10 @@ static void videoAllocateBuffers(void)
void (*PolymostProcessVoxels_Callback)(void) = NULL; void (*PolymostProcessVoxels_Callback)(void) = NULL;
static void PolymostProcessVoxels(void) static void PolymostProcessVoxels(void)
{ {
if (!g_haveVoxels) if (g_haveVoxels != 1)
return; return;
g_haveVoxels = 0; g_haveVoxels = 2;
OSD_Printf("Generating voxel models for Polymost. This may take a while...\n"); OSD_Printf("Generating voxel models for Polymost. This may take a while...\n");
videoNextPage(); videoNextPage();
@ -10626,9 +10627,10 @@ int32_t qloadkvx(int32_t voxindex, const char *filename)
Xfree(voxfilenames[voxindex]); Xfree(voxfilenames[voxindex]);
voxfilenames[voxindex] = Xstrdup(filename); voxfilenames[voxindex] = Xstrdup(filename);
g_haveVoxels = 1;
#endif #endif
g_haveVoxels = 1;
return 0; return 0;
} }

View file

@ -567,6 +567,9 @@ static MenuOption_t MEO_DISPLAYSETUP_ASPECTRATIO = MAKE_MENUOPTION(&MF_Redfont,
static MenuEntry_t ME_DISPLAYSETUP_ASPECTRATIO = MAKE_MENUENTRY( "Widescreen:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_ASPECTRATIO, Option ); static MenuEntry_t ME_DISPLAYSETUP_ASPECTRATIO = MAKE_MENUENTRY( "Widescreen:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_ASPECTRATIO, Option );
#endif #endif
static MenuOption_t MEO_DISPLAYSETUP_VOXELS = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &usevoxels);
static MenuEntry_t ME_DISPLAYSETUP_VOXELS = MAKE_MENUENTRY( "Voxels:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_VOXELS, Option );
static MenuRangeInt32_t MEO_DISPLAYSETUP_FOV = MAKE_MENURANGE( &ud.fov, &MF_Redfont, 70, 120, 0, 11, 1 ); static MenuRangeInt32_t MEO_DISPLAYSETUP_FOV = MAKE_MENURANGE( &ud.fov, &MF_Redfont, 70, 120, 0, 11, 1 );
static MenuEntry_t ME_DISPLAYSETUP_FOV = MAKE_MENUENTRY( "FOV:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_FOV, RangeInt32 ); static MenuEntry_t ME_DISPLAYSETUP_FOV = MAKE_MENUENTRY( "FOV:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_FOV, RangeInt32 );
@ -741,6 +744,7 @@ static MenuEntry_t *MEL_DISPLAYSETUP[] = {
#ifndef EDUKE32_ANDROID_MENU #ifndef EDUKE32_ANDROID_MENU
&ME_DISPLAYSETUP_VIDEOSETUP, &ME_DISPLAYSETUP_VIDEOSETUP,
&ME_DISPLAYSETUP_ASPECTRATIO, &ME_DISPLAYSETUP_ASPECTRATIO,
&ME_DISPLAYSETUP_VOXELS,
&ME_DISPLAYSETUP_FOV, &ME_DISPLAYSETUP_FOV,
#endif #endif
&ME_DISPLAYSETUP_UPSCALING, &ME_DISPLAYSETUP_UPSCALING,
@ -753,6 +757,7 @@ static MenuEntry_t *MEL_DISPLAYSETUP_GL[] = {
#ifndef EDUKE32_ANDROID_MENU #ifndef EDUKE32_ANDROID_MENU
&ME_DISPLAYSETUP_VIDEOSETUP, &ME_DISPLAYSETUP_VIDEOSETUP,
&ME_DISPLAYSETUP_ASPECTRATIO, &ME_DISPLAYSETUP_ASPECTRATIO,
&ME_DISPLAYSETUP_VOXELS,
&ME_DISPLAYSETUP_FOV, &ME_DISPLAYSETUP_FOV,
#endif #endif
#ifndef EDUKE32_STANDALONE #ifndef EDUKE32_STANDALONE
@ -782,6 +787,7 @@ static MenuEntry_t *MEL_DISPLAYSETUP_GL_POLYMER[] = {
#ifndef EDUKE32_ANDROID_MENU #ifndef EDUKE32_ANDROID_MENU
&ME_DISPLAYSETUP_VIDEOSETUP, &ME_DISPLAYSETUP_VIDEOSETUP,
&ME_DISPLAYSETUP_FOV, &ME_DISPLAYSETUP_FOV,
&ME_DISPLAYSETUP_VOXELS,
#endif #endif
#ifdef TEXFILTER_MENU_OPTIONS #ifdef TEXFILTER_MENU_OPTIONS
&ME_DISPLAYSETUP_TEXFILTER, &ME_DISPLAYSETUP_TEXFILTER,
@ -1988,8 +1994,9 @@ static void Menu_Pre(MenuID_t cm)
MenuEntry_DisableOnCondition(&ME_GAMESETUP_DEMOREC, (ps->gm&MODE_GAME) && ud.m_recstat != 1); MenuEntry_DisableOnCondition(&ME_GAMESETUP_DEMOREC, (ps->gm&MODE_GAME) && ud.m_recstat != 1);
break; break;
#ifdef USE_OPENGL
case MENU_DISPLAYSETUP: case MENU_DISPLAYSETUP:
MenuEntry_HideOnCondition(&ME_DISPLAYSETUP_VOXELS, !g_haveVoxels);
#ifdef USE_OPENGL
if (videoGetRenderMode() == REND_CLASSIC) if (videoGetRenderMode() == REND_CLASSIC)
MenuMenu_ChangeEntryList(M_DISPLAYSETUP, MEL_DISPLAYSETUP); MenuMenu_ChangeEntryList(M_DISPLAYSETUP, MEL_DISPLAYSETUP);
#ifdef POLYMER #ifdef POLYMER
@ -2045,8 +2052,8 @@ static void Menu_Pre(MenuID_t cm)
MenuEntry_DisableOnCondition(&ME_RENDERERSETUP_DETAILTEX, !usehightile); MenuEntry_DisableOnCondition(&ME_RENDERERSETUP_DETAILTEX, !usehightile);
MenuEntry_DisableOnCondition(&ME_RENDERERSETUP_GLOWTEX, !usehightile); MenuEntry_DisableOnCondition(&ME_RENDERERSETUP_GLOWTEX, !usehightile);
# endif # endif
break;
#endif #endif
break;
case MENU_VIDEOSETUP: case MENU_VIDEOSETUP:
{ {