Commit 0c01a180 authored by wind2009's avatar wind2009

Merge remote-tracking branch 'upstream/master'

parents 5f693aa2 27dd3d9d
......@@ -86,8 +86,6 @@ using namespace video;
using namespace io;
using namespace gui;
typedef int BOOL;
extern const unsigned short PRO_VERSION;
extern int enable_log;
extern bool exit_on_return;
......
......@@ -46,13 +46,13 @@ public:
string_pointer strings_begin;
string_pointer strings_end;
wchar_t numStrings[301][4];
wchar_t numBuffer[6];
wchar_t attBuffer[128];
wchar_t racBuffer[128];
wchar_t tpBuffer[128];
wchar_t scBuffer[128];
wchar_t lmBuffer[32];
wchar_t numStrings[301][4]{};
wchar_t numBuffer[6]{};
wchar_t attBuffer[128]{};
wchar_t racBuffer[128]{};
wchar_t tpBuffer[128]{};
wchar_t scBuffer[128]{};
wchar_t lmBuffer[32]{};
static byte scriptBuffer[0x20000];
static const wchar_t* unknown_string;
......
......@@ -4023,8 +4023,8 @@ void DuelClient::BeginRefreshHost() {
SOCKET sSend = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if(sSend == INVALID_SOCKET)
break;
BOOL opt = TRUE;
setsockopt(sSend, SOL_SOCKET, SO_BROADCAST, (const char*)&opt, sizeof(BOOL));
int opt = TRUE;
setsockopt(sSend, SOL_SOCKET, SO_BROADCAST, (const char*)&opt, sizeof opt);
if(bind(sSend, (sockaddr*)&local, sizeof(sockaddr)) == SOCKET_ERROR) {
closesocket(sSend);
break;
......
......@@ -783,7 +783,7 @@ bool Game::Initialize() {
btnCategoryOK = env->addButton(rect<s32>(150, 210, 250, 235), wCategories, BUTTON_CATEGORY_OK, dataManager.GetSysString(1211));
int catewidth = 0;
for(int i = 0; i < 32; ++i) {
irr::core::dimension2d<unsigned int> dtxt = mainGame->guiFont->getDimension(dataManager.GetSysString(1100 + i));
irr::core::dimension2d<unsigned int> dtxt = guiFont->getDimension(dataManager.GetSysString(1100 + i));
if((int)dtxt.Width + 40 > catewidth)
catewidth = dtxt.Width + 40;
}
......@@ -1556,7 +1556,7 @@ void Game::ShowCardInfo(int code, bool resize) {
myswprintf(formatBuffer, L"[%ls] %ls/%ls", dataManager.FormatType(cd.type), dataManager.FormatRace(cd.race), dataManager.FormatAttribute(cd.attribute));
stInfo->setText(formatBuffer);
int offset_info = 0;
irr::core::dimension2d<unsigned int> dtxt = mainGame->guiFont->getDimension(formatBuffer);
irr::core::dimension2d<unsigned int> dtxt = guiFont->getDimension(formatBuffer);
if(dtxt.Width > (300 * xScale - 13) - 15)
offset_info = 15;
if(!(cd.type & TYPE_LINK)) {
......@@ -1590,7 +1590,7 @@ void Game::ShowCardInfo(int code, bool resize) {
}
stDataInfo->setText(formatBuffer);
int offset_arrows = offset_info;
dtxt = mainGame->guiFont->getDimension(formatBuffer);
dtxt = guiFont->getDimension(formatBuffer);
if(dtxt.Width > (300 * xScale - 13) - 15)
offset_arrows += 15;
stInfo->setRelativePosition(rect<s32>(15, 37, 300 * xScale - 13, (60 + offset_info)));
......@@ -1920,8 +1920,8 @@ void Game::OnResize() {
scrTabSystem->setVisible(false);
if(gameConf.resize_popup_menu) {
int width = 100 * mainGame->xScale;
int height = (mainGame->yScale >= 0.666) ? 21 * mainGame->yScale : 14;
int width = 100 * xScale;
int height = (yScale >= 0.666) ? 21 * yScale : 14;
wCmdMenu->setRelativePosition(recti(1, 1, width + 1, 1));
btnActivate->setRelativePosition(recti(1, 1, width, height));
btnSummon->setRelativePosition(recti(1, 1, width, height));
......@@ -2101,7 +2101,7 @@ void Game::FlashWindow() {
#endif
}
void Game::SetCursor(ECURSOR_ICON icon) {
ICursorControl* cursor = mainGame->device->getCursorControl();
ICursorControl* cursor = device->getCursorControl();
if(cursor->getActiveIcon() != icon) {
cursor->setActiveIcon(icon);
}
......
......@@ -40,9 +40,9 @@ bool NetServer::StartBroadcast() {
if(!net_evbase)
return false;
SOCKET udp = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
BOOL opt = TRUE;
setsockopt(udp, SOL_SOCKET, SO_BROADCAST, (const char*)&opt, sizeof(BOOL));
setsockopt(udp, SOL_SOCKET, SO_REUSEADDR, (const char*)&opt, sizeof(BOOL));
int opt = TRUE;
setsockopt(udp, SOL_SOCKET, SO_BROADCAST, (const char*)&opt, sizeof opt);
setsockopt(udp, SOL_SOCKET, SO_REUSEADDR, (const char*)&opt, sizeof opt);
sockaddr_in addr;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
......
This diff is collapsed.
......@@ -41,6 +41,7 @@ bot_deck_path = ./botdeck
quick_animation = 0
auto_save_replay = 0
draw_single_chain = 0
hide_player_name = 0
prefer_expansion_script = 0
window_maximized = 0
window_width = 1280
......
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