diff --git a/readme.md b/readme.md index b0c42434b..200695882 100644 --- a/readme.md +++ b/readme.md @@ -28,11 +28,7 @@ Then use the Xcode project found at `platform/xcode/love.xcodeproj` to build the Download the required libraries from [here][dependencies-ios] and place the `include` and `libraries` folders into the `platform/xcode/ios` folder. -Then use the Xcode project found at `platform/xcode/love.xcodeproj` to build the `love-ios` target. - -Note that you must be registered in the [iOS Developer Program][iosdeveloper] in order to build for physical iOS devices. - -The iOS version is currently a work-in-progress. +Then use the Xcode project found at `platform/xcode/love.xcodeproj` to build the `love-ios` target. Note that you must be registered in the [iOS Developer Program][iosdeveloper] in order to build for physical iOS devices. Repository information ---------------------- diff --git a/src/common/Exception.cpp b/src/common/Exception.cpp index 69a9639ab..45a7097b1 100644 --- a/src/common/Exception.cpp +++ b/src/common/Exception.cpp @@ -18,8 +18,8 @@ * 3. This notice may not be removed or altered from any source distribution. **/ -#include "Exception.h" #include "common/config.h" +#include "Exception.h" #include diff --git a/src/common/runtime.cpp b/src/common/runtime.cpp index 341ed2eb1..44ee56258 100644 --- a/src/common/runtime.cpp +++ b/src/common/runtime.cpp @@ -133,7 +133,7 @@ bool luax_boolflag(lua_State *L, int table_index, const char *key, bool defaultV if (lua_isnoneornil(L, -1)) retval = defaultValue; else - retval = lua_toboolean(L, -1); + retval = lua_toboolean(L, -1) != 0; lua_pop(L, 1); return retval; diff --git a/src/modules/filesystem/physfs/Filesystem.cpp b/src/modules/filesystem/physfs/Filesystem.cpp index 4fc42fbeb..c5625a116 100644 --- a/src/modules/filesystem/physfs/Filesystem.cpp +++ b/src/modules/filesystem/physfs/Filesystem.cpp @@ -312,7 +312,7 @@ bool Filesystem::mount(const char *archive, const char *mountpoint, bool appendT if (realPath.length() == 0) return false; - return PHYSFS_mount(realPath.c_str(), mountpoint, appendToPath); + return PHYSFS_mount(realPath.c_str(), mountpoint, appendToPath) != 0; } bool Filesystem::unmount(const char *archive) @@ -353,7 +353,7 @@ bool Filesystem::unmount(const char *archive) if (!mountPoint) return false; - return PHYSFS_removeFromSearchPath(realPath.c_str()); + return PHYSFS_removeFromSearchPath(realPath.c_str()) != 0; } love::filesystem::File *Filesystem::newFile(const char *filename) const @@ -485,7 +485,7 @@ std::string Filesystem::getRealDirectory(const char *filename) const bool Filesystem::isDirectory(const char *dir) const { - return PHYSFS_isDirectory(dir); + return PHYSFS_isDirectory(dir) != 0; } bool Filesystem::isFile(const char *file) const diff --git a/src/modules/filesystem/wrap_File.cpp b/src/modules/filesystem/wrap_File.cpp index 6444573f2..857648da6 100644 --- a/src/modules/filesystem/wrap_File.cpp +++ b/src/modules/filesystem/wrap_File.cpp @@ -110,7 +110,7 @@ int w_File_read(lua_State *L) File *file = luax_checkfile(L, 1); Data *d = 0; - int64 size = (int64)luaL_optnumber(L, 2, File::ALL); + int64 size = (int64) luaL_optnumber(L, 2, (lua_Number) File::ALL); try { diff --git a/src/modules/graphics/opengl/Canvas.cpp b/src/modules/graphics/opengl/Canvas.cpp index 15c567653..2e9f9aa16 100644 --- a/src/modules/graphics/opengl/Canvas.cpp +++ b/src/modules/graphics/opengl/Canvas.cpp @@ -396,7 +396,7 @@ void Canvas::setupGrab() gl.setViewport({0, 0, width, height}); // Set up the projection matrix - gl.matrices.projection.push_back(Matrix::ortho(0.0, width, 0.0, height)); + gl.matrices.projection.push_back(Matrix::ortho(0.0, (float) width, 0.0, (float) height)); // Make sure the correct sRGB setting is used when drawing to the canvas. if (GLAD_VERSION_1_0 || GLAD_EXT_sRGB_write_control) diff --git a/src/modules/graphics/opengl/Graphics.cpp b/src/modules/graphics/opengl/Graphics.cpp index 0c613da16..9a325cb5c 100644 --- a/src/modules/graphics/opengl/Graphics.cpp +++ b/src/modules/graphics/opengl/Graphics.cpp @@ -226,7 +226,7 @@ void Graphics::setViewportSize(int width, int height) Canvas::systemViewport = gl.getViewport(); // Set up the projection matrix - gl.matrices.projection.back() = Matrix::ortho(0.0, width, height, 0.0); + gl.matrices.projection.back() = Matrix::ortho(0.0, (float) width, (float) height, 0.0); // Restore the previously active Canvas. setCanvas(canvases); diff --git a/src/modules/graphics/opengl/Image.cpp b/src/modules/graphics/opengl/Image.cpp index 8858c0fcd..1b8d8d079 100644 --- a/src/modules/graphics/opengl/Image.cpp +++ b/src/modules/graphics/opengl/Image.cpp @@ -586,7 +586,7 @@ GLenum Image::getCompressedFormat(image::CompressedImageData::Format cformat) co bool Image::hasAnisotropicFilteringSupport() { - return GLAD_EXT_texture_filter_anisotropic; + return GLAD_EXT_texture_filter_anisotropic != GL_FALSE; } bool Image::hasCompressedTextureSupport(image::CompressedImageData::Format format, bool sRGB) diff --git a/src/modules/graphics/opengl/Polyline.cpp b/src/modules/graphics/opengl/Polyline.cpp index 4fdaa52b5..cb5cb4aa8 100644 --- a/src/modules/graphics/opengl/Polyline.cpp +++ b/src/modules/graphics/opengl/Polyline.cpp @@ -49,7 +49,7 @@ void Polyline::render(const float *coords, size_t count, size_t size_hint, float // prepare vertex arrays if (draw_overdraw) - halfwidth -= pixel_size * .3; + halfwidth -= pixel_size * 0.3f; // compute sleeve bool is_looping = (coords[0] == coords[count - 2]) && (coords[1] == coords[count - 1]); diff --git a/src/modules/graphics/opengl/wrap_Graphics.cpp b/src/modules/graphics/opengl/wrap_Graphics.cpp index 5ee29e273..814c54cd0 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.cpp +++ b/src/modules/graphics/opengl/wrap_Graphics.cpp @@ -494,8 +494,8 @@ int w_newShader(lua_State *L) } } - bool has_arg1 = lua_isstring(L, 1); - bool has_arg2 = lua_isstring(L, 2); + bool has_arg1 = lua_isstring(L, 1) != 0; + bool has_arg2 = lua_isstring(L, 2) != 0; // require at least one string argument if (!(has_arg1 || has_arg2)) diff --git a/src/modules/keyboard/sdl/Keyboard.cpp b/src/modules/keyboard/sdl/Keyboard.cpp index ac6ed2738..1960a8d7b 100644 --- a/src/modules/keyboard/sdl/Keyboard.cpp +++ b/src/modules/keyboard/sdl/Keyboard.cpp @@ -137,12 +137,12 @@ void Keyboard::setTextInput(bool enable, double x, double y, double w, double h) bool Keyboard::hasTextInput() const { - return SDL_IsTextInputActive(); + return SDL_IsTextInputActive() != SDL_FALSE; } bool Keyboard::hasScreenKeyboard() const { - return SDL_HasScreenKeyboardSupport(); + return SDL_HasScreenKeyboardSupport() != SDL_FALSE; } bool Keyboard::getConstant(Scancode in, SDL_Scancode &out) diff --git a/src/modules/physics/box2d/ChainShape.cpp b/src/modules/physics/box2d/ChainShape.cpp index 4c778a3db..63cdf9f04 100644 --- a/src/modules/physics/box2d/ChainShape.cpp +++ b/src/modules/physics/box2d/ChainShape.cpp @@ -76,7 +76,7 @@ EdgeShape *ChainShape::getChildEdge(int index) const { c->GetChildEdge(e, index); } - catch (love::Exception &ex) + catch (love::Exception &) { delete e; throw; diff --git a/src/modules/window/sdl/Window.cpp b/src/modules/window/sdl/Window.cpp index b11de66da..1f5e025b7 100644 --- a/src/modules/window/sdl/Window.cpp +++ b/src/modules/window/sdl/Window.cpp @@ -252,7 +252,10 @@ bool Window::createWindowAndContext(int x, int y, int w, int h, Uint32 windowfla setGLFramebufferAttributes(0, false); window = SDL_CreateWindow(title.c_str(), x, y, w, h, windowflags); if (window) - curSRGB = curMSAA = 0; + { + curMSAA = 0; + curSRGB = false; + } } // Immediately try the next context profile if window creation failed. @@ -839,7 +842,7 @@ void Window::setMouseGrab(bool grab) bool Window::isMouseGrabbed() const { if (window) - return (bool) SDL_GetWindowGrab(window); + return SDL_GetWindowGrab(window) != SDL_FALSE; else return mouseGrabbed; } @@ -936,17 +939,17 @@ int Window::showMessageBox(const MessageBoxData &data) std::vector sdlbuttons; - for (size_t i = 0; i < data.buttons.size(); i++) + for (int i = 0; i < (int) data.buttons.size(); i++) { SDL_MessageBoxButtonData sdlbutton = {}; - sdlbutton.buttonid = (int) i; + sdlbutton.buttonid = i; sdlbutton.text = data.buttons[i].c_str(); - if ((int) i == data.enterButtonIndex) + if (i == data.enterButtonIndex) sdlbutton.flags |= SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT; - if ((int) i == data.escapeButtonIndex) + if (i == data.escapeButtonIndex) sdlbutton.flags |= SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT; sdlbuttons.push_back(sdlbutton);