Take out some header includes

This commit is contained in:
twinaphex 2019-01-19 23:15:48 +01:00
parent 1a0d5030f9
commit 0abe271909
4 changed files with 44 additions and 26 deletions

View File

@ -14,16 +14,21 @@
*/
#include <file/file_path.h>
#include <string/stdstring.h>
#include <retro_timers.h.>
#include "discord.h"
#include "discord_register.h"
#include "../deps/discord-rpc/include/discord_rpc.h"
#include "../retroarch.h"
#include "../configuration.h"
#include "../core.h"
#include "../core_info.h"
#include "../paths.h"
#include "../playlist.h"
#include "../verbosity.h"
#include "../msg_hash.h"
@ -305,11 +310,13 @@ void discord_update(enum discord_presence presence)
discord_presence.instance = 0;
break;
case DISCORD_PRESENCE_GAME_PAUSED:
discord_presence.smallImageKey = "paused";
discord_presence.smallImageText = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PAUSED);
discord_presence.details = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME_PAUSED);
pause_time = time(0);
ellapsed_time = difftime(time(0), start_time);
discord_presence.smallImageKey = "paused";
discord_presence.smallImageText = msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PAUSED);
discord_presence.details = msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME_PAUSED);
pause_time = time(0);
ellapsed_time = difftime(time(0), start_time);
discord_presence.startTimestamp = pause_time;
break;
case DISCORD_PRESENCE_GAME:
@ -339,13 +346,15 @@ void discord_update(enum discord_presence presence)
if (pause_time != 0)
start_time = time(0) - ellapsed_time;
pause_time = 0;
pause_time = 0;
ellapsed_time = 0;
discord_presence.smallImageKey = "playing";
discord_presence.smallImageText = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING);
discord_presence.smallImageText = msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING);
discord_presence.startTimestamp = start_time;
discord_presence.details = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME);
discord_presence.details = msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME);
discord_presence.state = label;
discord_presence.instance = 0;
@ -366,9 +375,9 @@ void discord_update(enum discord_presence presence)
snprintf(join_secret, sizeof(join_secret), "%d|%s", room->id, room->nickname);
discord_presence.joinSecret = strdup(join_secret);
/* discord_presence.spectateSecret = "SPECSPECSPEC"; */
discord_presence.partyId = strdup(party_name);
discord_presence.partyMax = 0;
discord_presence.partySize = 0;
discord_presence.partyId = strdup(party_name);
discord_presence.partyMax = 0;
discord_presence.partySize = 0;
RARCH_LOG("[Discord] join secret: %s\n", join_secret);
RARCH_LOG("[Discord] party id: %s\n", party_name);

View File

@ -20,15 +20,8 @@
#include <stdarg.h>
#include <stdint.h>
#include <string.h>
#include <math.h>
#include <boolean.h>
#include <string/stdstring.h>
#include <lists/string_list.h>
#include <retro_timers.h>
#include "../deps/discord-rpc/include/discord_rpc.h"
#include "verbosity.h"
enum discord_presence
{
@ -53,13 +46,13 @@ void discord_shutdown(void);
void discord_update(enum discord_presence presence);
void discord_run_callbacks();
void discord_run_callbacks(void);
bool discord_is_ready();
bool discord_is_ready(void);
void discord_avatar_set_ready(bool ready);
bool discord_avatar_is_ready();
bool discord_avatar_is_ready(void);
char* discord_get_own_username(void);

View File

@ -293,6 +293,8 @@ bool glslang_parse_meta(const vector<string> &lines, glslang_meta *meta)
for (auto &line : lines)
{
const char *line_c = line.c_str();
if (line.find("#pragma name ") == 0)
{
const char *str = NULL;
@ -303,7 +305,7 @@ bool glslang_parse_meta(const vector<string> &lines, glslang_meta *meta)
return false;
}
str = line.c_str() + strlen("#pragma name ");
str = line_c + strlen("#pragma name ");
while (*str == ' ')
str++;
@ -312,7 +314,7 @@ bool glslang_parse_meta(const vector<string> &lines, glslang_meta *meta)
else if (line.find("#pragma parameter ") == 0)
{
float initial, minimum, maximum, step;
int ret = sscanf(line.c_str(), "#pragma parameter %63s \"%63[^\"]\" %f %f %f %f",
int ret = sscanf(line_c, "#pragma parameter %63s \"%63[^\"]\" %f %f %f %f",
id, desc, &initial, &minimum, &maximum, &step);
if (ret == 5)
@ -347,7 +349,7 @@ bool glslang_parse_meta(const vector<string> &lines, glslang_meta *meta)
}
else
{
RARCH_ERR("[slang]: Invalid #pragma parameter line: \"%s\".\n", line.c_str());
RARCH_ERR("[slang]: Invalid #pragma parameter line: \"%s\".\n", line_c);
return false;
}
}
@ -361,7 +363,7 @@ bool glslang_parse_meta(const vector<string> &lines, glslang_meta *meta)
return false;
}
str = line.c_str() + strlen("#pragma format ");
str = line_c + strlen("#pragma format ");
while (*str == ' ')
str++;

View File

@ -1,4 +1,18 @@

/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2017 - Hans-Kristian Arntzen
*
* 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 <fstream>
#include <iostream>
#include <spirv_glsl.hpp>