Commit 4221f059 authored by nanahira's avatar nanahira

Merge branch 'master' of github.com:Fluorohydride/ygopro into develop

parents 02121635 99362157
...@@ -147,8 +147,8 @@ public: ...@@ -147,8 +147,8 @@ public:
ClientCard* menu_card{ nullptr }; ClientCard* menu_card{ nullptr };
int list_command{ 0 }; int list_command{ 0 };
virtual bool OnEvent(const irr::SEvent& event); bool OnEvent(const irr::SEvent& event) override;
virtual bool OnCommonEvent(const irr::SEvent& event); bool OnCommonEvent(const irr::SEvent& event);
void GetHoverField(int x, int y); void GetHoverField(int x, int y);
void ShowMenu(int flag, int x, int y); void ShowMenu(int flag, int x, int y);
void HideMenu(); void HideMenu();
......
...@@ -57,7 +57,6 @@ inline int _wtoi(const wchar_t * str){ ...@@ -57,7 +57,6 @@ inline int _wtoi(const wchar_t * str){
#include <string> #include <string>
#include "bufferio.h" #include "bufferio.h"
#include "../ocgcore/ocgapi.h" #include "../ocgcore/ocgapi.h"
#include "../ocgcore/common.h"
template<size_t N, typename... TR> template<size_t N, typename... TR>
inline int myswprintf(wchar_t(&buf)[N], const wchar_t* fmt, TR... args) { inline int myswprintf(wchar_t(&buf)[N], const wchar_t* fmt, TR... args) {
......
...@@ -24,7 +24,7 @@ struct CardDataC : card_data { ...@@ -24,7 +24,7 @@ struct CardDataC : card_data {
uint32_t ot{}; uint32_t ot{};
uint32_t category{}; uint32_t category{};
bool is_setcodes(std::vector <uint32_t> values) const { bool is_setcodes(const std::vector<unsigned int>& values) const {
for (auto& value : values) { for (auto& value : values) {
if (is_setcode(value)) if (is_setcode(value))
return true; return true;
......
...@@ -63,7 +63,7 @@ void DeckBuilder::Initialize() { ...@@ -63,7 +63,7 @@ void DeckBuilder::Initialize() {
mainGame->btnSideReload->setVisible(false); mainGame->btnSideReload->setVisible(false);
filterList = &deckManager._lfList[mainGame->gameConf.use_lflist ? mainGame->gameConf.default_lflist : deckManager._lfList.size() - 1].content; filterList = &deckManager._lfList[mainGame->gameConf.use_lflist ? mainGame->gameConf.default_lflist : deckManager._lfList.size() - 1].content;
ClearSearch(); ClearSearch();
rnd.reset((uint_fast32_t)time(nullptr)); rnd.reset((uint_fast32_t)std::time(nullptr));
mouse_pos.set(0, 0); mouse_pos.set(0, 0);
hovered_code = 0; hovered_code = 0;
hovered_pos = 0; hovered_pos = 0;
...@@ -1386,13 +1386,12 @@ void DeckBuilder::FilterCards() { ...@@ -1386,13 +1386,12 @@ void DeckBuilder::FilterCards() {
all, all,
name, name,
setcode setcode
} type; } type{ type_t::all };
bool exclude; bool exclude{ false };
element_t(): type(type_t::all), exclude(false) {}
}; };
const wchar_t* pstr = mainGame->ebCardName->getText(); const wchar_t* pstr = mainGame->ebCardName->getText();
int trycode = BufferIO::GetVal(pstr); int trycode = BufferIO::GetVal(pstr);
std::wstring str = std::wstring(pstr); std::wstring str{ pstr };
std::vector<element_t> query_elements; std::vector<element_t> query_elements;
if(mainGame->gameConf.search_multiple_keywords) { if(mainGame->gameConf.search_multiple_keywords) {
const wchar_t separator = mainGame->gameConf.search_multiple_keywords == 1 ? L' ' : L'+'; const wchar_t separator = mainGame->gameConf.search_multiple_keywords == 1 ? L' ' : L'+';
......
...@@ -11,7 +11,7 @@ namespace ygo { ...@@ -11,7 +11,7 @@ namespace ygo {
class DeckBuilder: public irr::IEventReceiver { class DeckBuilder: public irr::IEventReceiver {
public: public:
virtual bool OnEvent(const irr::SEvent& event); bool OnEvent(const irr::SEvent& event) override;
void Initialize(); void Initialize();
void Terminate(); void Terminate();
void GetHoveredCard(); void GetHoveredCard();
......
...@@ -843,9 +843,8 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, int len) { ...@@ -843,9 +843,8 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, int len) {
else else
starttime = new_replay.pheader.seed; starttime = new_replay.pheader.seed;
tm* localedtime = localtime(&starttime);
wchar_t timetext[40]; wchar_t timetext[40];
std::wcsftime(timetext, 40, L"%Y-%m-%d %H-%M-%S", localedtime); std::wcsftime(timetext, sizeof timetext / sizeof timetext[0], L"%Y-%m-%d %H-%M-%S", std::localtime(&starttime));
mainGame->ebRSName->setText(timetext); mainGame->ebRSName->setText(timetext);
if(!mainGame->chkAutoSaveReplay->isChecked()) { if(!mainGame->chkAutoSaveReplay->isChecked()) {
if (!auto_watch_mode) { if (!auto_watch_mode) {
......
...@@ -2006,10 +2006,9 @@ void Game::ErrorLog(const char* msg) { ...@@ -2006,10 +2006,9 @@ void Game::ErrorLog(const char* msg) {
FILE* fp = fopen("error.log", "at"); FILE* fp = fopen("error.log", "at");
if(!fp) if(!fp)
return; return;
time_t nowtime = time(nullptr); time_t nowtime = std::time(nullptr);
tm* localedtime = localtime(&nowtime);
char timebuf[40]; char timebuf[40];
strftime(timebuf, 40, "%Y-%m-%d %H:%M:%S", localedtime); std::strftime(timebuf, sizeof timebuf, "%Y-%m-%d %H:%M:%S", std::localtime(&nowtime));
fprintf(fp, "[%s]%s\n", timebuf, msg); fprintf(fp, "[%s]%s\n", timebuf, msg);
fclose(fp); fclose(fp);
} }
...@@ -2459,8 +2458,8 @@ void Game::SetWindowsIcon() { ...@@ -2459,8 +2458,8 @@ void Game::SetWindowsIcon() {
HINSTANCE hInstance = (HINSTANCE)GetModuleHandleW(nullptr); HINSTANCE hInstance = (HINSTANCE)GetModuleHandleW(nullptr);
HICON hSmallIcon = (HICON)LoadImageW(hInstance, MAKEINTRESOURCEW(1), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); HICON hSmallIcon = (HICON)LoadImageW(hInstance, MAKEINTRESOURCEW(1), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
HICON hBigIcon = (HICON)LoadImageW(hInstance, MAKEINTRESOURCEW(1), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR); HICON hBigIcon = (HICON)LoadImageW(hInstance, MAKEINTRESOURCEW(1), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR);
SendMessageW(hWnd, WM_SETICON, ICON_SMALL, (long)hSmallIcon); SendMessageW(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)hSmallIcon);
SendMessageW(hWnd, WM_SETICON, ICON_BIG, (long)hBigIcon); SendMessageW(hWnd, WM_SETICON, ICON_BIG, (LPARAM)hBigIcon);
#endif #endif
} }
void Game::SetWindowsScale(float scale) { void Game::SetWindowsScale(float scale) {
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "deck_con.h" #include "deck_con.h"
#include "menu_handler.h" #include "menu_handler.h"
#include "CGUISkinSystem/CGUISkinSystem.h" #include "CGUISkinSystem/CGUISkinSystem.h"
#include <time.h> #include <ctime>
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>
#include <list> #include <list>
......
...@@ -546,8 +546,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -546,8 +546,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
curtime = ReplayMode::cur_replay.pheader.start_time; curtime = ReplayMode::cur_replay.pheader.start_time;
else else
curtime = ReplayMode::cur_replay.pheader.seed; curtime = ReplayMode::cur_replay.pheader.seed;
tm* st = localtime(&curtime); std::wcsftime(infobuf, sizeof infobuf / sizeof infobuf[0], L"%Y/%m/%d %H:%M:%S\n", std::localtime(&curtime));
std::wcsftime(infobuf, 256, L"%Y/%m/%d %H:%M:%S\n", st);
repinfo.append(infobuf); repinfo.append(infobuf);
wchar_t namebuf[4][20]{}; wchar_t namebuf[4][20]{};
ReplayMode::cur_replay.ReadName(namebuf[0]); ReplayMode::cur_replay.ReadName(namebuf[0]);
......
...@@ -7,7 +7,7 @@ namespace ygo { ...@@ -7,7 +7,7 @@ namespace ygo {
class MenuHandler: public irr::IEventReceiver { class MenuHandler: public irr::IEventReceiver {
public: public:
virtual bool OnEvent(const irr::SEvent& event); bool OnEvent(const irr::SEvent& event) override;
s32 prev_operation; s32 prev_operation;
int prev_sel; int prev_sel;
......
...@@ -88,7 +88,7 @@ public: ...@@ -88,7 +88,7 @@ public:
static void TraversalDir(const wchar_t* wpath, const std::function<void(const wchar_t*, bool)>& cb) { static void TraversalDir(const wchar_t* wpath, const std::function<void(const wchar_t*, bool)>& cb) {
wchar_t findstr[1024]; wchar_t findstr[1024];
std::swprintf(findstr, sizeof findstr / sizeof findstr[0], L"%s/*", wpath); std::swprintf(findstr, sizeof findstr / sizeof findstr[0], L"%ls/*", wpath);
WIN32_FIND_DATAW fdataw; WIN32_FIND_DATAW fdataw;
HANDLE fh = FindFirstFileW(findstr, &fdataw); HANDLE fh = FindFirstFileW(findstr, &fdataw);
if(fh == INVALID_HANDLE_VALUE) if(fh == INVALID_HANDLE_VALUE)
...@@ -119,7 +119,7 @@ public: ...@@ -119,7 +119,7 @@ public:
while((wfile = std::wcspbrk(wfile, L"/")) != nullptr) while((wfile = std::wcspbrk(wfile, L"/")) != nullptr)
*wfile++ = '_'; *wfile++ = '_';
} }
static bool IsFileExists(const char* file) { static bool IsFileExists(const char* file) {
struct stat fileStat; struct stat fileStat;
return (stat(file, &fileStat) == 0) && !S_ISDIR(fileStat.st_mode); return (stat(file, &fileStat) == 0) && !S_ISDIR(fileStat.st_mode);
......
...@@ -421,7 +421,7 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) { ...@@ -421,7 +421,7 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
rh.version = PRO_VERSION; rh.version = PRO_VERSION;
rh.flag = REPLAY_UNIFORM; rh.flag = REPLAY_UNIFORM;
rh.seed = seed; rh.seed = seed;
rh.start_time = (unsigned int)time(nullptr); rh.start_time = (unsigned int)std::time(nullptr);
last_replay.BeginRecord(); last_replay.BeginRecord();
last_replay.WriteHeader(rh); last_replay.WriteHeader(rh);
last_replay.WriteData(players[0]->name, 40, false); last_replay.WriteData(players[0]->name, 40, false);
......
...@@ -87,7 +87,7 @@ int SingleMode::SinglePlayThread() { ...@@ -87,7 +87,7 @@ int SingleMode::SinglePlayThread() {
rh.version = PRO_VERSION; rh.version = PRO_VERSION;
rh.flag = REPLAY_UNIFORM | REPLAY_SINGLE_MODE; rh.flag = REPLAY_UNIFORM | REPLAY_SINGLE_MODE;
rh.seed = seed; rh.seed = seed;
rh.start_time = (unsigned int)time(nullptr); rh.start_time = (unsigned int)std::time(nullptr);
mainGame->gMutex.lock(); mainGame->gMutex.lock();
mainGame->HideElement(mainGame->wSinglePlay); mainGame->HideElement(mainGame->wSinglePlay);
mainGame->ClearCardInfo(); mainGame->ClearCardInfo();
...@@ -138,10 +138,9 @@ int SingleMode::SinglePlayThread() { ...@@ -138,10 +138,9 @@ int SingleMode::SinglePlayThread() {
} }
last_replay.EndRecord(); last_replay.EndRecord();
mainGame->gMutex.lock(); mainGame->gMutex.lock();
time_t nowtime = time(nullptr); time_t nowtime = std::time(nullptr);
tm* localedtime = localtime(&nowtime);
wchar_t timetext[40]; wchar_t timetext[40];
std::wcsftime(timetext, 40, L"%Y-%m-%d %H-%M-%S", localedtime); std::wcsftime(timetext, sizeof timetext / sizeof timetext[0], L"%Y-%m-%d %H-%M-%S", std::localtime(&nowtime));
mainGame->ebRSName->setText(timetext); mainGame->ebRSName->setText(timetext);
if(!mainGame->chkAutoSaveReplay->isChecked()) { if(!mainGame->chkAutoSaveReplay->isChecked()) {
mainGame->wReplaySave->setText(dataManager.GetSysString(1340)); mainGame->wReplaySave->setText(dataManager.GetSysString(1340));
......
...@@ -14,7 +14,7 @@ bool SoundManager::Init() { ...@@ -14,7 +14,7 @@ bool SoundManager::Init() {
previous_bgm_scene = -1; previous_bgm_scene = -1;
RefreshBGMList(); RefreshBGMList();
bgm_process = false; bgm_process = false;
rnd.reset((unsigned int)time(nullptr)); rnd.reset((unsigned int)std::time(nullptr));
engineSound = irrklang::createIrrKlangDevice(); engineSound = irrklang::createIrrKlangDevice();
engineMusic = irrklang::createIrrKlangDevice(); engineMusic = irrklang::createIrrKlangDevice();
if(!engineSound || !engineMusic) { if(!engineSound || !engineMusic) {
......
...@@ -394,7 +394,7 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) { ...@@ -394,7 +394,7 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
rh.version = PRO_VERSION; rh.version = PRO_VERSION;
rh.flag = REPLAY_UNIFORM | REPLAY_TAG; rh.flag = REPLAY_UNIFORM | REPLAY_TAG;
rh.seed = seed; rh.seed = seed;
rh.start_time = (unsigned int)time(nullptr); rh.start_time = (unsigned int)std::time(nullptr);
last_replay.BeginRecord(); last_replay.BeginRecord();
last_replay.WriteHeader(rh); last_replay.WriteHeader(rh);
last_replay.WriteData(players[0]->name, 40, false); last_replay.WriteData(players[0]->name, 40, false);
......
Subproject commit 4345aa5812b41b4efe158cbc2c699ad4dcc4c866 Subproject commit bb6fd728598dc9c6fd4890d0c7a643d6b725be71
...@@ -1253,3 +1253,7 @@ ...@@ -1253,3 +1253,7 @@
!setname 0x1c0 龙华 竜華 !setname 0x1c0 龙华 竜華
!setname 0x1c1 阿尔戈☆群星 ARGS !setname 0x1c1 阿尔戈☆群星 ARGS
!setname 0x1c2 喷水引擎 アクア・ジェット !setname 0x1c2 喷水引擎 アクア・ジェット
!setname 0x1c3 御剑 Mitsurugi
!setname 0x1c4 征龙 征竜
!setname 0x1c5 再世 再世
!setname 0x1c6 统王 ドミナス
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment