summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/pica_to_gl.h
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-09-18 02:38:01 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-09-18 02:38:01 +0200
commitdc8479928c5aee4c6ad6fe4f59006fb604cee701 (patch)
tree569a7f13128450bbab973236615587ff00bced5f /src/video_core/renderer_opengl/pica_to_gl.h
parentTravis: Import Dolphin’s clang-format hook. (diff)
downloadyuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.gz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.bz2
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.lz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.xz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.zst
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.zip
Diffstat (limited to 'src/video_core/renderer_opengl/pica_to_gl.h')
-rw-r--r--src/video_core/renderer_opengl/pica_to_gl.h72
1 files changed, 33 insertions, 39 deletions
diff --git a/src/video_core/renderer_opengl/pica_to_gl.h b/src/video_core/renderer_opengl/pica_to_gl.h
index d9b9c9cc2..a604e94d4 100644
--- a/src/video_core/renderer_opengl/pica_to_gl.h
+++ b/src/video_core/renderer_opengl/pica_to_gl.h
@@ -25,8 +25,8 @@ namespace PicaToGL {
inline GLenum TextureFilterMode(Pica::Regs::TextureConfig::TextureFilter mode) {
static const GLenum filter_mode_table[] = {
- GL_NEAREST, // TextureFilter::Nearest
- GL_LINEAR // TextureFilter::Linear
+ GL_NEAREST, // TextureFilter::Nearest
+ GL_LINEAR // TextureFilter::Linear
};
// Range check table for input
@@ -52,10 +52,10 @@ inline GLenum TextureFilterMode(Pica::Regs::TextureConfig::TextureFilter mode) {
inline GLenum WrapMode(Pica::Regs::TextureConfig::WrapMode mode) {
static const GLenum wrap_mode_table[] = {
- GL_CLAMP_TO_EDGE, // WrapMode::ClampToEdge
- GL_CLAMP_TO_BORDER,// WrapMode::ClampToBorder
- GL_REPEAT, // WrapMode::Repeat
- GL_MIRRORED_REPEAT // WrapMode::MirroredRepeat
+ GL_CLAMP_TO_EDGE, // WrapMode::ClampToEdge
+ GL_CLAMP_TO_BORDER, // WrapMode::ClampToBorder
+ GL_REPEAT, // WrapMode::Repeat
+ GL_MIRRORED_REPEAT // WrapMode::MirroredRepeat
};
// Range check table for input
@@ -131,22 +131,22 @@ inline GLenum BlendFunc(Pica::Regs::BlendFactor factor) {
inline GLenum LogicOp(Pica::Regs::LogicOp op) {
static const GLenum logic_op_table[] = {
- GL_CLEAR, // Clear
- GL_AND, // And
- GL_AND_REVERSE, // AndReverse
- GL_COPY, // Copy
- GL_SET, // Set
- GL_COPY_INVERTED, // CopyInverted
- GL_NOOP, // NoOp
- GL_INVERT, // Invert
- GL_NAND, // Nand
- GL_OR, // Or
- GL_NOR, // Nor
- GL_XOR, // Xor
- GL_EQUIV, // Equiv
- GL_AND_INVERTED, // AndInverted
- GL_OR_REVERSE, // OrReverse
- GL_OR_INVERTED, // OrInverted
+ GL_CLEAR, // Clear
+ GL_AND, // And
+ GL_AND_REVERSE, // AndReverse
+ GL_COPY, // Copy
+ GL_SET, // Set
+ GL_COPY_INVERTED, // CopyInverted
+ GL_NOOP, // NoOp
+ GL_INVERT, // Invert
+ GL_NAND, // Nand
+ GL_OR, // Or
+ GL_NOR, // Nor
+ GL_XOR, // Xor
+ GL_EQUIV, // Equiv
+ GL_AND_INVERTED, // AndInverted
+ GL_OR_REVERSE, // OrReverse
+ GL_OR_INVERTED, // OrInverted
};
// Range check table for input
@@ -185,14 +185,14 @@ inline GLenum CompareFunc(Pica::Regs::CompareFunc func) {
inline GLenum StencilOp(Pica::Regs::StencilAction action) {
static const GLenum stencil_op_table[] = {
- GL_KEEP, // StencilAction::Keep
- GL_ZERO, // StencilAction::Zero
- GL_REPLACE, // StencilAction::Replace
- GL_INCR, // StencilAction::Increment
- GL_DECR, // StencilAction::Decrement
- GL_INVERT, // StencilAction::Invert
- GL_INCR_WRAP, // StencilAction::IncrementWrap
- GL_DECR_WRAP // StencilAction::DecrementWrap
+ GL_KEEP, // StencilAction::Keep
+ GL_ZERO, // StencilAction::Zero
+ GL_REPLACE, // StencilAction::Replace
+ GL_INCR, // StencilAction::Increment
+ GL_DECR, // StencilAction::Decrement
+ GL_INVERT, // StencilAction::Invert
+ GL_INCR_WRAP, // StencilAction::IncrementWrap
+ GL_DECR_WRAP // StencilAction::DecrementWrap
};
// Range check table for input
@@ -207,18 +207,12 @@ inline GLenum StencilOp(Pica::Regs::StencilAction action) {
}
inline GLvec4 ColorRGBA8(const u32 color) {
- return { { (color >> 0 & 0xFF) / 255.0f,
- (color >> 8 & 0xFF) / 255.0f,
- (color >> 16 & 0xFF) / 255.0f,
- (color >> 24 & 0xFF) / 255.0f
- } };
+ return {{(color >> 0 & 0xFF) / 255.0f, (color >> 8 & 0xFF) / 255.0f,
+ (color >> 16 & 0xFF) / 255.0f, (color >> 24 & 0xFF) / 255.0f}};
}
inline std::array<GLfloat, 3> LightColor(const Pica::Regs::LightColor& color) {
- return { { color.r / 255.0f,
- color.g / 255.0f,
- color.b / 255.0f
- } };
+ return {{color.r / 255.0f, color.g / 255.0f, color.b / 255.0f}};
}
} // namespace