- Cleanup of the voxel code.

* moving polymost_voxdraw into polymost.cpp.
* consolidated all remaining voxel code in hw_voxels.cpp. All original Build voxel code is completely gone now, except for polymost_voxdraw, so this got moved out of the build/ folder.
* integrate Blood's voxel init code into the main function.
* some further cleanup was allowed as a result of this, so engineInit is gone now because these parts can now be done outside the games' app_init functions.
This commit is contained in:
Christoph Oelckers 2021-04-05 13:55:36 +02:00
parent ba90f444dd
commit e30dc82676
29 changed files with 362 additions and 486 deletions

View file

@ -16,6 +16,7 @@
#include "texturemanager.h"
#include "hw_renderstate.h"
#include "printf.h"
#include "hw_voxels.h"
#include "../../glbackend/glbackend.h"
static int32_t curextra=MAXTILES;
@ -23,6 +24,7 @@ static int32_t curextra=MAXTILES;
#define MIN_CACHETIME_PRINT 10
using namespace Polymost;
int32_t polymost_voxdraw(voxmodel_t* m, tspriteptr_t const tspr, bool rotate);
static int32_t addtileP(int32_t model,int32_t tile,int32_t pallet)
{
@ -1538,6 +1540,11 @@ int32_t polymost_mddraw(tspriteptr_t tspr)
return 0;
}
void voxfree(voxmodel_t* m)
{
if (m) delete m;
}
static void mdfree(mdmodel_t *vm)
{
if (vm->mdnum == 1) { voxfree((voxmodel_t *)vm); return; }