Merge branch '12.0-development' of https://github.com/nikeinikei/love into 12.0-development

This commit is contained in:
niki
2022-12-21 16:29:55 +01:00
8 changed files with 23 additions and 20 deletions
+7
View File
@@ -113,6 +113,13 @@ jobs:
if: steps.vars.outputs.angle == '1' if: steps.vars.outputs.angle == '1'
working-directory: angle working-directory: angle
run: 7z x angle-win-${{ steps.vars.outputs.arch }}.zip run: 7z x angle-win-${{ steps.vars.outputs.arch }}.zip
- name: Delete Strawbery Perl
# https://github.com/actions/runner-images/issues/6627
# In particular, this is not pretty, but even CMAKE_IGNORE_PREFIX_PATH
# cannot help in this case. Delete the whole folder!
run: |
rmdir /s /q C:\Strawberry
exit /b 0
- name: Configure - name: Configure
run: cmake -Bbuild -Hmegasource -T v142 -A ${{ matrix.platform }} -DCMAKE_INSTALL_PREFIX=%CD%\install ${{ steps.vars.outputs.moredef }} run: cmake -Bbuild -Hmegasource -T v142 -A ${{ matrix.platform }} -DCMAKE_INSTALL_PREFIX=%CD%\install ${{ steps.vars.outputs.moredef }}
- name: Install - name: Install
+4 -3
View File
@@ -866,9 +866,7 @@ static void replaceAll(std::string &str, const std::string &substr, const std::s
int loader(lua_State *L) int loader(lua_State *L)
{ {
std::string modulename = luax_checkstring(L, 1); std::string modulename = luax_checkstring(L, 1);
bool hasSlash = modulename.find('/') != std::string::npos;
if (modulename.find('/') != std::string::npos)
luax_markdeprecated(L, 2, "character in require string (forward slashes), use dots instead.", API_CUSTOM);
for (char &c : modulename) for (char &c : modulename)
{ {
@@ -884,6 +882,9 @@ int loader(lua_State *L)
Filesystem::Info info = {}; Filesystem::Info info = {};
if (inst->getInfo(element.c_str(), info) && info.type != Filesystem::FILETYPE_DIRECTORY) if (inst->getInfo(element.c_str(), info) && info.type != Filesystem::FILETYPE_DIRECTORY)
{ {
if (hasSlash)
luax_markdeprecated(L, 2, "character in require string (forward slashes), use dots instead.", API_CUSTOM);
lua_pop(L, 1); lua_pop(L, 1);
lua_pushstring(L, element.c_str()); lua_pushstring(L, element.c_str());
return w_load(L); return w_load(L);
+1 -1
View File
@@ -551,7 +551,7 @@ std::string Shader::createShaderStageCode(Graphics *gfx, ShaderStageType stage,
// Note: backends are expected to handle this situation if highp is ever // Note: backends are expected to handle this situation if highp is ever
// conditional in that backend. // conditional in that backend.
if (!gfx->getCapabilities().features[Graphics::FEATURE_PIXEL_SHADER_HIGHP]) if (!gfx->getCapabilities().features[Graphics::FEATURE_PIXEL_SHADER_HIGHP])
ss << "#define LOVE_SPLIT_UNIFORMS_PER_DRAW 1"; ss << "#define LOVE_SPLIT_UNIFORMS_PER_DRAW 1\n";
for (const auto &def : options.defines) for (const auto &def : options.defines)
ss << "#define " + def.first + " " + def.second + "\n"; ss << "#define " + def.first + " " + def.second + "\n";
+1 -1
View File
@@ -469,7 +469,7 @@ bool Shader::loadVolatile()
// love::graphics::Shader sets up the shader code-side of this. // love::graphics::Shader sets up the shader code-side of this.
auto gfx = Module::getInstance<love::graphics::Graphics>(Module::M_GRAPHICS); auto gfx = Module::getInstance<love::graphics::Graphics>(Module::M_GRAPHICS);
if (gfx != nullptr) if (gfx != nullptr)
splitUniformsPerDraw = gfx->getCapabilities().features[Graphics::FEATURE_PIXEL_SHADER_HIGHP]; splitUniformsPerDraw = !gfx->getCapabilities().features[Graphics::FEATURE_PIXEL_SHADER_HIGHP];
// zero out active texture list // zero out active texture list
textureUnits.clear(); textureUnits.clear();
+7 -12
View File
@@ -86,6 +86,11 @@ extern "C"
# include "audio/Audio.h" # include "audio/Audio.h"
#endif #endif
// For love::system::System::getOS.
#ifdef LOVE_ENABLE_SYSTEM
# include "system/System.h"
#endif
// Scripts. // Scripts.
#include "scripts/nogame.lua.h" #include "scripts/nogame.lua.h"
@@ -599,18 +604,8 @@ int luaopen_love(lua_State *L)
lua_pushcfunction(L, w_love_isVersionCompatible); lua_pushcfunction(L, w_love_isVersionCompatible);
lua_setfield(L, -2, "isVersionCompatible"); lua_setfield(L, -2, "isVersionCompatible");
#ifdef LOVE_WINDOWS_UWP #ifdef LOVE_ENABLE_SYSTEM
lua_pushstring(L, "UWP"); lua_pushstring(L, love::system::System::getOS());
#elif LOVE_WINDOWS
lua_pushstring(L, "Windows");
#elif defined(LOVE_MACOS)
lua_pushstring(L, "OS X");
#elif defined(LOVE_IOS)
lua_pushstring(L, "iOS");
#elif defined(LOVE_ANDROID)
lua_pushstring(L, "Android");
#elif defined(LOVE_LINUX)
lua_pushstring(L, "Linux");
#else #else
lua_pushstring(L, "Unknown"); lua_pushstring(L, "Unknown");
#endif #endif
+1 -1
View File
@@ -62,7 +62,7 @@ System::System()
{ {
} }
std::string System::getOS() const const char *System::getOS()
{ {
#if defined(LOVE_MACOS) #if defined(LOVE_MACOS)
return "OS X"; return "OS X";
+1 -1
View File
@@ -57,7 +57,7 @@ public:
/** /**
* Gets the current operating system. * Gets the current operating system.
**/ **/
std::string getOS() const; static const char *getOS();
/** /**
* Gets the number of reported CPU cores on the current system. * Gets the number of reported CPU cores on the current system.
+1 -1
View File
@@ -31,7 +31,7 @@ namespace system
int w_getOS(lua_State *L) int w_getOS(lua_State *L)
{ {
luax_pushstring(L, instance()->getOS()); luax_pushstring(L, System::getOS());
return 1; return 1;
} }