diff --git a/AndroidManifest.xml b/AndroidManifest.xml index a6637b86..ca675990 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,6 +1,6 @@ diff --git a/README.md b/README.md index 788f88f3..173463ea 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ specific fixes are: * Added a new love.conf flag t.externalstorage, which determines whether files are saved in internal or external storage on Android devices. * Fixed audio on Android to pause when the app is inactive, and resume when the app becomes active again. * Fixed a driver bug on some Android devices which caused all objects to show up as black. +* Fixed love.graphics.clear(colortable) causing crashes on OpenGL ES 2 systems when a Canvas is active. * New icons 0.10.0: diff --git a/jni/love/changes.txt b/jni/love/changes.txt index f7204c1c..b8cbfa98 100644 --- a/jni/love/changes.txt +++ b/jni/love/changes.txt @@ -20,6 +20,7 @@ Released: N/A * Fixed RandomGenerator:random crashing if a nil 'self' is used. * Fixed loading BMFont files which have characters with 0 width or height (a space character, for example). * Fixed love.graphics.newFont causing crashes if FileData is passed in. + * Fixed love.graphics.clear(colortable) causing crashes on OpenGL ES 2 systems when a Canvas is active. * Fixed a driver bug on some Android devices which caused all objects to show up as black. * Fixed a driver bug on Windows with AMD graphics cards where love.graphics.clear would not always work. * Fixed Shader:sendColor incorrectly converting alpha values from sRGB to linear RGB when gamma-correct rendering is enabled. diff --git a/jni/love/src/modules/graphics/opengl/Graphics.cpp b/jni/love/src/modules/graphics/opengl/Graphics.cpp index d4c3088f..5ab7608e 100644 --- a/jni/love/src/modules/graphics/opengl/Graphics.cpp +++ b/jni/love/src/modules/graphics/opengl/Graphics.cpp @@ -461,17 +461,23 @@ void Graphics::clear(const std::vector &colors) if (colors.size() == 0) return; - if (states.back().canvases.size() == 0) + size_t numcanvases = states.back().canvases.size(); + + if (numcanvases > 0 && colors.size() != numcanvases) + throw love::Exception("Number of clear colors must match the number of active canvases (%ld)", states.back().canvases.size()); + + // We want to take the single-color codepath if there's no active Canvas, or + // if there's only one active Canvas. The multi-color codepath (in the loop + // below) assumes MRT functions are available, and also may call more + // expensive GL functions which are unnecessary if only one Canvas is active. + if (numcanvases <= 1) { if (colors[0].enabled) - clear({colors[0].r, colors[0].g, colors[0].b, colors[0].a}); + clear(colors[0].toColor()); return; } - if (colors.size() != states.back().canvases.size()) - throw love::Exception("Number of clear colors must match the number of active canvases (%ld)", states.back().canvases.size()); - bool drawbuffermodified = false; for (int i = 0; i < (int) colors.size(); i++) diff --git a/jni/love/src/modules/graphics/opengl/Graphics.h b/jni/love/src/modules/graphics/opengl/Graphics.h index d602af78..f1103354 100644 --- a/jni/love/src/modules/graphics/opengl/Graphics.h +++ b/jni/love/src/modules/graphics/opengl/Graphics.h @@ -66,6 +66,8 @@ public: { float r, g, b, a; bool enabled; + + Colorf toColor() const { return Colorf(r, g, b, a); } }; Graphics(); diff --git a/love_icon_512x512.png b/love_icon_512x512.png new file mode 100644 index 00000000..58eb3116 Binary files /dev/null and b/love_icon_512x512.png differ diff --git a/res/drawable-hdpi/love.png b/res/drawable-hdpi/love.png index b47e8c28..da3ef3a6 100755 Binary files a/res/drawable-hdpi/love.png and b/res/drawable-hdpi/love.png differ diff --git a/res/drawable-mdpi/love.png b/res/drawable-mdpi/love.png index de670813..82caa826 100755 Binary files a/res/drawable-mdpi/love.png and b/res/drawable-mdpi/love.png differ diff --git a/res/drawable-xhdpi/love.png b/res/drawable-xhdpi/love.png index 6e6ca481..b2e6d1a2 100755 Binary files a/res/drawable-xhdpi/love.png and b/res/drawable-xhdpi/love.png differ diff --git a/res/drawable-xxhdpi/love.png b/res/drawable-xxhdpi/love.png index c07cb053..0e091788 100755 Binary files a/res/drawable-xxhdpi/love.png and b/res/drawable-xxhdpi/love.png differ diff --git a/res/drawable-xxxhdpi/love.png b/res/drawable-xxxhdpi/love.png index 7e0efdc3..01a4634f 100755 Binary files a/res/drawable-xxxhdpi/love.png and b/res/drawable-xxxhdpi/love.png differ