mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-28 12:30:46 +00:00
- also handle SW's voxels.
This commit is contained in:
parent
e5e23cd63c
commit
0ee28fb45e
6 changed files with 12 additions and 9 deletions
|
@ -2202,7 +2202,7 @@ void polymost_scansector(int32_t sectnum)
|
||||||
{
|
{
|
||||||
if ((spr->cstat&(64+48))!=(64+16) ||
|
if ((spr->cstat&(64+48))!=(64+16) ||
|
||||||
(r_voxels && tiletovox[spr->picnum] >= 0 && voxmodels[tiletovox[spr->picnum]]) ||
|
(r_voxels && tiletovox[spr->picnum] >= 0 && voxmodels[tiletovox[spr->picnum]]) ||
|
||||||
(r_voxels && gi->Voxelize(spr->picnum)) ||
|
(r_voxels && gi->Voxelize(spr->picnum) > -1) ||
|
||||||
DMulScale(bcos(spr->ang), -s.x, bsin(spr->ang), -s.y, 6) > 0)
|
DMulScale(bcos(spr->ang), -s.x, bsin(spr->ang), -s.y, 6) > 0)
|
||||||
if (renderAddTsprite(z, sectnum))
|
if (renderAddTsprite(z, sectnum))
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -101,7 +101,7 @@ struct GameInterface
|
||||||
virtual int chaseCamX(binangle ang) { return 0; }
|
virtual int chaseCamX(binangle ang) { return 0; }
|
||||||
virtual int chaseCamY(binangle ang) { return 0; }
|
virtual int chaseCamY(binangle ang) { return 0; }
|
||||||
virtual int chaseCamZ(fixedhoriz horiz) { return 0; }
|
virtual int chaseCamZ(fixedhoriz horiz) { return 0; }
|
||||||
virtual bool Voxelize(int sprnum) { return false; }
|
virtual int Voxelize(int sprnum) { return -1; }
|
||||||
|
|
||||||
virtual FString statFPS()
|
virtual FString statFPS()
|
||||||
{
|
{
|
||||||
|
|
|
@ -72,8 +72,9 @@ static void doprecache(int picnum, int palette)
|
||||||
if (r_voxels)
|
if (r_voxels)
|
||||||
{
|
{
|
||||||
int vox = tiletovox[picnum];
|
int vox = tiletovox[picnum];
|
||||||
|
if (vox == -1) vox = gi->Voxelize(picnum);
|
||||||
if (vox == -1 && isBlood()) vox = Blood::voxelIndex[picnum];
|
if (vox == -1 && isBlood()) vox = Blood::voxelIndex[picnum];
|
||||||
if (vox != -1 && voxmodels[vox] && voxmodels[vox]->model)
|
if (vox >= 0 && vox < MAXVOXELS && voxmodels[vox] && voxmodels[vox]->model)
|
||||||
{
|
{
|
||||||
FHWModelRenderer mr(*screen->RenderState(), 0);
|
FHWModelRenderer mr(*screen->RenderState(), 0);
|
||||||
voxmodels[vox]->model->BuildVertexBuffer(&mr);
|
voxmodels[vox]->model->BuildVertexBuffer(&mr);
|
||||||
|
@ -127,5 +128,6 @@ void precacheMarkedTiles()
|
||||||
int dapalnum = pair->Key >> 32;
|
int dapalnum = pair->Key >> 32;
|
||||||
doprecache(dapicnum, dapalnum);
|
doprecache(dapicnum, dapalnum);
|
||||||
}
|
}
|
||||||
|
cachemap.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,4 +2,5 @@
|
||||||
|
|
||||||
void PrecacheHardwareTextures(int nTile);
|
void PrecacheHardwareTextures(int nTile);
|
||||||
void markTileForPrecache(int tilenum, int palnum);
|
void markTileForPrecache(int tilenum, int palnum);
|
||||||
|
void markVoxelForPrecache(int voxnum);
|
||||||
void precacheMarkedTiles();
|
void precacheMarkedTiles();
|
||||||
|
|
|
@ -798,9 +798,9 @@ void GameInterface::FreeLevelData()
|
||||||
::GameInterface::FreeLevelData();
|
::GameInterface::FreeLevelData();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GameInterface::Voxelize(int sprnum)
|
int GameInterface::Voxelize(int sprnum)
|
||||||
{
|
{
|
||||||
return (aVoxelArray[sprnum].Voxel >= 0);
|
return (aVoxelArray[sprnum].Voxel);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_SW_NS
|
END_SW_NS
|
||||||
|
|
|
@ -2252,10 +2252,10 @@ struct GameInterface : ::GameInterface
|
||||||
void WarpToCoords(int x, int y, int z, int a, int h) override;
|
void WarpToCoords(int x, int y, int z, int a, int h) override;
|
||||||
void ToggleThirdPerson() override;
|
void ToggleThirdPerson() override;
|
||||||
void SwitchCoopView() override;
|
void SwitchCoopView() override;
|
||||||
int chaseCamX(binangle ang) { return -ang.bcos(-3); }
|
int chaseCamX(binangle ang) override { return -ang.bcos(-3); }
|
||||||
int chaseCamY(binangle ang) { return -ang.bsin(-3); }
|
int chaseCamY(binangle ang) override { return -ang.bsin(-3); }
|
||||||
int chaseCamZ(fixedhoriz horiz) { return horiz.asq16() >> 8; }
|
int chaseCamZ(fixedhoriz horiz) override { return horiz.asq16() >> 8; }
|
||||||
bool Voxelize(int sprnum);
|
int Voxelize(int sprnum) override;
|
||||||
|
|
||||||
|
|
||||||
GameStats getStats() override;
|
GameStats getStats() override;
|
||||||
|
|
Loading…
Reference in a new issue