2010-08-17 09:28:20 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2014-02-18 02:34:21 +01:00
|
|
|
*
|
2010-08-17 09:28:20 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2014-02-18 02:34:21 +01:00
|
|
|
*
|
2010-08-17 09:28:20 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This code is based on original Hugo Trilogy source code
|
|
|
|
*
|
|
|
|
* Copyright (c) 1989-1995 David P. Gray
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef HUGO_INVENTORY_H
|
|
|
|
#define HUGO_INVENTORY_H
|
|
|
|
namespace Hugo {
|
|
|
|
|
2011-01-23 00:05:52 +00:00
|
|
|
/**
|
2011-02-11 20:27:48 +00:00
|
|
|
* Actions for Process_inventory()
|
|
|
|
*/
|
2012-06-13 20:58:01 +02:00
|
|
|
enum InvAct {kInventoryActionInit, kInventoryActionLeft, kInventoryActionRight, kInventoryActionGet};
|
2010-08-17 09:28:20 +00:00
|
|
|
|
|
|
|
class InventoryHandler {
|
|
|
|
public:
|
2010-10-21 17:09:57 +00:00
|
|
|
InventoryHandler(HugoEngine *vm);
|
2010-08-17 09:28:20 +00:00
|
|
|
|
2011-02-18 22:24:32 +01:00
|
|
|
void setInventoryObjId(int16 objId);
|
2012-06-13 20:58:01 +02:00
|
|
|
void setInventoryState(Istate state);
|
2011-02-18 22:24:32 +01:00
|
|
|
void freeInvent();
|
2011-02-15 10:15:21 +01:00
|
|
|
|
2011-02-18 22:24:32 +01:00
|
|
|
int16 getInventoryObjId() const;
|
2012-06-13 20:58:01 +02:00
|
|
|
Istate getInventoryState() const;
|
2011-02-08 20:52:26 +00:00
|
|
|
|
2011-02-15 10:15:21 +01:00
|
|
|
int16 findIconId(int16 objId);
|
2011-02-18 08:11:55 +01:00
|
|
|
void loadInvent(Common::SeekableReadStream &in);
|
2017-10-06 00:55:11 +01:00
|
|
|
int16 processInventory(const int action, ...);
|
2011-02-15 10:15:21 +01:00
|
|
|
void runInventory();
|
2010-08-17 09:28:20 +00:00
|
|
|
|
|
|
|
private:
|
2010-10-21 17:09:57 +00:00
|
|
|
HugoEngine *_vm;
|
2010-08-17 09:28:20 +00:00
|
|
|
|
2011-01-23 00:05:52 +00:00
|
|
|
static const int kStepDy = 8; // Pixels per step movement
|
2011-06-20 00:59:48 +02:00
|
|
|
|
2011-02-08 20:52:26 +00:00
|
|
|
int16 _firstIconId; // Index of first icon to display
|
2011-02-15 10:15:21 +01:00
|
|
|
int16 *_invent;
|
2012-06-13 20:58:01 +02:00
|
|
|
Istate _inventoryState; // Inventory icon bar state
|
2011-02-08 20:52:26 +00:00
|
|
|
int16 _inventoryHeight; // Inventory icon bar height
|
|
|
|
int16 _inventoryObjId; // Inventory object selected, or -1
|
2011-02-15 10:15:21 +01:00
|
|
|
byte _maxInvent;
|
2011-01-23 00:05:52 +00:00
|
|
|
|
2011-02-02 21:12:51 +00:00
|
|
|
void constructInventory(const int16 imageTotNumb, int displayNumb, const bool scrollFl, int16 firstObjId);
|
2010-08-17 09:28:20 +00:00
|
|
|
};
|
|
|
|
|
2010-08-27 09:48:53 +00:00
|
|
|
} // End of namespace Hugo
|
|
|
|
|
2010-08-17 09:28:20 +00:00
|
|
|
#endif // HUGO_INVENTORY_H
|