mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-16 23:43:13 +00:00
People who make texture packs usually release them using a specific ID (for instance SX4E01). Users who have a different version of the game (like the PAL version SX4P01) then need to rename the custom texture folder to match. This is a lot simpler than renaming every texture file, as was required with the old texture format, but it's still something that users can forget to do. To make that unnecessary, this change makes it possible to use three-character region-free IDs for custom texture folders, similarly to how game INIs can use three-character IDs. Once most people have updated to Dolphin versions that include this change, those who make texture packs will be able to name them with three-character IDs, removing the need for users to rename anything.
59 lines
1.1 KiB
C++
59 lines
1.1 KiB
C++
// Copyright 2008 Dolphin Emulator Project
|
|
// Licensed under GPLv2+
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
class HiresTexture
|
|
{
|
|
public:
|
|
using SOILPointer = std::unique_ptr<u8, void(*)(unsigned char*)>;
|
|
|
|
static void Init();
|
|
static void Update();
|
|
static void Shutdown();
|
|
|
|
static std::shared_ptr<HiresTexture> Search(
|
|
const u8* texture, size_t texture_size,
|
|
const u8* tlut, size_t tlut_size,
|
|
u32 width, u32 height,
|
|
int format, bool has_mipmaps
|
|
);
|
|
|
|
static std::string GenBaseName(
|
|
const u8* texture, size_t texture_size,
|
|
const u8* tlut, size_t tlut_size,
|
|
u32 width, u32 height,
|
|
int format, bool has_mipmaps,
|
|
bool dump = false
|
|
);
|
|
|
|
~HiresTexture();
|
|
|
|
struct Level
|
|
{
|
|
Level();
|
|
|
|
SOILPointer data;
|
|
size_t data_size = 0;
|
|
u32 width = 0;
|
|
u32 height = 0;
|
|
};
|
|
std::vector<Level> m_levels;
|
|
|
|
private:
|
|
static std::unique_ptr<HiresTexture> Load(const std::string& base_filename, u32 width, u32 height);
|
|
static void Prefetch();
|
|
|
|
static std::string GetTextureFolder(const std::string& game_id);
|
|
|
|
HiresTexture() {}
|
|
|
|
};
|