MCPcopy Create free account
hub / github.com/axmolengine/axmol / fixIndex

Function fixIndex

core/3d/ObjLoader.cpp:82–89  ·  view source on GitHub ↗

Make index zero-base, and also support relative index.

Source from the content-addressed store, hash-verified

80
81// Make index zero-base, and also support relative index.
82static inline int fixIndex(int idx, int n)
83{
84 if (idx > 0)
85 return idx - 1;
86 if (idx == 0)
87 return 0;
88 return n + idx; // negative value = relative
89}
90
91static inline std::string parseString(const char*& token)
92{

Callers 1

parseTripleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected