From c810b4d724b5c1078177603f0629f7a8467f2ea2 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 28 Jul 2013 20:29:25 -0500 Subject: [PATCH] Use new degree FLOPs for DECORATE expressions. - Now that the VM supports degrees, use those instructions when emitting code for cos and sin DECORATE expressions. (This looks like it also fixed a bug where sqrt also did the degree to radian conversion.) --- src/thingdef/thingdef_expression.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/thingdef/thingdef_expression.cpp b/src/thingdef/thingdef_expression.cpp index d68ba59e7..620082b4d 100644 --- a/src/thingdef/thingdef_expression.cpp +++ b/src/thingdef/thingdef_expression.cpp @@ -3458,11 +3458,10 @@ ExpEmit FxGlobalFunctionCall::Emit(VMFunctionBuilder *build) ExpEmit v = (*ArgList)[0]->Emit(build); assert(!v.Konst && v.RegType == REGT_FLOAT); - build->Emit(OP_MULF_RK, v.RegNum, v.RegNum, build->GetConstantFloat(M_PI / 180.0)); build->Emit(OP_FLOP, v.RegNum, v.RegNum, (Name == NAME_Sqrt) ? FLOP_SQRT : - (Name == NAME_Sin) ? FLOP_SIN : - FLOP_COS); + (Name == NAME_Sin) ? FLOP_SIN_DEG : + FLOP_COS_DEG); return v; }