MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / CreateTextStatic

Function CreateTextStatic

Descent3/TelComEffects.cpp:1028–1050  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

1026
1027////////////////////////////////////////////////////////////////////
1028bool CreateTextStatic(tceffect *tce, const char *text) {
1029 ASSERT(text);
1030 if (!text)
1031 return false;
1032
1033 tce->text_buffer = (char *)mem_malloc(strlen(text) + 10);
1034 if (!tce->text_buffer)
1035 return false;
1036
1037 tce->alpha = 255;
1038
1039 char *tempbuffer = (char *)mem_malloc(strlen(text) + 10);
1040 if (!tempbuffer)
1041 return false;
1042 strcpy(tempbuffer, text);
1043
1044 // apply the word wrap
1045 textaux_WordWrap(tempbuffer, tce->text_buffer, tce->w, Game_fonts[tce->textinfo.font_index]);
1046
1047 mem_free(tempbuffer);
1048
1049 return true;
1050}
1051
1052bool CreateTextFade(tceffect *tce, const char *text) {
1053 ASSERT(text);

Callers 1

CreateTextEffectFunction · 0.85

Calls 1

textaux_WordWrapFunction · 0.85

Tested by

no test coverage detected