GTK+: More consts and enums instead of #defines.

This commit is contained in:
Brandon Wright 2018-11-02 15:47:31 -05:00
parent 61d691a523
commit 4536194e32
5 changed files with 84 additions and 61 deletions

View File

@ -3,9 +3,12 @@
#include "gtk_builder_window.h" #include "gtk_builder_window.h"
#define TYPE_GAME_GENIE 0 enum
#define TYPE_ACTION_REPLAY 1 {
#define TYPE_GOLDFINGER 2 TYPE_GAME_GENIE = 0,
TYPE_ACTION_REPLAY = 1,
TYPE_GOLDFINGER = 2
};
class Snes9xCheats : public GtkBuilderWindow class Snes9xCheats : public GtkBuilderWindow
{ {

View File

@ -8,35 +8,42 @@
#include "SDL.h" #include "SDL.h"
#endif #endif
#ifndef NUM_JOYPADS const int NUM_JOYPADS = 10;
#define NUM_JOYPADS 10
#endif
#define JOY_MODE_GLOBAL 0 enum
#define JOY_MODE_INDIVIDUAL 1 {
#define JOY_MODE_CALIBRATE 2 JOY_MODE_GLOBAL = 0,
JOY_MODE_INDIVIDUAL = 1,
JOY_MODE_CALIBRATE = 2
};
#define JOY_RELEASED 0 enum
#define JOY_PRESSED 1 {
JOY_RELEASED = 0,
JOY_PRESSED = 1
};
#define PORT_COMMAND_FULLSCREEN 1 enum
#define PORT_COMMAND_SAVE_SPC 2 {
#define PORT_OPEN_ROM 3 PORT_COMMAND_FULLSCREEN = 1,
#define PORT_PAUSE 4 PORT_COMMAND_SAVE_SPC = 2,
#define PORT_SEEK_TO_FRAME 5 PORT_OPEN_ROM = 3,
#define PORT_QUIT 6 PORT_PAUSE = 4,
#define PORT_SWAP_CONTROLLERS 7 PORT_SEEK_TO_FRAME = 5,
#define PORT_REWIND 8 PORT_QUIT = 6,
#define PORT_QUICKLOAD0 9 PORT_SWAP_CONTROLLERS = 7,
#define PORT_QUICKLOAD1 10 PORT_REWIND = 8,
#define PORT_QUICKLOAD2 11 PORT_QUICKLOAD0 = 9,
#define PORT_QUICKLOAD3 12 PORT_QUICKLOAD1 = 10,
#define PORT_QUICKLOAD4 13 PORT_QUICKLOAD2 = 11,
#define PORT_QUICKLOAD5 14 PORT_QUICKLOAD3 = 12,
#define PORT_QUICKLOAD6 15 PORT_QUICKLOAD4 = 13,
#define PORT_QUICKLOAD7 16 PORT_QUICKLOAD5 = 14,
#define PORT_QUICKLOAD8 17 PORT_QUICKLOAD6 = 15,
#define PORT_QUICKLOAD9 18 PORT_QUICKLOAD7 = 16,
PORT_QUICKLOAD8 = 17,
PORT_QUICKLOAD9 = 18
};
typedef struct BindingLink typedef struct BindingLink
{ {
@ -47,8 +54,8 @@ typedef struct BindingLink
extern const BindingLink b_links[]; extern const BindingLink b_links[];
extern const int b_breaks[]; extern const int b_breaks[];
#define NUM_JOYPAD_LINKS 24 const int NUM_JOYPAD_LINKS = 24;
#define NUM_EMU_LINKS 55 const int NUM_EMU_LINKS = 55;
typedef struct JoypadBinding typedef struct JoypadBinding
{ {

View File

@ -13,37 +13,49 @@
#include "filter/epx.h" #include "filter/epx.h"
#include "filter_epx_unsafe.h" #include "filter_epx_unsafe.h"
#define FILTER_NONE 0 enum
#define FILTER_SUPEREAGLE 1 {
#define FILTER_2XSAI 2 FILTER_NONE = 0,
#define FILTER_SUPER2XSAI 3 FILTER_SUPEREAGLE = 1,
#define FILTER_EPX 4 FILTER_2XSAI = 2,
#define FILTER_EPX_SMOOTH 5 FILTER_SUPER2XSAI = 3,
#define FILTER_NTSC 6 FILTER_EPX = 4,
#define FILTER_SCANLINES 7 FILTER_EPX_SMOOTH = 5,
#define FILTER_SIMPLE2X 8 FILTER_NTSC = 6,
#define FILTER_SIMPLE3X 9 FILTER_SCANLINES = 7,
#define FILTER_SIMPLE4X 10 FILTER_SIMPLE2X = 8,
#define FILTER_HQ2X 11 FILTER_SIMPLE3X = 9,
#define FILTER_HQ3X 12 FILTER_SIMPLE4X = 10,
#define FILTER_HQ4X 13 FILTER_HQ2X = 11,
#define FILTER_2XBRZ 14 FILTER_HQ3X = 12,
#define FILTER_3XBRZ 15 FILTER_HQ4X = 13,
#define FILTER_4XBRZ 16 FILTER_2XBRZ = 14,
#define NUM_FILTERS 17 FILTER_3XBRZ = 15,
FILTER_4XBRZ = 16,
NUM_FILTERS = 17
};
#define NTSC_COMPOSITE 0 enum
#define NTSC_SVIDEO 1 {
#define NTSC_RGB 2 NTSC_COMPOSITE = 0,
NTSC_SVIDEO = 1,
NTSC_RGB = 2
};
#define ENDIAN_NORMAL 0 enum
#define ENDIAN_SWAPPED 1 {
ENDIAN_NORMAL = 0,
ENDIAN_SWAPPED = 1
};
#define JOB_FILTER 0 enum
#define JOB_CONVERT 1 {
#define JOB_SCALE_AND_CONVERT 2 JOB_FILTER = 0,
#define JOB_CONVERT_YUV 3 JOB_CONVERT = 1,
#define JOB_CONVERT_MASK 4 JOB_SCALE_AND_CONVERT = 2,
JOB_CONVERT_YUV = 3,
JOB_CONVERT_MASK = 4
};
typedef struct thread_job_t typedef struct thread_job_t
{ {

View File

@ -9,7 +9,7 @@
#include "gtk_s9x.h" #include "gtk_s9x.h"
#include "gtk_display_driver.h" #include "gtk_display_driver.h"
#define FOURCC_YUY2 0x32595559 const uint32 FOURCC_YUY2 = 0x32595559;
class S9xXVDisplayDriver : public S9xDisplayDriver class S9xXVDisplayDriver : public S9xDisplayDriver
{ {

View File

@ -3,8 +3,9 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "gtk_s9x.h" #include "port.h"
#include "gtk_builder_window.h" #include "gtk_builder_window.h"
#include "gtk_config.h"
class Snes9xWindow : public GtkBuilderWindow class Snes9xWindow : public GtkBuilderWindow
{ {