mirror of
https://github.com/open-goal/jak-project
synced 2026-07-11 15:28:58 -04:00
[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 
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user