MCPcopy Create free account
hub / github.com/ZDoom/gzdoom / stringvalue

Function stringvalue

src/playsim/fragglescript/t_variable.cpp:95–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93//==========================================================================
94
95const char *stringvalue(const svalue_t & v)
96{
97 static char buffer[256];
98
99 switch(v.type)
100 {
101 case svt_string:
102 return v.string.GetChars();
103
104 case svt_mobj:
105 // return the class name
106 return (const char *)v.value.mobj->GetClass()->TypeName.GetChars();
107
108 case svt_fixed:
109 {
110 double val = v.value.f / 65536.;
111 mysnprintf(buffer, countof(buffer), "%g", val);
112 return buffer;
113 }
114
115 case svt_int:
116 default:
117 mysnprintf(buffer, countof(buffer), "%i", v.value.i);
118 return buffer;
119 }
120}
121
122//==========================================================================
123//

Callers 13

T_ClassTypeFunction · 0.85
T_GetAmmoFunction · 0.85
GetFormatStringMethod · 0.85
SF_StartSoundMethod · 0.85
SF_StartSectorSoundMethod · 0.85
SF_ChangeMusicMethod · 0.85
SF_SetLineTextureMethod · 0.85
SF_GiveInventoryMethod · 0.85
SF_TakeInventoryMethod · 0.85
SF_CheckInventoryMethod · 0.85
SF_AmbientSoundMethod · 0.85
SF_StringValueMethod · 0.85

Calls 2

GetClassMethod · 0.80
GetCharsMethod · 0.45

Tested by

no test coverage detected