From a13ada3b2d6460c418b3480a729a5857c533e482 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 28 Apr 2015 10:39:35 +0200 Subject: [PATCH] Revert "Merge commit '173dbd6bcee02a9e9c12a4a74d1fffe3e081d162' into scripting" This reverts commit e9cbb0b2235bdd95db01a52f2f8f01725e29f4cb, reversing changes made to d6e3fc0567ace7f5d5754d0f43f1ef09685121de. The merge just copied the obsolete FxFloatCast from master without any conflict so it all had to be removed again. --- src/thingdef/thingdef_exp.h | 19 ------- src/thingdef/thingdef_expression.cpp | 76 ---------------------------- 2 files changed, 95 deletions(-) diff --git a/src/thingdef/thingdef_exp.h b/src/thingdef/thingdef_exp.h index b81bac4f1..7277d48bb 100644 --- a/src/thingdef/thingdef_exp.h +++ b/src/thingdef/thingdef_exp.h @@ -389,25 +389,6 @@ public: }; -//========================================================================== -// -// -// -//========================================================================== - -class FxFloatCast : public FxExpression -{ - FxExpression *basex; - -public: - - FxFloatCast(FxExpression *x); - ~FxFloatCast(); - FxExpression *Resolve(FCompileContext&); - - ExpVal EvalExpression (AActor *self); -}; - //========================================================================== // // FxSign diff --git a/src/thingdef/thingdef_expression.cpp b/src/thingdef/thingdef_expression.cpp index 92e34a038..e8e3c2b67 100644 --- a/src/thingdef/thingdef_expression.cpp +++ b/src/thingdef/thingdef_expression.cpp @@ -488,82 +488,6 @@ ExpEmit FxFloatCast::Emit(VMFunctionBuilder *build) return to; } -//========================================================================== -// -// -// -//========================================================================== - -FxFloatCast::FxFloatCast(FxExpression *x) -: FxExpression(x->ScriptPosition) -{ - basex = x; - ValueType = VAL_Float; -} - -//========================================================================== -// -// -// -//========================================================================== - -FxFloatCast::~FxFloatCast() -{ - SAFE_DELETE(basex); -} - -//========================================================================== -// -// -// -//========================================================================== - -FxExpression *FxFloatCast::Resolve(FCompileContext &ctx) -{ - CHECKRESOLVED(); - SAFE_RESOLVE(basex, ctx); - - if (basex->ValueType == VAL_Float) - { - FxExpression *x = basex; - basex = NULL; - delete this; - return x; - } - else if (basex->ValueType == VAL_Int) - { - if (basex->isConstant()) - { - ExpVal constval = basex->EvalExpression(NULL); - FxExpression *x = new FxConstant(constval.GetFloat(), ScriptPosition); - delete this; - return x; - } - return this; - } - else - { - ScriptPosition.Message(MSG_ERROR, "Numeric type expected"); - delete this; - return NULL; - } -} - -//========================================================================== -// -// -// -//========================================================================== - -ExpVal FxFloatCast::EvalExpression (AActor *self) -{ - ExpVal baseval = basex->EvalExpression(self); - baseval.Float = baseval.GetFloat(); - baseval.Type = VAL_Float; - return baseval; -} - - //========================================================================== // //