22 #ifndef NUVIE_CORE_MAP_WINDOW_H 23 #define NUVIE_CORE_MAP_WINDOW_H 25 #include "ultima/nuvie/core/nuvie_defs.h" 26 #include "ultima/nuvie/core/obj_manager.h" 27 #include "ultima/nuvie/gui/widgets/gui_widget.h" 28 #include "ultima/nuvie/core/map.h" 44 #define MAPWINDOW_THUMBNAIL_SIZE 52 45 #define MAPWINDOW_THUMBNAIL_SCALE 3 47 #define MAP_OVERLAY_DEFAULT 0 48 #define MAP_OVERLAY_ONTOP 1 50 #define MAPWINDOW_ROOFTILES_IMG_W 5 51 #define MAPWINDOW_ROOFTILES_IMG_H 204 60 uint16 prev_x, prev_y;
65 enum RoofDisplayType {ROOF_DISPLAY_OFF, ROOF_DISPLAY_NORMAL, ROOF_DISPLAY_FORCE_ON };
66 enum InterfaceType { INTERFACE_NORMAL, INTERFACE_FULLSCREEN, INTERFACE_IGNORE_BLOCK };
67 enum X_RayType { X_RAY_CHEAT_OFF = -1, X_RAY_OFF = 0, X_RAY_ON = 1, X_RAY_CHEAT_ON = 2};
68 enum CanDropOrMoveMsg { MSG_NOT_POSSIBLE, MSG_SUCCESS, MSG_BLOCKED, MSG_OUT_OF_RANGE, MSG_NO_TILE};
76 bool enable_doubleclick;
77 bool walk_with_left_button;
78 uint8 walk_button_mask;
80 InterfaceType interface;
82 bool custom_actor_tiles;
87 uint16 tmp_map_width, tmp_map_height;
98 uint16 cursor_x, cursor_y, map_center_xoff;
99 sint16 mousecenter_x, mousecenter_y;
100 uint16 last_boundary_fill_x, last_boundary_fill_y;
105 bool show_use_cursor;
108 unsigned char *thumbnail;
111 uint16 win_width, win_height, border_width;
115 uint8 cur_x_add, cur_y_add;
126 bool look_on_left_click;
130 bool freeze_blacking_location;
131 bool enable_blacking;
134 RoofDisplayType roof_display;
140 bool draw_brit_lens_anim;
141 bool draw_garg_lens_anim;
145 bool lighting_update_required;
156 sint16 get_cur_x()
const {
159 sint16 get_cur_y()
const {
162 bool set_windowSize(uint16 width, uint16 height);
163 void set_show_cursor(
bool state);
164 void set_show_use_cursor(
bool state);
165 void set_show_grid(
bool state);
166 bool is_grid_showing() {
169 void set_velocity(sint16 vx, sint16 vy) {
174 void set_overlay_level(
int level = MAP_OVERLAY_DEFAULT) {
175 overlay_level = level;
177 void set_x_ray_view(X_RayType state,
bool cheat_off =
false);
178 X_RayType get_x_ray_view() {
181 void set_freeze_blacking_location(
bool state);
182 void set_enable_blacking(
bool state);
183 void set_roof_mode(
bool roofs);
184 void set_roof_display_mode(
enum RoofDisplayType mode) {
187 void set_walking(
bool state);
188 void set_walk_button_mask();
189 bool will_walk_with_left_button() {
190 return walk_with_left_button;
192 void set_walk_with_left_button(
bool val) {
193 walk_with_left_button = val;
194 set_walk_button_mask();
196 void set_looking(
bool state) {
199 int get_min_brightness() {
200 return min_brightness;
202 void set_min_brightness(
int brightness) {
203 min_brightness = brightness;
206 void moveLevel(uint8 new_level);
207 void moveMap(sint16 new_x, sint16 new_y, sint8 new_level, uint8 new_x_add = 0, uint8 new_y_add = 0);
208 void moveMapRelative(sint16 rel_x, sint16 rel_y);
209 void shiftMapRelative(sint16 rel_x, sint16 rel_y);
210 void set_mousecenter(sint16 new_x, sint16 new_y) {
211 mousecenter_x = new_x;
212 mousecenter_y = new_y;
214 void reset_mousecenter() {
215 mousecenter_x = win_width / 2;
216 mousecenter_y = win_height / 2;
218 uint16 get_win_area() {
219 return win_width * win_height;
221 void centerMapOnActor(
Actor *actor);
222 void centerMap(uint16 x, uint16 y, uint8 z);
225 void moveCursor(sint16 new_x, sint16 new_y);
226 void moveCursorRelative(sint16 rel_x, sint16 rel_y);
228 bool is_doubleclick_enabled() {
229 return enable_doubleclick;
231 void set_enable_doubleclick(
bool val) {
232 enable_doubleclick = val;
234 void set_look_on_left_click(
bool val) {
235 look_on_left_click = val;
237 void set_use_left_clicks();
238 bool will_look_on_left_click() {
239 return look_on_left_click;
241 bool is_on_screen(uint16 x, uint16 y, uint8 z);
242 bool tile_is_black(uint16 x, uint16 y,
const Obj *obj =
nullptr)
const;
243 const char *look(uint16 x, uint16 y,
bool show_prefix =
true);
244 const char *lookAtCursor(
bool show_prefix =
true) {
245 return (look(cursor_x, cursor_y, show_prefix));
247 Obj *get_objAtCursor(
bool for_use =
false);
248 Obj *get_objAtCoord(
MapCoord coord,
bool top_obj,
bool include_ignored_objects,
bool for_use =
false);
249 Actor *get_actorAtCursor();
251 Obj *get_objAtMousePos(
int x,
int y);
252 Actor *get_actorAtMousePos(
int x,
int y);
253 void teleport_to_cursor();
254 void select_target(
int x,
int y);
255 void mouseToWorldCoords(
int mx,
int my,
int &wx,
int &wy);
256 void get_movement_direction(uint16 mx, uint16 my, sint16 &rel_x, sint16 &rel_y, uint8 *mptr =
nullptr);
269 void get_level(uint8 *level)
const;
270 void get_pos(uint16 *x, uint16 *y, uint8 *px =
nullptr, uint8 *py =
nullptr)
const;
271 void get_velocity(sint16 *vx, sint16 *vy)
const {
275 void get_windowSize(uint16 *width, uint16 *height)
const;
277 bool in_window(uint16 x, uint16 y, uint8 z)
const;
278 bool in_dungeon_level()
const;
279 bool in_town()
const;
281 CanDropOrMoveMsg can_drop_or_move_obj(uint16 x, uint16 y,
Actor *actor,
Obj *obj);
282 void display_can_drop_or_move_msg(CanDropOrMoveMsg msg,
Common::String msg_text =
"");
283 bool can_get_obj(
const Actor *actor,
Obj *obj);
284 bool blocked_by_wall(
const Actor *actor,
const Obj *obj);
287 void updateBlacking();
288 void updateAmbience();
290 void Display(
bool full_redraw)
override;
292 GUI_status MouseDown(
int x,
int y, Events::MouseButton button)
override;
293 GUI_status MouseUp(
int x,
int y, Events::MouseButton button)
override;
294 GUI_status MouseMotion(
int x,
int y, uint8 state)
override;
295 GUI_status MouseDouble(
int x,
int y, Events::MouseButton button)
override;
296 GUI_status MouseClick(
int x,
int y, Events::MouseButton button)
override;
297 GUI_status Idle(
void)
override;
298 GUI_status MouseLeave(uint8 state)
override;
299 GUI_status MouseDelayed(
int x,
int y, Events::MouseButton button)
override;
300 GUI_status MouseHeld(
int x,
int y, Events::MouseButton button)
override;
302 GUI_status MouseWheel(sint32 x, sint32 y)
override;
304 void drag_drop_success(
int x,
int y,
int message,
void *data)
override;
305 void drag_drop_failed(
int x,
int y,
int message,
void *data)
override;
307 bool drag_accept_drop(
int x,
int y,
int message,
void *data)
override;
308 void drag_perform_drop(
int x,
int y,
int message,
void *data)
override;
309 bool move_on_drop(
Obj *obj);
310 void set_interface();
311 InterfaceType get_interface();
312 bool is_interface_fullscreen_in_combat();
314 void drag_draw(
int x,
int y,
int message,
void *data)
override;
316 void update_mouse_cursor(uint32 mx, uint32 my);
318 unsigned char *make_thumbnail();
319 void free_thumbnail();
328 void wizard_eye_start(
const MapCoord &location, uint16 duration,
CallBack *caller);
330 bool using_map_tile_lighting;
333 void create_thumbnail();
336 void drawAnims(
bool top_anims);
338 void drawObjSuperBlock(
bool draw_lowertiles,
bool toptile);
339 inline void drawObj(
const Obj *obj,
bool draw_lowertiles,
bool toptile);
340 inline void drawTile(
const Tile *tile, uint16 x, uint16 y,
bool toptile,
bool use_tile_data =
false);
341 inline void drawNewTile(
const Tile *tile, uint16 x, uint16 y,
bool toptile);
343 inline void drawTopTile(
const Tile *tile, uint16 x, uint16 y,
bool toptile);
344 inline void drawActor(
const Actor *actor);
348 inline void drawLensAnim();
350 void updateLighting();
351 void generateTmpMap();
352 void boundaryFill(
const byte *map_ptr, uint16 pitch, uint16 x, uint16 y);
353 bool floorTilesVisible();
354 bool boundaryLookThroughWindow(uint16 tile_num, uint16 x, uint16 y);
356 void reshapeBoundary();
357 inline bool tmpBufTileIsBlack(uint16 x, uint16 y)
const;
358 bool tmpBufTileIsBoundary(uint16 x, uint16 y);
359 bool tmpBufTileIsWall(uint16 x, uint16 y, NuvieDir direction);
361 void wizard_eye_stop();
362 void wizard_eye_update();
363 bool is_wizard_eye_mode() {
364 if (wizard_eye_info.moves_left != 0)
return true;
368 void loadRoofTiles();
371 void createLightOverlay();
373 void AddMapTileToVisibleList(uint16 tile_num, uint16 x, uint16 y);
374 bool can_display_obj(uint16 x, uint16 y,
Obj *obj);
Definition: managed_surface.h:51
Definition: map_window.h:70
Definition: configuration.h:60
Definition: atari-screen.h:58
Definition: tile_manager.h:145
Definition: actor_manager.h:42
Definition: detection.h:27
Definition: map_window.h:58
Definition: call_back.h:50
Definition: converse_gump_wou.h:38
Definition: map_window.h:53
Definition: obj_manager.h:74
Definition: keyboard.h:294
Definition: tile_manager.h:113
Definition: anim_manager.h:49