diff --git a/menu/drivers/nuklear/nk_menu.c b/menu/drivers/nuklear/nk_menu.c index 5e74be2ddf..6174d86326 100644 --- a/menu/drivers/nuklear/nk_menu.c +++ b/menu/drivers/nuklear/nk_menu.c @@ -1,37 +1,37 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2011-2016 - Daniel De Matteis - * Copyright (C) 2014-2015 - Jean-André Santoni - * Copyright (C) 2016 - Andrés Suárez - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . - */ - - - /* This file is intended for helper functions, custom controls, etc. */ - -#include "nk_menu.h" - -/* sets window position and size */ -void nk_wnd_set_state(nk_menu_handle_t *zr, const int id, - struct nk_vec2 pos, struct nk_vec2 size) -{ - zr->window[id].position = pos; - zr->window[id].size = size; -} - -/* gets window position and size */ -void nk_wnd_get_state(nk_menu_handle_t *zr, const int id, - struct nk_vec2 *pos, struct nk_vec2 *size) -{ - *pos = zr->window[id].position; - *size = zr->window[id].size; -} +/* RetroArch - A frontend for libretro. + * Copyright (C) 2011-2016 - Daniel De Matteis + * Copyright (C) 2014-2015 - Jean-André Santoni + * Copyright (C) 2016 - Andrés Suárez + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + + + /* This file is intended for helper functions, custom controls, etc. */ + +#include "nk_menu.h" + +/* sets window position and size */ +void nk_wnd_set_state(nk_menu_handle_t *nk, const int id, + struct nk_vec2 pos, struct nk_vec2 size) +{ + nk->window[id].position = pos; + nk->window[id].size = size; +} + +/* gets window position and size */ +void nk_wnd_get_state(nk_menu_handle_t *nk, const int id, + struct nk_vec2 *pos, struct nk_vec2 *size) +{ + *pos = nk->window[id].position; + *size = nk->window[id].size; +} diff --git a/menu/drivers/nuklear/nk_menu.h b/menu/drivers/nuklear/nk_menu.h index b479b4c63f..495ae679cf 100644 --- a/menu/drivers/nuklear/nk_menu.h +++ b/menu/drivers/nuklear/nk_menu.h @@ -85,13 +85,13 @@ typedef struct nk_menu_handle video_font_raster_block_t list_block; } nk_menu_handle_t; -void nk_wnd_shader_parameters(nk_menu_handle_t *zr); -void nk_wnd_main(nk_menu_handle_t *zr); +void nk_wnd_shader_parameters(nk_menu_handle_t *nk); +void nk_wnd_main(nk_menu_handle_t *nk); bool nk_wnd_file_picker(nk_menu_handle_t *nk, const char* in, char* out, const char* filter); -void nk_wnd_settings(nk_menu_handle_t *zr); -void nk_wnd_set_state(nk_menu_handle_t *zr, const int id, +void nk_wnd_settings(nk_menu_handle_t *nk); +void nk_wnd_set_state(nk_menu_handle_t *nk, const int id, struct nk_vec2 pos, struct nk_vec2 size); -void nk_wnd_get_state(nk_menu_handle_t *zr, const int id, +void nk_wnd_get_state(nk_menu_handle_t *nk, const int id, struct nk_vec2 *pos, struct nk_vec2 *size); #endif diff --git a/menu/drivers/nuklear/nk_wnd_main.c b/menu/drivers/nuklear/nk_wnd_main.c index 0922b6b25c..14a8e3cf76 100644 --- a/menu/drivers/nuklear/nk_wnd_main.c +++ b/menu/drivers/nuklear/nk_wnd_main.c @@ -1,50 +1,50 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2011-2016 - Daniel De Matteis - * Copyright (C) 2014-2015 - Jean-André Santoni - * Copyright (C) 2016 - Andrés Suárez - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . - */ - -#include "nk_menu.h" - -#include -#include -#include -#include - -#include -#include -#include - -#include "../../menu_driver.h" -#include "../../menu_hash.h" - -void nk_wnd_main(nk_menu_handle_t *zr) -{ - unsigned i; - video_shader_ctx_t shader_info; - struct nk_panel layout; - struct nk_context *ctx = &zr->ctx; - const int id = NK_WND_MAIN; - - if (nk_begin(ctx, &layout, "Main", nk_rect(240, 10, 300, 400), - NK_WINDOW_CLOSABLE|NK_WINDOW_MINIMIZABLE|NK_WINDOW_MOVABLE| - NK_WINDOW_SCALABLE|NK_WINDOW_BORDER)) - { - nk_layout_row_dynamic(ctx, 30, 1); - } - - /* save position and size to restore after context reset */ - nk_wnd_set_state(zr, id, nk_window_get_position(ctx), nk_window_get_size(ctx)); - nk_end(ctx); -} +/* RetroArch - A frontend for libretro. + * Copyright (C) 2011-2016 - Daniel De Matteis + * Copyright (C) 2014-2015 - Jean-André Santoni + * Copyright (C) 2016 - Andrés Suárez + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + +#include "nk_menu.h" + +#include +#include +#include +#include + +#include +#include +#include + +#include "../../menu_driver.h" +#include "../../menu_hash.h" + +void nk_wnd_main(nk_menu_handle_t *nk) +{ + unsigned i; + video_shader_ctx_t shader_info; + struct nk_panel layout; + struct nk_context *ctx = &nk->ctx; + const int id = NK_WND_MAIN; + + if (nk_begin(ctx, &layout, "Main", nk_rect(240, 10, 300, 400), + NK_WINDOW_CLOSABLE|NK_WINDOW_MINIMIZABLE|NK_WINDOW_MOVABLE| + NK_WINDOW_SCALABLE|NK_WINDOW_BORDER)) + { + nk_layout_row_dynamic(ctx, 30, 1); + } + + /* save position and size to restore after context reset */ + nk_wnd_set_state(nk, id, nk_window_get_position(ctx), nk_window_get_size(ctx)); + nk_end(ctx); +} diff --git a/menu/drivers/nuklear/nk_wnd_settings.c b/menu/drivers/nuklear/nk_wnd_settings.c index 9d57ebca00..a8ce97ea1f 100644 --- a/menu/drivers/nuklear/nk_wnd_settings.c +++ b/menu/drivers/nuklear/nk_wnd_settings.c @@ -1,50 +1,50 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2011-2016 - Daniel De Matteis - * Copyright (C) 2014-2015 - Jean-André Santoni - * Copyright (C) 2016 - Andrés Suárez - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . - */ - -#include "nk_menu.h" - -#include -#include -#include -#include - -#include -#include -#include - -#include "../../menu_driver.h" -#include "../../menu_hash.h" - -void nk_wnd_settings(nk_menu_handle_t *zr) -{ - unsigned i; - video_shader_ctx_t shader_info; - struct nk_panel layout; - struct nk_context *ctx = &zr->ctx; - const int id = NK_WND_SETTINGS; - - if (nk_begin(ctx, &layout, "Settings", nk_rect(240, 10, 300, 400), - NK_WINDOW_CLOSABLE|NK_WINDOW_MINIMIZABLE|NK_WINDOW_MOVABLE| - NK_WINDOW_SCALABLE|NK_WINDOW_BORDER)) - { - nk_layout_row_dynamic(ctx, 30, 1); - } - - /* save position and size to restore after context reset */ - nk_wnd_set_state(zr, id, nk_window_get_position(ctx), nk_window_get_size(ctx)); - nk_end(ctx); -} +/* RetroArch - A frontend for libretro. + * Copyright (C) 2011-2016 - Daniel De Matteis + * Copyright (C) 2014-2015 - Jean-André Santoni + * Copyright (C) 2016 - Andrés Suárez + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + +#include "nk_menu.h" + +#include +#include +#include +#include + +#include +#include +#include + +#include "../../menu_driver.h" +#include "../../menu_hash.h" + +void nk_wnd_settings(nk_menu_handle_t *nk) +{ + unsigned i; + video_shader_ctx_t shader_info; + struct nk_panel layout; + struct nk_context *ctx = &nk->ctx; + const int id = NK_WND_SETTINGS; + + if (nk_begin(ctx, &layout, "Settings", nk_rect(240, 10, 300, 400), + NK_WINDOW_CLOSABLE|NK_WINDOW_MINIMIZABLE|NK_WINDOW_MOVABLE| + NK_WINDOW_SCALABLE|NK_WINDOW_BORDER)) + { + nk_layout_row_dynamic(ctx, 30, 1); + } + + /* save position and size to restore after context reset */ + nk_wnd_set_state(nk, id, nk_window_get_position(ctx), nk_window_get_size(ctx)); + nk_end(ctx); +} diff --git a/menu/drivers/nuklear/nk_wnd_shader_parameters.c b/menu/drivers/nuklear/nk_wnd_shader_parameters.c index 5e00f56420..55b59a09d2 100644 --- a/menu/drivers/nuklear/nk_wnd_shader_parameters.c +++ b/menu/drivers/nuklear/nk_wnd_shader_parameters.c @@ -1,72 +1,72 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2011-2016 - Daniel De Matteis - * Copyright (C) 2014-2015 - Jean-André Santoni - * Copyright (C) 2016 - Andrés Suárez - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . - */ - -#include "nk_menu.h" - -#include -#include -#include -#include - -#include -#include -#include - -#include "../../menu_driver.h" -#include "../../menu_hash.h" - -#include "../../../gfx/common/gl_common.h" -#include "../../../core_info.h" -#include "../../../configuration.h" -#include "../../../retroarch.h" - -void nk_wnd_shader_parameters(nk_menu_handle_t *zr) -{ - unsigned i; - video_shader_ctx_t shader_info; - struct nk_panel layout; - struct nk_context *ctx = &zr->ctx; - const int id = NK_WND_SHADER_PARAMETERS; - - if (nk_begin(ctx, &layout, "Shader Parameters", nk_rect(240, 10, 300, 400), - NK_WINDOW_CLOSABLE|NK_WINDOW_MINIMIZABLE|NK_WINDOW_MOVABLE| - NK_WINDOW_SCALABLE|NK_WINDOW_BORDER)) - { - nk_layout_row_dynamic(ctx, 30, 1); - - video_shader_driver_get_current_shader(&shader_info); - - if (shader_info.data) - { - for (i = 0; i < GFX_MAX_PARAMETERS; i++) - { - if (!string_is_empty(shader_info.data->parameters[i].desc)) - { - nk_property_float(ctx, shader_info.data->parameters[i].desc, - shader_info.data->parameters[i].minimum, - &(shader_info.data->parameters[i].current), - shader_info.data->parameters[i].maximum, - shader_info.data->parameters[i].step, 1); - } - } - } - } - - /* save position and size to restore after context reset */ - nk_wnd_set_state(zr, id, nk_window_get_position(ctx), nk_window_get_size(ctx)); - nk_end(ctx); -} +/* RetroArch - A frontend for libretro. + * Copyright (C) 2011-2016 - Daniel De Matteis + * Copyright (C) 2014-2015 - Jean-André Santoni + * Copyright (C) 2016 - Andrés Suárez + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + +#include "nk_menu.h" + +#include +#include +#include +#include + +#include +#include +#include + +#include "../../menu_driver.h" +#include "../../menu_hash.h" + +#include "../../../gfx/common/gl_common.h" +#include "../../../core_info.h" +#include "../../../configuration.h" +#include "../../../retroarch.h" + +void nk_wnd_shader_parameters(nk_menu_handle_t *nk) +{ + unsigned i; + video_shader_ctx_t shader_info; + struct nk_panel layout; + struct nk_context *ctx = &nk->ctx; + const int id = NK_WND_SHADER_PARAMETERS; + + if (nk_begin(ctx, &layout, "Shader Parameters", nk_rect(240, 10, 300, 400), + NK_WINDOW_CLOSABLE|NK_WINDOW_MINIMIZABLE|NK_WINDOW_MOVABLE| + NK_WINDOW_SCALABLE|NK_WINDOW_BORDER)) + { + nk_layout_row_dynamic(ctx, 30, 1); + + video_shader_driver_get_current_shader(&shader_info); + + if (shader_info.data) + { + for (i = 0; i < GFX_MAX_PARAMETERS; i++) + { + if (!string_is_empty(shader_info.data->parameters[i].desc)) + { + nk_property_float(ctx, shader_info.data->parameters[i].desc, + shader_info.data->parameters[i].minimum, + &(shader_info.data->parameters[i].current), + shader_info.data->parameters[i].maximum, + shader_info.data->parameters[i].step, 1); + } + } + } + } + + /* save position and size to restore after context reset */ + nk_wnd_set_state(nk, id, nk_window_get_position(ctx), nk_window_get_size(ctx)); + nk_end(ctx); +}