Commit f1e924df authored by nanahira's avatar nanahira

Merge branch 'master' into another

parents ac26fd38 62469620
...@@ -1480,23 +1480,14 @@ void ClientField::RefreshCardCountDisplay() { ...@@ -1480,23 +1480,14 @@ void ClientField::RefreshCardCountDisplay() {
myswprintf(mainGame->dInfo.str_card_count[p], L"%d", mainGame->dInfo.card_count[p]); myswprintf(mainGame->dInfo.str_card_count[p], L"%d", mainGame->dInfo.card_count[p]);
} }
if(mainGame->dInfo.card_count[0] > mainGame->dInfo.card_count[1]) { if(mainGame->dInfo.card_count[0] > mainGame->dInfo.card_count[1]) {
mainGame->dInfo.card_adv_color[0] = 0xffffff00; mainGame->dInfo.card_count_color[0] = 0xffffff00;
mainGame->dInfo.card_adv_color[1] = 0xffff0000; mainGame->dInfo.card_count_color[1] = 0xffff0000;
mainGame->dInfo.card_adv = mainGame->dInfo.card_count[0] - mainGame->dInfo.card_count[1];
myswprintf(mainGame->dInfo.str_card_adv[0], L"+%d", mainGame->dInfo.card_adv);
myswprintf(mainGame->dInfo.str_card_adv[1], L"-%d", mainGame->dInfo.card_adv);
} else if(mainGame->dInfo.card_count[1] > mainGame->dInfo.card_count[0]) { } else if(mainGame->dInfo.card_count[1] > mainGame->dInfo.card_count[0]) {
mainGame->dInfo.card_adv_color[1] = 0xffffff00; mainGame->dInfo.card_count_color[1] = 0xffffff00;
mainGame->dInfo.card_adv_color[0] = 0xffff0000; mainGame->dInfo.card_count_color[0] = 0xffff0000;
mainGame->dInfo.card_adv = mainGame->dInfo.card_count[1] - mainGame->dInfo.card_count[0];
myswprintf(mainGame->dInfo.str_card_adv[1], L"+%d", mainGame->dInfo.card_adv);
myswprintf(mainGame->dInfo.str_card_adv[0], L"-%d", mainGame->dInfo.card_adv);
} else { } else {
mainGame->dInfo.card_adv_color[0] = 0xffffffff; mainGame->dInfo.card_count_color[0] = 0xffffffff;
mainGame->dInfo.card_adv_color[1] = 0xffffffff; mainGame->dInfo.card_count_color[1] = 0xffffffff;
mainGame->dInfo.card_adv = 0;
myswprintf(mainGame->dInfo.str_card_adv[0], L"+%d", mainGame->dInfo.card_adv);
myswprintf(mainGame->dInfo.str_card_adv[1], L"+%d", mainGame->dInfo.card_adv);
} }
} }
} }
...@@ -531,31 +531,30 @@ void Game::DrawMisc() { ...@@ -531,31 +531,30 @@ void Game::DrawMisc() {
} }
} }
if(!dInfo.isReplay && dInfo.player_type < 7 && dInfo.time_limit) { if(!dInfo.isReplay && dInfo.player_type < 7 && dInfo.time_limit) {
DrawShadowText(numFont, L"/", Resize(455, 31, 525, 50), Resize(0, 1, 2, 0), dInfo.time_color[0], 0xff000000, true, false, 0); if(imageManager.tClock != NULL) {
DrawShadowText(numFont, dInfo.str_time_left[0], Resize(455, 31, 490, 50), Resize(0, 1, 2, 0), dInfo.time_color[0], 0xff000000, true, false, 0); driver->draw2DImage(imageManager.tClock, ResizeCardMid(472, 32, 490, 50, 490, 41), recti(0, 0, 128, 128), 0, 0, true);
DrawShadowText(numFont, dInfo.str_time_limit, Resize(490, 31, 525, 50), Resize(0, 1, 2, 0), dInfo.time_color[0], 0xff000000, true, false, 0); driver->draw2DImage(imageManager.tClock, ResizeCardMid(800, 32, 818, 50, 818, 41), recti(0, 0, 128, 128), 0, 0, true);
}
DrawShadowText(numFont, dInfo.str_time_left[0], Resize(490, 31, 520, 50), Resize(0, 1, 2, 0), dInfo.time_color[0], 0xff000000, true, false, 0);
DrawShadowText(numFont, dInfo.str_time_left[1], Resize(818, 31, 848, 50), Resize(0, 1, 2, 0), dInfo.time_color[1], 0xff000000, true, false, 0);
driver->draw2DImage(imageManager.tCover[0], ResizeCardMid(433, 32, 445, 50, 455, 41), rect<s32>(0, 0, CARD_IMG_WIDTH, CARD_IMG_HEIGHT), 0, 0, true);
driver->draw2DImage(imageManager.tCover[1], ResizeCardMid(850, 32, 862, 50, 862, 41), rect<s32>(0, 0, CARD_IMG_WIDTH, CARD_IMG_HEIGHT), 0, 0, true);
DrawShadowText(numFont, L"/", Resize(795, 31, 865, 50), Resize(0, 1, 2, 0), dInfo.time_color[1], 0xff000000, true, false, 0); DrawShadowText(numFont, dInfo.str_card_count[0], Resize(445, 31, 470, 50), Resize(0, 1, 2, 0), dInfo.card_count_color[0], 0xff000000, true, false, 0);
DrawShadowText(numFont, dInfo.str_time_left[1], Resize(795, 31, 830, 50), Resize(0, 1, 2, 0), dInfo.time_color[1], 0xff000000, true, false, 0); DrawShadowText(numFont, dInfo.str_card_count[1], Resize(862, 31, 887, 50), Resize(0, 1, 2, 0), dInfo.card_count_color[1], 0xff000000, true, false, 0);
DrawShadowText(numFont, dInfo.str_time_limit, Resize(830, 31, 865, 50), Resize(0, 1, 2, 0), dInfo.time_color[1], 0xff000000, true, false, 0);
driver->draw2DRectangle(Resize(525, 34, 525 + dInfo.time_left[0] * 100 / dInfo.time_limit, 44), 0xa0e0e0e0, 0xa0e0e0e0, 0xa0c0c0c0, 0xa0c0c0c0); driver->draw2DRectangle(Resize(525, 34, 525 + dInfo.time_left[0] * 100 / dInfo.time_limit, 44), 0xa0e0e0e0, 0xa0e0e0e0, 0xa0c0c0c0, 0xa0c0c0c0);
driver->draw2DRectangleOutline(Resize(525, 34, 625, 44), 0xffffffff); driver->draw2DRectangleOutline(Resize(525, 34, 625, 44), 0xffffffff);
driver->draw2DRectangle(Resize(795 - dInfo.time_left[1] * 100 / dInfo.time_limit, 34, 795, 44), 0xa0e0e0e0, 0xa0e0e0e0, 0xa0c0c0c0, 0xa0c0c0c0); driver->draw2DRectangle(Resize(795 - dInfo.time_left[1] * 100 / dInfo.time_limit, 34, 795, 44), 0xa0e0e0e0, 0xa0e0e0e0, 0xa0c0c0c0, 0xa0c0c0c0);
driver->draw2DRectangleOutline(Resize(695, 34, 795, 44), 0xffffffff); driver->draw2DRectangleOutline(Resize(695, 34, 795, 44), 0xffffffff);
DrawShadowText(numFont, dInfo.str_card_adv[0], Resize(395, 31, 425, 50), Resize(0, 1, 2, 0), dInfo.card_adv_color[0], 0xff000000, true, false, 0);
DrawShadowText(numFont, dInfo.str_card_count[0], Resize(425, 31, 455, 50), Resize(0, 1, 2, 0), 0xffffffff, 0xff000000, true, false, 0);
DrawShadowText(numFont, dInfo.str_card_count[1], Resize(865, 31, 895, 50), Resize(0, 1, 2, 0), 0xffffffff, 0xff000000, true, false, 0);
DrawShadowText(numFont, dInfo.str_card_adv[1], Resize(895, 31, 925, 50), Resize(0, 1, 2, 0), dInfo.card_adv_color[1], 0xff000000, true, false, 0);
} }
else { else {
DrawShadowText(numFont, dInfo.str_card_adv[0], Resize(565, 31, 595, 50), Resize(0, 1, 2, 0), dInfo.card_adv_color[0], 0xff000000, true, false, 0); driver->draw2DImage(imageManager.tCover[0], ResizeCardMid(588, 32, 600, 50, 600, 41), rect<s32>(0, 0, CARD_IMG_WIDTH, CARD_IMG_HEIGHT), 0, 0, true);
DrawShadowText(numFont, dInfo.str_card_count[0], Resize(595, 31, 625, 50), Resize(0, 1, 2, 0), 0xffffffff, 0xff000000, true, false, 0); driver->draw2DImage(imageManager.tCover[1], ResizeCardMid(695, 32, 707, 50, 707, 41), rect<s32>(0, 0, CARD_IMG_WIDTH, CARD_IMG_HEIGHT), 0, 0, true);
DrawShadowText(numFont, dInfo.str_card_count[1], Resize(695, 31, 725, 50), Resize(0, 1, 2, 0), 0xffffffff, 0xff000000, true, false, 0); DrawShadowText(numFont, dInfo.str_card_count[0], Resize(600, 31, 625, 50), Resize(0, 1, 2, 0), dInfo.card_count_color[0], 0xff000000, true, false, 0);
DrawShadowText(numFont, dInfo.str_card_adv[1], Resize(725, 31, 755, 50), Resize(0, 1, 2, 0), dInfo.card_adv_color[1], 0xff000000, true, false, 0); DrawShadowText(numFont, dInfo.str_card_count[1], Resize(707, 31, 732, 50), Resize(0, 1, 2, 0), dInfo.card_count_color[1], 0xff000000, true, false, 0);
} }
DrawShadowText(numFont, dInfo.strLP[0], Resize(330, 12, 631, 30), Resize(0, 1, 2, 0), 0xffffff00, 0xff000000, true, false, 0); DrawShadowText(numFont, dInfo.strLP[0], Resize(330, 12, 631, 30), Resize(0, 1, 2, 0), 0xffffff00, 0xff000000, true, false, 0);
DrawShadowText(numFont, dInfo.strLP[1], Resize(691, 12, 992, 30), Resize(0, 1, 2, 0), 0xffffff00, 0xff000000, true, false, 0); DrawShadowText(numFont, dInfo.strLP[1], Resize(691, 12, 992, 30), Resize(0, 1, 2, 0), 0xffffff00, 0xff000000, true, false, 0);
......
...@@ -855,7 +855,6 @@ void Game::RefreshTimeDisplay() { ...@@ -855,7 +855,6 @@ void Game::RefreshTimeDisplay() {
} }
myswprintf(dInfo.str_time_left[0], L"%d", dInfo.time_left[0]); myswprintf(dInfo.str_time_left[0], L"%d", dInfo.time_left[0]);
myswprintf(dInfo.str_time_left[1], L"%d", dInfo.time_left[1]); myswprintf(dInfo.str_time_left[1], L"%d", dInfo.time_left[1]);
myswprintf(dInfo.str_time_limit, L"%d", dInfo.time_limit);
} }
void Game::BuildProjectionMatrix(irr::core::matrix4& mProjection, f32 left, f32 right, f32 bottom, f32 top, f32 znear, f32 zfar) { void Game::BuildProjectionMatrix(irr::core::matrix4& mProjection, f32 left, f32 right, f32 bottom, f32 top, f32 znear, f32 zfar) {
for(int i = 0; i < 16; ++i) for(int i = 0; i < 16; ++i)
......
...@@ -70,7 +70,6 @@ struct DuelInfo { ...@@ -70,7 +70,6 @@ struct DuelInfo {
int lp[2]; int lp[2];
int start_lp[2]; int start_lp[2];
int card_count[2]; int card_count[2];
int card_adv;
int duel_rule; int duel_rule;
int turn; int turn;
short curMsg; short curMsg;
...@@ -84,12 +83,10 @@ struct DuelInfo { ...@@ -84,12 +83,10 @@ struct DuelInfo {
unsigned char time_player; unsigned char time_player;
unsigned short time_limit; unsigned short time_limit;
unsigned short time_left[2]; unsigned short time_left[2];
wchar_t str_time_limit[16];
wchar_t str_time_left[2][16]; wchar_t str_time_left[2][16];
video::SColor time_color[2]; video::SColor time_color[2];
wchar_t str_card_adv[2][16];
wchar_t str_card_count[2][16]; wchar_t str_card_count[2][16];
video::SColor card_adv_color[2]; video::SColor card_count_color[2];
bool isReplaySwapped; bool isReplaySwapped;
}; };
......
...@@ -74,6 +74,7 @@ bool ImageManager::Initial() { ...@@ -74,6 +74,7 @@ bool ImageManager::Initial() {
snprintf(buff, 100, "textures/pscale/lscale_%d.png", i); snprintf(buff, 100, "textures/pscale/lscale_%d.png", i);
tLScale[i] = driver->getTexture(buff); tLScale[i] = driver->getTexture(buff);
} }
tClock = driver->getTexture("textures/clock.png");
return true; return true;
} }
irr::video::ITexture* ImageManager::GetRandomImage(int image_type) { irr::video::ITexture* ImageManager::GetRandomImage(int image_type) {
......
...@@ -51,6 +51,7 @@ public: ...@@ -51,6 +51,7 @@ public:
irr::video::ITexture* tFieldTransparent[2]; irr::video::ITexture* tFieldTransparent[2];
irr::video::ITexture* tRScale[14]; irr::video::ITexture* tRScale[14];
irr::video::ITexture* tLScale[14]; irr::video::ITexture* tLScale[14];
irr::video::ITexture* tClock;
}; };
extern ImageManager imageManager; extern ImageManager imageManager;
......
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