From 9fc5539ae76d6d9e1b7effead33b584707b53233 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 17 Jun 2011 22:46:34 +0000 Subject: [PATCH] - fixed case of damage type variables. - fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. SVN r3240 (trunk) --- src/p_interaction.cpp | 10 +++++----- src/v_font.cpp | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 5e37444fe7..ca75ffe6ce 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -643,12 +643,12 @@ void AActor::Die (AActor *source, AActor *inflictor) FState *diestate = NULL; FName damagetype = (inflictor && inflictor->DeathType != NAME_None) ? inflictor->DeathType : DamageType; - if (DamageType != NAME_None) + if (damagetype != NAME_None) { - diestate = FindState (NAME_Death, DamageType, true); + diestate = FindState (NAME_Death, damagetype, true); if (diestate == NULL) { - if (DamageType == NAME_Ice) + if (damagetype == NAME_Ice) { // If an actor doesn't have an ice death, we can still give them a generic one. if (!deh.NoAutofreeze && !(flags4 & MF4_NOICEDEATH) && (player || (flags3 & MF3_ISMONSTER))) @@ -667,9 +667,9 @@ void AActor::Die (AActor *source, AActor *inflictor) // Don't pass on a damage type this actor cannot handle. // (most importantly, prevent barrels from passing on ice damage.) // Massacre must be preserved though. - if (DamageType != NAME_Massacre) + if (damagetype != NAME_Massacre) { - DamageType = NAME_None; + damagetype = NAME_None; } if ((health < gibhealth || flags4 & MF4_EXTREMEDEATH) && !(flags4 & MF4_NOEXTREMEDEATH)) diff --git a/src/v_font.cpp b/src/v_font.cpp index 1bb4753eed..eb26f0c6cf 100644 --- a/src/v_font.cpp +++ b/src/v_font.cpp @@ -1132,8 +1132,9 @@ void FSingleLumpFont::LoadBMF(int lump, const BYTE *data) // BMF palettes are only six bits per component. Fix that. for (i = 0; i < ActiveColors*3; ++i) { - raw_palette[i] = (data[17 + i] << 2) | (data[17 + i] >> 4); + raw_palette[i+3] = (data[17 + i] << 2) | (data[17 + i] >> 4); } + ActiveColors++; // Sort the palette by increasing brightness for (i = 0; i < ActiveColors; ++i)