MCPcopy Create free account
hub / github.com/TASEmulators/fceux / DrawMessage

Function DrawMessage

src/drawing.cpp:128–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126
127
128void DrawMessage(bool beforeMovie)
129{
130 if(guiMessage.howlong)
131 {
132 //don't display movie messages if we're not before the movie
133 if(beforeMovie && !guiMessage.isMovieMessage)
134 return;
135
136 uint8 *t;
137 guiMessage.howlong--;
138
139 if (guiMessage.linesFromBottom > 0)
140 t=XBuf+FCEU_TextScanlineOffsetFromBottom(guiMessage.linesFromBottom)+1;
141 else
142 t=XBuf+FCEU_TextScanlineOffsetFromBottom(20)+1;
143
144 /*
145 FCEU palette:
146 $00: [8] unvpalette found in palettes/palettes.h
147 black, white, black, greyish, redish, bright green, bluish
148 $80:
149 nes palette
150 $C0:
151 dim version of nes palette
152
153 */
154
155 if(t>=XBuf)
156 {
157 int color = 0x20;
158 if(guiMessage.howlong <= 40) color = 0x3C;
159 if(guiMessage.howlong <= 32) color = 0x31;
160 if(guiMessage.howlong <= 24) color = 0x21;
161 if(guiMessage.howlong <= 16) color = 0x51;
162 if(guiMessage.howlong <= 8) color = 0x41;
163 DrawTextTrans(ClipSidesOffset+t, 256, (uint8 *)guiMessage.errmsg, color+0x80);
164 }
165 }
166
167 if(subtitleMessage.howlong)
168 {
169 //don't display movie messages if we're not before the movie
170 if(beforeMovie && !subtitleMessage.isMovieMessage)
171 return;
172
173 uint8 *tt;
174 subtitleMessage.howlong--;
175 tt=XBuf+FCEU_TextScanlineOffsetFromBottom(216);
176
177 if(tt>=XBuf)
178 {
179 int color = 0x20;
180 if(subtitleMessage.howlong == 39) color = 0x38;
181 if(subtitleMessage.howlong <= 30) color = 0x2C;
182 if(subtitleMessage.howlong <= 20) color = 0x1C;
183 if(subtitleMessage.howlong <= 10) color = 0x11;
184 if(subtitleMessage.howlong <= 5) color = 0x1;
185 DrawTextTrans(ClipSidesOffset+tt, 256, (uint8 *)subtitleMessage.errmsg, color+0x80);

Callers 1

FCEU_PutImageFunction · 0.85

Calls 2

DrawTextTransFunction · 0.85

Tested by

no test coverage detected