MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / ParseFloatArray

Function ParseFloatArray

src/lua/LuaOpenGL.cpp:314–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312
313
314static int ParseFloatArray(lua_State* L, float* array, int size) {
315 if (!lua_istable(L, -1)) {
316 return -1;
317 }
318 const int table = lua_gettop(L);
319 for (int i = 0; i < size; i++) {
320 lua_rawgeti(L, table, (i + 1));
321 if (lua_israwnumber(L, -1)) {
322 array[i] = lua_tofloat(L, -1);
323 lua_pop(L, 1);
324 }
325 else {
326 lua_pop(L, 1);
327 return i;
328 }
329 }
330 return size;
331}
332
333
334//============================================================================//

Callers 6

Map1Method · 0.70
Map2Method · 0.70
ParseColorFunction · 0.70
MaterialMethod · 0.70
LoadMatrixMethod · 0.70
MultMatrixMethod · 0.70

Calls 4

lua_israwnumberFunction · 0.85
lua_tofloatFunction · 0.85
lua_gettopFunction · 0.50
lua_rawgetiFunction · 0.50

Tested by

no test coverage detected