OpenClonk
C4Real.cpp File Reference
#include "C4Include.h"
#include "lib/C4Real.h"
#include "lib/StdCompiler.h"
#include "lib/StdAdaptors.h"
Include dependency graph for C4Real.cpp:

Go to the source code of this file.

Functions

void CompileFunc (C4Real &rValue, StdCompiler *pComp)
 

Function Documentation

◆ CompileFunc()

void CompileFunc ( C4Real rValue,
StdCompiler pComp 
)

Definition at line 9033 of file C4Real.cpp.

9034 {
9035 #ifdef C4REAL_USE_FIXNUM
9036  char cFormat = 'F';
9037 #else
9038  char cFormat = 'f';
9039 #endif
9040  try
9041  {
9042  // Read/write type
9043  pComp->Character(cFormat);
9044 
9045  }
9046  catch (StdCompiler::NotFoundException *pEx)
9047  {
9048  delete pEx;
9049  // Expect old format if not found
9050  cFormat = 'F';
9051  }
9052  // Read value (as int32_t)
9053  pComp->Value(mkCastAdapt<int32_t>(rValue));
9054  // convert, if neccessary
9055 #ifdef C4REAL_USE_FIXNUM
9056  if (cFormat == 'f')
9057  FLOAT_TO_FIXED(&rValue);
9058 #else
9059  if (cFormat == 'F')
9060  FIXED_TO_FLOAT(&rValue);
9061 #endif
9062 }
void FLOAT_TO_FIXED(C4Real *pVal)
Definition: C4Real.h:318
virtual void Character(char &rChar)=0
void Value(const T &rStruct)
Definition: StdCompiler.h:161

Referenced by C4ValueProviderLinear::CompileFunc(), C4ValueProviderX::CompileFunc(), C4ValueProviderY::CompileFunc(), C4ValueProviderR::CompileFunc(), C4ValueProviderAbsX::CompileFunc(), C4ValueProviderAbsY::CompileFunc(), C4ValueProviderDist::CompileFunc(), C4ValueProviderXDir::CompileFunc(), C4ValueProviderYDir::CompileFunc(), C4ValueProviderRDir::CompileFunc(), C4ValueProviderAbsRDir::CompileFunc(), C4ValueProviderCosR::CompileFunc(), C4ValueProviderSinR::CompileFunc(), C4ValueProviderCosV::CompileFunc(), C4ValueProviderSinV::CompileFunc(), and C4ValueProviderAction::CompileFunc().

Here is the caller graph for this function: