2003-12-16 02:10:15 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
2005-01-01 16:09:25 +00:00
|
|
|
* Copyright (C) 2003-2005 The ScummVM project
|
2003-12-16 02:10:15 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
|
|
|
|
* 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.
|
|
|
|
|
|
|
|
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* $Header$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef BSMENU_H
|
|
|
|
#define BSMENU_H
|
|
|
|
|
2004-10-21 12:43:49 +00:00
|
|
|
#include "sword1/sworddefs.h"
|
|
|
|
#include "sword1/object.h"
|
2003-12-16 02:10:15 +00:00
|
|
|
|
2004-01-11 15:47:41 +00:00
|
|
|
namespace Sword1 {
|
|
|
|
|
|
|
|
class Screen;
|
|
|
|
class Mouse;
|
2003-12-16 02:10:15 +00:00
|
|
|
class ResMan;
|
|
|
|
|
|
|
|
#define MENU_TOP 0
|
|
|
|
#define MENU_BOT 1
|
|
|
|
|
|
|
|
struct Subject {
|
|
|
|
uint32 subjectRes;
|
|
|
|
uint32 frameNo;
|
|
|
|
};
|
|
|
|
|
2003-12-17 01:47:47 +00:00
|
|
|
struct MenuObject {
|
|
|
|
int32 textDesc;
|
|
|
|
uint32 bigIconRes;
|
|
|
|
uint32 bigIconFrame;
|
|
|
|
uint32 luggageIconRes;
|
|
|
|
uint32 useScript;
|
|
|
|
};
|
|
|
|
|
2004-01-11 15:47:41 +00:00
|
|
|
class MenuIcon {
|
2003-12-16 02:10:15 +00:00
|
|
|
public:
|
2004-01-11 15:47:41 +00:00
|
|
|
MenuIcon(uint8 menuType, uint8 menuPos, uint32 resId, uint32 frame, Screen *screen);
|
2003-12-16 02:10:15 +00:00
|
|
|
bool wasClicked(uint16 mouseX, uint16 mouseY);
|
|
|
|
void setSelect(bool pSel);
|
2003-12-21 17:55:40 +00:00
|
|
|
void draw(const byte *fadeMask = NULL, int8 fadeStatus = 0);
|
2003-12-16 02:10:15 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
uint8 _menuType, _menuPos;
|
|
|
|
uint32 _resId, _frame;
|
|
|
|
bool _selected;
|
2004-01-11 15:47:41 +00:00
|
|
|
Screen *_screen;
|
2003-12-16 02:10:15 +00:00
|
|
|
};
|
|
|
|
|
2004-01-11 15:47:41 +00:00
|
|
|
class Menu {
|
2003-12-16 02:10:15 +00:00
|
|
|
public:
|
2004-01-11 15:47:41 +00:00
|
|
|
Menu(Screen *pScreen, Mouse *pMouse);
|
2004-11-09 04:06:10 +00:00
|
|
|
~Menu(void);
|
2004-01-11 15:47:41 +00:00
|
|
|
void fnChooser(Object *compact);
|
2003-12-16 02:10:15 +00:00
|
|
|
void fnEndChooser(void);
|
|
|
|
void fnAddSubject(int32 sub);
|
|
|
|
void cfnReleaseMenu(void);
|
2004-01-11 15:47:41 +00:00
|
|
|
int logicChooser(Object *compact);
|
2003-12-16 02:10:15 +00:00
|
|
|
void engine(void);
|
|
|
|
void refresh(uint8 menuType);
|
|
|
|
void fnStartMenu(void);
|
|
|
|
void fnEndMenu(void);
|
2003-12-17 05:16:37 +00:00
|
|
|
void checkTopMenu(void);
|
2003-12-21 16:50:02 +00:00
|
|
|
static const MenuObject _objectDefs[TOTAL_pockets + 1];
|
2003-12-16 02:10:15 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void buildSubjects(void);
|
2003-12-17 01:47:47 +00:00
|
|
|
void buildMenu(void);
|
|
|
|
void showMenu(uint8 menuType);
|
2003-12-21 17:55:40 +00:00
|
|
|
byte _subjectBarStatus;
|
|
|
|
byte _objectBarStatus;
|
|
|
|
int8 _fadeSubject;
|
|
|
|
int8 _fadeObject;
|
2004-01-02 11:15:35 +00:00
|
|
|
void refreshMenus(void);
|
2003-12-16 02:10:15 +00:00
|
|
|
uint8 checkMenuClick(uint8 menuType);
|
2003-12-17 01:47:47 +00:00
|
|
|
//- lower menu, speech subjects:
|
2004-01-11 15:47:41 +00:00
|
|
|
MenuIcon *_subjects[16];
|
2003-12-16 02:10:15 +00:00
|
|
|
uint32 _subjectBar[16];
|
2003-12-17 01:47:47 +00:00
|
|
|
//- top menu, items
|
2004-01-11 15:47:41 +00:00
|
|
|
MenuIcon *_objects[TOTAL_pockets];
|
2003-12-17 01:47:47 +00:00
|
|
|
uint32 _menuList[TOTAL_pockets];
|
|
|
|
uint32 _inMenu;
|
2003-12-16 02:10:15 +00:00
|
|
|
|
2004-01-11 15:47:41 +00:00
|
|
|
Screen *_screen;
|
|
|
|
Mouse *_mouse;
|
2003-12-16 02:10:15 +00:00
|
|
|
static const Subject _subjectList[TOTAL_subjects];
|
2003-12-21 17:55:40 +00:00
|
|
|
|
|
|
|
static const byte _fadeEffectTop[64];
|
|
|
|
static const byte _fadeEffectBottom[64];
|
2003-12-16 02:10:15 +00:00
|
|
|
};
|
|
|
|
|
2004-01-11 15:47:41 +00:00
|
|
|
} // End of namespace Sword1
|
|
|
|
|
2003-12-16 02:10:15 +00:00
|
|
|
#endif //BSMENU_H
|