decomp: stash changes

This commit is contained in:
Tyler Wilding
2026-07-15 19:09:22 -04:00
parent 9988c5305b
commit 3451479362
4 changed files with 12 additions and 4 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
namespace decompiler {
TextureDB::TextureDB() : replacement_cache(TextureLRUCache(25)) {
TextureDB::TextureDB() : replacement_cache(TextureLRUCache(50)) {
std::vector<u32> data(16 * 16, 0xffffffff);
add_texture(kPlaceholderWhiteTexturePage, kPlaceholderWhiteTextureId, data, 16, 16,
"placeholder-white", "placeholder", {}, 1, 0);
+10
View File
@@ -1,6 +1,7 @@
#pragma once
#include <map>
#include <mutex>
#include <optional>
#include <set>
#include <string>
@@ -26,10 +27,18 @@ struct TextureLRUCache {
size_t capacity;
List entries; // front = most recently used
std::unordered_map<u32, Iterator> lookup;
std::mutex mutex;
TextureLRUCache(size_t capacity) : capacity(capacity) {}
void clear() {
std::lock_guard lock(mutex);
entries.clear();
lookup.clear();
}
ResolvedTextureData* get(u32 id) {
std::lock_guard lock(mutex);
auto it = lookup.find(id);
if (it == lookup.end()) {
return nullptr;
@@ -39,6 +48,7 @@ struct TextureLRUCache {
}
void put(u32 id, ResolvedTextureData data) {
std::lock_guard lock(mutex);
auto it = lookup.find(id);
if (it != lookup.end()) {
it->second->second = std::move(data);
+1 -2
View File
@@ -358,8 +358,7 @@ std::unique_ptr<TextureDB> handle_textures(Config config,
tex_db->merge_textures(texture_merge_path);
}
auto replacements_path = file_util::get_jak_project_dir() / "custom_assets" /
game_version_names[config.game_version] / "texture_replacements";
auto replacements_path = "E:\\awful_texture_pack\\"; // DONT MERGE
if (fs::exists(replacements_path)) {
tex_db->replace_textures(replacements_path);
}
@@ -1,7 +1,6 @@
#include "extract_level.h"
#include <set>
#include <thread>
#include "extract_anim.h"