MCPcopy Create free account
hub / github.com/ZDoom/Raze / ToReg

Method ToReg

source/common/scripting/backend/codegen.cpp:5688–5697  ·  view source on GitHub ↗

========================================================================== The atan2 opcode only takes registers as parameters, so any constants must be loaded into registers first. ==========================================================================

Source from the content-addressed store, hash-verified

5686//
5687//==========================================================================
5688ExpEmit FxATan2::ToReg(VMFunctionBuilder* build, FxExpression* val)
5689{
5690 if (val->isConstant())
5691 {
5692 ExpEmit reg(build, REGT_FLOAT);
5693 build->Emit(OP_LKF, reg.RegNum, build->GetConstantFloat(static_cast<FxConstant*>(val)->GetValue().GetFloat()));
5694 return reg;
5695 }
5696 return val->Emit(build);
5697}
5698
5699//==========================================================================
5700//

Callers

nothing calls this directly

Calls 5

GetConstantFloatMethod · 0.80
isConstantMethod · 0.45
EmitMethod · 0.45
GetFloatMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected