From 0c694353e5ca4ce084189bb5c2bdfa8d49200b8e Mon Sep 17 00:00:00 2001 From: zeromus Date: Mon, 26 May 2008 03:32:55 +0000 Subject: [PATCH] display pause icon and play/rec icons at the same time --- src/drawing.cpp | 27 +++++++++++++++++++++++++-- src/drawing.h | 2 +- src/video.cpp | 16 ---------------- 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/drawing.cpp b/src/drawing.cpp index ca04a40b..beb6979a 100644 --- a/src/drawing.cpp +++ b/src/drawing.cpp @@ -221,12 +221,13 @@ static uint8* sline_icons[4]= pause_slines }; -void FCEU_DrawRecordingStatusN(uint8* XBuf, int n) +static void drawstatus(uint8* XBuf, int n, int y, int xofs) { uint8* slines=sline_icons[n]; int i; - XBuf += (FSettings.LastSLine-28)*256 + 240 + 255; + + XBuf += FCEU_TextScanlineOffsetFromBottom(y) + 240 + 255 + xofs; for(i=0; slines[i]!=99; i+=3) { int y=slines[i]; @@ -247,6 +248,28 @@ void FCEU_DrawRecordingStatusN(uint8* XBuf, int n) } } +/// this draws the recording icon (play/pause/record) +void FCEU_DrawRecordingStatus(uint8* XBuf) +{ + if(FCEUD_ShowStatusIcon()) + { + bool hasPlayRecIcon = false; + if(FCEUI_IsMovieActive()>0) + { + drawstatus(XBuf,2,28,0); + hasPlayRecIcon = true; + } + else if(FCEUI_IsMovieActive()<0) + { + drawstatus(XBuf,1,28,0); + hasPlayRecIcon = true; + } + + if(FCEUI_EmulationPaused()) + drawstatus(XBuf,3,28,hasPlayRecIcon?-16:0); + } +} + void FCEU_DrawNumberRow(uint8 *XBuf, int *nstatus, int cur) { diff --git a/src/drawing.h b/src/drawing.h index 43519111..b4183a2a 100644 --- a/src/drawing.h +++ b/src/drawing.h @@ -2,6 +2,6 @@ void DrawTextLineBG(uint8 *dest); void DrawMessage(void); -void FCEU_DrawRecordingStatusN(uint8* XBuf, int n); +void FCEU_DrawRecordingStatus(uint8* XBuf); void FCEU_DrawNumberRow(uint8 *XBuf, int *nstatus, int cur); void DrawTextTrans(uint8 *dest, uint32 width, uint8 *textmsg, uint8 fgcolor); \ No newline at end of file diff --git a/src/video.cpp b/src/video.cpp index dd04ffa8..a6cf6bf0 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -161,23 +161,7 @@ void FCEUI_SaveSnapshot(void) dosnapsave=1; } -/// this draws the recording icon (play/pause/record) -static void FCEU_DrawRecordingStatus(uint8* XBuf) -{ - int n=0; - if(FCEUD_ShowStatusIcon()) - { - if(FCEUI_EmulationPaused()) - n=3; - else if(FCEUI_IsMovieActive()>0) - n=2; - else if(FCEUI_IsMovieActive()<0) - n=1; - } - if(n) - FCEU_DrawRecordingStatusN(XBuf, n); -} static void ReallySnap(void) {