animation doesn't work
This commit is contained in:
1 parent
cfd1a0a062
commit
992befeb45
5 files changed
+33
-78
No files matched your search
+21
-24
@@ -54,7 +54,7 @@ void TMatch3FieldParams::Serialize(boost::property_tree::ptree& propertyTree)
|
||||
ChipMatchTime = propertyTree.get<size_t>("Match3Params.ChipMatchTime");
|
||||
ChipTypeCount = propertyTree.get<size_t>("Match3Params.ChipTypeCount");
|
||||
|
||||
BOOST_FOREACH(boost::property_tree::ptree::value_type &v, propertyTree.get_child("Match3Params.ChipList"))
|
||||
for (boost::property_tree::ptree::value_type &v : propertyTree.get_child("Match3Params.ChipList"))
|
||||
{
|
||||
boost::property_tree::ptree& p = v.second.get_child("");
|
||||
chipTemplateParams.Serialize(p);
|
||||
@@ -181,14 +181,14 @@ Eigen::Vector2f TMatch3Logic::GetExpectedLeftBottomPos(size_t x, size_t y)
|
||||
|
||||
void TMatch3Logic::StartAnimateChip(size_t x, size_t y)
|
||||
{
|
||||
//return;
|
||||
SE::ResourceManager->HalibutAnimationManager.StartAnimation(ChipMatrix[x][y].AnimName);
|
||||
}
|
||||
|
||||
void TMatch3Logic::StopAnimateChip(size_t x, size_t y)
|
||||
{
|
||||
|
||||
//return;
|
||||
SE::ResourceManager->HalibutAnimationManager.StopAnimation(ChipMatrix[x][y].AnimName);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -413,8 +413,6 @@ void TMatch3Logic::MoveVertexListShiftBackWithoutAnimation(SE::TRenderPairList::
|
||||
|
||||
void TMatch3Logic::InnerAddChipToUp(size_t colNum, int chipType, Eigen::Vector2f spawnPos, TChip::TChipState chipState)
|
||||
{
|
||||
size_t yPos = ChipMatrix[colNum].size();
|
||||
|
||||
Eigen::Vector2f posFrom = spawnPos;
|
||||
Eigen::Vector2f posTo = posFrom + Eigen::Vector2f(Match3FieldParams.CellWidth, Match3FieldParams.CellHeight);
|
||||
|
||||
@@ -448,9 +446,9 @@ void TMatch3Logic::InnerAddChipToUp(size_t colNum, int chipType, Eigen::Vector2f
|
||||
|
||||
void TMatch3Logic::AddChipToUp(size_t colNum, int chipType, Eigen::Vector2f spawnPos, TChip::TChipState chipState)
|
||||
{
|
||||
InnerAddChipToUp(colNum, chipType, spawnPos, chipState);
|
||||
size_t yPos = ChipMatrix[colNum].size();
|
||||
|
||||
size_t yPos = ChipMatrix[colNum].size() - 1; //?
|
||||
InnerAddChipToUp(colNum, chipType, spawnPos, chipState);
|
||||
|
||||
ReplaceAnimation(Eigen::Vector2i(colNum, yPos));
|
||||
|
||||
@@ -484,7 +482,7 @@ void TMatch3Logic::InsertEmptyChip(size_t colNum, size_t rowNum, int chipType)
|
||||
ReplaceAnimation(Eigen::Vector2i(colNum, rowNum));
|
||||
|
||||
|
||||
triangleList.NeedRefreshBuffer = true;
|
||||
//triangleList.NeedRefreshBuffer = true;
|
||||
|
||||
Eigen::Vector2f pos = GetExpectedLeftBottomPos(colNum, rowNum);
|
||||
|
||||
@@ -565,8 +563,8 @@ void TMatch3Logic::UpdateChipSwapping(size_t dt)
|
||||
chip2.RenderPair->second.Data.Vec3CoordArr[SE::CONST_STRING_POSITION_ATTRIB][chip2.VertexListShift + k] += shiftChip2;
|
||||
}
|
||||
|
||||
chip1.RenderPair->second.NeedRefreshBuffer = true;
|
||||
chip2.RenderPair->second.NeedRefreshBuffer = true;
|
||||
//chip1.RenderPair->second.NeedRefreshBuffer = true;
|
||||
//chip2.RenderPair->second.NeedRefreshBuffer = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -655,7 +653,7 @@ void TMatch3Logic::UpdateChipPosition(size_t dt)
|
||||
}
|
||||
|
||||
|
||||
chip.RenderPair->second.NeedRefreshBuffer = true;
|
||||
//chip.RenderPair->second.NeedRefreshBuffer = true;
|
||||
|
||||
for (size_t k = j + 1; k < ChipMatrix[i].size(); k++)
|
||||
{
|
||||
@@ -671,7 +669,7 @@ void TMatch3Logic::UpdateChipPosition(size_t dt)
|
||||
chipAbove.ChipState = TChip::CS_FALLING;
|
||||
chipAbove.SetLeftBottomPos(chip.GetLeftBottomPos() + Eigen::Vector2f(0, Match3FieldParams.CellHeight));
|
||||
chipAbove.Velocity = chip.Velocity;
|
||||
chipAbove.RenderPair->second.NeedRefreshBuffer = true;
|
||||
//chipAbove.RenderPair->second.NeedRefreshBuffer = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -715,9 +713,10 @@ void TMatch3Logic::TryMatchAllChips()
|
||||
|
||||
void TMatch3Logic::DestroyChip(Eigen::Vector2i p)
|
||||
{
|
||||
ChipMatrix[p[0]][p[1]].RenderPair->second.NeedRefreshBuffer = true;
|
||||
//ChipMatrix[p[0]][p[1]].RenderPair->second.NeedRefreshBuffer = true;
|
||||
|
||||
SE::ResourceManager->HalibutAnimationManager.DeleteAnimationObject(ChipMatrix[p[0]][p[1]].AnimName);
|
||||
|
||||
|
||||
ChipMatrix[p[0]][p[1]].RenderPair->second.Data.Vec3CoordArr[SE::CONST_STRING_POSITION_ATTRIB].erase(
|
||||
ChipMatrix[p[0]][p[1]].RenderPair->second.Data.Vec3CoordArr[SE::CONST_STRING_POSITION_ATTRIB].begin() + ChipMatrix[p[0]][p[1]].VertexListShift,
|
||||
@@ -761,14 +760,14 @@ void TMatch3Logic::ChangeChipType(Eigen::Vector2i p)
|
||||
|
||||
MoveVertexListShiftBack(chip.RenderPair, chip.VertexListShift);
|
||||
|
||||
chip.RenderPair->second.NeedRefreshBuffer = true;
|
||||
//chip.RenderPair->second.NeedRefreshBuffer = true;
|
||||
|
||||
chip.ChipType = newChipType;
|
||||
|
||||
RenderPairIteratorVector[newChipType]->second.Data.Vec3CoordArr[SE::CONST_STRING_POSITION_ATTRIB].insert(RenderPairIteratorVector[newChipType]->second.Data.Vec3CoordArr[SE::CONST_STRING_POSITION_ATTRIB].end(), vertexCoordSubVec.begin(), vertexCoordSubVec.end());
|
||||
RenderPairIteratorVector[newChipType]->second.Data.Vec2CoordArr[SE::CONST_STRING_TEXCOORD_ATTRIB].insert(RenderPairIteratorVector[newChipType]->second.Data.Vec2CoordArr[SE::CONST_STRING_TEXCOORD_ATTRIB].end(), texCoordSubVec.begin(), texCoordSubVec.end());
|
||||
|
||||
RenderPairIteratorVector[newChipType]->second.NeedRefreshBuffer = true;
|
||||
//RenderPairIteratorVector[newChipType]->second.NeedRefreshBuffer = true;
|
||||
|
||||
chip.RenderPair = RenderPairIteratorVector[newChipType];
|
||||
chip.VertexListShift = RenderPairIteratorVector[newChipType]->second.Data.Vec3CoordArr[SE::CONST_STRING_POSITION_ATTRIB].size() - 6;
|
||||
@@ -910,7 +909,7 @@ void TMatch3Logic::SwapChips(Eigen::Vector2i p1, Eigen::Vector2i p2, bool isRetu
|
||||
Eigen::Vector2f chip2PosFrom(LeftBottomPosField[0] + p2[0]*Match3FieldParams.CellWidth, LeftBottomPosField[1] + p2[1]*Match3FieldParams.CellHeight);
|
||||
ChipSwappingPairVector.push_back(TChipSwappingPair(p1, p2, chip1PosFrom, chip2PosFrom));
|
||||
|
||||
(ChipSwappingPairVector.end() - 1)->IsReturning = isReturning;
|
||||
ChipSwappingPairVector.back().IsReturning = isReturning;
|
||||
|
||||
ChipMatrix[p1[0]][p1[1]].ChipState = TChip::CS_SWAPPING;
|
||||
ChipMatrix[p2[0]][p2[1]].ChipState = TChip::CS_SWAPPING;
|
||||
@@ -932,7 +931,7 @@ void TMatch3Logic::ResetChipPos(Eigen::Vector2i p)
|
||||
chip.RenderPair->second.Data.Vec3CoordArr[SE::CONST_STRING_POSITION_ATTRIB][chip.VertexListShift + i] = vertexCoordVec[i];
|
||||
}
|
||||
|
||||
chip.RenderPair->second.NeedRefreshBuffer = true;
|
||||
//chip.RenderPair->second.NeedRefreshBuffer = true;
|
||||
|
||||
|
||||
}
|
||||
@@ -973,7 +972,7 @@ void TMatch3Logic::UpdateLogic(size_t dt)
|
||||
|
||||
std::vector<Eigen::Vector3f> vertexCoordArr = SE::MakeVertexCoordVec(centerPos - (1.f - i->T)*halfPos, centerPos + (1.f - i->T)*halfPos, ZLEVEL);
|
||||
|
||||
for (int t = 0; t < 6; t++)
|
||||
for (int t = 0; t < 6; t++)
|
||||
{
|
||||
ChipMatrix[p[0]][p[1]].RenderPair->second.Data.Vec3CoordArr[SE::CONST_STRING_POSITION_ATTRIB][ChipMatrix[p[0]][p[1]].VertexListShift + t] = vertexCoordArr[t];
|
||||
}
|
||||
@@ -994,6 +993,7 @@ void TMatch3Logic::UpdateLogic(size_t dt)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
RemoveBubbles();
|
||||
}
|
||||
|
||||
@@ -1168,7 +1168,7 @@ void TMatch3Field::FillBasicChipMatrixAndTriangleList()
|
||||
|
||||
for (SE::TRenderPairList::iterator i = TriangleListVector.begin(); i != TriangleListVector.end(); ++i)
|
||||
{
|
||||
i->second.NeedRefreshBuffer = false;
|
||||
//i->second.NeedRefreshBuffer = false;
|
||||
i->second.RefreshBuffer();
|
||||
}
|
||||
|
||||
@@ -1192,14 +1192,11 @@ void TMatch3Field::Update(size_t dt)
|
||||
|
||||
TMatch3Logic::UpdateLogic(dt);
|
||||
|
||||
|
||||
SE::TRenderPairList::iterator i;
|
||||
for (i = TriangleListVector.begin(); i != TriangleListVector.end(); ++i)
|
||||
{
|
||||
if (i->second.NeedRefreshBuffer)
|
||||
{
|
||||
i->second.RefreshBuffer();
|
||||
}
|
||||
i->second.RefreshBuffer();
|
||||
|
||||
}
|
||||
|
||||
int y = 6;
|
||||
|
||||
Reference in new issue
Block a user