2019-11-04 21:24:37 +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.
|
|
|
|
*
|
2021-12-26 23:54:17 +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 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2019-11-04 21:24:37 +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.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2021-12-26 23:54:17 +00:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2019-11-04 21:24:37 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2022-02-09 03:38:34 +00:00
|
|
|
#ifndef CHEWY_OBJECT_H
|
|
|
|
#define CHEWY_OBJECT_H
|
2019-11-04 21:24:37 +00:00
|
|
|
|
2022-02-09 03:38:34 +00:00
|
|
|
#include "chewy/object_extra.h"
|
2019-11-04 21:24:37 +00:00
|
|
|
|
2021-09-12 22:41:09 +00:00
|
|
|
namespace Chewy {
|
|
|
|
|
2019-11-04 21:24:37 +00:00
|
|
|
#define ENDLOS_FLIP_FLOP 255
|
|
|
|
|
|
|
|
#define LOAD_NEW_OBJ 1
|
|
|
|
|
|
|
|
#define NO_ACTION 0
|
2022-02-22 07:43:46 +00:00
|
|
|
#define OBJECT_1 1
|
|
|
|
#define OBJECT_2 2
|
2019-11-04 21:24:37 +00:00
|
|
|
|
2022-02-09 03:38:34 +00:00
|
|
|
class Object {
|
2019-11-04 21:24:37 +00:00
|
|
|
public:
|
2022-03-20 10:38:41 +00:00
|
|
|
Object(GameState *sp);
|
2022-02-09 03:38:34 +00:00
|
|
|
~Object();
|
2019-11-04 21:24:37 +00:00
|
|
|
|
2022-03-16 21:55:49 +00:00
|
|
|
short load(const char *filename, RoomMovObject *rmo);
|
|
|
|
int16 load(const char *filename, RoomStaticInventory *rsi);
|
|
|
|
int16 load(const char *filename, RoomExit *roomExit);
|
2019-11-04 21:24:37 +00:00
|
|
|
void sort();
|
2021-09-12 05:01:30 +00:00
|
|
|
void free_inv_spr(byte **inv_spr_adr);
|
2019-11-04 21:24:37 +00:00
|
|
|
int16 is_sib_mouse(int16 mouse_x, int16 mouse_y);
|
|
|
|
int16 is_iib_mouse(int16 mouse_x, int16 mouse_y);
|
|
|
|
int16 iib_txt_nr(int16 inv_nr);
|
|
|
|
int16 sib_txt_nr(int16 sib_nr);
|
|
|
|
int16 action_iib_iib(int16 maus_obj_nr, int16 test_obj_nr);
|
|
|
|
int16 action_iib_sib(int16 maus_obj_nr, int16 test_obj_nr);
|
|
|
|
void hide_sib(int16 nr);
|
|
|
|
void show_sib(int16 nr);
|
|
|
|
void calc_all_static_detail();
|
|
|
|
void calc_static_detail(int16 det_nr);
|
|
|
|
int16 calc_static_use(int16 nr);
|
|
|
|
int16 del_obj_use(int16 nr);
|
|
|
|
int16 calc_rsi_flip_flop(int16 nr);
|
|
|
|
void set_rsi_flip_flop(int16 nr, int16 anz);
|
2022-02-19 23:45:33 +00:00
|
|
|
void addInventory(int16 nr, RaumBlk *Rb);
|
|
|
|
void delInventory(int16 nr, RaumBlk *Rb);
|
|
|
|
void changeInventory(int16 old_inv, int16 new_inv, RaumBlk *Rb);
|
|
|
|
void setInventory(int16 nr, int16 x, int16 y, int16 automov, RaumBlk *Rb);
|
|
|
|
bool checkInventory(int16 nr);
|
2019-11-04 21:24:37 +00:00
|
|
|
int16 is_exit(int16 mouse_x, int16 mouse_y);
|
|
|
|
uint8 mov_obj_room[MAX_MOV_OBJ + 1];
|
|
|
|
uint8 spieler_invnr[MAX_MOV_OBJ + 1];
|
|
|
|
|
|
|
|
private:
|
|
|
|
int16 calc_rmo_flip_flop(int16 nr);
|
|
|
|
|
2022-02-22 07:43:46 +00:00
|
|
|
IibFileHeader _iibFileHeader;
|
|
|
|
SibFileHeader _sibFileHeader;
|
|
|
|
EibFileHeader _eibFileHeader;
|
|
|
|
int16 _maxInventoryObj;
|
|
|
|
int16 _maxStaticInventory;
|
|
|
|
int16 _maxExit;
|
2022-03-20 10:38:41 +00:00
|
|
|
GameState *_player;
|
2022-02-22 07:43:46 +00:00
|
|
|
RoomMovObject *_rmo;
|
|
|
|
RoomStaticInventory *_rsi;
|
|
|
|
RoomExit *_roomExit;
|
2019-11-04 21:24:37 +00:00
|
|
|
};
|
2021-09-12 22:41:09 +00:00
|
|
|
|
|
|
|
} // namespace Chewy
|
|
|
|
|
2019-11-04 21:24:37 +00:00
|
|
|
#endif
|