mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-03 12:27:21 +12:00
Migrate PICA-types into PICA
namespace
Rather than prefixing these types with `PICA`, a namespace is used instead.
This commit is contained in:
parent
78a3f9fa23
commit
838d3f27f9
7 changed files with 204 additions and 201 deletions
|
@ -47,11 +47,11 @@ class Renderer {
|
|||
OpenGL::uvec2 fbSize; // The size of the framebuffer (ie both the colour and depth buffer)'
|
||||
|
||||
u32 colourBufferLoc; // Location in 3DS VRAM for the colour buffer
|
||||
PICAColorFmt colourBufferFormat; // Format of the colours stored in the colour buffer
|
||||
PICA::ColorFmt colourBufferFormat; // Format of the colours stored in the colour buffer
|
||||
|
||||
// Same for the depth/stencil buffer
|
||||
u32 depthBufferLoc;
|
||||
PICADepthFmt depthBufferFormat;
|
||||
PICA::DepthFmt depthBufferFormat;
|
||||
|
||||
// Dummy VAO/VBO for blitting the final output
|
||||
OpenGL::VertexArray dummyVAO;
|
||||
|
@ -76,16 +76,16 @@ class Renderer {
|
|||
void getGraphicsContext(); // Set up graphics context for rendering
|
||||
void clearBuffer(u32 startAddress, u32 endAddress, u32 value, u32 control); // Clear a GPU buffer in VRAM
|
||||
void displayTransfer(u32 inputAddr, u32 outputAddr, u32 inputSize, u32 outputSize, u32 flags); // Perform display transfer
|
||||
void drawVertices(PICAPrimType primType, std::span<const Vertex> vertices); // Draw the given vertices
|
||||
void drawVertices(PICA::PrimType primType, std::span<const Vertex> vertices); // Draw the given vertices
|
||||
|
||||
void setFBSize(u32 width, u32 height) {
|
||||
fbSize.x() = width;
|
||||
fbSize.y() = height;
|
||||
}
|
||||
|
||||
void setColourFormat(PICAColorFmt format) { colourBufferFormat = format; }
|
||||
void setDepthFormat(PICADepthFmt format) {
|
||||
if (format == PICADepthFmt::Unknown1) {
|
||||
void setColourFormat(PICA::ColorFmt format) { colourBufferFormat = format; }
|
||||
void setDepthFormat(PICA::DepthFmt format) {
|
||||
if (format == PICA::DepthFmt::Unknown1) {
|
||||
Helpers::panic("[PICA] Undocumented depth-stencil mode!");
|
||||
}
|
||||
depthBufferFormat = format;
|
||||
|
|
|
@ -9,7 +9,7 @@ using Interval = boost::icl::right_open_interval<T>;
|
|||
|
||||
struct ColourBuffer {
|
||||
u32 location;
|
||||
PICAColorFmt format;
|
||||
PICA::ColorFmt format;
|
||||
OpenGL::uvec2 size;
|
||||
bool valid;
|
||||
|
||||
|
@ -21,7 +21,7 @@ struct ColourBuffer {
|
|||
|
||||
ColourBuffer() : valid(false) {}
|
||||
|
||||
ColourBuffer(u32 loc, PICAColorFmt format, u32 x, u32 y, bool valid = true)
|
||||
ColourBuffer(u32 loc, PICA::ColorFmt format, u32 x, u32 y, bool valid = true)
|
||||
: location(loc), format(format), size({x, y}), valid(valid) {
|
||||
|
||||
u64 endLoc = (u64)loc + sizeInBytes();
|
||||
|
@ -70,13 +70,13 @@ struct ColourBuffer {
|
|||
}
|
||||
|
||||
size_t sizeInBytes() {
|
||||
return (size_t)size.x() * (size_t)size.y() * sizePerPixel(format);
|
||||
return (size_t)size.x() * (size_t)size.y() * PICA::sizePerPixel(format);
|
||||
}
|
||||
};
|
||||
|
||||
struct DepthBuffer {
|
||||
u32 location;
|
||||
PICADepthFmt format;
|
||||
PICA::DepthFmt format;
|
||||
OpenGL::uvec2 size; // Implicitly set to the size of the framebuffer
|
||||
bool valid;
|
||||
|
||||
|
@ -87,7 +87,7 @@ struct DepthBuffer {
|
|||
|
||||
DepthBuffer() : valid(false) {}
|
||||
|
||||
DepthBuffer(u32 loc, PICADepthFmt format, u32 x, u32 y, bool valid = true) :
|
||||
DepthBuffer(u32 loc, PICA::DepthFmt format, u32 x, u32 y, bool valid = true) :
|
||||
location(loc), format(format), size({x, y}), valid(valid) {
|
||||
|
||||
u64 endLoc = (u64)loc + sizeInBytes();
|
||||
|
@ -96,7 +96,7 @@ struct DepthBuffer {
|
|||
}
|
||||
|
||||
bool hasStencil() {
|
||||
return format == PICADepthFmt::Depth24Stencil8;
|
||||
return format == PICA::DepthFmt::Depth24Stencil8;
|
||||
}
|
||||
|
||||
void allocate() {
|
||||
|
@ -142,6 +142,6 @@ struct DepthBuffer {
|
|||
}
|
||||
|
||||
size_t sizeInBytes() {
|
||||
return (size_t)size.x() * (size_t)size.y() * sizePerPixel(format);
|
||||
return (size_t)size.x() * (size_t)size.y() * PICA::sizePerPixel(format);
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue