Port of AVA2's CRenderTarget / GrpRenderTargetTexture / renderTarget module. The host gains an RGBA8 offscreen colour pass for D3D colour render targets; mt_preview shows wearable items on every allowed race and monsters with motions, reached by X+click in the inventory and shop and from the wiki. Player races are created as TYPE_PC so their parts exist. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
63 lines
1.8 KiB
C++
63 lines
1.8 KiB
C++
#pragma once
|
|
// PORT: AVA2 CRenderTarget (EterLib/CRenderTarget.h): one model drawn into its own colour render target, which
|
|
// a UI window then shows. It lives here, not in EterLib, because it owns a CInstanceBase.
|
|
#include <memory>
|
|
#include "../EterLib/GrpRenderTargetTexture.h"
|
|
|
|
class CInstanceBase;
|
|
class CGraphicImageInstance;
|
|
|
|
class CRenderTarget
|
|
{
|
|
public:
|
|
CRenderTarget(DWORD width, DWORD height);
|
|
~CRenderTarget();
|
|
|
|
void SetVisibility(bool isShow){ m_visible = isShow; }
|
|
void SetRotation(bool bRot) { m_pmodelRotationActive = bRot; }
|
|
bool IsReady() { return (m_visible && m_pModel); }
|
|
std::unique_ptr<CInstanceBase>& GetModel() { return m_pModel; }
|
|
|
|
void RotateEyeAroundTarget(float fPitchDegree, float fRollDegree);
|
|
void Zoom(float fRatio);
|
|
|
|
void SelectModel(int index, bool isFromScale= false);
|
|
void ResetModel();
|
|
|
|
void UpdateModel();
|
|
void DeformModel();
|
|
void RenderModel();
|
|
void SetRenderingRect(RECT* rect) const;
|
|
|
|
void CreateTextures() const;
|
|
void ReleaseTextures() const;
|
|
void RenderTexture() const;
|
|
|
|
bool CreateBackground(const char* imgPath, DWORD width, DWORD height);
|
|
void RenderBackground() const;
|
|
|
|
void SetModelV3Eye(float x, float y, float z);
|
|
void SetModelV3Target(float x, float y, float z);
|
|
|
|
void SetModelStatus(bool bStatus) { m_bShowModel = bStatus; }
|
|
|
|
float GetScale() { return m_bScale; }
|
|
void SetScale(float fScale);
|
|
|
|
bool IsShow() { return m_visible; }
|
|
|
|
private:
|
|
std::unique_ptr<CInstanceBase> m_pModel;
|
|
std::unique_ptr<CGraphicImageInstance> m_background;
|
|
std::unique_ptr<CGraphicRenderTargetTexture> m_renderTargetTexture;
|
|
float m_modelRotation;
|
|
bool m_pmodelRotationActive;
|
|
bool m_visible;
|
|
bool m_bShowModel;
|
|
float m_bScale;
|
|
D3DXVECTOR3 m_v3AngularVelocity;
|
|
D3DXVECTOR3 m_v3Eye;
|
|
D3DXVECTOR3 m_v3Target;
|
|
D3DXVECTOR3 m_v3Up;
|
|
};
|