22 #ifndef NUVIE_CORE_MAP_WINDOW_H 23 #define NUVIE_CORE_MAP_WINDOW_H 25 #include "ultima/shared/std/containers.h" 28 #include "ultima/nuvie/core/nuvie_defs.h" 29 #include "ultima/nuvie/core/obj_manager.h" 30 #include "ultima/nuvie/gui/widgets/gui_widget.h" 31 #include "ultima/nuvie/core/map.h" 47 #define MAPWINDOW_THUMBNAIL_SIZE 52 48 #define MAPWINDOW_THUMBNAIL_SCALE 3 50 #define MAP_OVERLAY_DEFAULT 0 51 #define MAP_OVERLAY_ONTOP 1 53 #define MAPWINDOW_ROOFTILES_IMG_W 5 54 #define MAPWINDOW_ROOFTILES_IMG_H 204 63 uint16 prev_x, prev_y;
68 enum RoofDisplayType {ROOF_DISPLAY_OFF, ROOF_DISPLAY_NORMAL, ROOF_DISPLAY_FORCE_ON };
69 enum InterfaceType { INTERFACE_NORMAL, INTERFACE_FULLSCREEN, INTERFACE_IGNORE_BLOCK };
70 enum X_RayType { X_RAY_CHEAT_OFF = -1, X_RAY_OFF = 0, X_RAY_ON = 1, X_RAY_CHEAT_ON = 2};
71 enum CanDropOrMoveMsg { MSG_NOT_POSSIBLE, MSG_SUCCESS, MSG_BLOCKED, MSG_OUT_OF_RANGE, MSG_NO_TILE};
79 bool enable_doubleclick;
80 bool walk_with_left_button;
81 uint8 walk_button_mask;
83 InterfaceType interface;
85 bool custom_actor_tiles;
90 uint16 tmp_map_width, tmp_map_height;
101 uint16 cursor_x, cursor_y, map_center_xoff;
102 sint16 mousecenter_x, mousecenter_y;
103 uint16 last_boundary_fill_x, last_boundary_fill_y;
108 bool show_use_cursor;
111 unsigned char *thumbnail;
114 uint16 win_width, win_height, border_width;
118 uint8 cur_x_add, cur_y_add;
129 bool look_on_left_click;
133 bool freeze_blacking_location;
134 bool enable_blacking;
137 RoofDisplayType roof_display;
143 bool draw_brit_lens_anim;
144 bool draw_garg_lens_anim;
148 bool lighting_update_required;
159 sint16 get_cur_x()
const {
162 sint16 get_cur_y()
const {
165 bool set_windowSize(uint16 width, uint16 height);
166 void set_show_cursor(
bool state);
167 void set_show_use_cursor(
bool state);
168 void set_show_grid(
bool state);
169 bool is_grid_showing() {
172 void set_velocity(sint16 vx, sint16 vy) {
177 void set_overlay_level(
int level = MAP_OVERLAY_DEFAULT) {
178 overlay_level = level;
180 void set_x_ray_view(X_RayType state,
bool cheat_off =
false);
181 X_RayType get_x_ray_view() {
184 void set_freeze_blacking_location(
bool state);
185 void set_enable_blacking(
bool state);
186 void set_roof_mode(
bool roofs);
187 void set_roof_display_mode(
enum RoofDisplayType mode) {
190 void set_walking(
bool state);
191 void set_walk_button_mask();
192 bool will_walk_with_left_button() {
193 return walk_with_left_button;
195 void set_walk_with_left_button(
bool val) {
196 walk_with_left_button = val;
197 set_walk_button_mask();
199 void set_looking(
bool state) {
202 int get_min_brightness() {
203 return min_brightness;
205 void set_min_brightness(
int brightness) {
206 min_brightness = brightness;
209 void moveLevel(uint8 new_level);
210 void moveMap(sint16 new_x, sint16 new_y, sint8 new_level, uint8 new_x_add = 0, uint8 new_y_add = 0);
211 void moveMapRelative(sint16 rel_x, sint16 rel_y);
212 void shiftMapRelative(sint16 rel_x, sint16 rel_y);
213 void set_mousecenter(sint16 new_x, sint16 new_y) {
214 mousecenter_x = new_x;
215 mousecenter_y = new_y;
217 void reset_mousecenter() {
218 mousecenter_x = win_width / 2;
219 mousecenter_y = win_height / 2;
221 uint16 get_win_area() {
222 return win_width * win_height;
224 void centerMapOnActor(
Actor *actor);
225 void centerMap(uint16 x, uint16 y, uint8 z);
228 void moveCursor(sint16 new_x, sint16 new_y);
229 void moveCursorRelative(sint16 rel_x, sint16 rel_y);
231 bool is_doubleclick_enabled() {
232 return enable_doubleclick;
234 void set_enable_doubleclick(
bool val) {
235 enable_doubleclick = val;
237 void set_look_on_left_click(
bool val) {
238 look_on_left_click = val;
240 void set_use_left_clicks();
241 bool will_look_on_left_click() {
242 return look_on_left_click;
244 bool is_on_screen(uint16 x, uint16 y, uint8 z);
245 bool tile_is_black(uint16 x, uint16 y,
const Obj *obj =
nullptr)
const;
246 const char *look(uint16 x, uint16 y,
bool show_prefix =
true);
247 const char *lookAtCursor(
bool show_prefix =
true) {
248 return (look(cursor_x, cursor_y, show_prefix));
250 Obj *get_objAtCursor(
bool for_use =
false);
251 Obj *get_objAtCoord(
MapCoord coord,
bool top_obj,
bool include_ignored_objects,
bool for_use =
false);
252 Actor *get_actorAtCursor();
254 Obj *get_objAtMousePos(
int x,
int y);
255 Actor *get_actorAtMousePos(
int x,
int y);
256 void teleport_to_cursor();
257 void select_target(
int x,
int y);
258 void mouseToWorldCoords(
int mx,
int my,
int &wx,
int &wy);
259 void get_movement_direction(uint16 mx, uint16 my, sint16 &rel_x, sint16 &rel_y, uint8 *mptr =
nullptr);
272 void get_level(uint8 *level)
const;
273 void get_pos(uint16 *x, uint16 *y, uint8 *px =
nullptr, uint8 *py =
nullptr)
const;
274 void get_velocity(sint16 *vx, sint16 *vy)
const {
278 void get_windowSize(uint16 *width, uint16 *height)
const;
280 bool in_window(uint16 x, uint16 y, uint8 z)
const;
281 bool in_dungeon_level()
const;
282 bool in_town()
const;
284 CanDropOrMoveMsg can_drop_or_move_obj(uint16 x, uint16 y,
Actor *actor,
Obj *obj);
285 void display_can_drop_or_move_msg(CanDropOrMoveMsg msg,
Std::string msg_text =
"");
286 bool can_get_obj(
const Actor *actor,
Obj *obj);
287 bool blocked_by_wall(
const Actor *actor,
const Obj *obj);
290 void updateBlacking();
291 void updateAmbience();
293 void Display(
bool full_redraw)
override;
295 GUI_status MouseDown(
int x,
int y, Shared::MouseButton button)
override;
296 GUI_status MouseUp(
int x,
int y, Shared::MouseButton button)
override;
297 GUI_status MouseMotion(
int x,
int y, uint8 state)
override;
298 GUI_status MouseDouble(
int x,
int y, Shared::MouseButton button)
override;
299 GUI_status MouseClick(
int x,
int y, Shared::MouseButton button)
override;
300 GUI_status Idle(
void)
override;
301 GUI_status MouseLeave(uint8 state)
override;
302 GUI_status MouseDelayed(
int x,
int y, Shared::MouseButton button)
override;
303 GUI_status MouseHeld(
int x,
int y, Shared::MouseButton button)
override;
305 GUI_status MouseWheel(sint32 x, sint32 y)
override;
307 void drag_drop_success(
int x,
int y,
int message,
void *data)
override;
308 void drag_drop_failed(
int x,
int y,
int message,
void *data)
override;
310 bool drag_accept_drop(
int x,
int y,
int message,
void *data)
override;
311 void drag_perform_drop(
int x,
int y,
int message,
void *data)
override;
312 bool move_on_drop(
Obj *obj);
313 void set_interface();
314 InterfaceType get_interface();
315 bool is_interface_fullscreen_in_combat();
317 void drag_draw(
int x,
int y,
int message,
void *data)
override;
319 void update_mouse_cursor(uint32 mx, uint32 my);
321 unsigned char *make_thumbnail();
322 void free_thumbnail();
331 void wizard_eye_start(
const MapCoord &location, uint16 duration,
CallBack *caller);
333 bool using_map_tile_lighting;
336 void create_thumbnail();
339 void drawAnims(
bool top_anims);
341 void drawObjSuperBlock(
bool draw_lowertiles,
bool toptile);
342 inline void drawObj(
const Obj *obj,
bool draw_lowertiles,
bool toptile);
343 inline void drawTile(
const Tile *tile, uint16 x, uint16 y,
bool toptile,
bool use_tile_data =
false);
344 inline void drawNewTile(
const Tile *tile, uint16 x, uint16 y,
bool toptile);
346 inline void drawTopTile(
const Tile *tile, uint16 x, uint16 y,
bool toptile);
347 inline void drawActor(
const Actor *actor);
351 inline void drawLensAnim();
353 void updateLighting();
354 void generateTmpMap();
355 void boundaryFill(
const byte *map_ptr, uint16 pitch, uint16 x, uint16 y);
356 bool floorTilesVisible();
357 bool boundaryLookThroughWindow(uint16 tile_num, uint16 x, uint16 y);
359 void reshapeBoundary();
360 inline bool tmpBufTileIsBlack(uint16 x, uint16 y)
const;
361 bool tmpBufTileIsBoundary(uint16 x, uint16 y);
362 bool tmpBufTileIsWall(uint16 x, uint16 y, NuvieDir direction);
364 void wizard_eye_stop();
365 void wizard_eye_update();
366 bool is_wizard_eye_mode() {
367 if (wizard_eye_info.moves_left != 0)
return true;
371 void loadRoofTiles();
374 void createLightOverlay();
376 void AddMapTileToVisibleList(uint16 tile_num, uint16 x, uint16 y);
377 bool can_display_obj(uint16 x, uint16 y,
Obj *obj);
Definition: managed_surface.h:51
Definition: map_window.h:73
Definition: configuration.h:61
Definition: atari-screen.h:60
Definition: tile_manager.h:145
Definition: actor_manager.h:42
Definition: detection.h:27
Definition: map_window.h:61
Definition: call_back.h:50
Definition: converse_gump_wou.h:41
Definition: map_window.h:56
Definition: obj_manager.h:75
Definition: keyboard.h:294
Definition: tile_manager.h:113
Definition: anim_manager.h:53
Definition: containers.h:38