Fix a few more random PMAPBITS issues
This commit is contained in:
parent
240bb3bd92
commit
4ff1dc0bc3
@ -715,7 +715,7 @@ void GameView::NotifyActiveToolsChanged(GameModel * sender)
|
|||||||
if (!active->GetIdentifier().Contains("_PT_"))
|
if (!active->GetIdentifier().Contains("_PT_"))
|
||||||
ren->findingElement = 0;
|
ren->findingElement = 0;
|
||||||
else
|
else
|
||||||
ren->findingElement = sender->GetActiveTool(0)->GetToolID()%256;
|
ren->findingElement = sender->GetActiveTool(0)->GetToolID() & ((1 << PMAPBITS) - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1509,10 +1509,10 @@ void GameView::OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl,
|
|||||||
if (ctrl)
|
if (ctrl)
|
||||||
{
|
{
|
||||||
Tool *active = c->GetActiveTool(0);
|
Tool *active = c->GetActiveTool(0);
|
||||||
if (!active->GetIdentifier().Contains("_PT_") || ren->findingElement == active->GetToolID()%256)
|
if (!active->GetIdentifier().Contains("_PT_") || (ren->findingElement == (active->GetToolID() & ((1 << PMAPBITS) - 1))))
|
||||||
ren->findingElement = 0;
|
ren->findingElement = 0;
|
||||||
else
|
else
|
||||||
ren->findingElement = active->GetToolID()%256;
|
ren->findingElement = active->GetToolID() & ((1 << PMAPBITS) - 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
c->FrameStep();
|
c->FrameStep();
|
||||||
|
@ -54,7 +54,7 @@ void SampleTool::Draw(Simulation * sim, Brush * brush, ui::Point position)
|
|||||||
for(std::vector<Tool*>::iterator iter = elementTools.begin(), end = elementTools.end(); iter != end; ++iter)
|
for(std::vector<Tool*>::iterator iter = elementTools.begin(), end = elementTools.end(); iter != end; ++iter)
|
||||||
{
|
{
|
||||||
Tool * elementTool = *iter;
|
Tool * elementTool = *iter;
|
||||||
if(elementTool && elementTool->GetToolID()/256 == particleCtype)
|
if(elementTool && (elementTool->GetToolID() >> PMAPBITS) == particleCtype)
|
||||||
gameModel->SetActiveTool(0, elementTool);
|
gameModel->SetActiveTool(0, elementTool);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user