Refactoring

This commit is contained in:
elasota
2020-01-05 16:41:04 -05:00
parent 1fba6f9e85
commit 645a997c7a
18 changed files with 174 additions and 186 deletions

View File

@@ -9,6 +9,7 @@
#include "PLToolUtils.h"
#include "PLKeyEncoding.h"
#include "Externs.h"
#include "InputManager.h"
#include "ObjectEdit.h"
#include "RectUtils.h"
@@ -48,7 +49,6 @@ short wasFlower;
Boolean AddNewObject (Point where, short what, Boolean showItNow)
{
KeyDownStates theseKeys;
Rect srcRect, newRect;
short direction, dist;
Boolean handled, drawWholeRoom;
@@ -738,13 +738,16 @@ Boolean AddNewObject (Point where, short what, Boolean showItNow)
break;
case kFlower:
GetKeys(theseKeys);
if (!BitTst(theseKeys, PL_KEY_EITHER_SPECIAL(kShift)))
wasFlower = RandomInt(kNumFlowers);
newRect = flowerSrc[wasFlower];
CenterRectOnPoint(&newRect, where);
thisRoom->objects[objActive].data.i.bounds = newRect;
thisRoom->objects[objActive].data.i.pict = wasFlower;
{
const KeyDownStates *theseKeys = PortabilityLayer::InputManager::GetInstance()->GetKeys();
if (!theseKeys->IsSet(PL_KEY_EITHER_SPECIAL(kShift)))
wasFlower = RandomInt(kNumFlowers);
newRect = flowerSrc[wasFlower];
CenterRectOnPoint(&newRect, where);
thisRoom->objects[objActive].data.i.bounds = newRect;
thisRoom->objects[objActive].data.i.pict = wasFlower;
}
break;
case kOzma: