mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-02-03 12:31:15 +00:00
Refactor c3d renderer (#14)
* Refactor c3d renderer * format * Apply suggestions from code review Co-authored-by: Anders Jenbo <anders@jenbo.dk> --------- Co-authored-by: Anders Jenbo <anders@jenbo.dk>
This commit is contained in:
parent
eeb7c16425
commit
6b5fbdd27a
@ -1,3 +1,4 @@
|
|||||||
|
#include "d3drmrenderer.h"
|
||||||
#include "d3drmrenderer_citro3d.h"
|
#include "d3drmrenderer_citro3d.h"
|
||||||
#include "d3drmtexture_impl.h"
|
#include "d3drmtexture_impl.h"
|
||||||
#include "ddraw_impl.h"
|
#include "ddraw_impl.h"
|
||||||
@ -362,15 +363,6 @@ Uint32 Citro3DRenderer::GetMeshId(IDirect3DRMMesh* mesh, const MeshGroup* meshGr
|
|||||||
return (Uint32) (m_meshs.size() - 1);
|
return (Uint32) (m_meshs.size() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Citro3DRenderer::GetDesc(D3DDEVICEDESC* halDesc, D3DDEVICEDESC* helDesc)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* Citro3DRenderer::GetName()
|
|
||||||
{
|
|
||||||
return "Citro3D";
|
|
||||||
}
|
|
||||||
|
|
||||||
void Citro3DRenderer::StartFrame()
|
void Citro3DRenderer::StartFrame()
|
||||||
{
|
{
|
||||||
if (g_rendering) {
|
if (g_rendering) {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "d3drmrenderer.h"
|
#include "d3drmrenderer.h"
|
||||||
|
#include "ddraw_impl.h"
|
||||||
|
|
||||||
#include <SDL3/SDL.h>
|
#include <SDL3/SDL.h>
|
||||||
#include <citro3d.h>
|
#include <citro3d.h>
|
||||||
@ -33,8 +34,6 @@ class Citro3DRenderer : public Direct3DRMRenderer {
|
|||||||
void SetFrustumPlanes(const Plane* frustumPlanes) override;
|
void SetFrustumPlanes(const Plane* frustumPlanes) override;
|
||||||
Uint32 GetTextureId(IDirect3DRMTexture* texture, bool isUi) override;
|
Uint32 GetTextureId(IDirect3DRMTexture* texture, bool isUi) override;
|
||||||
Uint32 GetMeshId(IDirect3DRMMesh* mesh, const MeshGroup* meshGroup) override;
|
Uint32 GetMeshId(IDirect3DRMMesh* mesh, const MeshGroup* meshGroup) override;
|
||||||
void GetDesc(D3DDEVICEDESC* halDesc, D3DDEVICEDESC* helDesc) override;
|
|
||||||
const char* GetName() override;
|
|
||||||
HRESULT BeginFrame() override;
|
HRESULT BeginFrame() override;
|
||||||
void EnableTransparency() override;
|
void EnableTransparency() override;
|
||||||
void SubmitDraw(
|
void SubmitDraw(
|
||||||
@ -68,9 +67,6 @@ class Citro3DRenderer : public Direct3DRMRenderer {
|
|||||||
|
|
||||||
inline static void Citro3DRenderer_EnumDevice(LPD3DENUMDEVICESCALLBACK cb, void* ctx)
|
inline static void Citro3DRenderer_EnumDevice(LPD3DENUMDEVICESCALLBACK cb, void* ctx)
|
||||||
{
|
{
|
||||||
GUID guid = Citro3D_GUID;
|
|
||||||
char* deviceNameDup = SDL_strdup("Citro3D");
|
|
||||||
char* deviceDescDup = SDL_strdup("Miniwin driver");
|
|
||||||
D3DDEVICEDESC halDesc = {};
|
D3DDEVICEDESC halDesc = {};
|
||||||
halDesc.dcmColorModel = D3DCOLOR_RGB;
|
halDesc.dcmColorModel = D3DCOLOR_RGB;
|
||||||
halDesc.dwFlags = D3DDD_DEVICEZBUFFERBITDEPTH;
|
halDesc.dwFlags = D3DDD_DEVICEZBUFFERBITDEPTH;
|
||||||
@ -79,10 +75,8 @@ inline static void Citro3DRenderer_EnumDevice(LPD3DENUMDEVICESCALLBACK cb, void*
|
|||||||
halDesc.dpcTriCaps.dwTextureCaps = D3DPTEXTURECAPS_PERSPECTIVE;
|
halDesc.dpcTriCaps.dwTextureCaps = D3DPTEXTURECAPS_PERSPECTIVE;
|
||||||
halDesc.dpcTriCaps.dwShadeCaps = D3DPSHADECAPS_ALPHAFLATBLEND;
|
halDesc.dpcTriCaps.dwShadeCaps = D3DPSHADECAPS_ALPHAFLATBLEND;
|
||||||
halDesc.dpcTriCaps.dwTextureFilterCaps = D3DPTFILTERCAPS_LINEAR;
|
halDesc.dpcTriCaps.dwTextureFilterCaps = D3DPTFILTERCAPS_LINEAR;
|
||||||
|
|
||||||
D3DDEVICEDESC helDesc = {};
|
D3DDEVICEDESC helDesc = {};
|
||||||
|
|
||||||
cb(&guid, deviceNameDup, deviceDescDup, &halDesc, &helDesc, ctx);
|
EnumDevice(cb, ctx, "Citro3D", &halDesc, &helDesc, Citro3D_GUID);
|
||||||
|
|
||||||
SDL_free(deviceDescDup);
|
|
||||||
SDL_free(deviceNameDup);
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user