Add sort_rect

This commit is contained in:
Alexander Batalov 2023-09-03 19:15:50 +03:00
parent 6e9f1ae517
commit 8c61b0bd8c
2 changed files with 21 additions and 0 deletions

View File

@ -22,6 +22,26 @@ void copy_proto_lists()
// TODO: Incomplete. // TODO: Incomplete.
} }
// 0x484294
void sort_rect(Rect* a, Rect* b)
{
if (b->right > b->left) {
a->left = b->left;
a->right = b->right;
} else {
a->left = b->right;
a->right = b->left;
}
if (b->bottom > b->top) {
a->top = b->top;
a->bottom = b->bottom;
} else {
a->top = b->bottom;
a->bottom = b->top;
}
}
// 0x4842D4 // 0x4842D4
void draw_rect(Rect* rect, unsigned char color) void draw_rect(Rect* rect, unsigned char color)
{ {

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 sort_rect(Rect* a, Rect* b);
void draw_rect(Rect* rect); void draw_rect(Rect* rect);
void erase_rect(Rect* rect); void erase_rect(Rect* rect);
int toolbar_proto(int type, int id); int toolbar_proto(int type, int id);