mirror of
https://github.com/0ldsk00l/nestopia.git
synced 2024-06-22 06:02:26 -04:00
Clean up old codepaths and improve fullscreen mode
This commit is contained in:
parent
40bd75f672
commit
f631ba0d16
|
@ -91,14 +91,6 @@ void cli_handle_command(int argc, char *argv[]) {
|
|||
if (c == -1) { break; }
|
||||
|
||||
switch(c) {
|
||||
/*case 'd':
|
||||
conf.misc_disable_gui = true;
|
||||
break;
|
||||
|
||||
case 'e':
|
||||
conf.misc_disable_gui = false;
|
||||
break;*/
|
||||
|
||||
case 'f':
|
||||
conf.video_fullscreen = true;
|
||||
break;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "ini.h"
|
||||
|
||||
settings_t conf;
|
||||
static int fs = 0;
|
||||
|
||||
void config_file_read(const char *nstdir) {
|
||||
// Read the config file
|
||||
|
@ -39,6 +40,7 @@ void config_file_read(const char *nstdir) {
|
|||
if (ini_parse(confpath, config_match, &conf) < 0) {
|
||||
fprintf(stderr, "Failed to read config file %s: Using defaults.\n", confpath);
|
||||
}
|
||||
fs = conf.video_fullscreen;
|
||||
}
|
||||
|
||||
void config_file_write(const char *nstdir) {
|
||||
|
@ -80,7 +82,7 @@ void config_file_write(const char *nstdir) {
|
|||
fprintf(fp, "linear_filter=%d\n", conf.video_linear_filter);
|
||||
fprintf(fp, "tv_aspect=%d\n", conf.video_tv_aspect);
|
||||
fprintf(fp, "unmask_overscan=%d\n", conf.video_unmask_overscan);
|
||||
fprintf(fp, "fullscreen=%d\n", conf.video_fullscreen);
|
||||
fprintf(fp, "fullscreen=%d\n", fs);
|
||||
fprintf(fp, "stretch_aspect=%d\n", conf.video_stretch_aspect);
|
||||
fprintf(fp, "unlimited_sprites=%d\n", conf.video_unlimited_sprites);
|
||||
fprintf(fp, "xbr_pixel_blending=%d\n", conf.video_xbr_pixel_blending);
|
||||
|
|
|
@ -68,6 +68,8 @@ static std::fstream *movierecfile;
|
|||
void *custompalette = NULL;
|
||||
static size_t custpalsize;
|
||||
|
||||
static int loaded = 0;
|
||||
|
||||
bool (*nst_archive_select)(const char*, char*, size_t);
|
||||
|
||||
static bool NST_CALLBACK nst_cb_videolock(void* userData, Video::Output& video) {
|
||||
|
@ -849,7 +851,6 @@ void nst_pause() {
|
|||
}
|
||||
|
||||
playing = false;
|
||||
//nstsdl_video_set_cursor();
|
||||
}
|
||||
|
||||
void nst_play() {
|
||||
|
@ -892,7 +893,6 @@ int nst_load(const char *filename) {
|
|||
if (playing) { nst_pause(); }
|
||||
|
||||
// Pull out any inserted cartridges
|
||||
static int loaded = 0;
|
||||
if (loaded) { nst_unload(); }
|
||||
nst_video_print_time("", false);
|
||||
|
||||
|
|
|
@ -210,8 +210,8 @@ void video_toggle_fullscreen() {
|
|||
void video_toggle_filter() {
|
||||
conf.video_filter++;
|
||||
if (conf.video_filter > 5) { conf.video_filter = 0; }
|
||||
//video_init();
|
||||
//nst_video_refresh();
|
||||
video_init();
|
||||
nst_video_refresh();
|
||||
}
|
||||
|
||||
void video_toggle_filterupdate() {
|
||||
|
@ -470,7 +470,7 @@ void video_set_dimensions() {
|
|||
case 5: // ScaleX
|
||||
basesize.w = Video::Output::WIDTH * scalefactor;
|
||||
basesize.h = Video::Output::HEIGHT * scalefactor;
|
||||
conf.video_tv_aspect == true ? rendersize.w = tvwidth * wscalefactor : rendersize.w = Video::Output::WIDTH * wscalefactor;;
|
||||
conf.video_tv_aspect == true ? rendersize.w = tvwidth * wscalefactor : rendersize.w = Video::Output::WIDTH * wscalefactor;
|
||||
rendersize.h = Video::Output::HEIGHT * wscalefactor;
|
||||
overscan_offset = basesize.w * OVERSCAN_TOP * scalefactor;
|
||||
overscan_height = basesize.h - (OVERSCAN_TOP + OVERSCAN_BOTTOM) * scalefactor;
|
||||
|
@ -493,15 +493,6 @@ void video_set_dimensions() {
|
|||
|
||||
// Calculate the aspect from the height because it's smaller
|
||||
float aspect = (float)screensize.h / (float)rendersize.h;
|
||||
|
||||
if (!conf.video_stretch_aspect && conf.video_fullscreen) {
|
||||
rendersize.h *= aspect;
|
||||
rendersize.w *= aspect;
|
||||
}
|
||||
else if (conf.video_fullscreen) {
|
||||
rendersize.h = screensize.h;
|
||||
rendersize.w = screensize.w;
|
||||
}
|
||||
}
|
||||
|
||||
long video_lock_screen(void*& ptr) {
|
||||
|
|
|
@ -56,7 +56,7 @@ extern bool (*nst_archive_select)(const char*, char*, size_t);
|
|||
|
||||
extern Input::Controllers *cNstPads;
|
||||
extern nstpaths_t nstpaths;
|
||||
int nst_quit = 0;
|
||||
int nst_quit = 1;
|
||||
|
||||
gpointer gtkui_emuloop(gpointer data) {
|
||||
while(!nst_quit) { nst_emuloop(); }
|
||||
|
@ -78,12 +78,6 @@ void gtkui_quit() {
|
|||
gtk_main_quit();
|
||||
}
|
||||
|
||||
void gtkui_init(int argc, char *argv[]) {
|
||||
// Initialize the GTK GUI
|
||||
gtk_init(&argc, &argv);
|
||||
gtkui_create();
|
||||
}
|
||||
|
||||
static void gtkui_glarea_realize(GtkGLArea *glarea) {
|
||||
gtk_gl_area_make_current(glarea);
|
||||
gtk_gl_area_set_has_depth_buffer(glarea, FALSE);
|
||||
|
@ -439,8 +433,6 @@ void gtkui_create() {
|
|||
gtk_widget_show_all(gtkwindow);
|
||||
|
||||
nst_video_set_dimensions_screen(gtkui_video_get_dimensions());
|
||||
|
||||
if (conf.video_fullscreen) { gtkui_video_toggle_fullscreen(); }
|
||||
}
|
||||
|
||||
void gtkui_signals_init() {
|
||||
|
@ -598,7 +590,7 @@ void gtkui_cursor_set(int curtype) {
|
|||
void gtkui_play() {
|
||||
gtkui_signals_init();
|
||||
nst_play();
|
||||
//gtkui_emuloop_start();
|
||||
|
||||
if (nst_input_zapper_present()) {
|
||||
gtkui_cursor_set(conf.misc_disable_cursor_special ? 0 : 2);
|
||||
}
|
||||
|
@ -609,7 +601,6 @@ void gtkui_play() {
|
|||
|
||||
void gtkui_pause() {
|
||||
gtkui_signals_deinit();
|
||||
//gtkui_emuloop_stop();
|
||||
nst_pause();
|
||||
}
|
||||
|
||||
|
@ -660,14 +651,18 @@ int main(int argc, char *argv[]) {
|
|||
nst_fds_bios_load();
|
||||
nst_db_load();
|
||||
|
||||
gtkui_init(argc, argv);
|
||||
// Initialize the GTK GUI
|
||||
gtk_init(&argc, &argv);
|
||||
gtkui_create();
|
||||
|
||||
// Load a rom from the command line
|
||||
if (argc > 1) {
|
||||
if (argc > 1 && argv[argc - 1][0] != '-') {
|
||||
nst_load(argv[argc - 1]);
|
||||
if (conf.video_fullscreen) { gtkui_video_toggle_fullscreen(); }
|
||||
gtkui_play();
|
||||
gtkui_set_title(nstpaths.gamename);
|
||||
}
|
||||
else if (conf.video_fullscreen) { conf.video_fullscreen = 0; }
|
||||
|
||||
// Start GTK main loop
|
||||
gtk_main();
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
void gtkui_init(int argc, char *argv[]);
|
||||
void gtkui_emuloop_start();
|
||||
void gtkui_emuloop_stop();
|
||||
void gtkui_create();
|
||||
|
|
Loading…
Reference in a new issue