Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
particles.cpp File Reference
#include "particles.h"
#include <type_traits>
+ Include dependency graph for particles.cpp:

Namespaces

namespace  ParticleParamTypes
 

Macros

#define PARAM_PVFN(n)   ParticleParamTypes::n##ParameterValue
 
#define PARAM_DEF_SRZR(T, wr, rd)
 
#define PARAM_DEF_NUM(T, wr, rd)
 

Typedefs

using FlagT = std::underlying_type_t<ParticleTextureFlags>
 

Enumerations

enum class  ParticleTextureFlags : u8 { animated = 1 , blend = 0x7 << 1 }
 

Functions

template<typename T >
static T numericalBlend (float fac, T min, T max)
 
v2f PARAM_PVFN pick (float *f, const v2f a, const v2f b)
 
v3f PARAM_PVFN pick (float *f, const v3f a, const v3f b)
 
v2f PARAM_PVFN interpolate (float fac, const v2f a, const v2f b)
 
v3f PARAM_PVFN interpolate (float fac, const v3f a, const v3f b)
 
 PARAM_DEF_NUM (u8, writeU8, readU8)
 
 PARAM_DEF_NUM (s8, writeS8, readS8)
 
 PARAM_DEF_NUM (u16, writeU16, readU16)
 
 PARAM_DEF_NUM (s16, writeS16, readS16)
 
 PARAM_DEF_NUM (u32, writeU32, readU32)
 
 PARAM_DEF_NUM (s32, writeS32, readS32)
 
 PARAM_DEF_NUM (f32, writeF32, readF32)
 
 PARAM_DEF_SRZR (v2f, writeV2F32, readV2F32)
 
 PARAM_DEF_SRZR (v3f, writeV3F32, readV3F32)
 
template<typename T , T(reader)(std::istream &is) >
bool streamEndsBeforeParam (T &val, std::istream &is)
 

Macro Definition Documentation

◆ PARAM_DEF_NUM

#define PARAM_DEF_NUM ( T,
wr,
rd )
Value:
PARAM_DEF_SRZR(T, wr, rd) \
T PARAM_PVFN(interpolate)(float fac, const T a, const T b) \
{ return numericalBlend<T>(fac,a,b); } \
T PARAM_PVFN(pick) (float* f, const T a, const T b) \
{ return numericalBlend<T>(f[0],a,b); }
#define PARAM_PVFN(n)
Definition particles.cpp:127
static T numericalBlend(float fac, T min, T max)
Definition particles.cpp:122
v2f PARAM_PVFN interpolate(float fac, const v2f a, const v2f b)
Definition particles.cpp:143
v2f PARAM_PVFN pick(float *f, const v2f a, const v2f b)
Definition particles.cpp:128
#define PARAM_DEF_SRZR(T, wr, rd)
Definition particles.cpp:148

◆ PARAM_DEF_SRZR

#define PARAM_DEF_SRZR ( T,
wr,
rd )
Value:
void PARAM_PVFN(serialize) (std::ostream& os, T v) {wr(os,v); } \
void PARAM_PVFN(deSerialize)(std::istream& is, T& v) {v = rd(is);}

◆ PARAM_PVFN

#define PARAM_PVFN ( n)    ParticleParamTypes::n##ParameterValue

Typedef Documentation

◆ FlagT

using FlagT = std::underlying_type_t<ParticleTextureFlags>

Enumeration Type Documentation

◆ ParticleTextureFlags

enum class ParticleTextureFlags : u8
strong
Enumerator
animated 
blend 

Function Documentation

◆ interpolate() [1/2]

v2f PARAM_PVFN interpolate ( float fac,
const v2f a,
const v2f b )

Referenced by GUITouchscreenLayout::interpolateGUIImages().

+ Here is the caller graph for this function:

◆ interpolate() [2/2]

v3f PARAM_PVFN interpolate ( float fac,
const v3f a,
const v3f b )

◆ numericalBlend()

template<typename T >
static T numericalBlend ( float fac,
T min,
T max )
static

Referenced by pick(), and pick().

+ Here is the caller graph for this function:

◆ PARAM_DEF_NUM() [1/7]

PARAM_DEF_NUM ( f32 ,
writeF32 ,
readF32  )

◆ PARAM_DEF_NUM() [2/7]

PARAM_DEF_NUM ( s16 ,
writeS16 ,
readS16  )

◆ PARAM_DEF_NUM() [3/7]

PARAM_DEF_NUM ( s32 ,
writeS32 ,
readS32  )

◆ PARAM_DEF_NUM() [4/7]

PARAM_DEF_NUM ( s8 ,
writeS8 ,
readS8  )

◆ PARAM_DEF_NUM() [5/7]

PARAM_DEF_NUM ( u16 ,
writeU16 ,
readU16  )

◆ PARAM_DEF_NUM() [6/7]

PARAM_DEF_NUM ( u32 ,
writeU32 ,
readU32  )

◆ PARAM_DEF_NUM() [7/7]

PARAM_DEF_NUM ( u8 ,
writeU8 ,
readU8  )

◆ PARAM_DEF_SRZR() [1/2]

PARAM_DEF_SRZR ( v2f ,
writeV2F32 ,
readV2F32  )

◆ PARAM_DEF_SRZR() [2/2]

PARAM_DEF_SRZR ( v3f ,
writeV3F32 ,
readV3F32  )

◆ pick() [1/2]

v2f PARAM_PVFN pick ( float * f,
const v2f a,
const v2f b )

References numericalBlend().

+ Here is the call graph for this function:

◆ pick() [2/2]

v3f PARAM_PVFN pick ( float * f,
const v3f a,
const v3f b )

References numericalBlend().

+ Here is the call graph for this function:

◆ streamEndsBeforeParam()

template<typename T , T(reader)(std::istream &is) >
bool streamEndsBeforeParam ( T & val,
std::istream & is )
inline

Referenced by ParticleParameters::deSerialize().

+ Here is the caller graph for this function: