switched header files in sdl/ directory to c++ headers

This commit is contained in:
xhainingx 2013-04-16 19:53:01 +00:00
parent acc1a07c1e
commit 7abad425c5
10 changed files with 93 additions and 86 deletions

View File

@ -1,13 +1,3 @@
#include <unistd.h>
#include <sys/types.h>
#include <csignal>
#include <sys/time.h>
#include <sys/stat.h>
#include <cstring>
#include <cerrno>
#include <cstdio>
#include <cstdlib>
#include "main.h"
#include "throttle.h"
#include "config.h"
@ -25,6 +15,16 @@
#include <windows.h>
#endif
#include <unistd.h>
#include <csignal>
#include <cstring>
#include <cerrno>
#include <cstdio>
#include <cstdlib>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/types.h>
/**
* Read a custom pallete from a file and load it into the core.

View File

@ -1,15 +1,3 @@
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <gdk/gdkx.h>
#ifdef _GTK3
#include <gdk/gdkkeysyms-compat.h>
#endif
#include <fstream>
#include <iostream>
#include <cstdlib>
#include "../../types.h"
#include "../../fceu.h"
#include "../../driver.h"
@ -30,6 +18,18 @@
#include "../../fceulua.h"
#endif
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <gdk/gdkx.h>
#ifdef _GTK3
#include <gdk/gdkkeysyms-compat.h>
#endif
#include <fstream>
#include <iostream>
#include <cstdlib>
// 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));

View File

@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <cstring>
#include <cstdio>
#include "main.h"
#include "dface.h"
#include "input.h"
@ -47,6 +44,9 @@
#endif
#include <cstring>
#include <cstdio>
/** GLOBALS **/
int NoWaiting = 1;
extern Config *g_config;

View File

@ -22,12 +22,12 @@
/// \file
/// \brief Handles joystick input using the SDL.
#include <stdlib.h>
#include "sdl.h"
#include <cstdlib>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include "sdl.h"
#include <cerrno>
#define MAX_JOYSTICKS 32
static SDL_Joystick *s_Joysticks[MAX_JOYSTICKS] = {NULL};

View File

@ -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 <OpenGL/gl.h>
#include <OpenGL/glu.h>
@ -8,13 +14,8 @@
#include <GL/glu.h>
#include <GL/glext.h>
#endif
#include <string.h>
#include <stdlib.h>
#include "sdl.h"
#include "sdl-opengl.h"
#include "../common/vidblit.h"
#include "../../utils/memory.h"
#include <cstring>
#include <cstdlib>
#ifndef APIENTRY
#define APIENTRY

View File

@ -21,15 +21,15 @@
/// \file
/// \brief Handles sound emulation using the SDL.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "sdl.h"
#include "../common/configSys.h"
#include "../../utils/memory.h"
#include <cstdio>
#include <cstring>
#include <cstdlib>
extern Config *g_config;
static volatile int *s_Buffer = 0;

View File

@ -21,10 +21,6 @@
/// \file
/// \brief Handles the graphical game display for the SDL implementation.
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include "sdl.h"
#include "sdl-opengl.h"
#include "../common/vidblit.h"
@ -49,6 +45,10 @@
#include <gdk/gdkx.h>
#endif
#include <cstdio>
#include <cstring>
#include <cstdlib>
// GLOBALS
extern Config *g_config;

View File

@ -1,22 +1,3 @@
#include <unistd.h>
#include <sys/types.h>
#include <csignal>
#include <sys/time.h>
#include <sys/stat.h>
#include <cstring>
#include <cerrno>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <climits>
#include <cmath>
#ifdef _GTK
#include <gtk/gtk.h>
#include "gui.cpp"
#endif
#include "main.h"
#include "throttle.h"
#include "config.h"
@ -48,6 +29,25 @@
#include <windows.h>
#endif
#ifdef _GTK
#include <gtk/gtk.h>
#include "gui.cpp"
#endif
#include <unistd.h>
#include <csignal>
#include <cstring>
#include <cerrno>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <cmath>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <iostream>
#include <fstream>
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; n<Count; ++n)
MonoBuf[n] = Buffer[n] & 0xFFFF;
@ -356,7 +357,7 @@ FCEUD_Update(uint8 *XBuf,
FSettings.SndRate, 16, 1,
Count
);
free(MonoBuf);
delete [] MonoBuf;
}
Count /= 2;
if(inited & 1)
@ -589,8 +590,9 @@ int main(int argc, char *argv[])
// This is here so that a default fceux.cfg will be created on first
// run, even without a valid ROM to play.
// Unless, of course, there's actually --no-config given
// mbg 8/23/2008 - this is also here so that the inputcfg routines can have a chance to dump the new inputcfg to the fceux.cfg
// in case you didnt specify a rom filename
// mbg 8/23/2008 - this is also here so that the inputcfg routines can have
// a chance to dump the new inputcfg to the fceux.cfg in case you didnt
// specify a rom filename
g_config->getOption("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

View File

@ -21,19 +21,26 @@
//todo - ensure that #ifdef WIN32 makes sense
//consider changing this to use sdl net stuff?
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <errno.h>
#include <fcntl.h>
#include "main.h"
#include "dface.h"
#include "unix-netplay.h"
#include "../../fceu.h"
#include "../../utils/md5.h"
#include "../../utils/memory.h"
#include <string>
#include "../common/configSys.h"
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cerrno>
#include <fcntl.h>
#ifdef WIN32
#include <winsock.h>
#else
@ -45,13 +52,6 @@
#include <netdb.h>
#endif
#include "../../fceu.h"
#include "../../utils/md5.h"
#include "../../utils/memory.h"
#include <string>
#include "../common/configSys.h"
extern Config *g_config;
#ifndef socklen_t

View File

@ -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();
}