mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
[nk] remove some nk references, fix carriage returns
This commit is contained in:
parent
4dd7bc4f72
commit
8ce0f9cf0a
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
/* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "nk_menu.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <file/file_path.h>
|
||||
#include <string/stdstring.h>
|
||||
#include <lists/string_list.h>
|
||||
|
||||
#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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "nk_menu.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <file/file_path.h>
|
||||
#include <string/stdstring.h>
|
||||
#include <lists/string_list.h>
|
||||
|
||||
#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);
|
||||
}
|
||||
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "nk_menu.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <file/file_path.h>
|
||||
#include <string/stdstring.h>
|
||||
#include <lists/string_list.h>
|
||||
|
||||
#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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "nk_menu.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <file/file_path.h>
|
||||
#include <string/stdstring.h>
|
||||
#include <lists/string_list.h>
|
||||
|
||||
#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);
|
||||
}
|
||||
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "nk_menu.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <file/file_path.h>
|
||||
#include <string/stdstring.h>
|
||||
#include <lists/string_list.h>
|
||||
|
||||
#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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "nk_menu.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <file/file_path.h>
|
||||
#include <string/stdstring.h>
|
||||
#include <lists/string_list.h>
|
||||
|
||||
#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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user