Add place_entrance_hex

This commit is contained in:
Alexander Batalov 2023-09-03 20:24:36 +03:00
parent 30a3bf9b71
commit 0d83cff24e
4 changed files with 36 additions and 0 deletions

View File

@ -48,6 +48,9 @@ typedef enum ScienceRepairTargetType {
// 0x5106D0 // 0x5106D0
static bool _action_in_explode = false; static bool _action_in_explode = false;
// 0x5106D4
int rotation;
// 0x5106E0 // 0x5106E0
static const int gNormalDeathAnimations[DAMAGE_TYPE_COUNT] = { static const int gNormalDeathAnimations[DAMAGE_TYPE_COUNT] = {
ANIM_DANCING_AUTOFIRE, ANIM_DANCING_AUTOFIRE,

View File

@ -6,6 +6,8 @@
namespace fallout { namespace fallout {
extern int rotation;
int _action_attack(Attack* attack); int _action_attack(Attack* attack);
int _action_use_an_item_on_object(Object* a1, Object* a2, Object* a3); int _action_use_an_item_on_object(Object* a1, Object* a2, Object* a3);
int _action_use_an_object(Object* a1, Object* a2); int _action_use_an_object(Object* a1, Object* a2);

View File

@ -1,13 +1,17 @@
#include "mapper/map_func.h" #include "mapper/map_func.h"
#include "actions.h"
#include "color.h" #include "color.h"
#include "game_mouse.h" #include "game_mouse.h"
#include "input.h" #include "input.h"
#include "map.h"
#include "memory.h" #include "memory.h"
#include "mouse.h" #include "mouse.h"
#include "proto.h" #include "proto.h"
#include "svga.h" #include "svga.h"
#include "tile.h"
#include "window_manager.h" #include "window_manager.h"
#include "window_manager_private.h"
namespace fallout { namespace fallout {
@ -26,6 +30,32 @@ void copy_proto_lists()
// TODO: Incomplete. // TODO: Incomplete.
} }
// 0x482708
void place_entrance_hex()
{
int x;
int y;
int tile;
while (inputGetInput() != -2) {
}
if ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_DOWN) != 0) {
if (_mouse_click_in(0, 0, _scr_size.right - _scr_size.left, _scr_size.bottom - _scr_size.top - 100)) {
mouseGetPosition(&x, &y);
tile = tileFromScreenXY(x, y, gElevation);
if (tile != -1) {
if (tileSetCenter(tile, TILE_SET_CENTER_FLAG_IGNORE_SCROLL_RESTRICTIONS) == 0) {
mapSetEnteringLocation(tile, gElevation, rotation);
} else {
win_timed_msg("ERROR: Entrance out of range!", _colorTable[31744]);
}
}
}
}
}
// 0x4841C4 // 0x4841C4
void pick_region(Rect* rect) void pick_region(Rect* rect)
{ {

View File

@ -7,6 +7,7 @@ namespace fallout {
void setup_map_dirs(); void setup_map_dirs();
void copy_proto_lists(); void copy_proto_lists();
void place_entrance_hex();
void pick_region(Rect* rect); void pick_region(Rect* rect);
void sort_rect(Rect* a, Rect* b); void sort_rect(Rect* a, Rect* b);
void draw_rect(Rect* rect, unsigned char color); void draw_rect(Rect* rect, unsigned char color);