Skip to content

Commit

Permalink
Merge branch 'main' into SDL3
Browse files Browse the repository at this point in the history
  • Loading branch information
slime73 committed Mar 24, 2024
2 parents 62ac858 + 21b71d0 commit 2bdadf5
Show file tree
Hide file tree
Showing 616 changed files with 4,552 additions and 3,978 deletions.
204 changes: 144 additions & 60 deletions .github/workflows/main.yml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ stamp-h1
/testing/output/*.html
/testing/output/*.md
/testing/output/actual/*.png
/testing/output/difference/*.png
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2006-2023 LOVE Development Team
# Copyright (c) 2006-2024 LOVE Development Team
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
Expand Down Expand Up @@ -60,7 +60,7 @@ else()
endif()


if(APPLE OR MEGA_ARM64)
if(APPLE)
set(LOVE_DEFAULT_JIT FALSE)
else()
set(LOVE_DEFAULT_JIT TRUE)
Expand Down
2 changes: 2 additions & 0 deletions changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ Released: N/A
* Changed RevoluteJoint:getMotorTorque and WheelJoint:getMotorTorque to take 'dt' as a parameter instead of 'inverse_dt'.
* Changed love.math.perlinNoise and simplexNoise to use higher precision numbers for its internal calculations.
* Changed t.accelerometerjoystick startup flag in love.conf to unset by default.
* Changed love.data.hash to take in a container type.

* Renamed 'display' field to 'displayindex' in love.window.setMode/updateMode/getMode and love.conf.
* Renamed love.graphics Text objects to TextBatch.
Expand All @@ -120,6 +121,7 @@ Released: N/A
* Deprecated t.accelerometerjoystick in love.conf (replaced by love.sensor module).
* Deprecated the variants of Mesh:attachAttribute and SpriteBatch:attachAttribute which accept a Mesh (replaced by variants which accept a Buffer).
* Deprecated Texture:newImageData (replaced by love.graphics.readbackTexture).
* Deprecated love.data.hash (replaced by function variant, which takes container type).

* Removed the variant of SpriteBatch:setColor() which turns off all previously set colors.
* Removed the no-argument variant of love.graphics.setColorMask.
Expand Down
Binary file modified extra/windows/love.rc
Binary file not shown.
2 changes: 1 addition & 1 deletion license.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This distribution contains code from the following projects (full license text b
- LOVE
Website: https://love2d.org/
License: zlib
Copyright (c) 2006-2023 LOVE Development Team
Copyright (c) 2006-2024 LOVE Development Team

- ENet
Website: http://enet.bespin.org/index.html
Expand Down
2 changes: 1 addition & 1 deletion platform/xcode/macosx/love-macosx.plist
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<key>NSHighResolutionCapable</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>© 2006-2023 LÖVE Development Team</string>
<string>© 2006-2024 LÖVE Development Team</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>
Expand Down
28 changes: 9 additions & 19 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ If you need further help, feel free to ask on our [forums][forums], our [Discord
Repository
----------

We use the 'main' branch for patch development of the current major release, and therefore it should not be considered stable.
There may also be a branch for the next major version in development, which is named after that version.
We use the 'main' branch for development of the next major release, and therefore it should not be considered stable.

There are also branches for currently released major versions, which may have fixes and changes meant for upcoming patch releases within that major version.

We tag all our releases (since we started using mercurial and git), and have binary downloads available for them.

Experimental changes are developed in a separate [love-experiments][love-experiments] repository.
Experimental changes are sometimes developed in a separate [love-experiments][love-experiments] repository.

Builds
------
Expand All @@ -32,12 +33,11 @@ There are also unstable/nightly builds:
Test Suite
----------

The test suite in `testing/` covers all the LÖVE APIs, and tests them the same way developers use them. You can view current test coverage from any [12.0-dev action][12devworkflows].
You can run the suite locally like you would run a normal LÖVE project, i.e.:
`love testing/main.lua`
The test suite in `testing/` covers all the LÖVE APIs, and tests them the same way developers use them. You can view current test coverage from any [action][workflows].
You can run the suite locally like you would run a normal LÖVE project, e.g.:
`love testing`

See the [readme][testsuite] in the testing folder for more info.
You can contribute to the test suite [here][testsuitemain]

Contributing
------------
Expand Down Expand Up @@ -70,7 +70,6 @@ Then use the Xcode project found at `platform/xcode/love.xcodeproj` to build the
### iOS
Building for iOS requires macOS and Xcode.

#### LÖVE 11.4 and newer
Download the `love-apple-dependencies` zip file corresponding to the LÖVE version being used from the [Releases page][dependencies-ios],
unzip it, and place the `iOS/libraries` subfolder into love's `platform/xcode/ios` folder.

Expand All @@ -80,14 +79,6 @@ Then use the Xcode project found at `platform/xcode/love.xcodeproj` to build the

See `readme-iOS.rtf` for more information.

#### LÖVE 11.3 and older
Download the `ios-libraries` zip file corresponding to the LÖVE version being used from the [Releases page][dependencies-ios],
unzip it, and place the `include` and `libraries` subfolders into love's `platform/xcode/ios` folder.

Then use the Xcode project found at `platform/xcode/love.xcodeproj` to build the `love-ios` target.

See `readme-iOS.rtf` for more information.

### Android
Visit the [Android build repository][android-repository] for build instructions.

Expand Down Expand Up @@ -117,6 +108,5 @@ Dependencies
[codestyle]: https://love2d.org/wiki/Code_Style
[android-repository]: https://github.com/love2d/love-android
[releases]: https://github.com/love2d/love/releases
[testsuite]: https://github.com/love2d/love/tree/12.0-development/testing
[testsuitemain]: https://github.com/ellraiser/love-test
[12devworkflows]: https://github.com/love2d/love/actions/workflows/main.yml?query=branch%3A12.0-development
[testsuite]: https://github.com/love2d/love/tree/main/testing
[workflows]: https://github.com/love2d/love/actions/workflows/main.yml?query=branch%3Amain
2 changes: 1 addition & 1 deletion src/common/Color.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2023 LOVE Development Team
* Copyright (c) 2006-2024 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand Down
19 changes: 18 additions & 1 deletion src/common/Data.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2023 LOVE Development Team
* Copyright (c) 2006-2024 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand All @@ -20,10 +20,27 @@

// LOVE
#include "Data.h"
#include "thread/threads.h"

namespace love
{

love::Type Data::type("Data", &Object::type);

Data::~Data()
{
delete mutex;
}

static void createMutex(love::thread::Mutex **mutexAddress)
{
*mutexAddress = love::thread::newMutex();
}

love::thread::Mutex *Data::getMutex()
{
std::call_once(mutexCreated, createMutex, &mutex);
return mutex;
}

} // love
26 changes: 20 additions & 6 deletions src/common/Data.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2023 LOVE Development Team
* Copyright (c) 2006-2024 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand All @@ -22,15 +22,20 @@
#define LOVE_DATA_H

// LOVE
#include "config.h"
#include "Object.h"

// C
#include <stddef.h>
#include <mutex>

namespace love
{

namespace thread
{
class Mutex;
}

/**
* This class is a simple abstraction over all objects which contain data.
**/
Expand All @@ -40,10 +45,8 @@ class Data : public Object

