MCPcopy Create free account
hub / github.com/JACoders/OpenJK / cg_SP_GetStringTextStringWithRetry

Function cg_SP_GetStringTextStringWithRetry

code/cgame/cg_text.cpp:194–218  ·  view source on GitHub ↗

try and get the correct StripEd text (with retry) for a given reference... returns 0 if failed, else strlen...

Source from the content-addressed store, hash-verified

192// returns 0 if failed, else strlen...
193//
194static int cg_SP_GetStringTextStringWithRetry( const char *psReference, char *psDest, int iSizeofDest)
195{
196 int iReturn;
197
198 if (psReference[0] == '#')
199 {
200 // then we know the striped package name is already built in, so do NOT try prepending anything else...
201 //
202 return cgi_SP_GetStringTextString( va("%s",psReference+1), psDest, iSizeofDest );
203 }
204
205 for (int i=0; i<STRIPED_LEVELNAME_VARIATIONS; i++)
206 {
207 if (cgs.stripLevelName[i][0]) // entry present?
208 {
209 iReturn = cgi_SP_GetStringTextString( va("%s_%s",cgs.stripLevelName[i],psReference), psDest, iSizeofDest );
210 if (iReturn)
211 {
212 return iReturn;
213 }
214 }
215 }
216
217 return 0;
218}
219
220// slightly confusingly, the char arg for this function is an audio filename of the form "path/path/filename",
221// the "filename" part of which should be the same as the StripEd reference we're looking for in the current

Callers 1

CG_CaptionTextFunction · 0.70

Calls 2

vaFunction · 0.50

Tested by

no test coverage detected