diff --git a/src/modules/graphics/Graphics.cpp b/src/modules/graphics/Graphics.cpp index a148f7501..15bc9242b 100644 --- a/src/modules/graphics/Graphics.cpp +++ b/src/modules/graphics/Graphics.cpp @@ -130,9 +130,9 @@ StringMap Graphics::alignModes(Gr StringMap::Entry Graphics::blendModeEntries[] = { { "alpha", Graphics::BLEND_ALPHA }, - { "additive", Graphics::BLEND_ADDITIVE }, - { "subtractive", Graphics::BLEND_SUBTRACTIVE }, - { "multiplicative", Graphics::BLEND_MULTIPLICATIVE }, + { "add", Graphics::BLEND_ADD }, + { "subtract", Graphics::BLEND_SUBTRACT }, + { "multiply", Graphics::BLEND_MULTIPLY }, { "premultiplied", Graphics::BLEND_PREMULTIPLIED }, { "screen", Graphics::BLEND_SCREEN }, { "replace", Graphics::BLEND_REPLACE }, diff --git a/src/modules/graphics/Graphics.h b/src/modules/graphics/Graphics.h index 3b95bac51..1a122fea2 100644 --- a/src/modules/graphics/Graphics.h +++ b/src/modules/graphics/Graphics.h @@ -53,9 +53,9 @@ public: enum BlendMode { BLEND_ALPHA = 1, - BLEND_ADDITIVE, - BLEND_SUBTRACTIVE, - BLEND_MULTIPLICATIVE, + BLEND_ADD, + BLEND_SUBTRACT, + BLEND_MULTIPLY, BLEND_PREMULTIPLIED, BLEND_SCREEN, BLEND_REPLACE, diff --git a/src/modules/graphics/opengl/Graphics.cpp b/src/modules/graphics/opengl/Graphics.cpp index b698a90f3..b4240eee1 100644 --- a/src/modules/graphics/opengl/Graphics.cpp +++ b/src/modules/graphics/opengl/Graphics.cpp @@ -639,7 +639,7 @@ void Graphics::setBlendMode(Graphics::BlendMode mode) state.srcA = GL_ONE; state.dstRGB = state.dstA = GL_ONE_MINUS_SRC_ALPHA; break; - case BLEND_MULTIPLICATIVE: + case BLEND_MULTIPLY: state.srcRGB = state.srcA = GL_DST_COLOR; state.dstRGB = state.dstA = GL_ZERO; break; @@ -647,9 +647,9 @@ void Graphics::setBlendMode(Graphics::BlendMode mode) state.srcRGB = state.srcA = GL_ONE; state.dstRGB = state.dstA = GL_ONE_MINUS_SRC_ALPHA; break; - case BLEND_SUBTRACTIVE: + case BLEND_SUBTRACT: state.func = GL_FUNC_REVERSE_SUBTRACT; - case BLEND_ADDITIVE: + case BLEND_ADD: state.srcRGB = state.srcA = GL_SRC_ALPHA; state.dstRGB = state.dstA = GL_ONE; break; @@ -672,16 +672,16 @@ Graphics::BlendMode Graphics::getBlendMode() const OpenGL::BlendState state = gl.getBlendState(); if (state.func == GL_FUNC_REVERSE_SUBTRACT) // && src == GL_SRC_ALPHA && dst == GL_ONE - return BLEND_SUBTRACTIVE; + return BLEND_SUBTRACT; // Everything else has equation == GL_FUNC_ADD. else if (state.srcRGB == state.srcA && state.dstRGB == state.dstA) { if (state.srcRGB == GL_SRC_ALPHA && state.dstRGB == GL_ONE) - return BLEND_ADDITIVE; + return BLEND_ADD; else if (state.srcRGB == GL_SRC_ALPHA && state.dstRGB == GL_ONE_MINUS_SRC_ALPHA) return BLEND_ALPHA; // alpha blend mode fallback for very old OpenGL versions. else if (state.srcRGB == GL_DST_COLOR && state.dstRGB == GL_ZERO) - return BLEND_MULTIPLICATIVE; + return BLEND_MULTIPLY; else if (state.srcRGB == GL_ONE && state.dstRGB == GL_ONE_MINUS_SRC_ALPHA) return BLEND_PREMULTIPLIED; else if (state.srcRGB == GL_ONE && state.dstRGB == GL_ONE_MINUS_SRC_COLOR) diff --git a/src/scripts/boot.lua b/src/scripts/boot.lua index 4c4353724..a01330445 100644 --- a/src/scripts/boot.lua +++ b/src/scripts/boot.lua @@ -1429,7 +1429,7 @@ function love.nogame() local small_y = -rain.spacing_y + y / 2 local big_y = -rain.spacing_y + y - love.graphics.setBlendMode("subtractive") + love.graphics.setBlendMode("subtract") love.graphics.setColor(255, 255, 255, 128) love.graphics.draw(rain.batch, -rain.spacing_x, small_y, 0, 0.5, 0.5) @@ -1458,7 +1458,7 @@ function love.nogame() love.graphics.draw(background.image, bx, by, 0, 0.7, 0.7, 256, 256) love.graphics.setColor(255, 255, 255, 32 + 16*intensity) love.graphics.draw(background.image, bx, by, 0, 0.65, 0.65, 256, 256) - love.graphics.setBlendMode("additive") + love.graphics.setBlendMode("add") love.graphics.setColor(255, 255, 255, 16 + 16*intensity) love.graphics.draw(background.image, bx, by, 0, 0.6, 0.6, 256, 256) end diff --git a/src/scripts/boot.lua.h b/src/scripts/boot.lua.h index 82a227750..7a57a7a87 100644 --- a/src/scripts/boot.lua.h +++ b/src/scripts/boot.lua.h @@ -5020,7 +5020,7 @@ const unsigned char boot_lua[] = 0x61, 0x69, 0x6e, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x5f, 0x79, 0x20, 0x2b, 0x20, 0x79, 0x0a, 0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x42, 0x6c, 0x65, 0x6e, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x28, 0x22, 0x73, 0x75, 0x62, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0x29, 0x0a, + 0x63, 0x74, 0x22, 0x29, 0x0a, 0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x31, 0x32, 0x38, 0x29, 0x0a, @@ -5083,8 +5083,7 @@ const unsigned char boot_lua[] = 0x65, 0x2c, 0x20, 0x62, 0x78, 0x2c, 0x20, 0x62, 0x79, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x36, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x36, 0x35, 0x2c, 0x20, 0x32, 0x35, 0x36, 0x2c, 0x20, 0x32, 0x35, 0x36, 0x29, 0x0a, 0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, - 0x74, 0x42, 0x6c, 0x65, 0x6e, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x28, 0x22, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x22, 0x29, 0x0a, + 0x74, 0x42, 0x6c, 0x65, 0x6e, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x28, 0x22, 0x61, 0x64, 0x64, 0x22, 0x29, 0x0a, 0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x31, 0x36, 0x20, 0x2b, 0x20, 0x31, 0x36, 0x2a, 0x69, 0x6e, 0x74, 0x65, 0x6e, 0x73,