From 7abad425c54fdedc380ab4ce1145c39b9e826be9 Mon Sep 17 00:00:00 2001 From: xhainingx Date: Tue, 16 Apr 2013 19:53:01 +0000 Subject: [PATCH] switched header files in sdl/ directory to c++ headers --- trunk/src/drivers/sdl/config.cpp | 20 +++++------ trunk/src/drivers/sdl/gui.cpp | 26 +++++++------- trunk/src/drivers/sdl/input.cpp | 6 ++-- trunk/src/drivers/sdl/sdl-joystick.cpp | 8 ++--- trunk/src/drivers/sdl/sdl-opengl.cpp | 15 ++++---- trunk/src/drivers/sdl/sdl-sound.cpp | 8 ++--- trunk/src/drivers/sdl/sdl-video.cpp | 8 ++--- trunk/src/drivers/sdl/sdl.cpp | 49 ++++++++++++++------------ trunk/src/drivers/sdl/unix-netplay.cpp | 32 ++++++++--------- trunk/src/input.cpp | 7 ++-- 10 files changed, 93 insertions(+), 86 deletions(-) diff --git a/trunk/src/drivers/sdl/config.cpp b/trunk/src/drivers/sdl/config.cpp index b19d3d51..2105c423 100644 --- a/trunk/src/drivers/sdl/config.cpp +++ b/trunk/src/drivers/sdl/config.cpp @@ -1,13 +1,3 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "main.h" #include "throttle.h" #include "config.h" @@ -25,6 +15,16 @@ #include #endif +#include + +#include +#include +#include +#include +#include +#include +#include +#include /** * Read a custom pallete from a file and load it into the core. diff --git a/trunk/src/drivers/sdl/gui.cpp b/trunk/src/drivers/sdl/gui.cpp index a911db93..de8a5cfb 100644 --- a/trunk/src/drivers/sdl/gui.cpp +++ b/trunk/src/drivers/sdl/gui.cpp @@ -1,15 +1,3 @@ -#include -#include -#include - -#ifdef _GTK3 -#include -#endif - -#include -#include -#include - #include "../../types.h" #include "../../fceu.h" #include "../../driver.h" @@ -30,6 +18,18 @@ #include "../../fceulua.h" #endif +#include +#include +#include + +#ifdef _GTK3 +#include +#endif + +#include +#include +#include + // Fix compliation errors for older version of GTK (Ubuntu 10.04 LTS) #if GTK_MINOR_VERSION < 24 && GTK_MAJOR_VERSION == 2 #define GTK_COMBO_BOX_TEXT GTK_COMBO_BOX @@ -517,7 +517,7 @@ void openHotkeyConfig() SDL_GetKeyName((SDLKey)keycode), #endif -1); - gtk_tree_store_append(hotkey_store, &iter, NULL); // acquire child iterator + gtk_tree_store_append(hotkey_store, &iter, NULL); // acquire child iterator } tree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(hotkey_store)); diff --git a/trunk/src/drivers/sdl/input.cpp b/trunk/src/drivers/sdl/input.cpp index 2e00428c..68c90d7a 100644 --- a/trunk/src/drivers/sdl/input.cpp +++ b/trunk/src/drivers/sdl/input.cpp @@ -18,9 +18,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include - #include "main.h" #include "dface.h" #include "input.h" @@ -47,6 +44,9 @@ #endif +#include +#include + /** GLOBALS **/ int NoWaiting = 1; extern Config *g_config; diff --git a/trunk/src/drivers/sdl/sdl-joystick.cpp b/trunk/src/drivers/sdl/sdl-joystick.cpp index d0462cae..690b012b 100644 --- a/trunk/src/drivers/sdl/sdl-joystick.cpp +++ b/trunk/src/drivers/sdl/sdl-joystick.cpp @@ -22,12 +22,12 @@ /// \file /// \brief Handles joystick input using the SDL. -#include +#include "sdl.h" + +#include #include #include -#include - -#include "sdl.h" +#include #define MAX_JOYSTICKS 32 static SDL_Joystick *s_Joysticks[MAX_JOYSTICKS] = {NULL}; diff --git a/trunk/src/drivers/sdl/sdl-opengl.cpp b/trunk/src/drivers/sdl/sdl-opengl.cpp index 919fbeb4..ce8562fc 100644 --- a/trunk/src/drivers/sdl/sdl-opengl.cpp +++ b/trunk/src/drivers/sdl/sdl-opengl.cpp @@ -1,4 +1,10 @@ #define GL_GLEXT_LEGACY + +#include "sdl.h" +#include "sdl-opengl.h" +#include "../common/vidblit.h" +#include "../../utils/memory.h" + #ifdef APPLEOPENGL #include #include @@ -8,13 +14,8 @@ #include #include #endif -#include -#include - -#include "sdl.h" -#include "sdl-opengl.h" -#include "../common/vidblit.h" -#include "../../utils/memory.h" +#include +#include #ifndef APIENTRY #define APIENTRY diff --git a/trunk/src/drivers/sdl/sdl-sound.cpp b/trunk/src/drivers/sdl/sdl-sound.cpp index 02794f56..55ef7679 100644 --- a/trunk/src/drivers/sdl/sdl-sound.cpp +++ b/trunk/src/drivers/sdl/sdl-sound.cpp @@ -21,15 +21,15 @@ /// \file /// \brief Handles sound emulation using the SDL. -#include -#include -#include - #include "sdl.h" #include "../common/configSys.h" #include "../../utils/memory.h" +#include +#include +#include + extern Config *g_config; static volatile int *s_Buffer = 0; diff --git a/trunk/src/drivers/sdl/sdl-video.cpp b/trunk/src/drivers/sdl/sdl-video.cpp index 840cb904..df629913 100644 --- a/trunk/src/drivers/sdl/sdl-video.cpp +++ b/trunk/src/drivers/sdl/sdl-video.cpp @@ -21,10 +21,6 @@ /// \file /// \brief Handles the graphical game display for the SDL implementation. -#include -#include -#include - #include "sdl.h" #include "sdl-opengl.h" #include "../common/vidblit.h" @@ -49,6 +45,10 @@ #include #endif +#include +#include +#include + // GLOBALS extern Config *g_config; diff --git a/trunk/src/drivers/sdl/sdl.cpp b/trunk/src/drivers/sdl/sdl.cpp index 55d2c897..17fdb4e8 100644 --- a/trunk/src/drivers/sdl/sdl.cpp +++ b/trunk/src/drivers/sdl/sdl.cpp @@ -1,22 +1,3 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef _GTK -#include -#include "gui.cpp" -#endif - #include "main.h" #include "throttle.h" #include "config.h" @@ -48,6 +29,25 @@ #include #endif +#ifdef _GTK +#include +#include "gui.cpp" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + extern double g_fpsScale; extern bool MaxSpeed; @@ -64,6 +64,7 @@ int eoptions=0; static void DriverKill(void); static int DriverInitialize(FCEUGI *gi); +uint64 FCEUD_GetTime(); int gametype = 0; #ifdef CREATE_AVI int mutecapture; @@ -346,7 +347,7 @@ FCEUD_Update(uint8 *XBuf, { if(LoggingEnabled == 2) { - int16* MonoBuf = (int16*)malloc(sizeof(*MonoBuf) * Count); + int16* MonoBuf = new int16[Count]; int n; for(n=0; ngetOption("SDL.NoConfig", &noconfig); if (!noconfig) g_config->save(); @@ -902,6 +904,7 @@ int main(int argc, char *argv[]) SDL_Delay(1); while(gtk_events_pending()) gtk_main_iteration_do(FALSE); + printf("%d\n", FCEUD_GetTime()); } } else diff --git a/trunk/src/drivers/sdl/unix-netplay.cpp b/trunk/src/drivers/sdl/unix-netplay.cpp index 8de8c97b..62ba2c1e 100644 --- a/trunk/src/drivers/sdl/unix-netplay.cpp +++ b/trunk/src/drivers/sdl/unix-netplay.cpp @@ -21,19 +21,26 @@ //todo - ensure that #ifdef WIN32 makes sense //consider changing this to use sdl net stuff? -#include - -#include -#include -#include -#include -#include -#include -#include #include "main.h" #include "dface.h" #include "unix-netplay.h" +#include "../../fceu.h" +#include "../../utils/md5.h" +#include "../../utils/memory.h" + +#include +#include "../common/configSys.h" + +#include +#include +#include +#include +#include +#include +#include +#include + #ifdef WIN32 #include #else @@ -45,13 +52,6 @@ #include #endif -#include "../../fceu.h" -#include "../../utils/md5.h" -#include "../../utils/memory.h" - -#include -#include "../common/configSys.h" - extern Config *g_config; #ifndef socklen_t diff --git a/trunk/src/input.cpp b/trunk/src/input.cpp index 86b332f7..9e9a776b 100644 --- a/trunk/src/input.cpp +++ b/trunk/src/input.cpp @@ -170,9 +170,9 @@ static DECLFW(B4016) } //a main joystick port driver representing the case where nothing is plugged in -static INPUTC DummyJPort={0,0,0,0,0,0}; +static INPUTC DummyJPort={0}; //and an expansion port driver for the same ting -static INPUTCFC DummyPortFC={0,0,0,0,0,0}; +static INPUTCFC DummyPortFC={0}; //--------4 player driver for expansion port-------- @@ -1155,6 +1155,9 @@ static void MovieSubtitleToggle(void) static void UndoRedoSavestate(void) { + // FIXME this will always evaluate to true, should this be + // if (*lastSavestateMade...) to check if it holds a string or just + // a '\0'? if (lastSavestateMade && (undoSS || redoSS)) SwapSaveState(); }