mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
VideoCommon: Abstract bounding box
This moves much of the duplicated bounding box code into VideoCommon, leaving only the specific buffer implementations in each backend.
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
add_library(videonull
|
||||
NullBackend.cpp
|
||||
NullBoundingBox.h
|
||||
NullRender.cpp
|
||||
NullRender.h
|
||||
NullTexture.cpp
|
||||
|
25
Source/Core/VideoBackends/Null/NullBoundingBox.h
Normal file
25
Source/Core/VideoBackends/Null/NullBoundingBox.h
Normal file
@ -0,0 +1,25 @@
|
||||
// Copyright 2021 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
|
||||
#include "VideoCommon/BoundingBox.h"
|
||||
|
||||
namespace Null
|
||||
{
|
||||
class NullBoundingBox final : public BoundingBox
|
||||
{
|
||||
public:
|
||||
bool Initialize() override { return true; }
|
||||
|
||||
protected:
|
||||
std::vector<BBoxType> Read(u32 index, u32 length) override
|
||||
{
|
||||
return std::vector<BBoxType>(length);
|
||||
}
|
||||
void Write(u32 index, const std::vector<BBoxType>& values) override {}
|
||||
};
|
||||
|
||||
} // namespace Null
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include "VideoBackends/Null/NullRender.h"
|
||||
|
||||
#include "VideoBackends/Null/NullBoundingBox.h"
|
||||
#include "VideoBackends/Null/NullTexture.h"
|
||||
|
||||
#include "VideoCommon/AbstractPipeline.h"
|
||||
@ -83,4 +84,9 @@ Renderer::CreateNativeVertexFormat(const PortableVertexDeclaration& vtx_decl)
|
||||
{
|
||||
return std::make_unique<NativeVertexFormat>(vtx_decl);
|
||||
}
|
||||
|
||||
std::unique_ptr<BoundingBox> Renderer::CreateBoundingBox() const
|
||||
{
|
||||
return std::make_unique<NullBoundingBox>();
|
||||
}
|
||||
} // namespace Null
|
||||
|
@ -5,6 +5,8 @@
|
||||
|
||||
#include "VideoCommon/RenderBase.h"
|
||||
|
||||
class BoundingBox;
|
||||
|
||||
namespace Null
|
||||
{
|
||||
class Renderer final : public ::Renderer
|
||||
@ -35,8 +37,6 @@ public:
|
||||
|
||||
u32 AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) override { return 0; }
|
||||
void PokeEFB(EFBAccessType type, const EfbPokeData* points, size_t num_points) override {}
|
||||
u16 BBoxReadImpl(int index) override { return 0; }
|
||||
void BBoxWriteImpl(int index, u16 value) override {}
|
||||
|
||||
void ClearScreen(const MathUtil::Rectangle<int>& rc, bool colorEnable, bool alphaEnable,
|
||||
bool zEnable, u32 color, u32 z) override
|
||||
@ -44,5 +44,8 @@ public:
|
||||
}
|
||||
|
||||
void ReinterpretPixelData(EFBReinterpretType convtype) override {}
|
||||
|
||||
protected:
|
||||
std::unique_ptr<BoundingBox> CreateBoundingBox() const override;
|
||||
};
|
||||
} // namespace Null
|
||||
|
Reference in New Issue
Block a user