static love::Type type;

/**
* Destructor.
**/
virtual ~Data() {}
Data() {};
virtual ~Data();

/**
* Creates a duplicate of Data derived class instance.
Expand All @@ -60,6 +63,17 @@ class Data : public Object
**/
virtual size_t getSize() const = 0;

/**
* Gets the Mutex associated with this Data object. Creates it in a thread-
* safe manner if necessary.
**/
love::thread::Mutex *getMutex();

private:

love::thread::Mutex *mutex = nullptr;
std::once_flag mutexCreated;

}; // Data

} // love
Expand Down
2 changes: 1 addition & 1 deletion src/common/EnumMap.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2023 LOVE Development Team
* Copyright (c) 2006-2024 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand Down
2 changes: 1 addition & 1 deletion src/common/Exception.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2023 LOVE Development Team
* Copyright (c) 2006-2024 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand Down
2 changes: 1 addition & 1 deletion src/common/Exception.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2023 LOVE Development Team
* Copyright (c) 2006-2024 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand Down
2 changes: 1 addition & 1 deletion src/common/Matrix.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2023 LOVE Development Team
* Copyright (c) 2006-2024 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand Down
2 changes: 1 addition & 1 deletion src/common/Matrix.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2023 LOVE Development Team
* Copyright (c) 2006-2024 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand Down
7 changes: 5 additions & 2 deletions src/common/Module.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2023 LOVE Development Team
* Copyright (c) 2006-2024 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand Down Expand Up @@ -62,9 +62,12 @@ namespace love
love::Type Module::type("Module", &Object::type);
Module *Module::instances[] = {};

Module::Module()
Module::Module(Module::ModuleType moduleType, const char *name)
: moduleType(moduleType)
, name(name)
{
initDeprecation();
registerInstance(this);
}

Module::~Module()
Expand Down
20 changes: 9 additions & 11 deletions src/common/Module.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2023 LOVE Development Team
* Copyright (c) 2006-2024 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand Down Expand Up @@ -62,28 +62,21 @@ class Module : public Object
M_MAX_ENUM
};

Module();
Module(ModuleType moduleType, const char *name);
virtual ~Module();

/**
* Gets the base type of the module.
**/
virtual ModuleType getModuleType() const = 0;
ModuleType getModuleType() const { return moduleType; }

/**
* Gets the name of the module. This is used in case of errors
* and other messages.
*
* @return The full name of the module, eg. love.graphics.opengl.
**/
virtual const char *getName() const = 0;

/**
* Add module to internal registry. To be used /only/ in
* runtime.cpp:luax_register_module()
* @param instance The module instance.
*/
static void registerInstance(Module *instance);
const char *getName() const { return name.c_str(); }

/**
* Retrieve module instance from internal registry. May return NULL
Expand All @@ -106,6 +99,11 @@ class Module : public Object

private:

static void registerInstance(Module *instance);

ModuleType moduleType;
std::string name;

static Module *instances[M_MAX_ENUM];

}; // Module
Expand Down
2 changes: 1 addition & 1 deletion src/common/Object.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2023 LOVE Development Team
* Copyright (c) 2006-2024 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand Down
2 changes: 1 addition & 1 deletion src/common/Object.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2023 LOVE Development Team
* Copyright (c) 2006-2024 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand Down
2 changes: 1 addition & 1 deletion src/common/Optional.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2023 LOVE Development Team
* Copyright (c) 2006-2024 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand Down
4 changes: 2 additions & 2 deletions src/common/Range.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2023 LOVE Development Team
* Copyright (c) 2006-2024 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand Down Expand Up @@ -61,7 +61,7 @@ struct Range
return first <= other.first && last >= other.last;
}

bool intersects(const Range &other)
bool intersects(const Range &other) const
{
return !(first > other.last || last < other.first);
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/Reference.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2023 LOVE Development Team
* Copyright (c) 2006-2024 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand Down
2 changes: 1 addition & 1 deletion src/common/Reference.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2023 LOVE Development Team
* Copyright (c) 2006-2024 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand Down
2 changes: 1 addition & 1 deletion src/common/Stream.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2023 LOVE Development Team
* Copyright (c) 2006-2024 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand Down
2 changes: 1 addition & 1 deletion src/common/Stream.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2023 LOVE Development Team
* Copyright (c) 2006-2024 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand Down
Loading

0 comments on commit 2bdadf5

Please sign in to comment.