mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
df646282ab
This should fix a bunch of texture-related issues by generating a table of overlapping textures and just... adjusting them slightly so they don't overlap. It's not the most elegant solution in the world, but I think it's no worse than the existing hard-coded tpage dir stuff.
43 lines
1 KiB
C++
43 lines
1 KiB
C++
#pragma once
|
|
|
|
#include <map>
|
|
#include <set>
|
|
#include <string>
|
|
#include <unordered_map>
|
|
#include <vector>
|
|
|
|
#include "common/common_types.h"
|
|
#include "common/util/FileUtil.h"
|
|
|
|
namespace decompiler {
|
|
struct TextureDB {
|
|
struct TextureData {
|
|
u16 w, h;
|
|
std::string name;
|
|
u32 page;
|
|
u32 dest = -1;
|
|
std::vector<u32> rgba_bytes;
|
|
u32 num_mips = -1;
|
|
};
|
|
|
|
std::map<u32, TextureData> textures;
|
|
std::unordered_map<u32, std::string> tpage_names;
|
|
std::unordered_map<std::string, std::set<u32>> texture_ids_per_level;
|
|
|
|
void add_texture(u32 tpage,
|
|
u32 texid,
|
|
const std::vector<u32>& data,
|
|
u16 w,
|
|
u16 h,
|
|
const std::string& tex_name,
|
|
const std::string& tpage_name,
|
|
const std::vector<std::string>& level_names,
|
|
u32 num_mips,
|
|
u32 dest);
|
|
|
|
void replace_textures(const fs::path& path);
|
|
|
|
std::string generate_texture_dest_adjustment_table() const;
|
|
};
|
|
} // namespace decompiler
|