Complete disaster-recovery snapshot: engine/game source, game data assets, VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive. Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false, no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
68 lines
1.2 KiB
C++
68 lines
1.2 KiB
C++
#include<stdafx.h>
|
|
#include"Layer.h"
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
void TextureLayer::Import(const char *tname)
|
|
{
|
|
LoadTexture(tname);
|
|
|
|
}
|
|
|
|
void TextureLayer::Import(Image &img)
|
|
{
|
|
Img=img;
|
|
Loaded=true;
|
|
}
|
|
|
|
void HeightFieldLayer::Import(const char *tname)
|
|
{
|
|
CString tstr(tname);
|
|
tstr+=".TGA";
|
|
Img.Load((char *)(LPCTSTR)tstr);
|
|
Loaded=true;
|
|
}
|
|
|
|
void HeightFieldLayer::Import(Image &img)
|
|
{
|
|
Img=img;
|
|
Loaded=true;
|
|
}
|
|
|
|
void TextureLayer::LoadTexture(const char *tname)
|
|
{
|
|
Name=tname;
|
|
Texture = MLRTexturePool::Instance->Add(tname);
|
|
CString tstr(tname);
|
|
tstr+=".TGA";
|
|
Img.Load((char *)(LPCTSTR)tstr);
|
|
SetState();
|
|
MLRTexturePool::Instance->LoadImages();
|
|
Loaded=true;
|
|
}
|
|
|
|
Layer &Layer::operator=(Layer &lay)
|
|
{
|
|
|
|
Img=lay.Img;
|
|
Name=lay.Name;
|
|
Texture=lay.Texture;
|
|
State=lay.State;
|
|
Loaded=lay.Loaded;
|
|
return *this;
|
|
}
|
|
|
|
void Layer::SetState()
|
|
{
|
|
State.SetTextureHandle(Texture->GetTextureHandle());
|
|
State.SetRenderDeltaMask(MLRState::TextureMask);
|
|
State.SetZBufferCompareOn();
|
|
State.SetZBufferWriteOn();
|
|
State.SetFilterMode(MLRState::TriLinearFilterMode);
|
|
State.SetPriority(MLRState::DefaultPriority);
|
|
|
|
}
|