From 6aa80c44cfc70fd19969961ce73f29f7b0492b8e Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 12 Apr 2009 22:15:08 +0000 Subject: [PATCH] Win32 - AVI Capture - added started/ended messages to the screen. --- desmume/src/windows/aviout.cpp | 10 +++++++--- desmume/src/windows/main.cpp | 9 +++++++++ desmume/src/windows/main.h | 1 + 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/desmume/src/windows/aviout.cpp b/desmume/src/windows/aviout.cpp index 54669a3bb..fe396d8dd 100644 --- a/desmume/src/windows/aviout.cpp +++ b/desmume/src/windows/aviout.cpp @@ -18,7 +18,7 @@ * along with DeSmuME; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ - +#include "main.h" //I added this so that this file could gain access to SetMessageToDisplay. #include "types.h" #include "windriver.h" #include "console.h" @@ -374,8 +374,10 @@ bool DRV_AviBegin(const char* fname) } // Don't display at file splits - if(!avi_segnum) + if(!avi_segnum) { EMU_PrintMessage("AVI recording started."); + SetMessageToDisplay("AVI recording started."); + } strncpy(saved_cur_avi_fnameandext,fname,MAX_PATH); strncpy(saved_avi_fname,fname,MAX_PATH); @@ -438,8 +440,10 @@ void DRV_AviEnd() return; // Don't display if we're just starting another segment - if(avi_file->tBytes <= 2097152000) + if(avi_file->tBytes <= 2097152000) { EMU_PrintMessage("AVI recording ended."); + SetMessageToDisplay("AVI recording ended."); + } avi_destroy(&avi_file); } diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index f68df57bf..114c43ced 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -3722,4 +3722,13 @@ void ResetGame() CheatsSearchReset(); NDS_Reset(); frameCounter=0; +} + +void SetMessageToDisplay(const char *message) +{ + MessageToDisplay.str(""); //adelikat: Clear previous message //TODO set up a queue system, and/or a multiline system, instead of rudely cancelling out messages. + //adelikat: TODO: set up a function that does the clearing and setting of the counter, so this code doesn't have to be done all over the place + // make the function receive an int for the counter, but overload so that if no int, 120 is used + MessageToDisplay << message; + displayMessageCounter = 120;// } \ No newline at end of file diff --git a/desmume/src/windows/main.h b/desmume/src/windows/main.h index fae1614fe..fd4727669 100644 --- a/desmume/src/windows/main.h +++ b/desmume/src/windows/main.h @@ -15,6 +15,7 @@ void FrameAdvance(); void ResetGame(); //Resets game (for the menu item & hotkey void AviRecordTo(); void AviEnd(); +void SetMessageToDisplay(const char *message); //For sending output to the main screen extern bool ShowInputDisplay; extern bool frameCounterDisplay;