Commit 3ce37cde authored by fallenstardust's avatar fallenstardust

use standard mutex library

parent 0b80fb71
......@@ -601,7 +601,7 @@ void ClientField::ShowSelectOption(int select_hint) {
wchar_t textBuffer[256];
int count = select_options.size();
bool quickmode = true;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
for(auto option : select_options) {
if(mainGame->guiFont->getDimension(dataManager.GetDesc(option)).Width > 310 * mainGame->xScale) {
quickmode = false;
......@@ -649,7 +649,7 @@ void ClientField::ShowSelectOption(int select_hint) {
myswprintf(textBuffer, dataManager.GetSysString(555));
mainGame->wOptions->setText(textBuffer);
mainGame->PopupElement(mainGame->wOptions);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
}
void ClientField::ReplaySwap() {
std::swap(deck[0], deck[1]);
......
......@@ -85,10 +85,10 @@ inline int _wtoi(const wchar_t * s) {
#include <thread>
#ifdef _IRR_ANDROID_PLATFORM_
#include <android/bufferio_android.h>
#else
#include <mutex>
#include "bufferio.h"
#endif
#include "mymutex.h"
#include "myfilesystem.h"
#include "mysignal.h"
#include "../ocgcore/ocgapi.h"
#include "../ocgcore/common.h"
......
......@@ -139,10 +139,10 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
switch(id) {
case BUTTON_CLEAR_DECK: {
mainGame->soundEffectPlayer->doPressButton();
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->SetStaticText(mainGame->stQMessage, 370, mainGame->textFont, dataManager.GetSysString(1339));
mainGame->PopupElement(mainGame->wQuery);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
prev_operation = id;
break;
}
......@@ -198,11 +198,11 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
int sel = mainGame->cbDBDecks->getSelected();
if(sel == -1)
break;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->wRenameDeck->setText(dataManager.GetSysString(1362));
mainGame->ebREName->setText(mainGame->cbDBDecks->getItem(sel));
mainGame->PopupElement(mainGame->wRenameDeck);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
prev_operation = id;
prev_sel = sel;
break;
......@@ -240,12 +240,12 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
int sel = mainGame->cbDBDecks->getSelected();
if(sel == -1)
break;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
wchar_t textBuffer[256];
myswprintf(textBuffer, L"%ls\n%ls", mainGame->cbDBDecks->getItem(sel), dataManager.GetSysString(1337));
mainGame->SetStaticText(mainGame->stQMessage, 370 * mainGame->xScale, mainGame->textFont, textBuffer);
mainGame->PopupElement(mainGame->wQuery);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
prev_operation = id;
prev_sel = sel;
mainGame->soundEffectPlayer->doDelete();
......@@ -253,10 +253,10 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
}
case BUTTON_LEAVE_GAME: {
if(is_modified && !mainGame->chkIgnoreDeckChanges->isChecked()) {
mainGame->gMutex.Lock();
mainGame->SetStaticText(mainGame->stQMessage, 370 * mainGame->xScale, mainGame->textFont, dataManager.GetSysString(1356));
mainGame->gMutex.lock();
mainGame->SetStaticText(mainGame->stQMessage, 310, mainGame->guiFont, dataManager.GetSysString(1356));
mainGame->PopupElement(mainGame->wQuery);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
prev_operation = id;
break;
}
......@@ -432,10 +432,10 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
}
case COMBOBOX_DBDECKS: {
if(is_modified && !mainGame->chkIgnoreDeckChanges->isChecked()) {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->SetStaticText(mainGame->stQMessage, 370 * mainGame-> xScale, mainGame->textFont, dataManager.GetSysString(1356));
mainGame->PopupElement(mainGame->wQuery);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
prev_operation = id;
break;
}
......
......@@ -79,13 +79,13 @@ void DuelClient::ConnectTimeout(evutil_socket_t fd, short events, void* arg) {
mainGame->btnJoinCancel->setEnabled(true);
mainGame->btnStartBot->setEnabled(true);
mainGame->btnBotCancel->setEnabled(true);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
if(bot_mode && !mainGame->wSinglePlay->isVisible())
mainGame->ShowElement(mainGame->wSinglePlay);
else if(!bot_mode && !mainGame->wLanWindow->isVisible())
mainGame->ShowElement(mainGame->wLanWindow);
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1400));
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
}
event_base_loopbreak(client_base);
}
......@@ -169,13 +169,13 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
mainGame->btnJoinCancel->setEnabled(true);
mainGame->btnStartBot->setEnabled(true);
mainGame->btnBotCancel->setEnabled(true);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
if(bot_mode && !mainGame->wSinglePlay->isVisible())
mainGame->ShowElement(mainGame->wSinglePlay);
else if(!bot_mode && !mainGame->wLanWindow->isVisible())
mainGame->ShowElement(mainGame->wLanWindow);
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1400));
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
} else if(connect_state == 0x7) {
if(!mainGame->dInfo.isStarted && !mainGame->is_building) {
mainGame->btnCreateHost->setEnabled(true);
......@@ -183,7 +183,7 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
mainGame->btnJoinCancel->setEnabled(true);
mainGame->btnStartBot->setEnabled(true);
mainGame->btnBotCancel->setEnabled(true);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->HideElement(mainGame->wHostPrepare);
if(bot_mode)
mainGame->ShowElement(mainGame->wSinglePlay);
......@@ -193,9 +193,9 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
if(events & BEV_EVENT_EOF)
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1401));
else mainGame->env->addMessageBox(L"", dataManager.GetSysString(1402));
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
} else {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1502));
mainGame->btnCreateHost->setEnabled(true);
mainGame->btnJoinHost->setEnabled(true);
......@@ -203,11 +203,11 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
mainGame->btnStartBot->setEnabled(true);
mainGame->btnBotCancel->setEnabled(true);
mainGame->stTip->setVisible(false);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->closeDoneSignal.Reset();
mainGame->closeSignal.Set();
mainGame->closeDoneSignal.Wait();
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dInfo.isStarted = false;
mainGame->dInfo.isFinished = false;
mainGame->is_building = false;
......@@ -216,7 +216,7 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
mainGame->ShowElement(mainGame->wSinglePlay);
else
mainGame->ShowElement(mainGame->wLanWindow);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
}
}
}
......@@ -249,19 +249,19 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->btnJoinCancel->setEnabled(true);
mainGame->btnStartBot->setEnabled(true);
mainGame->btnBotCancel->setEnabled(true);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
if(pkt->code == 0)
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1403));
else if(pkt->code == 1)
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1404));
else if(pkt->code == 2)
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1405));
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
event_base_loopbreak(client_base);
break;
}
case ERRMSG_DECKERROR: {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
unsigned int code = pkt->code & 0xFFFFFFF;
int flag = pkt->code >> 28;
wchar_t msgbuf[256];
......@@ -309,13 +309,13 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
}
mainGame->env->addMessageBox(L"", msgbuf);
mainGame->cbDeckSelect->setEnabled(true);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
break;
}
case ERRMSG_SIDEERROR: {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1408));
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
break;
}
case ERRMSG_VERERROR: {
......@@ -324,11 +324,11 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->btnJoinCancel->setEnabled(true);
mainGame->btnStartBot->setEnabled(true);
mainGame->btnBotCancel->setEnabled(true);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
wchar_t msgbuf[256];
myswprintf(msgbuf, dataManager.GetSysString(1411), pkt->code >> 12, (pkt->code >> 4) & 0xff, pkt->code & 0xf);
mainGame->env->addMessageBox(L"", msgbuf);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
event_base_loopbreak(client_base);
break;
}
......@@ -340,9 +340,9 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
break;
}
case STOC_SELECT_TP: {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->PopupElement(mainGame->wFTSelect);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
break;
}
case STOC_HAND_RESULT: {
......@@ -359,7 +359,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
break;
}
case STOC_CHANGE_SIDE: {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dInfo.isStarted = false;
mainGame->dField.Clear();
mainGame->is_building = true;
......@@ -392,15 +392,15 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->deckBuilder.pre_extrac = deckManager.current_deck.extra.size();
mainGame->deckBuilder.pre_sidec = deckManager.current_deck.side.size();
mainGame->device->setEventReceiver(&mainGame->deckBuilder);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
break;
}
case STOC_WAITING_SIDE: {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dField.Clear();
mainGame->stHintMsg->setText(dataManager.GetSysString(1409));
mainGame->stHintMsg->setVisible(true);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
break;
}
case STOC_JOIN_GAME: {
......@@ -437,7 +437,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
myswprintf(msgbuf, L"*%ls\n", dataManager.GetSysString(1230));
str.append(msgbuf);
}
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
if(pkt->info.mode == 2) {
mainGame->dInfo.isTag = true;
mainGame->chkHostPrepReady[2]->setVisible(true);
......@@ -482,7 +482,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->ShowElement(mainGame->wHostPrepare);
if(!mainGame->chkIgnore1->isChecked())
mainGame->wChat->setVisible(true);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->dInfo.duel_rule = pkt->info.duel_rule;
watching = 0;
connect_state |= 0x4;
......@@ -565,7 +565,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->soundEffectPlayer->doStartGame();
mainGame->HideElement(mainGame->wHostPrepare);
mainGame->WaitFrameSignal(11);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dField.Clear();
mainGame->dInfo.isStarted = true;
mainGame->dInfo.isFinished = false;
......@@ -630,12 +630,12 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->dInfo.tag_player[0] = false;
mainGame->dInfo.tag_player[1] = false;
}
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
match_kill = 0;
break;
}
case STOC_DUEL_END: {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
if(mainGame->dInfo.player_type < 7)
mainGame->btnLeaveGame->setVisible(false);
mainGame->btnSpectatorSwap->setVisible(false);
......@@ -646,13 +646,13 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->wSurrender->setVisible(false);
mainGame->stMessage->setText(dataManager.GetSysString(1500));
mainGame->PopupElement(mainGame->wMessage);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->actionSignal.Reset();
mainGame->actionSignal.Wait();
mainGame->closeDoneSignal.Reset();
mainGame->closeSignal.Set();
mainGame->closeDoneSignal.Wait();
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dInfo.isStarted = false;
mainGame->dInfo.isFinished = true;
mainGame->is_building = false;
......@@ -668,7 +668,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->ShowElement(mainGame->wSinglePlay);
else
mainGame->ShowElement(mainGame->wLanWindow);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->SaveConfig();
event_base_loopbreak(client_base);
if(exit_on_return)
......@@ -676,7 +676,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
break;
}
case STOC_REPLAY: {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->wPhase->setVisible(false);
mainGame->wSurrender->setVisible(false);
if(mainGame->dInfo.player_type < 7)
......@@ -697,7 +697,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
if(!mainGame->chkAutoSaveReplay->isChecked()) {
mainGame->wReplaySave->setText(dataManager.GetSysString(1340));
mainGame->PopupElement(mainGame->wReplaySave);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->replaySignal.Reset();
mainGame->replaySignal.Wait();
}
......@@ -707,7 +707,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
myswprintf(msgbuf, dataManager.GetSysString(1367), timetext);
mainGame->SetStaticText(mainGame->stACMessage, 310, mainGame->guiFont, msgbuf);
mainGame->PopupElement(mainGame->wACMessage, 20);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(30);
}
if(mainGame->actionParam || !is_host) {
......@@ -765,9 +765,9 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
}
wchar_t msg[256];
BufferIO::CopyWStr(pkt->msg, msg, 256);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->AddChatMsg(msg, player);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
break;
}
case STOC_HS_PLAYER_ENTER: {
......@@ -792,9 +792,9 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
else if(pkt->pos == 1)
BufferIO::CopyWStr(pkt->name, mainGame->dInfo.clientname, 20);
}
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->stHostPrepDuelist[pkt->pos]->setText(name);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
break;
}
case STOC_HS_PLAYER_CHANGE: {
......@@ -803,7 +803,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
unsigned char state = pkt->status & 0xf;
if(pos > 3)
break;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
if(state < 8) {
mainGame->soundEffectPlayer->doPlayerEnterEffect();
wchar_t* prename = (wchar_t*)mainGame->stHostPrepDuelist[pos]->getText();
......@@ -848,7 +848,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
} else {
mainGame->btnHostPrepStart->setEnabled(false);
}
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
break;
}
case STOC_HS_WATCH_CHANGE: {
......@@ -856,9 +856,9 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
watching = pkt->watch_count;
wchar_t watchbuf[32];
myswprintf(watchbuf, L"%ls%d", dataManager.GetSysString(1253), watching);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->stHostPrepOB->setText(watchbuf);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
break;
}
}
......@@ -876,24 +876,24 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->waitFrame = -1;
mainGame->stHintMsg->setVisible(false);
if(mainGame->wCardSelect->isVisible()) {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->HideElement(mainGame->wCardSelect);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(11);
}
if(mainGame->wOptions->isVisible()) {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->HideElement(mainGame->wOptions);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(11);
}
}
if(mainGame->dInfo.time_player == 1)
mainGame->dInfo.time_player = 2;
if(is_swapping) {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dField.ReplaySwap();
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
is_swapping = false;
}
switch(mainGame->dInfo.curMsg) {
......@@ -943,26 +943,26 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
default:
break;
}
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->stMessage->setText(dataManager.GetDesc(err_desc));
mainGame->PopupElement(mainGame->wMessage);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->actionSignal.Reset();
mainGame->actionSignal.Wait();
select_hint = last_select_hint;
return ClientAnalyze(last_successful_msg, last_successful_msg_length);
}
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->stMessage->setText(L"Error occurs.");
mainGame->PopupElement(mainGame->wMessage);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->actionSignal.Reset();
mainGame->actionSignal.Wait();
if(!mainGame->dInfo.isSingleMode) {
mainGame->closeDoneSignal.Reset();
mainGame->closeSignal.Set();
mainGame->closeDoneSignal.Wait();
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dInfo.isStarted = false;
mainGame->dInfo.isFinished = false;
mainGame->btnCreateHost->setEnabled(true);
......@@ -976,7 +976,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->ShowElement(mainGame->wSinglePlay);
else
mainGame->ShowElement(mainGame->wLanWindow);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
event_base_loopbreak(client_base);
if(exit_on_return)
mainGame->device->closeDevice();
......@@ -995,10 +995,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
break;
}
case HINT_MESSAGE: {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->stMessage->setText(dataManager.GetDesc(data));
mainGame->PopupElement(mainGame->wMessage);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->actionSignal.Reset();
mainGame->actionSignal.Wait();
break;
......@@ -1011,10 +1011,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
case HINT_OPSELECTED: {
myswprintf(textBuffer, dataManager.GetSysString(1510), dataManager.GetDesc(data));
mainGame->AddLog(textBuffer);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->SetStaticText(mainGame->stACMessage, 310 * mainGame->xScale, mainGame->textFont, textBuffer);
mainGame->PopupElement(mainGame->wACMessage, 20);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(40);
break;
}
......@@ -1028,40 +1028,40 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
case HINT_RACE: {
myswprintf(textBuffer, dataManager.GetSysString(1511), dataManager.FormatRace(data));
mainGame->AddLog(textBuffer);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->SetStaticText(mainGame->stACMessage, 310 * mainGame->xScale, mainGame->textFont, textBuffer);
mainGame->PopupElement(mainGame->wACMessage, 20);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(40);
break;
}
case HINT_ATTRIB: {
myswprintf(textBuffer, dataManager.GetSysString(1511), dataManager.FormatAttribute(data));
mainGame->AddLog(textBuffer);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->SetStaticText(mainGame->stACMessage, 310 * mainGame->xScale, mainGame->textFont, textBuffer);
mainGame->PopupElement(mainGame->wACMessage, 20);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(40);
break;
}
case HINT_CODE: {
myswprintf(textBuffer, dataManager.GetSysString(1511), dataManager.GetName(data));
mainGame->AddLog(textBuffer, data);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->SetStaticText(mainGame->stACMessage, 310 * mainGame->xScale, mainGame->textFont, textBuffer);
mainGame->PopupElement(mainGame->wACMessage, 20);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(40);
break;
}
case HINT_NUMBER: {
myswprintf(textBuffer, dataManager.GetSysString(1512), data);
mainGame->AddLog(textBuffer);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->SetStaticText(mainGame->stACMessage, 310, mainGame->textFont, textBuffer);
mainGame->PopupElement(mainGame->wACMessage, 20);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(40);
break;
}
......@@ -1112,10 +1112,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
case MSG_WAITING: {
mainGame->waitFrame = 0;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->stHintMsg->setText(dataManager.GetSysString(1390));
mainGame->stHintMsg->setVisible(true);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
return true;
}
case MSG_START: {
......@@ -1125,7 +1125,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->showcard = 101;
mainGame->WaitFrameSignal(40);
mainGame->showcard = 0;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
int playertype = BufferIO::ReadInt8(pbuf);
mainGame->dInfo.isFirst = (playertype & 0xf) ? false : true;
if(playertype & 0xf0)
......@@ -1159,24 +1159,24 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->dInfo.isReplaySwapped = false;
mainGame->dField.ReplaySwap();
}
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
return true;
}
case MSG_UPDATE_DATA: {
int player = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int location = BufferIO::ReadInt8(pbuf);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dField.UpdateFieldCard(player, location, pbuf);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
return true;
}
case MSG_UPDATE_CARD: {
int player = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int loc = BufferIO::ReadInt8(pbuf);
int seq = BufferIO::ReadInt8(pbuf);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dField.UpdateCard(player, loc, seq, pbuf);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
break;
}
case MSG_SELECT_BATTLECMD: {
......@@ -1226,7 +1226,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->cmdFlag |= COMMAND_ATTACK;
}
mainGame->dField.RefreshCardCountDisplay();
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
if(BufferIO::ReadInt8(pbuf)) {
mainGame->btnM2->setVisible(true);
mainGame->btnM2->setEnabled(true);
......@@ -1237,7 +1237,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->btnEP->setEnabled(true);
mainGame->btnEP->setPressed(false);
}
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
return false;
}
case MSG_SELECT_IDLECMD: {
......@@ -1388,20 +1388,20 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
} else {
myswprintf(textBuffer, dataManager.GetDesc(desc), dataManager.GetName(code));
}
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->SetStaticText(mainGame->stQMessage, 370 * mainGame->xScale, mainGame->textFont, textBuffer);
mainGame->PopupElement(mainGame->wQuery);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
return false;
}
case MSG_SELECT_YESNO: {
/*int selecting_player = */BufferIO::ReadInt8(pbuf);
int desc = BufferIO::ReadInt32(pbuf);
mainGame->dField.highlighting_card = 0;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->SetStaticText(mainGame->stQMessage, 370 * mainGame->xScale, mainGame->textFont, dataManager.GetDesc(desc));
mainGame->PopupElement(mainGame->wQuery);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
return false;
}
case MSG_SELECT_OPTION: {
......@@ -1454,10 +1454,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
else myswprintf(textBuffer, L"%ls(%d-%d)", dataManager.GetSysString(560), mainGame->dField.select_min, mainGame->dField.select_max);
select_hint = 0;
if (panelmode) {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->wCardSelect->setText(textBuffer);
mainGame->dField.ShowSelectCard(select_ready);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
} else {
mainGame->stHintMsg->setText(textBuffer);
mainGame->stHintMsg->setVisible(true);
......@@ -1534,10 +1534,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
else myswprintf(textBuffer, L"%ls(%d-%d)", dataManager.GetSysString(560), mainGame->dField.select_min, mainGame->dField.select_max);
select_hint = 0;
if (panelmode) {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->wCardSelect->setText(textBuffer);
mainGame->dField.ShowSelectCard(mainGame->dField.select_cancelable);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
} else {
mainGame->stHintMsg->setText(textBuffer);
mainGame->stHintMsg->setVisible(true);
......@@ -1622,7 +1622,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
DuelClient::SendResponse();
return true;
}
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
if(!conti_exist)
mainGame->stHintMsg->setText(dataManager.GetSysString(550));
else
......@@ -1647,7 +1647,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->PopupElement(mainGame->wQuery);
}
}
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
return false;
}
case MSG_SELECT_PLACE:
......@@ -1766,9 +1766,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->btnPSDD->setVisible(true);
startpos += 145;
} else mainGame->btnPSDD->setVisible(false);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->PopupElement(mainGame->wPosSelect);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
return false;
}
case MSG_SELECT_TRIBUTE: {
......@@ -1803,13 +1803,13 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->dField.select_min, mainGame->dField.select_max);
else myswprintf(textBuffer, L"%ls(%d-%d)", dataManager.GetSysString(531), mainGame->dField.select_min, mainGame->dField.select_max);
select_hint = 0;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->stHintMsg->setText(textBuffer);
mainGame->stHintMsg->setVisible(true);
if (mainGame->dField.select_cancelable) {
mainGame->dField.ShowCancelOrFinishButton(1);
}
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
return false;
}
case MSG_SELECT_COUNTER: {
......@@ -1832,10 +1832,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->is_selectable = true;
}
myswprintf(textBuffer, dataManager.GetSysString(204), mainGame->dField.select_counter_count, dataManager.GetCounterName(mainGame->dField.select_counter_type));
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->stHintMsg->setText(textBuffer);
mainGame->stHintMsg->setVisible(true);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
return false;
}
case MSG_SELECT_SUM: {
......@@ -1944,10 +1944,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->AddLog(textBuffer);
for (int i = 0; i < count; ++i) {
pcard = *(mainGame->dField.deck[player].rbegin() + i);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
myswprintf(textBuffer, L"*[%ls]", dataManager.GetName(pcard->code));
mainGame->AddLog(textBuffer, pcard->code);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
float shift = -0.15f;
if (player == 1) shift = 0.15f;
pcard->dPos = irr::core::vector3df(shift, 0, 0);
......@@ -1981,10 +1981,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->AddLog(textBuffer);
for (int i = 0; i < count; ++i) {
pcard = *(mainGame->dField.extra[player].rbegin() + i + mainGame->dField.extra_p_count[player]);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
myswprintf(textBuffer, L"*[%ls]", dataManager.GetName(pcard->code));
mainGame->AddLog(textBuffer, pcard->code);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
if (player == 0)
pcard->dPos = irr::core::vector3df(0, -0.20f, 0);
else
......@@ -2019,10 +2019,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard = mainGame->dField.GetCard(c, l, s);
if (code != 0)
pcard->SetCode(code);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
myswprintf(textBuffer, L"*[%ls]", dataManager.GetName(code));
mainGame->AddLog(textBuffer, code);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
if (l & 0x41) {
if(count == 1) {
float shift = -0.15f;
......@@ -2086,12 +2086,12 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
if (panel_confirm.size()) {
std::sort(panel_confirm.begin(), panel_confirm.end(), ClientCard::client_card_sort);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dField.selectable_cards = panel_confirm;
myswprintf(textBuffer, dataManager.GetSysString(208), panel_confirm.size());
mainGame->wCardSelect->setText(textBuffer);
mainGame->dField.ShowSelectCard(true);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->actionSignal.Reset();
mainGame->actionSignal.Wait();
}
......@@ -2231,7 +2231,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
}
} else {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dField.grave[player].swap(mainGame->dField.deck[player]);
for (auto cit = mainGame->dField.grave[player].begin(); cit != mainGame->dField.grave[player].end(); ++cit) {
(*cit)->location = LOCATION_GRAVE;
......@@ -2251,7 +2251,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
mainGame->dField.MoveCard(pcard, 10);
}
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(11);
}
return true;
......@@ -2434,9 +2434,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->position = cp;
pcard->SetCode(code);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dField.AddCard(pcard, cc, cl, cs);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->dField.GetCardLocation(pcard, &pcard->curPos, &pcard->curRot, true);
pcard->curAlpha = 5;
mainGame->dField.FadeCard(pcard, 255, 20);
......@@ -2453,9 +2453,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
mainGame->dField.FadeCard(pcard, 5, 20);
mainGame->WaitFrameSignal(20);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dField.RemoveCard(pc, pl, ps);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
if(pcard == mainGame->dField.hovered_card)
mainGame->dField.hovered_card = 0;
} else
......@@ -2487,11 +2487,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->position = cp;
mainGame->dField.AddCard(pcard, cc, cl, cs);
} else {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dField.RemoveCard(pc, pl, ps);
pcard->position = cp;
mainGame->dField.AddCard(pcard, cc, cl, cs);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
if (pl == cl && pc == cc && (cl & 0x71)) {
pcard->dPos = irr::core::vector3df(-0.3f, 0, 0);
pcard->dRot = irr::core::vector3df(0, 0, 0);
......@@ -2503,24 +2503,24 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->WaitFrameSignal(5);
} else {
if (cl == 0x4 && pcard->overlayed.size() > 0) {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
for (size_t i = 0; i < pcard->overlayed.size(); ++i)
mainGame->dField.MoveCard(pcard->overlayed[i], 10);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(10);
}
if (cl == 0x2) {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
for (size_t i = 0; i < mainGame->dField.hand[cc].size(); ++i)
mainGame->dField.MoveCard(mainGame->dField.hand[cc][i], 10);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
} else {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dField.MoveCard(pcard, 10);
if (pl == 0x2)
for (size_t i = 0; i < mainGame->dField.hand[pc].size(); ++i)
mainGame->dField.MoveCard(mainGame->dField.hand[pc][i], 10);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
}
mainGame->WaitFrameSignal(5);
}
......@@ -2542,21 +2542,21 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->location = 0x80;
pcard->sequence = olcard->overlayed.size() - 1;
} else {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dField.RemoveCard(pc, pl, ps);
olcard->overlayed.push_back(pcard);
mainGame->dField.overlay_cards.insert(pcard);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
pcard->overlayTarget = olcard;
pcard->location = 0x80;
pcard->sequence = olcard->overlayed.size() - 1;
if (olcard->location == 0x4) {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dField.MoveCard(pcard, 10);
if (pl == 0x2)
for (size_t i = 0; i < mainGame->dField.hand[pc].size(); ++i)
mainGame->dField.MoveCard(mainGame->dField.hand[pc][i], 10);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(5);
}
}
......@@ -2572,7 +2572,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
for (size_t i = 0; i < olcard->overlayed.size(); ++i)
olcard->overlayed[i]->sequence = i;
} else {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
olcard->overlayed.erase(olcard->overlayed.begin() + pcard->sequence);
pcard->overlayTarget = 0;
pcard->position = cp;
......@@ -2582,11 +2582,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
olcard->overlayed[i]->sequence = i;
mainGame->dField.MoveCard(olcard->overlayed[i], 2);
}
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(5);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dField.MoveCard(pcard, 10);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(5);
}
} else {
......@@ -2603,7 +2603,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
olcard1->overlayed[i]->sequence = i;
}
} else {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
olcard1->overlayed.erase(olcard1->overlayed.begin() + pcard->sequence);
olcard2->overlayed.push_back(pcard);
pcard->sequence = olcard2->overlayed.size() - 1;
......@@ -2614,7 +2614,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->dField.MoveCard(olcard1->overlayed[i], 2);
}
mainGame->dField.MoveCard(pcard, 10);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(5);
}
}
......@@ -2668,7 +2668,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
ClientCard* pc1 = mainGame->dField.GetCard(c1, l1, s1);
ClientCard* pc2 = mainGame->dField.GetCard(c2, l2, s2);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dField.RemoveCard(c1, l1, s1);
mainGame->dField.RemoveCard(c2, l2, s2);
mainGame->dField.AddCard(pc1, c2, l2, s2);
......@@ -2679,7 +2679,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->dField.MoveCard(pc1->overlayed[i], 10);
for (size_t i = 0; i < pc2->overlayed.size(); ++i)
mainGame->dField.MoveCard(pc2->overlayed[i], 10);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(11);
} else {
mainGame->dField.RemoveCard(c1, l1, s1);
......@@ -2834,9 +2834,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
return true;
myswprintf(event_string, dataManager.GetSysString(1609), dataManager.GetName(mainGame->dField.current_chain.code));
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dField.chains.push_back(mainGame->dField.current_chain);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
if (ct > 1)
mainGame->WaitFrameSignal(20);
mainGame->dField.last_chain = true;
......@@ -2968,13 +2968,13 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
} else {
for (int i = 0; i < count; ++i) {
mainGame->soundEffectPlayer->doDrawCardEffect();
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
pcard = mainGame->dField.GetCard(player, LOCATION_DECK, mainGame->dField.deck[player].size() - 1);
mainGame->dField.deck[player].erase(mainGame->dField.deck[player].end() - 1);
mainGame->dField.AddCard(pcard, player, LOCATION_HAND, 0);
for(size_t i = 0; i < mainGame->dField.hand[player].size(); ++i)
mainGame->dField.MoveCard(mainGame->dField.hand[player][i], 10);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(5);
}
}
......@@ -3009,9 +3009,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->WaitFrameSignal(11);
mainGame->lpcstring = 0;
mainGame->dInfo.lp[player] = final;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
return true;
}
case MSG_RECOVER: {
......@@ -3038,9 +3038,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->WaitFrameSignal(11);
mainGame->lpcstring = 0;
mainGame->dInfo.lp[player] = final;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
return true;
}
case MSG_EQUIP: {
......@@ -3061,7 +3061,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pc1->equipTarget = pc2;
pc2->equipped.insert(pc1);
} else {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
if(pc1->equipTarget) {
pc1->is_showequip = false;
pc1->equipTarget->is_showequip = false;
......@@ -3073,7 +3073,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pc2->is_showequip = true;
else if (mainGame->dField.hovered_card == pc2)
pc1->is_showequip = true;
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
}
return true;
}
......@@ -3090,9 +3090,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->lpframe = 10;
mainGame->WaitFrameSignal(11);
mainGame->dInfo.lp[player] = val;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
return true;
}
case MSG_UNEQUIP: {
......@@ -3105,14 +3105,14 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pc->equipTarget->equipped.erase(pc);
pc->equipTarget = 0;
} else {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
if (mainGame->dField.hovered_card == pc)
pc->equipTarget->is_showequip = false;
else if (mainGame->dField.hovered_card == pc->equipTarget)
pc->is_showequip = false;
pc->equipTarget->equipped.erase(pc);
pc->equipTarget = 0;
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
}
return true;
}
......@@ -3131,14 +3131,14 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pc1->cardTarget.insert(pc2);
pc2->ownerTarget.insert(pc1);
} else {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
pc1->cardTarget.insert(pc2);
pc2->ownerTarget.insert(pc1);
if (mainGame->dField.hovered_card == pc1)
pc2->is_showtarget = true;
else if (mainGame->dField.hovered_card == pc2)
pc1->is_showtarget = true;
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
}
break;
}
......@@ -3157,14 +3157,14 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pc1->cardTarget.erase(pc2);
pc2->ownerTarget.erase(pc1);
} else {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
pc1->cardTarget.erase(pc2);
pc2->ownerTarget.erase(pc1);
if (mainGame->dField.hovered_card == pc1)
pc2->is_showtarget = false;
else if (mainGame->dField.hovered_card == pc2)
pc1->is_showtarget = false;
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
}
break;
}
......@@ -3190,9 +3190,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->WaitFrameSignal(11);
mainGame->lpcstring = 0;
mainGame->dInfo.lp[player] = final;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
return true;
}
case MSG_ADD_COUNTER: {
......@@ -3210,10 +3210,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true;
myswprintf(textBuffer, dataManager.GetSysString(1617), dataManager.GetName(pc->code), count, dataManager.GetCounterName(type));
pc->is_highlighting = true;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->stACMessage->setText(textBuffer);
mainGame->PopupElement(mainGame->wACMessage, 20);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(40);
pc->is_highlighting = false;
return true;
......@@ -3233,10 +3233,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true;
myswprintf(textBuffer, dataManager.GetSysString(1618), dataManager.GetName(pc->code), count, dataManager.GetCounterName(type));
pc->is_highlighting = true;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->stACMessage->setText(textBuffer);
mainGame->PopupElement(mainGame->wACMessage, 20);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(40);
pc->is_highlighting = false;
return true;
......@@ -3308,7 +3308,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
/*int dd = */BufferIO::ReadInt8(pbuf);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
return true;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
ClientCard* pcard = mainGame->dField.GetCard(ca, la, sa);
if(aatk != pcard->attack) {
pcard->attack = aatk;
......@@ -3329,7 +3329,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
myswprintf(pcard->defstring, L"%d", ddef);
}
}
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
return true;
}
case MSG_ATTACK_DISABLED: {
......@@ -3364,11 +3364,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
*pwbuf = 0;
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
return true;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->AddLog(textBuffer);
mainGame->stACMessage->setText(textBuffer);
mainGame->PopupElement(mainGame->wACMessage, 20);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(40);
return true;
}
......@@ -3387,11 +3387,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
*pwbuf = 0;
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
return true;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->AddLog(textBuffer);
mainGame->stACMessage->setText(textBuffer);
mainGame->PopupElement(mainGame->wACMessage, 20);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(40);
return true;
}
......@@ -3399,9 +3399,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
/*int player = */mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
return true;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->PopupElement(mainGame->wHand);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
return false;
}
case MSG_HAND_RES: {
......@@ -3435,7 +3435,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
myswprintf(textBuffer, L"%ls", dataManager.GetDesc(select_hint));
else myswprintf(textBuffer, dataManager.GetSysString(563));
select_hint = 0;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->wANRace->setText(textBuffer);
mainGame->PopupElement(mainGame->wANRace);
/*#ifdef _IRR_ANDROID_PLATFORM_
......@@ -3471,7 +3471,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
free(contents);
#endif*/
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
return false;
}
case MSG_ANNOUNCE_ATTRIB: {
......@@ -3488,7 +3488,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
myswprintf(textBuffer, L"%ls", dataManager.GetDesc(select_hint));
else myswprintf(textBuffer, dataManager.GetSysString(562));
select_hint = 0;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->wANAttribute->setText(textBuffer);
mainGame->PopupElement(mainGame->wANAttribute);
/*#ifdef _IRR_ANDROID_PLATFORM_
......@@ -3525,7 +3525,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
free(contents);
#endif*/
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
return false;
}
case MSG_ANNOUNCE_CARD: {
......@@ -3538,18 +3538,18 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
myswprintf(textBuffer, L"%ls", dataManager.GetDesc(select_hint));
else myswprintf(textBuffer, dataManager.GetSysString(564));
select_hint = 0;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->ebANCard->setText(L"");
mainGame->wANCard->setText(textBuffer);
mainGame->dField.UpdateDeclarableList();
mainGame->PopupElement(mainGame->wANCard);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
return false;
}
case MSG_ANNOUNCE_NUMBER: {
/*int player = */mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int count = BufferIO::ReadInt8(pbuf);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->cbANNumber->clear();
for (int i = 0; i < count; ++i) {
int value = BufferIO::ReadInt32(pbuf);
......@@ -3563,7 +3563,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
select_hint = 0;
mainGame->wANNumber->setText(textBuffer);
mainGame->PopupElement(mainGame->wANNumber);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
return false;
}
case MSG_CARD_HINT: {
......@@ -3654,7 +3654,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
//
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping)
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
if(mainGame->dField.deck[player].size() > mcount) {
while(mainGame->dField.deck[player].size() > mcount) {
ClientCard* ccard = *mainGame->dField.deck[player].rbegin();
......@@ -3702,7 +3702,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
mainGame->dField.extra_p_count[player] = pcount;
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping)
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
//
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
for (auto cit = mainGame->dField.deck[player].begin(); cit != mainGame->dField.deck[player].end(); ++cit) {
......@@ -3736,7 +3736,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
break;
}
case MSG_RELOAD_FIELD: {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dField.Clear();
mainGame->dInfo.duel_rule = BufferIO::ReadInt8(pbuf);
int val = 0;
......@@ -3844,7 +3844,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->dField.last_chain = true;
}
}
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
break;
}
}
......@@ -4017,7 +4017,7 @@ void DuelClient::BroadcastReply(evutil_socket_t fd, short events, void * arg) {
unsigned int ipaddr = bc_addr.sin_addr.s_addr;
HostPacket* pHP = (HostPacket*)buf;
if(!is_closing && pHP->identifier == NETWORK_SERVER_ID && pHP->version == PRO_VERSION && remotes.find(ipaddr) == remotes.end() ) {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
remotes.insert(ipaddr);
pHP->ipaddr = ipaddr;
hosts.push_back(*pHP);
......@@ -4039,7 +4039,7 @@ void DuelClient::BroadcastReply(evutil_socket_t fd, short events, void * arg) {
BufferIO::CopyWStr(pHP->name, gamename, 20);
hoststr.append(gamename);
mainGame->lstHostList->addItem(hoststr.c_str());
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
}
}
}
......
......@@ -1045,7 +1045,7 @@ void Game::MainLoop() {
}
driver->enableMaterial2D(false);
#endif
gMutex.Lock();
gMutex.lock();
if(dInfo.isStarted) {
DrawBackImage(imageManager.tBackGround);
DrawBackGround();
......@@ -1074,7 +1074,7 @@ void Game::MainLoop() {
DrawGUI();
DrawSpec();
#endif
gMutex.Unlock();
gMutex.unlock();
if(signalFrame > 0) {
signalFrame--;
if(!signalFrame)
......
......@@ -163,9 +163,7 @@ public:
return focus && focus->hasType(type);
}
// don't merge
Mutex gMutex;
Mutex gBuffer;
std::mutex gMutex;
Signal frameSignal;
Signal actionSignal;
Signal replaySignal;
......
......@@ -90,9 +90,9 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
hints.ai_flags = EVUTIL_AI_ADDRCONFIG;
int status = evutil_getaddrinfo(hostname, port, &hints, &answer);
if(status != 0) {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1412));
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
break;
} else {
sockaddr_in * sin = ((struct sockaddr_in *)answer->ai_addr);
......@@ -266,12 +266,12 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
int sel = mainGame->lstReplayList->getSelected();
if(sel == -1)
break;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
wchar_t textBuffer[256];
myswprintf(textBuffer, L"%ls\n%ls", mainGame->lstReplayList->getListItem(sel), dataManager.GetSysString(1363));
mainGame->SetStaticText(mainGame->stQMessage, 370 * mainGame->xScale, mainGame->textFont, textBuffer);
mainGame->PopupElement(mainGame->wQuery);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
prev_operation = id;
prev_sel = sel;
break;
......@@ -280,11 +280,11 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
int sel = mainGame->lstReplayList->getSelected();
if(sel == -1)
break;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->wReplaySave->setText(dataManager.GetSysString(1364));
mainGame->ebRSName->setText(mainGame->lstReplayList->getListItem(sel));
mainGame->PopupElement(mainGame->wReplaySave);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
prev_operation = id;
prev_sel = sel;
break;
......
#ifndef MUTEX_H
#define MUTEX_H
#ifdef _WIN32
#include <windows.h>
class Mutex {
public:
Mutex() {
InitializeCriticalSection(&_mutex);
}
~Mutex() {
DeleteCriticalSection(&_mutex);
}
void Lock() {
EnterCriticalSection(&_mutex);
}
void Unlock() {
LeaveCriticalSection(&_mutex);
}
bool TryLock() {
return TryEnterCriticalSection(&_mutex) == TRUE;
}
private:
CRITICAL_SECTION _mutex;
};
#else // _WIN32
#include <pthread.h>
class Mutex {
public:
Mutex() {
pthread_mutex_init(&mutex_t, NULL);
}
~Mutex() {
pthread_mutex_destroy(&mutex_t);
}
void Lock() {
pthread_mutex_lock(&mutex_t);
}
void Unlock() {
pthread_mutex_unlock(&mutex_t);
}
bool TryLock() {
return !pthread_mutex_trylock(&mutex_t);
}
private:
pthread_mutex_t mutex_t;
};
#endif // _WIN32
#endif // MUTEX_H
......@@ -90,7 +90,7 @@ int ReplayMode::ReplayThread() {
exit_pending = false;
current_step = 0;
if(mainGame->dInfo.isReplaySkiping)
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
while (is_continuing && !exit_pending) {
int result = process(pduel);
int len = result & 0xffff;
......@@ -99,7 +99,7 @@ int ReplayMode::ReplayThread() {
get_message(pduel, (byte*)engineBuffer);
is_continuing = ReplayAnalyze(engineBuffer, len);
if(is_restarting) {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
is_restarting = false;
mainGame->dInfo.isReplaySkiping = true;
Restart(false);
......@@ -125,7 +125,7 @@ int ReplayMode::ReplayThread() {
mainGame->dInfo.isFinished = false;
mainGame->dInfo.isReplaySkiping = false;
mainGame->dField.RefreshAllCards();
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
}
skip_step = step;
current_step = 0;
......@@ -135,7 +135,7 @@ int ReplayMode::ReplayThread() {
if(mainGame->dInfo.isReplaySkiping) {
mainGame->dInfo.isReplaySkiping = false;
mainGame->dField.RefreshAllCards();
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
}
EndDuel();
return 0;
......@@ -228,26 +228,26 @@ void ReplayMode::EndDuel() {
end_duel(pduel);
if(!is_closing) {
mainGame->actionSignal.Reset();
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->stMessage->setText(dataManager.GetSysString(1501));
if(mainGame->wCardSelect->isVisible())
mainGame->HideElement(mainGame->wCardSelect);
mainGame->PopupElement(mainGame->wMessage);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->actionSignal.Wait();
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dInfo.isStarted = false;
mainGame->dInfo.isFinished = true;
mainGame->dInfo.isReplay = false;
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->closeDoneSignal.Reset();
mainGame->closeSignal.Set();
mainGame->closeDoneSignal.Wait();
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->ShowElement(mainGame->wReplay);
mainGame->stTip->setVisible(false);
mainGame->device->setEventReceiver(&mainGame->menuHandler);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
if(exit_on_return)
mainGame->device->closeDevice();
}
......@@ -291,9 +291,9 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
return true;
}
if(is_swaping) {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dField.ReplaySwap();
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
is_swaping = false;
}
char* offset = pbuf;
......@@ -304,12 +304,12 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
if(mainGame->dInfo.isReplaySkiping) {
mainGame->dInfo.isReplaySkiping = false;
mainGame->dField.RefreshAllCards();
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
}
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->stMessage->setText(L"Error occurs.");
mainGame->PopupElement(mainGame->wMessage);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->actionSignal.Reset();
mainGame->actionSignal.Wait();
return false;
......@@ -323,7 +323,7 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
if(mainGame->dInfo.isReplaySkiping) {
mainGame->dInfo.isReplaySkiping = false;
mainGame->dField.RefreshAllCards();
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
}
pbuf += 2;
DuelClient::ClientAnalyze(offset, pbuf - offset);
......@@ -505,7 +505,7 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
if(skip_turn == 0) {
mainGame->dInfo.isReplaySkiping = false;
mainGame->dField.RefreshAllCards();
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
}
}
player = BufferIO::ReadInt8(pbuf);
......@@ -842,7 +842,7 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
mainGame->dInfo.isFinished = false;
mainGame->dInfo.isReplaySkiping = false;
mainGame->dField.RefreshAllCards();
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
}
}
if(is_pausing) {
......
......@@ -67,7 +67,7 @@ int SingleMode::SinglePlayThread() {
rh.version = PRO_VERSION;
rh.flag = REPLAY_SINGLE_MODE;
rh.seed = seed;
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->HideElement(mainGame->wSinglePlay);
mainGame->ClearCardInfo();
mainGame->wCardImg->setVisible(true);
......@@ -81,7 +81,7 @@ int SingleMode::SinglePlayThread() {
mainGame->dInfo.isFinished = false;
mainGame->dInfo.isSingleMode = true;
mainGame->device->setEventReceiver(&mainGame->dField);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
char engineBuffer[0x1000];
is_closing = false;
is_continuing = true;
......@@ -113,7 +113,7 @@ int SingleMode::SinglePlayThread() {
}
}
last_replay.EndRecord();
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
time_t nowtime = time(NULL);
tm* localedtime = localtime(&nowtime);
wchar_t timetext[40];
......@@ -122,7 +122,7 @@ int SingleMode::SinglePlayThread() {
if(!mainGame->chkAutoSaveReplay->isChecked()) {
mainGame->wReplaySave->setText(dataManager.GetSysString(1340));
mainGame->PopupElement(mainGame->wReplaySave);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->replaySignal.Reset();
mainGame->replaySignal.Wait();
} else {
......@@ -131,26 +131,26 @@ int SingleMode::SinglePlayThread() {
myswprintf(msgbuf, dataManager.GetSysString(1367), timetext);
mainGame->SetStaticText(mainGame->stACMessage, 310, mainGame->guiFont, msgbuf);
mainGame->PopupElement(mainGame->wACMessage, 20);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(30);
}
if(mainGame->actionParam)
last_replay.SaveReplay(mainGame->ebRSName->getText());
end_duel(pduel);
if(!is_closing) {
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dInfo.isStarted = false;
mainGame->dInfo.isFinished = true;
mainGame->dInfo.isSingleMode = false;
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->closeDoneSignal.Reset();
mainGame->closeSignal.Set();
mainGame->closeDoneSignal.Wait();
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->ShowElement(mainGame->wSinglePlay);
mainGame->stTip->setVisible(false);
mainGame->device->setEventReceiver(&mainGame->menuHandler);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->SaveConfig();
if(exit_on_return)
mainGame->device->closeDevice();
......@@ -721,9 +721,9 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
pbuf++;
DuelClient::ClientAnalyze(offset, pbuf - offset);
SinglePlayReload();
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->dField.RefreshAllCards();
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
break;
}
case MSG_AI_NAME: {
......@@ -745,10 +745,10 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
pbuf += len + 1;
memcpy(msgbuf, begin, len + 1);
BufferIO::DecodeUTF8(msgbuf, msg);
mainGame->gMutex.Lock();
mainGame->gMutex.lock();
mainGame->SetStaticText(mainGame->stMessage, 310 * mainGame->xScale, mainGame->textFont, msg);
mainGame->PopupElement(mainGame->wMessage);
mainGame->gMutex.Unlock();
mainGame->gMutex.unlock();
mainGame->actionSignal.Reset();
mainGame->actionSignal.Wait();
break;
......
......@@ -179,9 +179,9 @@ JNIEXPORT jbyteArray JNICALL Java_cn_garymb_ygomobile_core_IrrlichtBridge_native
static void* join_game_thread(void* param) {
ygo::mainGame->externalSignal.Wait();
ygo::mainGame->gMutex.Lock();
ygo::mainGame->gMutex.lock();
if (ygo::mainGame->dInfo.isStarted) {
ygo::mainGame->gMutex.Unlock();
ygo::mainGame->gMutex.unlock();
return NULL;
}
irr::android::YGOGameOptions options = irr::android::YGOGameOptions(param);
......@@ -219,7 +219,7 @@ static void* join_game_thread(void* param) {
event.GUIEvent.Caller = ygo::mainGame->btnJoinHost;
ygo::mainGame->device->postEventFromUser(event);
// }
exit: ygo::mainGame->gMutex.Unlock();
exit: ygo::mainGame->gMutex.unlock();
free(param);
return NULL;
......
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