diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index e0a58a99c..b5404372b 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -124,6 +124,9 @@ static void drawpixel_safe(void *s, char a) //void loadvoxel(int32_t voxindex) { UNREFERENCED_PARAMATER(voxindex); } int16_t tiletovox[MAXTILES]; int32_t usevoxels = 1; +#ifdef USE_OPENGL +static char *voxfilenames[MAXVOXELS], g_haveVoxels=0; // for deferred voxel->model conversion +#endif //#define kloadvoxel loadvoxel int32_t novoxmips = 1; @@ -11468,6 +11471,28 @@ static void initsmost(void) nodesperline = tabledivide32_noinline(YSAVES, ydim); } +#ifdef USE_OPENGL +static void PolymostProcessVoxels(void) +{ + if (!g_haveVoxels) + return; + + g_haveVoxels = 0; + + OSD_Printf("Generating voxel models for Polymost. This may take a while...\n"); + nextpage(); + + for (int32_t i=0; i>1); } #ifdef USE_OPENGL + if (getrendermode() == REND_POLYMOST) + PolymostProcessVoxels(); + if (getrendermode() >= REND_POLYMOST) { polymost_glreset(); @@ -12072,7 +12100,9 @@ int32_t qloadkvx(int32_t voxindex, const char *filename) voxmodels[voxindex] = NULL; } - voxmodels[voxindex] = voxload(filename); + Bfree(voxfilenames[voxindex]); + voxfilenames[voxindex] = Bstrdup(filename); + g_haveVoxels = 1; #endif return 0; diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index 4f6d88ef9..c8e391a13 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -1461,8 +1461,16 @@ static void M_PreMenu(MenuID_t cm) #endif case MENU_VIDEOSETUP: - ME_VIDEOSETUP_APPLY.disabled = ((xdim == resolution[newresolution].xdim && ydim == resolution[newresolution].ydim && getrendermode() == newrendermode && fullscreen == newfullscreen) || (newfullscreen ? !(resolution[newresolution].flags & RES_FS) : !(resolution[newresolution].flags & RES_WIN)) || (newrendermode != REND_CLASSIC && resolution[newresolution].bppmax <= 8)); + { + const int32_t nr = newresolution; + + ME_VIDEOSETUP_APPLY.disabled = + ((xdim == resolution[nr].xdim && ydim == resolution[nr].ydim && + getrendermode() == newrendermode && fullscreen == newfullscreen) + || (newfullscreen ? !(resolution[nr].flags & RES_FS) : !(resolution[nr].flags & RES_WIN)) + || (newrendermode != REND_CLASSIC && resolution[nr].bppmax <= 8)); break; + } case MENU_SOUND: case MENU_SOUND_INGAME: