[jak2] WIP minimap (#2280)

Work in progress minimap. Known issues:
- "path finding" doesn't appear to work - it gets stuck forever in many
cases
- some nasty patches around timer-based code
- jak arrow blending issues
- would be nice to make it higher resolution

if the search is forced to terminate due to iteration/time limits, the
icon is not in the right place

![image](https://user-images.githubusercontent.com/48171810/221432792-678d6124-a6a6-4875-a91f-7eceedbfec98.png)
This commit is contained in:
water111
2023-02-27 19:51:14 -05:00
committed by GitHub
parent 1d0a5ade8d
commit 2c12a4e00b
14 changed files with 938 additions and 729 deletions
+9 -3
View File
@@ -1059,7 +1059,9 @@ goos::Object decompile_structure(const TypeSpec& type,
enum ByteStatus : u8 { ZERO_UNREAD, HAS_DATA_UNREAD, ZERO_READ, HAS_DATA_READ };
std::vector<int> field_status_per_byte;
for (int i = 0; i < byte_count; i++) {
auto& w = obj_words.at(i / 4);
// auto& w = obj_words.at(i / 4);
int b = (offset_location + i);
auto& w = words.at(label.target_segment).at(b / 4);
switch (w.kind()) {
case LinkedWord::TYPE_PTR:
case LinkedWord::PTR:
@@ -1068,7 +1070,7 @@ goos::Object decompile_structure(const TypeSpec& type,
field_status_per_byte.push_back(HAS_DATA_UNREAD);
break;
case LinkedWord::PLAIN_DATA: {
field_status_per_byte.push_back(w.get_byte(i % 4) ? HAS_DATA_UNREAD : ZERO_UNREAD);
field_status_per_byte.push_back(w.get_byte(b % 4) ? HAS_DATA_UNREAD : ZERO_UNREAD);
} break;
default:
throw std::runtime_error("Unsupported word in static data");
@@ -1209,7 +1211,11 @@ goos::Object decompile_structure(const TypeSpec& type,
}
std::vector<u8> bytes_out;
for (int byte_idx = field_start; byte_idx < field_end; byte_idx++) {
bytes_out.push_back(obj_words.at(byte_idx / 4).get_byte(byte_idx % 4));
int byte_idx_in_seg = byte_idx + label.offset - type_info->get_offset();
bytes_out.push_back(words.at(label.target_segment)
.at(byte_idx_in_seg / 4)
.get_byte(byte_idx_in_seg % 4));
// bytes_out.push_back(obj_words.at(byte_idx / 4).get_byte(byte_idx % 4));
}
// use more specific types for gif tags.