mirror of
https://github.com/libretro/RetroArch
synced 2025-02-11 15:40:28 +00:00
Cleanups/style nits
This commit is contained in:
parent
1450cc04de
commit
c477956f23
@ -28,23 +28,17 @@
|
|||||||
#include "glslang_util.h"
|
#include "glslang_util.h"
|
||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
|
|
||||||
static void get_include_file(
|
static void get_include_file(const char *line, char *s, size_t len)
|
||||||
const char *line, char *include_file, size_t len)
|
|
||||||
{
|
{
|
||||||
char *end = NULL;
|
char *end = NULL;
|
||||||
char *start = (char*)strchr(line, '\"');
|
char *start = (char*)strchr(line, '\"');
|
||||||
|
|
||||||
if (!start)
|
if (!start)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
start++;
|
start++;
|
||||||
end = (char*)strchr(start, '\"');
|
if (!(end = (char*)strchr(start, '\"')))
|
||||||
|
|
||||||
if (!end)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
*end = '\0';
|
*end = '\0';
|
||||||
strlcpy(include_file, start, len);
|
strlcpy(s, start, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool slang_texture_semantic_is_array(enum slang_texture_semantic sem)
|
bool slang_texture_semantic_is_array(enum slang_texture_semantic sem)
|
||||||
@ -116,7 +110,7 @@ bool glslang_read_shader_file(const char *path,
|
|||||||
if (string_is_empty(path) || !output)
|
if (string_is_empty(path) || !output)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
basename = path_basename_nocompression(path);
|
basename = path_basename_nocompression(path);
|
||||||
|
|
||||||
if (string_is_empty(basename))
|
if (string_is_empty(basename))
|
||||||
return false;
|
return false;
|
||||||
@ -219,7 +213,8 @@ bool glslang_read_shader_file(const char *path,
|
|||||||
include_path, path, include_file, sizeof(include_path));
|
include_path, path, include_file, sizeof(include_path));
|
||||||
|
|
||||||
/* Parse include file */
|
/* Parse include file */
|
||||||
if (!glslang_read_shader_file(include_path, output, false, include_optional)) {
|
if (!glslang_read_shader_file(include_path, output, false, include_optional))
|
||||||
|
{
|
||||||
if (include_optional)
|
if (include_optional)
|
||||||
RARCH_LOG("[slang]: Optional include not found \"%s\".\n", include_path);
|
RARCH_LOG("[slang]: Optional include not found \"%s\".\n", include_path);
|
||||||
else
|
else
|
||||||
@ -233,8 +228,8 @@ bool glslang_read_shader_file(const char *path,
|
|||||||
if (!string_list_append(output, tmp, attr))
|
if (!string_list_append(output, tmp, attr))
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
else if (!strncmp("#endif", line, STRLEN_CONST("#endif")) ||
|
else if ( !strncmp("#endif", line, STRLEN_CONST("#endif"))
|
||||||
!strncmp("#pragma", line, STRLEN_CONST("#pragma")))
|
|| !strncmp("#pragma", line, STRLEN_CONST("#pragma")))
|
||||||
{
|
{
|
||||||
/* #line seems to be ignored if preprocessor tests fail,
|
/* #line seems to be ignored if preprocessor tests fail,
|
||||||
* so we should reapply #line after each #endif.
|
* so we should reapply #line after each #endif.
|
||||||
|
@ -325,20 +325,20 @@ void gfx_thumbnail_request(
|
|||||||
/* Since task_push_pl_entry_download will shift the flag, do not attempt if it is already
|
/* Since task_push_pl_entry_download will shift the flag, do not attempt if it is already
|
||||||
* at second to last option. */
|
* at second to last option. */
|
||||||
curr_flag = playlist_get_curr_thumbnail_name_flag(playlist,idx);
|
curr_flag = playlist_get_curr_thumbnail_name_flag(playlist,idx);
|
||||||
if (curr_flag & PLAYLIST_THUMBNAIL_FLAG_NONE || curr_flag & PLAYLIST_THUMBNAIL_FLAG_SHORT_NAME)
|
if ( curr_flag & PLAYLIST_THUMBNAIL_FLAG_NONE
|
||||||
|
|| curr_flag & PLAYLIST_THUMBNAIL_FLAG_SHORT_NAME)
|
||||||
goto end;
|
goto end;
|
||||||
/* Do not try to fetch full names here, if it is not explicitly wanted */
|
/* Do not try to fetch full names here, if it is not explicitly wanted */
|
||||||
if (!settings->bools.playlist_use_filename &&
|
if ( !settings->bools.playlist_use_filename
|
||||||
!playlist_thumbnail_match_with_filename(playlist) &&
|
&& !playlist_thumbnail_match_with_filename(playlist)
|
||||||
curr_flag == PLAYLIST_THUMBNAIL_FLAG_INVALID)
|
&& curr_flag == PLAYLIST_THUMBNAIL_FLAG_INVALID)
|
||||||
playlist_update_thumbnail_name_flag(playlist, idx, PLAYLIST_THUMBNAIL_FLAG_FULL_NAME);
|
playlist_update_thumbnail_name_flag(playlist, idx, PLAYLIST_THUMBNAIL_FLAG_FULL_NAME);
|
||||||
|
|
||||||
/* Trigger thumbnail download *
|
/* Trigger thumbnail download *
|
||||||
* Note: download will grab all 3 possible thumbnails, no matter
|
* Note: download will grab all 3 possible thumbnails, no matter
|
||||||
* what left/right thumbnails are set at the moment */
|
* what left/right thumbnails are set at the moment */
|
||||||
task_push_pl_entry_thumbnail_download(
|
task_push_pl_entry_thumbnail_download(system, playlist,
|
||||||
system, playlist, (unsigned)idx,
|
(unsigned)idx, false, true);
|
||||||
false, true);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user