rodecomp/Source/Render/Textures/ClientTextureSources.h
ragnarok-clanker e168b4e4a6 Restore translation-unit ownership and publish verified source corrections
Owner-authorized source migration: 31 helper-only translation units were merged into their callers or existing inline headers; both build manifests updated. Includes the preserved source payload, Lua configuration matching wowdecomp, and exact malloca expansion without diagnostic pragmas.

449 native units compiled locally and 449 staged units compiled by the pinned server toolchain. No previously byte-matched function regressed. Compiler mapping diagnostics remain recorded as needs_cleanup, not accepted or peer-confirmed. Existing independent review records are preserved. README.md is intentionally unchanged.
2026-10-25 15:42:21 +00:00

61 lines
1.8 KiB
C++

#ifndef RAGNAROK_SOURCE_RENDER_TEXTURES_CLIENTTEXTURESOURCES_H
#define RAGNAROK_SOURCE_RENDER_TEXTURES_CLIENTTEXTURESOURCES_H
#include "Contents/Movies/BinkMovies.h"
#include "Render/RenderSystemBase.h"
#include "Render/Textures/TextureCache.h"
#include "Resource/TextureNames.h"
#include <ddraw.h>
struct TextureNames;
class BinkMovies;
class ClientTextureSources : public TextureSources {
public:
ClientTextureSources(TextureNames& names, const int& modeType, BinkMovies* const& movies, CRenderSystemBase*& system, IDirectDraw7* const& directDraw);
const char* Resolve(const char* name) override;
bool MovieSize(const char* name, int& width, int& height) override;
void CleanupTextures() override;
private:
TextureNames& m_names;
const int& m_modeType;
BinkMovies* const& m_movies;
CRenderSystemBase*& m_system;
IDirectDraw7* const& m_directDraw;
};
inline ClientTextureSources::ClientTextureSources(
TextureNames& names, const int& modeType, BinkMovies* const& movies, CRenderSystemBase*& system, IDirectDraw7* const& directDraw
)
: m_names(names), m_modeType(modeType), m_movies(movies), m_system(system), m_directDraw(directDraw) {
}
inline const char* ClientTextureSources::Resolve(const char* name) {
return this->m_names.Resolve(name);
}
inline bool ClientTextureSources::MovieSize(const char* name, int& width, int& height) {
if (this->m_modeType != 1 || !this->m_movies) {
return false;
}
NamedBinkMovie* movie = this->m_movies->Get(name, 1);
if (!movie) {
return false;
}
width = movie->decoder->Handle()->width;
height = movie->decoder->Handle()->height;
return true;
}
inline void ClientTextureSources::CleanupTextures() {
if (this->m_system && this->m_system->Backend() == 1 && this->m_directDraw) {
this->m_directDraw->Compact();
}
}
#endif