summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/sdl
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/sdl')
-rw-r--r--src/osd/sdl/input.c2
-rw-r--r--src/osd/sdl/video.h2
-rw-r--r--src/osd/sdl/window.c80
-rw-r--r--src/osd/sdl/window.h107
4 files changed, 95 insertions, 96 deletions
diff --git a/src/osd/sdl/input.c b/src/osd/sdl/input.c
index 7dbec939198..3fe3c7fcbb0 100644
--- a/src/osd/sdl/input.c
+++ b/src/osd/sdl/input.c
@@ -1941,7 +1941,7 @@ void sdlinput_poll(running_machine &machine)
machine.schedule_exit();
break;
case SDL_VIDEORESIZE:
- sdl_window_list->window_resize(event.resize.w, event.resize.h);
+ sdl_window_list->window_resize(event.resize.w, event.resize.h);
break;
#else
case SDL_TEXTINPUT:
diff --git a/src/osd/sdl/video.h b/src/osd/sdl/video.h
index 843583a8a06..195fd878f83 100644
--- a/src/osd/sdl/video.h
+++ b/src/osd/sdl/video.h
@@ -70,7 +70,7 @@ struct sdl_monitor_info
float aspect; // computed/configured aspect ratio of the physical device
int center_width; // width of first physical screen for centering
int center_height; // height of first physical screen for centering
- int monitor_x; // X position of this monitor in virtual desktop space (SDL virtual space has them all horizontally stacked, not real geometry)
+ int monitor_x; // X position of this monitor in virtual desktop space (SDL virtual space has them all horizontally stacked, not real geometry)
};
diff --git a/src/osd/sdl/window.c b/src/osd/sdl/window.c
index 91169f32f87..a08840fd852 100644
--- a/src/osd/sdl/window.c
+++ b/src/osd/sdl/window.c
@@ -101,33 +101,33 @@ static SDL_threadID window_threadid;
static sdl_draw_info draw;
struct worker_param {
- worker_param()
- : m_window(NULL), m_list(NULL), m_machine(NULL), m_resize_new_width(0), m_resize_new_height(0)
- {
- }
- worker_param(running_machine &amachine, sdl_window_info *awindow)
- : m_window(awindow), m_list(NULL), m_machine(&amachine), m_resize_new_width(0), m_resize_new_height(0)
- {
- }
- worker_param(running_machine &amachine, sdl_window_info *awindow, render_primitive_list *alist)
- : m_window(awindow), m_list(alist), m_machine(&amachine), m_resize_new_width(0), m_resize_new_height(0)
- {
- }
- worker_param(sdl_window_info *awindow, int anew_width, int anew_height)
- : m_window(awindow), m_list(NULL), m_machine(NULL), m_resize_new_width(anew_width), m_resize_new_height(anew_height)
- {
- }
- worker_param(sdl_window_info *awindow)
- : m_window(awindow), m_list(NULL), m_machine(NULL), m_resize_new_width(0), m_resize_new_height(0)
- {
- }
+ worker_param()
+ : m_window(NULL), m_list(NULL), m_machine(NULL), m_resize_new_width(0), m_resize_new_height(0)
+ {
+ }
+ worker_param(running_machine &amachine, sdl_window_info *awindow)
+ : m_window(awindow), m_list(NULL), m_machine(&amachine), m_resize_new_width(0), m_resize_new_height(0)
+ {
+ }
+ worker_param(running_machine &amachine, sdl_window_info *awindow, render_primitive_list *alist)
+ : m_window(awindow), m_list(alist), m_machine(&amachine), m_resize_new_width(0), m_resize_new_height(0)
+ {
+ }
+ worker_param(sdl_window_info *awindow, int anew_width, int anew_height)
+ : m_window(awindow), m_list(NULL), m_machine(NULL), m_resize_new_width(anew_width), m_resize_new_height(anew_height)
+ {
+ }
+ worker_param(sdl_window_info *awindow)
+ : m_window(awindow), m_list(NULL), m_machine(NULL), m_resize_new_width(0), m_resize_new_height(0)
+ {
+ }
running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
sdl_window_info *window() const { assert(m_window != NULL); return m_window; }
- render_primitive_list *list() const { return m_list; }
+ render_primitive_list *list() const { return m_list; }
int new_width() const { return m_resize_new_width; }
- int new_height() const { return m_resize_new_height; }
- // FIXME: only needed for window set-up which returns an error.
- void set_window(sdl_window_info *window) { m_window = window; }
+ int new_height() const { return m_resize_new_height; }
+ // FIXME: only needed for window set-up which returns an error.
+ void set_window(sdl_window_info *window) { m_window = window; }
private:
sdl_window_info *m_window;
render_primitive_list *m_list;
@@ -170,10 +170,10 @@ INLINE void execute_async(osd_work_callback callback, const worker_param &wp)
INLINE void execute_sync(osd_work_callback callback, const worker_param &wp)
{
- worker_param *wp_temp = (worker_param *) osd_malloc(sizeof(worker_param));
- *wp_temp = wp;
+ worker_param *wp_temp = (worker_param *) osd_malloc(sizeof(worker_param));
+ *wp_temp = wp;
- callback((void *) wp_temp, 0);
+ callback((void *) wp_temp, 0);
}
@@ -307,7 +307,7 @@ static OSDWORK_CALLBACK( sdlwindow_exit_wt )
void sdl_osd_interface::window_exit()
{
- worker_param wp_dummy;
+ worker_param wp_dummy;
ASSERT_MAIN_THREAD();
@@ -319,8 +319,8 @@ void sdl_osd_interface::window_exit()
sdl_window_info *temp = sdl_window_list;
sdl_window_list = temp->next;
temp->video_window_destroy(machine());
- // free the window itself
- global_free(temp);
+ // free the window itself
+ global_free(temp);
}
// if we're multithreaded, clean up the window thread
@@ -495,7 +495,7 @@ void sdl_window_info::window_clear()
execute_async_wait(&sdlwindow_clear_surface_wt, worker_param(this));
}
else
- execute_sync(&sdlwindow_clear_surface_wt, worker_param(this));
+ execute_sync(&sdlwindow_clear_surface_wt, worker_param(this));
}
@@ -651,12 +651,12 @@ static void sdlwindow_update_cursor_state(running_machine &machine, sdl_window_i
static OSDWORK_CALLBACK( sdlwindow_update_cursor_state_wt )
{
- worker_param * wp = (worker_param *) param;
- //sdl_window_info * window = wp->window;
+ worker_param * wp = (worker_param *) param;
+ //sdl_window_info * window = wp->window;
- sdlwindow_update_cursor_state(wp->machine(), wp->window());
+ sdlwindow_update_cursor_state(wp->machine(), wp->window());
- return NULL;
+ return NULL;
}
@@ -725,8 +725,8 @@ int sdlwindow_video_window_create(running_machine &machine, int index, sdl_monit
error:
window->video_window_destroy(machine);
- // free the window itself
- global_free(window);
+ // free the window itself
+ global_free(window);
return 1;
}
@@ -946,7 +946,7 @@ void sdl_window_info::video_window_update(running_machine &machine)
// adjust the cursor state
//sdlwindow_update_cursor_state(machine, window);
- execute_async(&sdlwindow_update_cursor_state_wt, worker_param(machine, this));
+ execute_async(&sdlwindow_update_cursor_state_wt, worker_param(machine, this));
// if we're visible and running and not in the middle of a resize, draw
if (target != NULL)
@@ -979,7 +979,7 @@ void sdl_window_info::video_window_update(running_machine &machine)
if (osd_event_wait(rendered_event, event_wait_ticks))
{
- // ensure the target bounds are up-to-date, and then get the primitives
+ // ensure the target bounds are up-to-date, and then get the primitives
render_primitive_list *primlist = &get_primitives(this);
// and redraw now
@@ -1038,7 +1038,7 @@ static OSDWORK_CALLBACK( complete_create_wt )
// if we're allowed to switch resolutions, override with something better
if (video_config.switchres)
- window->pick_best_mode(&tempwidth, &tempheight);
+ window->pick_best_mode(&tempwidth, &tempheight);
}
else if (window->windowed_width)
{
diff --git a/src/osd/sdl/window.h b/src/osd/sdl/window.h
index 39f518eab09..e8d96ef3d97 100644
--- a/src/osd/sdl/window.h
+++ b/src/osd/sdl/window.h
@@ -34,62 +34,61 @@ typedef UINT32 HashT;
struct sdl_window_info
{
-
- sdl_window_info(running_machine *a_machine, sdl_monitor_info *a_monitor,
- int index, const sdl_window_config *config)
- : next(NULL), m_minwidth(0), m_minheight(0),
- startmaximized(0),
- rendered_event(0), target(0), primlist(NULL), dxdata(NULL),
- width(0), height(0), blitwidth(0), blitheight(0),
- start_viewscreen(0),
+ sdl_window_info(running_machine *a_machine, sdl_monitor_info *a_monitor,
+ int index, const sdl_window_config *config)
+ : next(NULL), m_minwidth(0), m_minheight(0),
+ startmaximized(0),
+ rendered_event(0), target(0), primlist(NULL), dxdata(NULL),
+ width(0), height(0), blitwidth(0), blitheight(0),
+ start_viewscreen(0),
#if (SDLMAME_SDL2)
- sdl_window(NULL),
- resize_width(0),
- resize_height(0),
- last_resize(0),
+ sdl_window(NULL),
+ resize_width(0),
+ resize_height(0),
+ last_resize(0),
#else
- screen_width(0), screen_height(0),
+ screen_width(0), screen_height(0),
#endif
- m_machine(a_machine), m_monitor(a_monitor), m_fullscreen(0), m_index(0)
- {
- m_maxwidth = config->width;
- m_maxheight = config->height;
- depth = config->depth;
- refresh = config->refresh;
- m_index = index;
-
- //FIXME: these should be per_window in config-> or even better a bit set
- m_fullscreen = !video_config.windowed;
- prescale = video_config.prescale;
-
- if (!m_fullscreen)
- {
- windowed_width = config->width;
- windowed_height = config->height;
- }
- }
-
- void video_window_update(running_machine &machine);
- void blit_surface_size(int window_width, int window_height);
- void toggle_full_screen(running_machine &machine);
- void modify_prescale(running_machine &machine, int dir);
- void window_resize(INT32 width, INT32 height);
- void window_clear();
-
- void video_window_destroy(running_machine &machine);
- void pick_best_mode(int *fswidth, int *fsheight);
- void get_min_bounds(int *window_width, int *window_height, int constrain);
- void get_max_bounds(int *window_width, int *window_height, int constrain);
-
- // Pointer to next window
+ m_machine(a_machine), m_monitor(a_monitor), m_fullscreen(0), m_index(0)
+ {
+ m_maxwidth = config->width;
+ m_maxheight = config->height;
+ depth = config->depth;
+ refresh = config->refresh;
+ m_index = index;
+
+ //FIXME: these should be per_window in config-> or even better a bit set
+ m_fullscreen = !video_config.windowed;
+ prescale = video_config.prescale;
+
+ if (!m_fullscreen)
+ {
+ windowed_width = config->width;
+ windowed_height = config->height;
+ }
+ }
+
+ void video_window_update(running_machine &machine);
+ void blit_surface_size(int window_width, int window_height);
+ void toggle_full_screen(running_machine &machine);
+ void modify_prescale(running_machine &machine, int dir);
+ void window_resize(INT32 width, INT32 height);
+ void window_clear();
+
+ void video_window_destroy(running_machine &machine);
+ void pick_best_mode(int *fswidth, int *fsheight);
+ void get_min_bounds(int *window_width, int *window_height, int constrain);
+ void get_max_bounds(int *window_width, int *window_height, int constrain);
+
+ // Pointer to next window
sdl_window_info * next;
running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
sdl_monitor_info *monitor() const { return m_monitor; }
- int fullscreen() const { return m_fullscreen; }
- int index() const { return m_index; }
+ int fullscreen() const { return m_fullscreen; }
+ int index() const { return m_index; }
- void set_fullscreen(int afullscreen) { m_fullscreen = afullscreen; }
+ void set_fullscreen(int afullscreen) { m_fullscreen = afullscreen; }
// Draw Callbacks
int (*create)(sdl_window_info *window, int width, int height);
@@ -149,12 +148,12 @@ struct sdl_window_info
private:
void constrain_to_aspect_ratio(int *window_width, int *window_height, int adjustment);
- // Pointer to machine
- running_machine * m_machine;
- // monitor info
- sdl_monitor_info * m_monitor;
- int m_fullscreen;
- int m_index;
+ // Pointer to machine
+ running_machine * m_machine;
+ // monitor info
+ sdl_monitor_info * m_monitor;
+ int m_fullscreen;
+ int m_index;
};