* Updated to ZDoom 4304:

- Heretic and Hexen can now have their big fonts overridden by a font named "HBIGFONT". In   addition, a font named "BIGFONT" will override the big font for every game.
- Added OverridePalette VOXELDEF flag.
- Added ACS function LineAttack via Ryan Cordell.

git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1584 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
gez 2013-06-01 09:39:34 +00:00
parent 86e1081184
commit 5a4950af36
5 changed files with 70 additions and 5 deletions

View file

@ -4112,6 +4112,7 @@ enum EACSFunctions
ACSF_SetCVarString,
ACSF_GetUserCVarString,
ACSF_SetUserCVarString,
ACSF_LineAttack,
// ZDaemon
ACSF_GetTeamScore = 19620, // (int team)
@ -4853,6 +4854,33 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args)
}
break;
//[RC] A bullet firing function for ACS. Thanks to DavidPH.
case ACSF_LineAttack:
{
fixed_t angle = args[1] << FRACBITS;
fixed_t pitch = args[2] << FRACBITS;
int damage = args[3];
FName pufftype = argCount > 4 && args[4]? FName(FBehavior::StaticLookupString(args[4])) : NAME_BulletPuff;
FName damagetype = argCount > 5 && args[5]? FName(FBehavior::StaticLookupString(args[5])) : NAME_None;
fixed_t range = argCount > 6 && args[6]? args[6] : 0x7FFFFFFF;
if (args[0] == 0)
{
P_LineAttack(activator, angle, range, pitch, damage, damagetype, pufftype);
}
else
{
AActor *source;
FActorIterator it(args[0]);
while ((source = it.Next()) != NULL)
{
P_LineAttack(activator, angle, range, pitch, damage, damagetype, pufftype);
}
}
}
break;
default:
break;
}

View file

@ -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;

View file

@ -42,6 +42,7 @@ struct FVoxel
FVoxel();
~FVoxel();
void Remap();
void RemovePalette();
};
struct FVoxelDef

View file

@ -3,5 +3,5 @@
// This file was automatically generated by the
// updaterevision tool. Do not edit by hand.
#define ZD_SVN_REVISION_STRING "4301"
#define ZD_SVN_REVISION_NUMBER 4301
#define ZD_SVN_REVISION_STRING "4304"
#define ZD_SVN_REVISION_NUMBER 4304

View file

@ -2649,7 +2649,12 @@ void V_InitFonts()
}
if (!(BigFont = FFont::FindFont("BigFont")))
{
if (gameinfo.gametype & GAME_DoomChex)
int lump = Wads.CheckNumForName("BIGFONT");
if (lump >= 0)
{
BigFont = new FSingleLumpFont("BigFont", lump);
}
else if (gameinfo.gametype & GAME_DoomChex)
{
BigFont = new FSingleLumpFont ("BigFont", Wads.GetNumForName ("DBIGFONT"));
}
@ -2659,7 +2664,15 @@ void V_InitFonts()
}
else
{
BigFont = new FFont ("BigFont", "FONTB%02u", HU_FONTSTART, HU_FONTSIZE, 1, -1);
lump = Wads.CheckNumForName("HBIGFONT");
if (lump >= 0)
{
BigFont = new FSingleLumpFont("BigFont", lump);
}
else
{
BigFont = new FFont ("BigFont", "FONTB%02u", HU_FONTSTART, HU_FONTSIZE, 1, -1);
}
}
}
if (!(ConFont = FFont::FindFont("ConsoleFont")))