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

Function CreateTextType

Descent3/TelComEffects.cpp:1083–1103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1081}
1082
1083bool CreateTextType(tceffect *tce, const char *text) {
1084 ASSERT(text);
1085 if (!text || text[0] == '\0')
1086 return false;
1087 tce->text_buffer = (char *)mem_malloc(strlen(text) + 10);
1088 if (!tce->text_buffer)
1089 return false;
1090
1091 char *tempbuffer = (char *)mem_malloc(strlen(text) + 10);
1092 if (!tempbuffer)
1093 return false;
1094 strcpy(tempbuffer, text);
1095
1096 // apply the word wrap
1097 textaux_WordWrap(tempbuffer, tce->text_buffer, tce->w, Game_fonts[tce->textinfo.font_index]);
1098
1099 mem_free(tempbuffer);
1100
1101 tce->textinfo.last_letter = 0;
1102 return true;
1103}
1104
1105bool CreateBmpStatic(tceffect *tce, const char *filename) {
1106 ASSERT(filename);

Callers 1

CreateTextEffectFunction · 0.85

Calls 1

textaux_WordWrapFunction · 0.85

Tested by

no test coverage detected