///////////////////////////////////////////////////////////////
| 1026 | |
| 1027 | //////////////////////////////////////////////////////////////////// |
| 1028 | bool 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 | |
| 1052 | bool CreateTextFade(tceffect *tce, const char *text) { |
| 1053 | ASSERT(text); |
no test coverage detected