Subtitles have their own message function.
This commit is contained in:
parent
60fe20142e
commit
57de01eb86
|
@ -159,6 +159,24 @@ void DrawMessage(bool beforeMovie)
|
|||
DrawTextTrans(ClipSidesOffset+t, 256, (uint8 *)guiMessage.errmsg, color+0x80);
|
||||
}
|
||||
}
|
||||
|
||||
if(subtitleMessage.howlong)
|
||||
{
|
||||
uint8 *tt;
|
||||
subtitleMessage.howlong--;
|
||||
tt=XBuf+FCEU_TextScanlineOffsetFromBottom(216);
|
||||
|
||||
if(tt>=XBuf)
|
||||
{
|
||||
int color = 0x20;
|
||||
if(subtitleMessage.howlong == 39) color = 0x38;
|
||||
if(subtitleMessage.howlong <= 30) color = 0x2C;
|
||||
if(subtitleMessage.howlong <= 20) color = 0x1C;
|
||||
if(subtitleMessage.howlong <= 10) color = 0x11;
|
||||
if(subtitleMessage.howlong <= 5) color = 0x1;
|
||||
DrawTextTrans(ClipSidesOffset+tt, 256, (uint8 *)subtitleMessage.errmsg, color+0x80);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1216,6 +1216,31 @@ void ProcessSubtitles(void)
|
|||
for(uint32 i=0;i<currMovieData.subtitles.size();i++)
|
||||
{
|
||||
if (currFrameCounter == subtitleFrames[i])
|
||||
FCEUI_DispMessage("%s",subtitleMessages[i].c_str());
|
||||
FCEU_DisplaySubtitles("%s",subtitleMessages[i].c_str());
|
||||
//FCEUI_DispMessage("%s",subtitleMessages[i].c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void FCEU_DisplaySubtitles(char *format, ...)
|
||||
{
|
||||
/*
|
||||
uint8 color;
|
||||
|
||||
//color = 0x19+0x80; //else display green
|
||||
color = 0x20+0x80;
|
||||
|
||||
char counterbuf[512] = {0};
|
||||
sprintf(counterbuf,"%d",format);
|
||||
|
||||
if(counterbuf[0])
|
||||
DrawTextTrans(ClipSidesOffset+XBuf+FCEU_TextScanlineOffsetFromBottom(128), 256, (uint8*)counterbuf, color); //0x20+0x80
|
||||
*/
|
||||
va_list ap;
|
||||
|
||||
va_start(ap,format);
|
||||
vsnprintf(subtitleMessage.errmsg,sizeof(subtitleMessage.errmsg),format,ap);
|
||||
va_end(ap);
|
||||
|
||||
subtitleMessage.howlong = 300;
|
||||
subtitleMessage.isMovieMessage = false;
|
||||
}
|
|
@ -247,6 +247,7 @@ void FCEUI_ToggleInputDisplay(void);
|
|||
|
||||
void LoadSubtitles(void);
|
||||
void ProcessSubtitles(void);
|
||||
void FCEU_DisplaySubtitles(char *format, ...);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -60,6 +60,7 @@ int ClipSidesOffset=0; //Used to move displayed messages when Clips left and rig
|
|||
static uint8 *xbsave=NULL;
|
||||
|
||||
GUIMESSAGE guiMessage;
|
||||
GUIMESSAGE subtitleMessage;
|
||||
|
||||
//for input display
|
||||
extern int input_display;
|
||||
|
|
|
@ -10,12 +10,13 @@ extern struct GUIMESSAGE
|
|||
int howlong;
|
||||
|
||||
//the current gui message
|
||||
char errmsg[86];
|
||||
char errmsg[110];
|
||||
|
||||
//indicates that the movie should be drawn even on top of movies
|
||||
bool isMovieMessage;
|
||||
|
||||
} guiMessage;
|
||||
|
||||
extern GUIMESSAGE subtitleMessage;
|
||||
|
||||
void FCEU_DrawNumberRow(uint8 *XBuf, int *nstatus, int cur);
|
||||
|
|
Loading…
Reference in New Issue