mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
- Added Gez's OverridePalette VOXELDEF flag.
SVN r4303 (trunk)
This commit is contained in:
parent
8565484e29
commit
53b284fb5d
2 changed files with 25 additions and 1 deletions
|
@ -71,13 +71,14 @@ TDeletingArray<FVoxelDef *> VoxelDefs;
|
|||
struct VoxelOptions
|
||||
{
|
||||
VoxelOptions()
|
||||
: DroppedSpin(0), PlacedSpin(0), Scale(FRACUNIT), AngleOffset(ANGLE_90)
|
||||
: DroppedSpin(0), PlacedSpin(0), Scale(FRACUNIT), AngleOffset(ANGLE_90), OverridePalette(false)
|
||||
{}
|
||||
|
||||
int DroppedSpin;
|
||||
int PlacedSpin;
|
||||
fixed_t Scale;
|
||||
angle_t AngleOffset;
|
||||
bool OverridePalette;
|
||||
};
|
||||
|
||||
//==========================================================================
|
||||
|
@ -408,6 +409,20 @@ void FVoxel::Remap()
|
|||
{
|
||||
RemapVoxelSlabs((kvxslab_t *)Mips[i].SlabData, Mips[i].OffsetX[Mips[i].SizeX], remap);
|
||||
}
|
||||
RemovePalette();
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// Delete the voxel's built-in palette
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void FVoxel::RemovePalette()
|
||||
{
|
||||
if (Palette != NULL)
|
||||
{
|
||||
delete [] Palette;
|
||||
Palette = NULL;
|
||||
}
|
||||
|
@ -518,6 +533,10 @@ static void VOX_ReadOptions(FScanner &sc, VoxelOptions &opts)
|
|||
}
|
||||
opts.AngleOffset = ANGLE_90 + angle_t(sc.Float * ANGLE_180 / 180.0);
|
||||
}
|
||||
else if (sc.Compare("overridepalette"))
|
||||
{
|
||||
opts.OverridePalette = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
sc.ScriptMessage("Unknown voxel option '%s'\n", sc.String);
|
||||
|
@ -603,6 +622,10 @@ void R_InitVoxels()
|
|||
sc.SetCMode(false);
|
||||
if (voxeldata != NULL && vsprites.Size() != 0)
|
||||
{
|
||||
if (opts.OverridePalette)
|
||||
{
|
||||
voxeldata->RemovePalette();
|
||||
}
|
||||
FVoxelDef *def = new FVoxelDef;
|
||||
|
||||
def->Voxel = voxeldata;
|
||||
|
|
|
@ -42,6 +42,7 @@ struct FVoxel
|
|||
FVoxel();
|
||||
~FVoxel();
|
||||
void Remap();
|
||||
void RemovePalette();
|
||||
};
|
||||
|
||||
struct FVoxelDef
|
||||
|
|
Loading…
Reference in a new issue