Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.
Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
36 lines
1.1 KiB
C++
36 lines
1.1 KiB
C++
#include "Contents/Movies/BinkMovies.h"
|
|
#include "Render/Textures/ClientTextureSources.h"
|
|
#include "Render/RenderSystemBase.h"
|
|
#include "Resource/TextureNames.h"
|
|
|
|
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) {
|
|
}
|
|
|
|
const char* ClientTextureSources::Resolve(const char* name) {
|
|
return this->m_names.Resolve(name);
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
void ClientTextureSources::CleanupTextures() {
|
|
if (this->m_system && this->m_system->Backend() == 1 && this->m_directDraw) {
|
|
this->m_directDraw->Compact();
|
|
}
|
|
}
|