added gui.cpp functions to gui.h and compiled/linked gui.cpp
sdl.cpp had a #include "gui.cpp" line, rather than including the gui.h header (which was lacking). All the declarations are now in gui.h and gui.cpp is in the sources_list
This commit is contained in:
parent
40231420d1
commit
3d05dad95e
|
@ -7,21 +7,23 @@ if env['PLATFORM'] == 'darwin':
|
|||
env.ParseConfig(config_string)
|
||||
Export('env')
|
||||
|
||||
source_list = Split("""
|
||||
input.cpp
|
||||
config.cpp
|
||||
sdl.cpp
|
||||
sdl-joystick.cpp
|
||||
sdl-sound.cpp
|
||||
sdl-throttle.cpp
|
||||
sdl-video.cpp
|
||||
unix-netplay.cpp
|
||||
""")
|
||||
source_list = Split(
|
||||
"""
|
||||
input.cpp
|
||||
config.cpp
|
||||
sdl.cpp
|
||||
gui.cpp
|
||||
sdl-joystick.cpp
|
||||
sdl-sound.cpp
|
||||
sdl-throttle.cpp
|
||||
sdl-video.cpp
|
||||
unix-netplay.cpp
|
||||
game.cpp
|
||||
""")
|
||||
|
||||
Import('env')
|
||||
if 'GL' in env['LIBS']:
|
||||
source_list.append('sdl-opengl.cpp')
|
||||
|
||||
for x in range(len(source_list)):
|
||||
source_list[x] = 'drivers/sdl/' + source_list[x]
|
||||
source_list = ['drivers/sdl/' + source for source in source_list]
|
||||
Return('source_list')
|
||||
|
|
|
@ -235,9 +235,13 @@ InitConfig()
|
|||
config->addOption("mute", "SDL.MuteCapture", 0);
|
||||
#endif
|
||||
|
||||
|
||||
// auto load/save on gameload/close
|
||||
config->addOption("loadstate", "SDL.AutoLoadState", INVALID_STATE);
|
||||
config->addOption("savestate", "SDL.AutoSaveState", INVALID_STATE);
|
||||
|
||||
//TODO implement this
|
||||
config->addOption("periodicsaves", "SDL.PeriodicSaves", 0);
|
||||
|
||||
|
||||
#ifdef _GTK
|
||||
char* home_dir = getenv("HOME");
|
||||
|
|
|
@ -21,8 +21,6 @@ enum HOTKEY { HK_CHEAT_MENU=0, HK_BIND_STATE, HK_LOAD_LUA, HK_TOGGLE_BG,
|
|||
HK_SELECT_STATE_8, HK_SELECT_STATE_9,
|
||||
HK_SELECT_STATE_NEXT, HK_SELECT_STATE_PREV, HK_MAX};
|
||||
|
||||
const int INVALID_STATE = 99;
|
||||
|
||||
|
||||
static const char* HotkeyStrings[HK_MAX] = {
|
||||
"CheatMenu",
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#ifndef FCEUX_GUI_H
|
||||
#define FCEUX_GUI_H
|
||||
|
||||
#define GTK
|
||||
#include <gtk/gtk.h>
|
||||
extern GtkWidget* MainWindow;
|
||||
|
@ -26,7 +27,90 @@ extern GtkWidget* evbox;
|
|||
extern GtkRadioAction* stateSlot;
|
||||
extern int GtkMouseData[3];
|
||||
extern bool gtkIsStarted;
|
||||
|
||||
int InitGTKSubsystem(int argc, char** argv);
|
||||
void pushOutputToGTK(const char* str);
|
||||
void showGui(bool b);
|
||||
|
||||
bool checkGTKVersion(int major_required, int minor_required);
|
||||
|
||||
int configHotkey(char* hotkeyString);
|
||||
int configGamepadButton(GtkButton* button, gpointer p);
|
||||
|
||||
void resetVideo();
|
||||
void closeVideoWin(GtkWidget* w, GdkEvent* e, gpointer p);
|
||||
void closeDialog(GtkWidget* w, GdkEvent* e, gpointer p);
|
||||
|
||||
void toggleLowPass(GtkWidget* w, gpointer p);
|
||||
void toggleOption(GtkWidget* w, gpointer p);
|
||||
|
||||
int setTint(GtkWidget* w, gpointer p);
|
||||
int setHue(GtkWidget* w, gpointer p);
|
||||
void loadPalette (GtkWidget* w, gpointer p);
|
||||
void clearPalette(GtkWidget* w, gpointer p);
|
||||
void openPaletteConfig();
|
||||
|
||||
void launchNet(GtkWidget* w, gpointer p);
|
||||
void setUsername(GtkWidget* w, gpointer p);
|
||||
void netResponse(GtkWidget* w, gint response_id, gpointer p);
|
||||
void openNetworkConfig();
|
||||
void flushGtkEvents();
|
||||
|
||||
void openHotkeyConfig();
|
||||
int setInputDevice(GtkWidget* w, gpointer p);
|
||||
void updateGamepadConfig(GtkWidget* w, gpointer p);
|
||||
void openGamepadConfig();
|
||||
|
||||
int setBufSize(GtkWidget* w, gpointer p);
|
||||
void setRate(GtkWidget* w, gpointer p);
|
||||
void setQuality(GtkWidget* w, gpointer p);
|
||||
void resizeGtkWindow();
|
||||
void setScaler(GtkWidget* w, gpointer p);
|
||||
int setXscale(GtkWidget* w, gpointer p);
|
||||
int setYscale(GtkWidget* w, gpointer p);
|
||||
|
||||
#ifdef OPENGL
|
||||
void setGl(GtkWidget* w, gpointer p);
|
||||
void setDoubleBuffering(GtkWidget* w, gpointer p);
|
||||
#endif
|
||||
|
||||
void openVideoConfig();
|
||||
int mixerChanged(GtkWidget* w, gpointer p);
|
||||
void openSoundConfig();
|
||||
void quit ();
|
||||
void openAbout ();
|
||||
void toggleSound(GtkWidget* check, gpointer data);
|
||||
|
||||
void emuReset ();
|
||||
void hardReset ();
|
||||
void enableFullscreen ();
|
||||
void toggleAutoResume (GtkToggleAction *action);
|
||||
|
||||
void recordMovie();
|
||||
void recordMovieAs ();
|
||||
void loadMovie ();
|
||||
#ifdef _S9XLUA_H
|
||||
void loadLua ();
|
||||
#endif
|
||||
void loadFdsBios ();
|
||||
|
||||
void enableGameGenie(int enabled);
|
||||
void toggleGameGenie(GtkToggleAction *action);
|
||||
void togglePause(GtkAction *action);
|
||||
void loadGameGenie ();
|
||||
|
||||
void loadNSF ();
|
||||
void closeGame();
|
||||
void loadGame ();
|
||||
void saveStateAs();
|
||||
void loadStateFrom();
|
||||
void quickLoad();
|
||||
void quickSave();
|
||||
void changeState(GtkAction *action, GtkRadioAction *current, gpointer data);
|
||||
unsigned short GDKToSDLKeyval(int gdk_key);
|
||||
gint convertKeypress(GtkWidget *grab, GdkEventKey *event, gpointer user_data);
|
||||
gint handleMouseClick(GtkWidget* widget, GdkEvent *event, gpointer callback_data);
|
||||
void handle_resize(GtkWindow* win, GdkEvent* event, gpointer data);
|
||||
int InitGTKSubsystem(int argc, char** argv);
|
||||
|
||||
#endif // ifndef FCEUX_GUI_H
|
||||
|
|
|
@ -12,6 +12,8 @@ typedef struct {
|
|||
//uint64 DeviceID[MAXBUTTCONFIG]; /* TODO */
|
||||
} ButtConfig;
|
||||
|
||||
|
||||
extern int NoWaiting;
|
||||
extern CFGSTRUCT InputConfig[];
|
||||
extern ARGPSTRUCT InputArgs[];
|
||||
extern int Hotkeys[];
|
||||
|
|
|
@ -36,8 +36,6 @@ extern int eoptions;
|
|||
#define EO_LOWPASS 512
|
||||
#define EO_AUTOHIDE 1024
|
||||
|
||||
extern int NoWaiting;
|
||||
|
||||
extern int _sound;
|
||||
extern long soundrate;
|
||||
extern long soundbufsize;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "sdl.h"
|
||||
#include "input.h"
|
||||
#include <SDL_net.h>
|
||||
#include "sdl-netplay.h"
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
#ifdef _GTK
|
||||
#include <gtk/gtk.h>
|
||||
#include "gui.cpp"
|
||||
#include "gui.h"
|
||||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
|
@ -126,8 +126,8 @@ static const char *DriverUsage=
|
|||
"--rp2mic {0|1} Replace Port 2 Start with microphone (Famicom).\n"
|
||||
"--nogui Don't load the GTK GUI\n"
|
||||
"--4buttonexit {0|1} exit the emulator when A+B+Select+Start is pressed\n"
|
||||
"--savestate {0-9|>9} load from the given state when the game is loaded\n"
|
||||
"--loadstate {0-9|>9} save to the given state when the game is closed\n"
|
||||
"--loadstate {0-9|>9} load from the given state when the game is loaded\n"
|
||||
"--savestate {0-9|>9} save to the given state when the game is closed\n"
|
||||
" to not save/load automatically provide a number\n"
|
||||
" greater than 9\n";
|
||||
|
||||
|
|
|
@ -6,15 +6,19 @@
|
|||
#else
|
||||
#include <SDL.h>
|
||||
#endif
|
||||
|
||||
#include "main.h"
|
||||
#include "dface.h"
|
||||
#include "input.h"
|
||||
|
||||
static void DoFun(int frameskip);
|
||||
static int isloaded = 0;
|
||||
const int INVALID_STATE = 99;
|
||||
|
||||
extern int noGui;
|
||||
extern int isloaded;
|
||||
|
||||
int LoadGame(const char *path);
|
||||
int CloseGame(void);
|
||||
void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count);
|
||||
uint64 FCEUD_GetTime();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
//consider changing this to use sdl net stuff?
|
||||
|
||||
#include "main.h"
|
||||
#include "input.h"
|
||||
#include "dface.h"
|
||||
#include "unix-netplay.h"
|
||||
|
||||
|
|
Loading…
Reference in New Issue