Commit 3a335d91 authored by nanahira's avatar nanahira

Merge branch 'master' into side

parents 2405d8b7 34a65de1
......@@ -53,6 +53,7 @@
/fonts
/replay
/single
/screenshots
/sound/*.wav
/sound/custom
/sound/BGM
......
......@@ -103,13 +103,18 @@ before_deploy:
- rm -rf pics/thumbnail pics/*.db
- mkdir replay
- mkdir screenshots
- git clone --depth=1 https://$NANAHIRA@github.com/purerosefallen/fonts
- sed -i "s/c:\/windows/./g" system.conf
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
zip -q -r KoishiPro-$TRAVIS_OS_NAME-full-$TRAVIS_TAG.zip ygopro libirrKlang.so LICENSE README.md lflist.conf strings.conf system.conf cards.cdb script textures skin deck single pics replay;
zip -q -r KoishiPro-$TRAVIS_OS_NAME-full-with-sound-$TRAVIS_TAG.zip ygopro libirrKlang.so LICENSE README.md lflist.conf strings.conf system.conf cards.cdb script textures skin deck single pics replay sound;
zip -q -r KoishiPro-$TRAVIS_OS_NAME-full-$TRAVIS_TAG.zip ygopro libirrKlang.so LICENSE README.md lflist.conf strings.conf system.conf cards.cdb script textures fonts skin deck single pics replay screenshots;
zip -q -r KoishiPro-$TRAVIS_OS_NAME-full-with-sound-$TRAVIS_TAG.zip ygopro libirrKlang.so LICENSE README.md lflist.conf strings.conf system.conf cards.cdb script textures fonts skin deck single pics replay sound screenshots;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
zip -q -r KoishiPro-$TRAVIS_OS_NAME-full-$TRAVIS_TAG.zip ygopro.app LICENSE README.md lflist.conf strings.conf system.conf cards.cdb script textures skin deck single pics replay;
zip -q -r KoishiPro-$TRAVIS_OS_NAME-full-with-sound-$TRAVIS_TAG.zip ygopro.app LICENSE README.md lflist.conf strings.conf system.conf cards.cdb script textures skin deck single pics replay sound;
zip -q -r KoishiPro-$TRAVIS_OS_NAME-full-$TRAVIS_TAG.zip ygopro.app LICENSE README.md lflist.conf strings.conf system.conf cards.cdb script textures fonts skin deck single pics replay screenshots;
zip -q -r KoishiPro-$TRAVIS_OS_NAME-full-with-sound-$TRAVIS_TAG.zip ygopro.app LICENSE README.md lflist.conf strings.conf system.conf cards.cdb script textures fonts skin deck single pics replay screenshots sound;
fi
deploy:
......
......@@ -86,8 +86,9 @@ after_build:
- rm -rf pics/thumbnail pics/*.db
- mkdir replay
- mkdir screenshots
- 7z a -mx9 -xr!.git* KoishiPro-%APPVEYOR_REPO_TAG_NAME%.7z ygopro.exe LICENSE README.md lflist.conf strings.conf system.conf cards.cdb script textures skin deck single pics update-koishipro replay WindBot Bot.exe bot.conf
- 7z a -mx9 -xr!.git* KoishiPro-%APPVEYOR_REPO_TAG_NAME%.7z ygopro.exe LICENSE README.md lflist.conf strings.conf system.conf cards.cdb script textures skin deck single pics update-koishipro replay screenshots WindBot Bot.exe bot.conf
- cp -rf KoishiPro-%APPVEYOR_REPO_TAG_NAME%.7z KoishiPro-with-sound-%APPVEYOR_REPO_TAG_NAME%.7z
- 7z a -mx9 -xr!.git* KoishiPro-with-sound-%APPVEYOR_REPO_TAG_NAME%.7z sound
......
No preview for this file type
......@@ -65,7 +65,6 @@ public:
int select_counter_type;
std::vector<ClientCard*> selectable_cards;
std::vector<ClientCard*> selected_cards;
std::vector<ClientCard*> unselected_cards;
std::set<ClientCard*> selectsum_cards;
std::vector<ClientCard*> selectsum_all;
std::vector<int> opcode;
......
......@@ -832,9 +832,9 @@ void DeckBuilder::FilterCards() {
std::vector<std::wstring> query_elements;
std::vector<std::vector<std::wstring>::iterator> query_elements_track;
size_t element_start = 0;
while (1) {
while(1) {
size_t element_end = str.find_first_of(L' ', element_start);
if (element_end == std::wstring::npos)
if(element_end == std::wstring::npos)
break;
size_t length = element_end - element_start;
if(length > 0) {
......@@ -845,18 +845,17 @@ void DeckBuilder::FilterCards() {
}
query_elements.push_back(str.substr(element_start));
std::unordered_map<std::wstring, unsigned int> set_code_map;
for (auto elements_iterator = query_elements.begin(); elements_iterator != query_elements.end(); elements_iterator++) {
for(auto elements_iterator = query_elements.begin(); elements_iterator != query_elements.end(); elements_iterator++) {
const wchar_t* element_pointer = elements_iterator->c_str();
if (element_pointer[0] == L'@')
if(element_pointer[0] == L'@')
set_code_map[*elements_iterator] = dataManager.GetSetCode(&element_pointer[1]);
else
set_code_map[*elements_iterator] = dataManager.GetSetCode(&element_pointer[0]);
if (element_pointer[0] == 0 || (element_pointer[0] == L'$' && element_pointer[1] == 0) || (element_pointer[0] == L'@' && element_pointer[1] == 0))
if(element_pointer[0] == 0 || (element_pointer[0] == L'$' && element_pointer[1] == 0) || (element_pointer[0] == L'@' && element_pointer[1] == 0))
query_elements_track.push_back(elements_iterator);
}
for (auto elements_track_iterator = query_elements_track.begin(); elements_track_iterator != query_elements_track.end(); elements_track_iterator++) {
for(auto elements_track_iterator = query_elements_track.begin(); elements_track_iterator != query_elements_track.end(); elements_track_iterator++)
query_elements.erase(*elements_track_iterator);
}
auto strpointer = dataManager._strings.begin();
for(code_pointer ptr = dataManager._datas.begin(); ptr != dataManager._datas.end(); ++ptr, ++strpointer) {
const CardDataC& data = ptr->second;
......@@ -945,14 +944,14 @@ void DeckBuilder::FilterCards() {
break;
}
} else {
if (!CardNameContains(text.name.c_str(), elements_iterator->c_str()) && text.text.find(elements_iterator->c_str()) == std::wstring::npos
if(!CardNameContains(text.name.c_str(), elements_iterator->c_str()) && text.text.find(elements_iterator->c_str()) == std::wstring::npos
&& (!set_code_map[*elements_iterator] || !check_set_code(data, set_code_map[*elements_iterator]))) {
is_target = false;
break;
}
}
}
if (is_target)
if(is_target)
results.push_back(ptr);
else
continue;
......
......@@ -773,11 +773,13 @@ void Game::DrawGUI() {
env->drawAll();
}
void Game::DrawSpec() {
s32 midx = 574 + (CARD_IMG_WIDTH * 0.5);
s32 midy = 150 + (CARD_IMG_HEIGHT * 0.5);
if(showcard) {
switch(showcard) {
case 1: {
driver->draw2DImage(imageManager.GetTexture(showcardcode, true), Resize(574, 150));
driver->draw2DImage(imageManager.tMask, Resize(574, 150, 574 + (showcarddif > CARD_IMG_WIDTH ? CARD_IMG_WIDTH : showcarddif), 150 + CARD_IMG_HEIGHT),
driver->draw2DImage(imageManager.GetTexture(showcardcode, true), ResizeCardHint(574, 150));
driver->draw2DImage(imageManager.tMask, ResizeCardMid(574, 150, 574 + (showcarddif > CARD_IMG_WIDTH ? CARD_IMG_WIDTH : showcarddif), 150 + CARD_IMG_HEIGHT, midx, midy),
recti(CARD_IMG_HEIGHT - showcarddif, 0, CARD_IMG_HEIGHT - (showcarddif > CARD_IMG_WIDTH ? showcarddif - CARD_IMG_WIDTH : 0), CARD_IMG_HEIGHT), 0, 0, true);
showcarddif += 15;
if(showcarddif >= CARD_IMG_HEIGHT) {
......@@ -787,8 +789,8 @@ void Game::DrawSpec() {
break;
}
case 2: {
driver->draw2DImage(imageManager.GetTexture(showcardcode, true), Resize(574, 150));
driver->draw2DImage(imageManager.tMask, Resize(574 + showcarddif, 150, 574 + CARD_IMG_WIDTH, 150 + CARD_IMG_HEIGHT),
driver->draw2DImage(imageManager.GetTexture(showcardcode, true), ResizeCardHint(574, 150));
driver->draw2DImage(imageManager.tMask, ResizeCardMid(574 + showcarddif, 150, 574 + CARD_IMG_WIDTH, 150 + CARD_IMG_HEIGHT, midx, midy),
recti(0, 0, CARD_IMG_WIDTH - showcarddif, CARD_IMG_HEIGHT), 0, 0, true);
showcarddif += 15;
if(showcarddif >= CARD_IMG_WIDTH) {
......@@ -797,8 +799,8 @@ void Game::DrawSpec() {
break;
}
case 3: {
driver->draw2DImage(imageManager.GetTexture(showcardcode, true), Resize(574, 150));
driver->draw2DImage(imageManager.tNegated, Resize(536 + showcarddif, 141 + showcarddif, 792 - showcarddif, 397 - showcarddif), recti(0, 0, 128, 128), 0, 0, true);
driver->draw2DImage(imageManager.GetTexture(showcardcode, true), ResizeCardHint(574, 150));
driver->draw2DImage(imageManager.tNegated, ResizeCardMid(536 + showcarddif, 141 + showcarddif, 792 - showcarddif, 397 - showcarddif, midx, midy), recti(0, 0, 128, 128), 0, 0, true);
if(showcarddif < 64)
showcarddif += 4;
break;
......@@ -808,8 +810,8 @@ void Game::DrawSpec() {
matManager.c2d[1] = (showcarddif << 24) | 0xffffff;
matManager.c2d[2] = (showcarddif << 24) | 0xffffff;
matManager.c2d[3] = (showcarddif << 24) | 0xffffff;
driver->draw2DImage(imageManager.GetTexture(showcardcode, true), Resize(574, 150, 574 + CARD_IMG_WIDTH, 150 + CARD_IMG_HEIGHT),
Resize(0, 0, CARD_IMG_WIDTH, CARD_IMG_HEIGHT), 0, matManager.c2d, true);
driver->draw2DImage(imageManager.GetTexture(showcardcode, true), ResizeCardHint(574, 150, 574 + CARD_IMG_WIDTH, 150 + CARD_IMG_HEIGHT),
ResizeFit(0, 0, CARD_IMG_WIDTH, CARD_IMG_HEIGHT), 0, matManager.c2d, true);
if(showcarddif < 255)
showcarddif += 17;
break;
......@@ -819,28 +821,34 @@ void Game::DrawSpec() {
matManager.c2d[1] = (showcarddif << 25) | 0xffffff;
matManager.c2d[2] = (showcarddif << 25) | 0xffffff;
matManager.c2d[3] = (showcarddif << 25) | 0xffffff;
driver->draw2DImage(imageManager.GetTexture(showcardcode, true), Resize(662 - showcarddif * 0.69685f, 277 - showcarddif, 662 + showcarddif * 0.69685f, 277 + showcarddif),
Resize(0, 0, CARD_IMG_WIDTH, CARD_IMG_HEIGHT), 0, matManager.c2d, true);
driver->draw2DImage(imageManager.GetTexture(showcardcode, true), ResizeCardMid(662 - showcarddif * 0.69685f, 277 - showcarddif, 662 + showcarddif * 0.69685f, 277 + showcarddif, midx, midy),
ResizeFit(0, 0, CARD_IMG_WIDTH, CARD_IMG_HEIGHT), 0, matManager.c2d, true);
if(showcarddif < 127)
showcarddif += 9;
break;
}
case 6: {
driver->draw2DImage(imageManager.GetTexture(showcardcode, true), Resize(574, 150));
driver->draw2DImage(imageManager.tNumber, Resize(536 + showcarddif, 141 + showcarddif, 792 - showcarddif, 397 - showcarddif),
driver->draw2DImage(imageManager.GetTexture(showcardcode, true), ResizeCardHint(574, 150));
driver->draw2DImage(imageManager.tNumber, ResizeCardMid(536 + showcarddif, 141 + showcarddif, 792 - showcarddif, 397 - showcarddif, midx, midy),
recti((showcardp % 5) * 64, (showcardp / 5) * 64, (showcardp % 5 + 1) * 64, (showcardp / 5 + 1) * 64), 0, 0, true);
if(showcarddif < 64)
showcarddif += 4;
break;
}
case 7: {
float mul = xScale;
if(xScale > yScale)
mul = yScale;
core::position2d<s32> corner[4];
float y = sin(showcarddif * 3.1415926f / 180.0f) * CARD_IMG_HEIGHT * yScale;
corner[0] = core::position2d<s32>(574 * xScale - (CARD_IMG_HEIGHT * yScale - y) * 0.3f, 404 * yScale - y);
corner[1] = core::position2d<s32>(751 * xScale + (CARD_IMG_HEIGHT * yScale - y) * 0.3f, 404 * yScale - y);
corner[2] = core::position2d<s32>(574 * xScale, 404 * yScale);
corner[3] = core::position2d<s32>(751 * xScale, 404 * yScale);
irr::gui::Draw2DImageQuad(driver, imageManager.GetTexture(showcardcode, true), Resize(0, 0, CARD_IMG_WIDTH, CARD_IMG_HEIGHT), corner);
float y = sin(showcarddif * 3.1415926f / 180.0f) * CARD_IMG_HEIGHT * mul;
s32 winx = midx * xScale + (574 - midx) * mul;
s32 winx2 = midx * xScale + (751 - midx) * mul;
s32 winy = midy * yScale + (404 - midy) * mul;
corner[0] = core::position2d<s32>(winx - (CARD_IMG_HEIGHT * mul - y) * 0.3f, winy - y);
corner[1] = core::position2d<s32>(winx2 + (CARD_IMG_HEIGHT * mul - y) * 0.3f, winy - y);
corner[2] = core::position2d<s32>(winx, winy);
corner[3] = core::position2d<s32>(winx2, winy);
irr::gui::Draw2DImageQuad(driver, imageManager.GetTexture(showcardcode, true), ResizeFit(0, 0, CARD_IMG_WIDTH, CARD_IMG_HEIGHT), corner);
showcardp++;
showcarddif += 9;
if(showcarddif >= 90)
......@@ -918,7 +926,7 @@ void Game::DrawSpec() {
DrawShadowText(lpcFont, lstr, ResizeElem(650 - pos.Width / 2, 290, 950, 370), Resize(-1, -1, 0, 0), 0xffffffff);
if(dInfo.vic_string && (showcardcode == 1 || showcardcode == 2)) {
driver->draw2DRectangle(0xa0000000, ResizeElem(540, 320, 800, 340));
DrawShadowText(textFont, dInfo.vic_string, ResizeElem(500, 320, 840, 340), Resize(-2, -1, 0, 0), 0xffffffff, 0xff000000, true, true, 0);
DrawShadowText(guiFont, dInfo.vic_string, ResizeElem(500, 320, 840, 340), Resize(-2, -1, 0, 0), 0xffffffff, 0xff000000, true, true, 0);
}
} else if(showcardp < showcarddif + 10) {
int alpha = ((showcarddif + 10 - showcardp) * 25) << 24;
......@@ -957,7 +965,7 @@ void Game::DrawSpec() {
continue;
if(!showChat && i > 2)
continue;
int w = textFont->getDimension(chatMsg[i].c_str()).Width;
int w = guiFont->getDimension(chatMsg[i].c_str()).Width;
recti rectloc(mainGame->wChat->getRelativePosition().UpperLeftCorner.X, mainGame->window_size.Height - 45, mainGame->wChat->getRelativePosition().UpperLeftCorner.X + 2 + w, mainGame->window_size.Height - 25);
rectloc -= position2di(0, i * 20);
......@@ -966,8 +974,8 @@ void Game::DrawSpec() {
recti shadowloc = msgloc + position2di(1, 1);
driver->draw2DRectangle(rectloc, 0xa0000000, 0xa0000000, 0xa0000000, 0xa0000000);
textFont->draw(chatMsg[i].c_str(), msgloc, 0xff000000, false, false);
textFont->draw(chatMsg[i].c_str(), shadowloc, chatColor[chatType[i]], false, false);
guiFont->draw(chatMsg[i].c_str(), msgloc, 0xff000000, false, false);
guiFont->draw(chatMsg[i].c_str(), shadowloc, chatColor[chatType[i]], false, false);
}
}
}
......
......@@ -1438,7 +1438,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
should_show_tip = true;
myswprintf(formatBuffer, dataManager.GetSysString(1700), mainGame->btnCancelOrFinish->getText());
mainGame->stTip->setText(formatBuffer);
irr::core::dimension2d<unsigned int> dtip = mainGame->textFont->getDimension(formatBuffer) + irr::core::dimension2d<unsigned int>(10, 10);
irr::core::dimension2d<unsigned int> dtip = mainGame->guiFont->getDimension(formatBuffer) + irr::core::dimension2d<unsigned int>(10, 10);
mainGame->stTip->setRelativePosition(mainGame->Resize(x - 10 - dtip.Width, y - 10 - dtip.Height, x - 10, y - 10));
}
mainGame->stTip->setVisible(should_show_tip);
......@@ -1562,7 +1562,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
str.append(formatBuffer);
}
should_show_tip = true;
irr::core::dimension2d<unsigned int> dtip = mainGame->textFont->getDimension(str.c_str()) + irr::core::dimension2d<unsigned int>(10, 10);
irr::core::dimension2d<unsigned int> dtip = mainGame->guiFont->getDimension(str.c_str()) + irr::core::dimension2d<unsigned int>(10, 10);
mainGame->stTip->setRelativePosition(recti(mousepos.X - 10 - dtip.Width, mousepos.Y - 10 - dtip.Height, mousepos.X - 10, mousepos.Y - 10));
mainGame->stTip->setText(str.c_str());
}
......@@ -1919,6 +1919,13 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
return true;
break;
}
case irr::KEY_KEY_X:
case irr::KEY_F12: {
if(!event.KeyInput.PressedDown && !mainGame->HasFocus(EGUIET_EDIT_BOX))
mainGame->takeScreenshot();
return true;
break;
}
default: break;
}
break;
......
This diff is collapsed.
......@@ -147,6 +147,8 @@ public:
void AddChatMsg(wchar_t* msg, int player);
void ClearChatMsg();
void AddDebugMsg(char* msgbuf);
bool MakeDirectory(const std::string folder);
void initUtils();
void ClearTextures();
void CloseDuelWindow();
......@@ -166,9 +168,15 @@ public:
recti ResizeElem(s32 x, s32 y, s32 x2, s32 y2);
recti ResizeWin(s32 x, s32 y, s32 x2, s32 y2, bool chat = false);
recti ResizeCard(s32 x, s32 y, s32 x2, s32 y2);
recti ResizeCardHint(s32 x, s32 y, s32 x2, s32 y2);
position2di ResizeCardHint(s32 x, s32 y);
recti ResizeCardMid(s32 x, s32 y, s32 x2, s32 y2, s32 midx, s32 midy);
position2di ResizeCardMid(s32 x, s32 y, s32 midx, s32 midy);
recti ResizeFit(s32 x, s32 y, s32 x2, s32 y2);
void SetWindowsIcon();
void FlashWindow();
void takeScreenshot();
void SetCursor(ECURSOR_ICON icon);
Mutex gMutex;
......
......@@ -268,14 +268,25 @@ irr::video::ITexture* ImageManager::GetTexture(int code, bool fit) {
int width = CARD_IMG_WIDTH;
int height = CARD_IMG_HEIGHT;
if(fit) {
width = width * mainGame->xScale;
height = height * mainGame->yScale;
float mul = mainGame->xScale;
if(mainGame->xScale > mainGame->yScale)
mul = mainGame->yScale;
width = width * mul;
height = height * mul;
}
auto tit = tMap[fit ? 1 : 0].find(code);
if(tit == tMap[fit ? 1 : 0].end()) {
char file[256];
sprintf(file, "expansions/pics/%d.jpg", code);
sprintf(file, "expansions/pics/%d.png", code);
irr::video::ITexture* img = GetTextureFromFile(file, width, height);
if(img == NULL) {
sprintf(file, "expansions/pics/%d.jpg", code);
img = GetTextureFromFile(file, width, height);
}
if(img == NULL) {
sprintf(file, "pics/%d.png", code);
img = GetTextureFromFile(file, width, height);
}
if(img == NULL) {
sprintf(file, "pics/%d.jpg", code);
img = GetTextureFromFile(file, width, height);
......@@ -300,15 +311,31 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
int height = CARD_THUMB_HEIGHT * mainGame->yScale;
if(tit == tThumb.end()) {
char file[256];
sprintf(file, "expansions/pics/thumbnail/%d.jpg", code);
sprintf(file, "expansions/pics/thumbnail/%d.png", code);
irr::video::ITexture* img = GetTextureFromFile(file, width, height);
if(img == NULL) {
sprintf(file, "expansions/pics/thumbnail/%d.jpg", code);
img = GetTextureFromFile(file, width, height);
}
if(img == NULL) {
sprintf(file, "pics/thumbnail/%d.png", code);
img = GetTextureFromFile(file, width, height);
}
if(img == NULL) {
sprintf(file, "pics/thumbnail/%d.jpg", code);
img = GetTextureFromFile(file, width, height);
}
if(img == NULL && mainGame->gameConf.use_image_scale) {
sprintf(file, "expansions/pics/%d.jpg", code);
sprintf(file, "expansions/pics/%d.png", code);
img = GetTextureFromFile(file, width, height);
if(img == NULL) {
sprintf(file, "expansions/pics/%d.jpg", code);
img = GetTextureFromFile(file, width, height);
}
if(img == NULL) {
sprintf(file, "pics/%d.png", code);
img = GetTextureFromFile(file, width, height);
}
if(img == NULL) {
sprintf(file, "pics/%d.jpg", code);
img = GetTextureFromFile(file, width, height);
......
Subproject commit 482e002181d7a007ffe04d4bb8cb4a8b5e4d2e28
Subproject commit 92ad9db2a69bbaf4a07ef0173fe3ee03615b1f24
......@@ -9,7 +9,7 @@ solution "ygo"
end
end
configurations { "Debug", "Release" }
configurations { "Release", "Debug" }
defines { "LUA_COMPAT_5_2" }
configuration "windows"
defines { "WIN32", "_WIN32", "WINVER=0x0501" }
......@@ -44,7 +44,7 @@ solution "ygo"
configuration { "Release", "vs*" }
flags { "StaticRuntime", "LinkTimeOptimization" }
disablewarnings { "4244", "4267", "4838", "4577", "4819", "4018", "4996", "4477", "4091" }
disablewarnings { "4244", "4267", "4838", "4577", "4819", "4018", "4996", "4477", "4091", "4305" }
configuration { "Release", "not vs*" }
symbols "On"
......
Subproject commit 63aa6c77dae13e742d43f92528ca7a84ec80b7d8
Subproject commit be6d9d319603f81d44d73d86d93804bb290f9bda
......@@ -240,6 +240,9 @@
!system 1161 效果处理
!system 1162 效果重置
!system 1163 灵摆召唤
!system 1164 同调召唤
!system 1165 超量召唤
!system 1166 连接召唤
#menu
!system 1200 联机模式
!system 1201 单人模式
......
......@@ -2,7 +2,7 @@
#nickname & gamename should be less than 20 characters
use_d3d = 0
use_image_scale = 1
pro_version = 4930
pro_version = 4931
antialias = 2
errorlog = 3
nickname = Komeiji Koishi
......
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