mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Merge from root
This commit is contained in:
@@ -232,7 +232,7 @@ int w_Source_setVolumeLimits(lua_State *L)
|
||||
if (vmin < .0f || vmin > 1.f || vmax < .0f || vmax > 1.f)
|
||||
return luaL_error(L, "Invalid volume limits: [%f:%f]. Must be in [0:1]", vmin, vmax);
|
||||
t->setMinVolume(vmin);
|
||||
t->setMaxVolume(vmin);
|
||||
t->setMaxVolume(vmax);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -124,6 +124,7 @@ StringMap<Graphics::BlendMode, Graphics::BLEND_MAX_ENUM>::Entry Graphics::blendM
|
||||
{ "subtractive", Graphics::BLEND_SUBTRACTIVE },
|
||||
{ "multiplicative", Graphics::BLEND_MULTIPLICATIVE },
|
||||
{ "premultiplied", Graphics::BLEND_PREMULTIPLIED },
|
||||
{ "none", Graphics::BLEND_NONE },
|
||||
};
|
||||
|
||||
StringMap<Graphics::BlendMode, Graphics::BLEND_MAX_ENUM> Graphics::blendModes(Graphics::blendModeEntries, sizeof(Graphics::blendModeEntries));
|
||||
|
||||
@@ -57,6 +57,7 @@ public:
|
||||
BLEND_SUBTRACTIVE,
|
||||
BLEND_MULTIPLICATIVE,
|
||||
BLEND_PREMULTIPLIED,
|
||||
BLEND_NONE,
|
||||
BLEND_MAX_ENUM
|
||||
};
|
||||
|
||||
|
||||
@@ -553,6 +553,8 @@ void Graphics::setBlendMode(Graphics::BlendMode mode)
|
||||
glBlendFunc(GL_DST_COLOR, GL_ZERO);
|
||||
else if (mode == BLEND_PREMULTIPLIED)
|
||||
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
else if (mode == BLEND_NONE)
|
||||
glBlendFunc(GL_ONE, GL_ZERO);
|
||||
else // mode == BLEND_ADDITIVE || mode == BLEND_SUBTRACTIVE
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
}
|
||||
@@ -588,6 +590,8 @@ Graphics::BlendMode Graphics::getBlendMode()
|
||||
return BLEND_MULTIPLICATIVE;
|
||||
else if (src == GL_ONE && dst == GL_ONE_MINUS_SRC_ALPHA) // && equation == GL_FUNC_ADD
|
||||
return BLEND_PREMULTIPLIED;
|
||||
else if (src == GL_ONE && dst == GL_ZERO)
|
||||
return BLEND_NONE;
|
||||
|
||||
return BLEND_MAX_ENUM; // Should never be reached.
|
||||
}
|
||||
|
||||
@@ -357,7 +357,7 @@ void Image::drawv(const Matrix &t, const vertex *v) const
|
||||
|
||||
bool Image::hasNpot()
|
||||
{
|
||||
return GLEE_ARB_texture_non_power_of_two != 0;
|
||||
return GLEE_VERSION_2_0 || GLEE_ARB_texture_non_power_of_two;
|
||||
}
|
||||
|
||||
bool Image::hasMipmapSupport()
|
||||
|
||||
@@ -682,7 +682,7 @@ end
|
||||
-- Error screen.
|
||||
-----------------------------------------------------------
|
||||
|
||||
local debug = debug
|
||||
local debug, print = debug, print
|
||||
|
||||
local function error_printer(msg, layer)
|
||||
print((debug.traceback("Error: " .. tostring(msg), 1+(layer or 1)):gsub("\n[^\n]+$", "")))
|
||||
@@ -801,6 +801,11 @@ function love.releaseerrhand(msg)
|
||||
end
|
||||
end
|
||||
|
||||
local function deferErrhand(...)
|
||||
local handler = ((love._release and love.releaseerrhand) or love.errhand or error_printer)
|
||||
return handler(...)
|
||||
end
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- The root of all calls.
|
||||
@@ -809,9 +814,9 @@ end
|
||||
return function()
|
||||
local result = xpcall(love.boot, error_printer)
|
||||
if not result then return 1 end
|
||||
local result = xpcall(love.init, love._release and love.releaseerrhand or love.errhand)
|
||||
local result = xpcall(love.init, deferErrhand)
|
||||
if not result then return 1 end
|
||||
local result, retval = xpcall(love.run, love._release and love.releaseerrhand or love.errhand)
|
||||
local result, retval = xpcall(love.run, deferErrhand)
|
||||
if not result then return 1 end
|
||||
|
||||
return tonumber(retval) or 0
|
||||
|
||||
+16
-10
@@ -1667,8 +1667,8 @@ const unsigned char boot_lua[] =
|
||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a,
|
||||
0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x64, 0x65, 0x62, 0x75, 0x67, 0x20, 0x3d, 0x20, 0x64, 0x65, 0x62, 0x75,
|
||||
0x67, 0x0a,
|
||||
0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x64, 0x65, 0x62, 0x75, 0x67, 0x2c, 0x20, 0x70, 0x72, 0x69, 0x6e, 0x74,
|
||||
0x20, 0x3d, 0x20, 0x64, 0x65, 0x62, 0x75, 0x67, 0x2c, 0x20, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x0a,
|
||||
0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x72, 0x72,
|
||||
0x6f, 0x72, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x28, 0x6d, 0x73, 0x67, 0x2c, 0x20, 0x6c, 0x61,
|
||||
0x79, 0x65, 0x72, 0x29, 0x0a,
|
||||
@@ -1845,6 +1845,17 @@ const unsigned char boot_lua[] =
|
||||
0x09, 0x09, 0x64, 0x72, 0x61, 0x77, 0x28, 0x29, 0x0a,
|
||||
0x09, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x65, 0x6e, 0x64, 0x0a,
|
||||
0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x65, 0x66,
|
||||
0x65, 0x72, 0x45, 0x72, 0x72, 0x68, 0x61, 0x6e, 0x64, 0x28, 0x2e, 0x2e, 0x2e, 0x29, 0x0a,
|
||||
0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x20, 0x3d, 0x20, 0x28,
|
||||
0x28, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x61, 0x6e, 0x64,
|
||||
0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x65, 0x72, 0x72, 0x68, 0x61,
|
||||
0x6e, 0x64, 0x29, 0x20, 0x6f, 0x72, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x65, 0x72, 0x72, 0x68, 0x61, 0x6e,
|
||||
0x64, 0x20, 0x6f, 0x72, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72,
|
||||
0x29, 0x0a,
|
||||
0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x28, 0x2e, 0x2e,
|
||||
0x2e, 0x29, 0x0a,
|
||||
0x65, 0x6e, 0x64, 0x0a,
|
||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
||||
@@ -1862,18 +1873,13 @@ const unsigned char boot_lua[] =
|
||||
0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x20, 0x74, 0x68, 0x65,
|
||||
0x6e, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x20, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x20, 0x3d, 0x20, 0x78, 0x70,
|
||||
0x63, 0x61, 0x6c, 0x6c, 0x28, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x69, 0x6e, 0x69, 0x74, 0x2c, 0x20, 0x6c, 0x6f,
|
||||
0x76, 0x65, 0x2e, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6c, 0x6f,
|
||||
0x76, 0x65, 0x2e, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x65, 0x72, 0x72, 0x68, 0x61, 0x6e, 0x64, 0x20,
|
||||
0x6f, 0x72, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x65, 0x72, 0x72, 0x68, 0x61, 0x6e, 0x64, 0x29, 0x0a,
|
||||
0x63, 0x61, 0x6c, 0x6c, 0x28, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x69, 0x6e, 0x69, 0x74, 0x2c, 0x20, 0x64, 0x65,
|
||||
0x66, 0x65, 0x72, 0x45, 0x72, 0x72, 0x68, 0x61, 0x6e, 0x64, 0x29, 0x0a,
|
||||
0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x20, 0x74, 0x68, 0x65,
|
||||
0x6e, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x20, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2c, 0x20, 0x72, 0x65, 0x74,
|
||||
0x76, 0x61, 0x6c, 0x20, 0x3d, 0x20, 0x78, 0x70, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x6c, 0x6f, 0x76, 0x65, 0x2e,
|
||||
0x72, 0x75, 0x6e, 0x2c, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
|
||||
0x20, 0x61, 0x6e, 0x64, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x65,
|
||||
0x72, 0x72, 0x68, 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x72, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x65, 0x72, 0x72,
|
||||
0x68, 0x61, 0x6e, 0x64, 0x29, 0x0a,
|
||||
0x72, 0x75, 0x6e, 0x2c, 0x20, 0x64, 0x65, 0x66, 0x65, 0x72, 0x45, 0x72, 0x72, 0x68, 0x61, 0x6e, 0x64, 0x29, 0x0a,
|
||||
0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x20, 0x74, 0x68, 0x65,
|
||||
0x6e, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x20, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x6f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x28, 0x72,
|
||||
|
||||
Reference in New Issue
Block a user