Commit 8535e022 authored by nanahira's avatar nanahira

add pscale image

parent f24fe048
......@@ -395,6 +395,22 @@ void Game::DrawCard(ClientCard* pcard) {
driver->setTransform(irr::video::ETS_WORLD, atk);
driver->drawVertexPrimitiveList(matManager.vSymbol, 4, matManager.iRectangle, 2);
}
if(mainGame->chkEnablePScale->isChecked() && (pcard->type & TYPE_PENDULUM) && ((pcard->location & LOCATION_SZONE) && (pcard->sequence == 0 || pcard->sequence == 6))) {
int scale = pcard->lscale;
if(scale >= 0 && scale <= 13 && imageManager.tLScale[scale]) {
matManager.mTexture.setTexture(0, imageManager.tLScale[scale]);
driver->setMaterial(matManager.mTexture);
driver->drawVertexPrimitiveList(matManager.vPScale, 4, matManager.iRectangle, 2);
}
}
if(mainGame->chkEnablePScale->isChecked() && (pcard->type & TYPE_PENDULUM) && ((pcard->location & LOCATION_SZONE) && (pcard->sequence == 4 || pcard->sequence == 7))) {
int scale2 = pcard->rscale;
if(scale2 >= 0 && scale2 <= 13 && imageManager.tRScale[scale2]) {
matManager.mTexture.setTexture(0, imageManager.tRScale[scale2]);
driver->setMaterial(matManager.mTexture);
driver->drawVertexPrimitiveList(matManager.vPScale, 4, matManager.iRectangle, 2);
}
}
}
void Game::DrawMisc() {
static irr::core::vector3df act_rot(0, 0, 0);
......
......@@ -304,6 +304,9 @@ bool Game::Initialize() {
posY += 30;
chkMusicMode = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabSystem, -1, dataManager.GetSysString(1281));
chkMusicMode->setChecked(gameConf.music_mode != 0);
posY += 30;
chkEnablePScale = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabSystem, -1, dataManager.GetSysString(1282));
chkEnablePScale->setChecked(gameConf.chkEnablePScale != 0);
//
wHand = env->addWindow(rect<s32>(500, 450, 825, 605), false, L"");
wHand->getCloseButton()->setVisible(false);
......@@ -1054,6 +1057,7 @@ void Game::LoadConfig() {
gameConf.enable_music = true;
gameConf.music_volume = 0.5;
gameConf.music_mode = 1;
gameConf.chkEnablePScale = 1;
while(fgets(linebuf, 256, fp)) {
sscanf(linebuf, "%s = %s", strbuf, valbuf);
if(!strcmp(strbuf, "antialias")) {
......@@ -1126,6 +1130,8 @@ void Game::LoadConfig() {
gameConf.music_volume = atof(valbuf) / 100;
} else if(!strcmp(strbuf, "music_mode")) {
gameConf.music_mode = atoi(valbuf);
} else if(!strcmp(strbuf, "enable_pendulum_scale")) {
gameConf.chkEnablePScale = atoi(valbuf);
} else {
// options allowing multiple words
sscanf(linebuf, "%s = %240[^\n]", strbuf, valbuf);
......@@ -1196,6 +1202,14 @@ void Game::SaveConfig() {
if(vol < 0) vol = 0; else if(vol > 100) vol = 100;
fprintf(fp, "music_volume = %d\n", vol);
fprintf(fp, "music_mode = %d\n", (chkMusicMode->isChecked() ? 1 : 0));
<<<<<<< HEAD
=======
fprintf(fp, "window_maximized = %d\n", (gameConf.window_maximized ? 1 : 0));
fprintf(fp, "window_width = %d\n", gameConf.window_width);
fprintf(fp, "window_height = %d\n", gameConf.window_height);
fprintf(fp, "resize_popup_menu = %d\n", gameConf.resize_popup_menu ? 1 : 0);
fprintf(fp, "enable_pendulum_scale = %d\n", ((mainGame->chkEnablePScale->isChecked()) ? 1 : 0));
>>>>>>> 82b74157... Merge branch 'master' into another
fclose(fp);
}
void Game::ShowCardInfo(int code) {
......
......@@ -47,6 +47,7 @@ struct Config {
double sound_volume;
double music_volume;
int music_mode;
int chkEnablePScale;
};
struct DuelInfo {
......@@ -245,6 +246,7 @@ public:
irr::gui::IGUIScrollBar* scrSoundVolume;
irr::gui::IGUIScrollBar* scrMusicVolume;
irr::gui::IGUICheckBox* chkMusicMode;
irr::gui::IGUICheckBox* chkEnablePScale;
//main menu
irr::gui::IGUIWindow* wMainMenu;
irr::gui::IGUIButton* btnLanMode;
......
......@@ -38,6 +38,15 @@ bool ImageManager::Initial() {
tFieldTransparent[0] = driver->getTexture("textures/field-transparent2.png");
tField[1] = driver->getTexture("textures/field3.png");
tFieldTransparent[1] = driver->getTexture("textures/field-transparent3.png");
char buff[100];
for (int i = 0; i < 14; i++) {
snprintf(buff, 100, "textures/pscale/rscale_%d.png", i);
tRScale[i] = driver->getTexture(buff);
}
for (int i = 0; i < 14; i++) {
snprintf(buff, 100, "textures/pscale/lscale_%d.png", i);
tLScale[i] = driver->getTexture(buff);
}
return true;
}
void ImageManager::SetDevice(irr::IrrlichtDevice* dev) {
......
......@@ -44,6 +44,8 @@ public:
irr::video::ITexture* tBackGround_deck;
irr::video::ITexture* tField[2];
irr::video::ITexture* tFieldTransparent[2];
irr::video::ITexture* tRScale[14];
irr::video::ITexture* tLScale[14];
};
extern ImageManager imageManager;
......
......@@ -21,6 +21,7 @@ Materials::Materials() {
SetS3DVertex(vChainNum, -0.35f, -0.35f, 0.35f, 0.35f, 0, 1, 0, 0, 0.19375f, 0.2421875f);
SetS3DVertex(vActivate, -0.5f, -0.5f, 0.5f, 0.5f, 0, 1, 0, 0, 1, 1);
SetS3DVertex(vField, -1.0f, -4.0f, 9.0f, 4.0f, 0, 1, 0, 0, 1, 1);
SetS3DVertex(vPScale, -0.35f, -0.5, 0.35, 0.5f, 0, 1, 0, 0, 1, 1);
SetS3DVertex(vFieldSpell, 1.2f, -3.2f, 6.7f, 3.2f, 0, 1, 0, 0, 1, 1);
SetS3DVertex(vFieldSpell1, 1.2f, 0.8f, 6.7f, 3.2f, 0, 1, 0, 0.2f, 1, 0.63636f);
SetS3DVertex(vFieldSpell2, 1.2f, -3.2f, 6.7f, -0.8f, 0, 1, 1, 0.63636f, 0, 0.2f);
......
......@@ -11,6 +11,7 @@ public:
S3DVertex vCardOutline[4];
S3DVertex vCardOutliner[4];
S3DVertex vCardBack[4];
S3DVertex vPScale[4];
S3DVertex vSymbol[4];
S3DVertex vNegate[4];
S3DVertex vChainNum[4];
......
......@@ -305,6 +305,7 @@
!system 1279 开启音效
!system 1280 开启音乐
!system 1281 按场景切换音乐
!system 1282 数字灵摆图片
!system 1290 忽略对方发言
!system 1291 忽略观战者发言
!system 1292 忽略时点
......
......@@ -36,3 +36,4 @@ enable_music = 1
sound_volume = 50
music_volume = 50
music_mode = 1
enable_pendulum_scale = 1
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