Add includePressure to saveStamp as well
Also removed in a407aba087
, as part of cleanup. Restoring it now that loadStamp also has this same parameter.
This commit is contained in:
parent
cdc3eb8663
commit
c60e87870a
@ -448,7 +448,12 @@ static Rect<int> SaneSaveRect(Vec2<int> point1, Vec2<int> point2)
|
||||
|
||||
ByteString GameController::StampRegion(ui::Point point1, ui::Point point2)
|
||||
{
|
||||
auto newSave = gameModel->GetSimulation()->Save(gameModel->GetIncludePressure() != gameView->ShiftBehaviour(), SaneSaveRect(point1, point2));
|
||||
return StampRegion(point1, point2, gameModel->GetIncludePressure() != gameView->ShiftBehaviour());
|
||||
}
|
||||
|
||||
ByteString GameController::StampRegion(ui::Point point1, ui::Point point2, bool includePressure)
|
||||
{
|
||||
auto newSave = gameModel->GetSimulation()->Save(includePressure, SaneSaveRect(point1, point2));
|
||||
if(newSave)
|
||||
{
|
||||
newSave->paused = gameModel->GetPaused();
|
||||
|
@ -106,6 +106,7 @@ public:
|
||||
void DrawLine(int toolSelection, ui::Point point1, ui::Point point2);
|
||||
void DrawFill(int toolSelection, ui::Point point);
|
||||
ByteString StampRegion(ui::Point point1, ui::Point point2);
|
||||
ByteString StampRegion(ui::Point point1, ui::Point point2, bool includePressure);
|
||||
void CopyRegion(ui::Point point1, ui::Point point2);
|
||||
void CutRegion(ui::Point point1, ui::Point point2);
|
||||
void Update();
|
||||
|
@ -2168,14 +2168,14 @@ int LuaScriptInterface::simulation_saveStamp(lua_State * l)
|
||||
int y = luaL_optint(l,2,0);
|
||||
int w = luaL_optint(l,3,XRES-1);
|
||||
int h = luaL_optint(l,4,YRES-1);
|
||||
ByteString name = luacon_controller->StampRegion(ui::Point(x, y), ui::Point(x+w, y+h));
|
||||
bool includePressure = luaL_optint(l, 5, 1);
|
||||
ByteString name = luacon_controller->StampRegion(ui::Point(x, y), ui::Point(x+w, y+h), includePressure);
|
||||
tpt_lua_pushByteString(l, name);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int LuaScriptInterface::simulation_loadStamp(lua_State * l)
|
||||
{
|
||||
auto *luacon_ci = static_cast<LuaScriptInterface *>(commandInterface);
|
||||
int i = -1;
|
||||
int pushed = 1;
|
||||
std::unique_ptr<SaveFile> tempfile;
|
||||
|
Loading…
Reference in New Issue
Block a user