Skip to content

Commit

Permalink
always show chain mark (Fluorohydride#2294)
Browse files Browse the repository at this point in the history
  • Loading branch information
mercury233 authored May 6, 2020
1 parent 2acbb94 commit 032b1f7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 31 deletions.
42 changes: 20 additions & 22 deletions gframe/drawing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,28 +457,26 @@ void Game::DrawMisc() {
driver->setTransform(irr::video::ETS_WORLD, im);
driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2);
}
if(dField.chains.size() > 1) {
for(size_t i = 0; i < dField.chains.size(); ++i) {
if(dField.chains[i].solved)
break;
matManager.mTRTexture.setTexture(0, imageManager.tChain);
matManager.mTRTexture.AmbientColor = 0xffffff00;
ic.setRotationRadians(act_rot);
ic.setTranslation(dField.chains[i].chain_pos);
driver->setMaterial(matManager.mTRTexture);
driver->setTransform(irr::video::ETS_WORLD, ic);
driver->drawVertexPrimitiveList(matManager.vSymbol, 4, matManager.iRectangle, 2);
it.setScale(0.6f);
it.setTranslation(dField.chains[i].chain_pos);
matManager.mTRTexture.setTexture(0, imageManager.tNumber);
matManager.vChainNum[0].TCoords = vector2df(0.19375f * (i % 5), 0.2421875f * (i / 5));
matManager.vChainNum[1].TCoords = vector2df(0.19375f * (i % 5 + 1), 0.2421875f * (i / 5));
matManager.vChainNum[2].TCoords = vector2df(0.19375f * (i % 5), 0.2421875f * (i / 5 + 1));
matManager.vChainNum[3].TCoords = vector2df(0.19375f * (i % 5 + 1), 0.2421875f * (i / 5 + 1));
driver->setMaterial(matManager.mTRTexture);
driver->setTransform(irr::video::ETS_WORLD, it);
driver->drawVertexPrimitiveList(matManager.vChainNum, 4, matManager.iRectangle, 2);
}
for(size_t i = 0; i < dField.chains.size(); ++i) {
if(dField.chains[i].solved)
break;
matManager.mTRTexture.setTexture(0, imageManager.tChain);
matManager.mTRTexture.AmbientColor = 0xffffff00;
ic.setRotationRadians(act_rot);
ic.setTranslation(dField.chains[i].chain_pos);
driver->setMaterial(matManager.mTRTexture);
driver->setTransform(irr::video::ETS_WORLD, ic);
driver->drawVertexPrimitiveList(matManager.vSymbol, 4, matManager.iRectangle, 2);
it.setScale(0.6f);
it.setTranslation(dField.chains[i].chain_pos);
matManager.mTRTexture.setTexture(0, imageManager.tNumber);
matManager.vChainNum[0].TCoords = vector2df(0.19375f * (i % 5), 0.2421875f * (i / 5));
matManager.vChainNum[1].TCoords = vector2df(0.19375f * (i % 5 + 1), 0.2421875f * (i / 5));
matManager.vChainNum[2].TCoords = vector2df(0.19375f * (i % 5), 0.2421875f * (i / 5 + 1));
matManager.vChainNum[3].TCoords = vector2df(0.19375f * (i % 5 + 1), 0.2421875f * (i / 5 + 1));
driver->setMaterial(matManager.mTRTexture);
driver->setTransform(irr::video::ETS_WORLD, it);
driver->drawVertexPrimitiveList(matManager.vChainNum, 4, matManager.iRectangle, 2);
}
//finish button
if(btnCancelOrFinish->isVisible() && dField.select_ready)
Expand Down
16 changes: 7 additions & 9 deletions gframe/duelclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2906,15 +2906,13 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int ct = BufferIO::ReadInt8(pbuf);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
return true;
if (mainGame->dField.chains.size() > 1) {
if (mainGame->dField.last_chain)
mainGame->WaitFrameSignal(11);
for(int i = 0; i < 5; ++i) {
mainGame->dField.chains[ct - 1].solved = false;
mainGame->WaitFrameSignal(3);
mainGame->dField.chains[ct - 1].solved = true;
mainGame->WaitFrameSignal(3);
}
if(mainGame->dField.last_chain)
mainGame->WaitFrameSignal(11);
for(int i = 0; i < 5; ++i) {
mainGame->dField.chains[ct - 1].solved = false;
mainGame->WaitFrameSignal(3);
mainGame->dField.chains[ct - 1].solved = true;
mainGame->WaitFrameSignal(3);
}
mainGame->dField.last_chain = false;
return true;
Expand Down

0 comments on commit 032b1f7

Please sign in to comment.