This commit is contained in:
Christoph Oelckers 2013-09-03 09:02:44 +02:00
commit 37de4bea67
7 changed files with 17 additions and 14 deletions

View File

@ -2657,10 +2657,11 @@ void AM_drawThings ()
if (texture == NULL) goto drawTriangle; // fall back to standard display if no sprite can be found. if (texture == NULL) goto drawTriangle; // fall back to standard display if no sprite can be found.
const fixed_t spriteScale = 10 * scale_mtof; const fixed_t spriteXScale = FixedMul(t->scaleX, 10 * scale_mtof);
const fixed_t spriteYScale = FixedMul(t->scaleY, 10 * scale_mtof);
DrawMarker (texture, p.x, p.y, 0, !!(frame->Flip & (1 << rotation)), DrawMarker (texture, p.x, p.y, 0, !!(frame->Flip & (1 << rotation)),
spriteScale, spriteScale, 0, FRACUNIT, 0, LegacyRenderStyles[STYLE_Normal]); spriteXScale, spriteYScale, t->Translation, FRACUNIT, 0, LegacyRenderStyles[STYLE_Normal]);
} }
else else
{ {

View File

@ -73,7 +73,6 @@ static FRandom pr_script("FScript");
#define AngleToFixed(x) ((((double) x) / ((double) ANG45/45)) * FRACUNIT) #define AngleToFixed(x) ((((double) x) / ((double) ANG45/45)) * FRACUNIT)
#define FixedToAngle(x) ((((double) x) / FRACUNIT) * ANG45/45) #define FixedToAngle(x) ((((double) x) / FRACUNIT) * ANG45/45)
#define FIXED_TO_FLOAT(f) ((f)/(float)FRACUNIT)
// functions. FParser::SF_ means Script Function not, well.. heh, me // functions. FParser::SF_ means Script Function not, well.. heh, me
@ -1417,11 +1416,11 @@ void FParser::SF_PointToDist(void)
if (CheckArgs(4)) if (CheckArgs(4))
{ {
// Doing this in floating point is actually faster with modern computers! // Doing this in floating point is actually faster with modern computers!
float x = floatvalue(t_argv[2]) - floatvalue(t_argv[0]); double x = floatvalue(t_argv[2]) - floatvalue(t_argv[0]);
float y = floatvalue(t_argv[3]) - floatvalue(t_argv[1]); double y = floatvalue(t_argv[3]) - floatvalue(t_argv[1]);
t_return.type = svt_fixed; t_return.type = svt_fixed;
t_return.value.f = (fixed_t)(sqrtf(x*x+y*y)*65536.f); t_return.value.f = FLOAT2FIXED(sqrt(x*x+y*y)*65536.f);
} }
} }

View File

@ -110,7 +110,7 @@ struct svalue_t
int intvalue(const svalue_t & v); int intvalue(const svalue_t & v);
fixed_t fixedvalue(const svalue_t & v); fixed_t fixedvalue(const svalue_t & v);
float floatvalue(const svalue_t & v); double floatvalue(const svalue_t & v);
const char *stringvalue(const svalue_t & v); const char *stringvalue(const svalue_t & v);
AActor *actorvalue(const svalue_t &svalue); AActor *actorvalue(const svalue_t &svalue);

View File

@ -89,11 +89,12 @@ fixed_t fixedvalue(const svalue_t &v)
// //
//========================================================================== //==========================================================================
float floatvalue(const svalue_t &v) double floatvalue(const svalue_t &v)
{ {
return (float)( (v.type == svt_string ? atof(v.string) : return
v.type == svt_fixed ? (float)(v.value.f / (float)FRACUNIT) : v.type == svt_string ? atof(v.string) :
v.type == svt_mobj ? -1.f : (float)v.value.i )); v.type == svt_fixed ? FIXED2DBL(v.value.f) :
v.type == svt_mobj ? -1. : (double)v.value.i;
} }
//========================================================================== //==========================================================================

View File

@ -752,7 +752,10 @@ public:
{ {
ReplyText = GStrings(ReplyText + 1); ReplyText = GStrings(ReplyText + 1);
} }
FBrokenLines *ReplyLines = V_BreakLines (SmallFont, 320-50-10, ReplyText); FString ReplyString = ReplyText;
if (reply->NeedsGold) ReplyString.AppendFormat(" for %u", reply->ItemCheck[0].Amount);
FBrokenLines *ReplyLines = V_BreakLines (SmallFont, 320-50-10, ReplyString);
mResponses.Push(mResponseLines.Size()); mResponses.Push(mResponseLines.Size());
for (j = 0; ReplyLines[j].Width >= 0; ++j) for (j = 0; ReplyLines[j].Width >= 0; ++j)

View File

@ -224,7 +224,6 @@ class USDFParser : public UDMFParserBase
if (reply->ItemCheck.Size() > 0) if (reply->ItemCheck.Size() > 0)
{ {
if (reply->ItemCheck[0].Amount <= 0) reply->NeedsGold = false; if (reply->ItemCheck[0].Amount <= 0) reply->NeedsGold = false;
if (reply->NeedsGold) ReplyString.AppendFormat(" for %u", reply->ItemCheck[0].Amount);
} }
reply->Reply = ncopystring(ReplyString); reply->Reply = ncopystring(ReplyString);

View File

@ -699,7 +699,7 @@ bool I_WriteIniFailed ()
static const char *pattern; static const char *pattern;
#ifdef __APPLE__ #if defined(__APPLE__) && !defined(__llvm__)
static int matchfile (struct dirent *ent) static int matchfile (struct dirent *ent)
#else #else
static int matchfile (const struct dirent *ent) static int matchfile (const struct dirent *ent)