mirror of
https://github.com/love2d/love.git
synced 2026-08-21 21:15:09 +02:00
Merge branch 'main' into SDL3
This commit is contained in:
+144
-60
@@ -2,7 +2,7 @@ name: continuous-integration
|
|||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
linux-os:
|
Linux:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
permissions:
|
permissions:
|
||||||
checks: write
|
checks: write
|
||||||
@@ -25,12 +25,12 @@ jobs:
|
|||||||
libcurl4-openssl-dev libfuse2 wmctrl openbox mesa-vulkan-drivers \
|
libcurl4-openssl-dev libfuse2 wmctrl openbox mesa-vulkan-drivers \
|
||||||
libvulkan1 vulkan-tools vulkan-validationlayers
|
libvulkan1 vulkan-tools vulkan-validationlayers
|
||||||
- name: Checkout love-appimage-source
|
- name: Checkout love-appimage-source
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: love2d/love-appimage-source
|
repository: love2d/love-appimage-source
|
||||||
ref: 12.x
|
ref: 12.x
|
||||||
- name: Checkout LÖVE
|
- name: Checkout LÖVE
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
path: love2d-${{ github.sha }}
|
path: love2d-${{ github.sha }}
|
||||||
- name: Get Dependencies for AppImage
|
- name: Get Dependencies for AppImage
|
||||||
@@ -61,60 +61,63 @@ jobs:
|
|||||||
- name: Run Test Suite (opengl)
|
- name: Run Test Suite (opengl)
|
||||||
run: |
|
run: |
|
||||||
chmod a+x love-${{ github.sha }}.AppImage
|
chmod a+x love-${{ github.sha }}.AppImage
|
||||||
./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua --runAllTests --isRunner
|
./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua --all --isRunner
|
||||||
- name: Love Test Report (opengl)
|
- name: Love Test Report (opengl)
|
||||||
id: report1
|
id: report1
|
||||||
uses: ellraiser/love-test-report@main
|
uses: ellraiser/love-test-report@main
|
||||||
with:
|
with:
|
||||||
name: Love Testsuite Linux
|
name: Love Testsuite Linux
|
||||||
title: test-report-linux-opengl
|
title: test-report-linux-opengl
|
||||||
path: love2d-${{ github.sha }}/testing/output/lovetest_runAllTests.md
|
path: love2d-${{ github.sha }}/testing/output/lovetest_all.md
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Zip Test Output (opengl)
|
- name: Zip Test Output (opengl)
|
||||||
run: |
|
run: |
|
||||||
7z a -tzip test-output-linux-opengl.zip love2d-${{ github.sha }}/testing/output/
|
7z a -tzip test-output-linux-opengl.zip love2d-${{ github.sha }}/testing/output/
|
||||||
- name: Artifact Test Output (opengl)
|
- name: Artifact Test Output (opengl)
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: test-output-linux-opengl-${{ steps.report1.outputs.conclusion }}
|
name: test-output-linux-opengl-${{ steps.report1.outputs.conclusion }}
|
||||||
path: test-output-linux-opengl.zip
|
path: test-output-linux-opengl.zip
|
||||||
# linux opengles tests
|
# linux opengles tests
|
||||||
- name: Run Test Suite (opengles)
|
- name: Run Test Suite (opengles)
|
||||||
|
env:
|
||||||
|
LOVE_GRAPHICS_DEBUG: 1
|
||||||
run: |
|
run: |
|
||||||
export LOVE_GRAPHICS_USE_OPENGLES=1
|
export LOVE_GRAPHICS_USE_OPENGLES=1
|
||||||
./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua --runAllTests --isRunner
|
./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua --all --isRunner
|
||||||
- name: Love Test Report (opengles)
|
- name: Love Test Report (opengles)
|
||||||
uses: ellraiser/love-test-report@main
|
uses: ellraiser/love-test-report@main
|
||||||
id: report2
|
id: report2
|
||||||
with:
|
with:
|
||||||
name: Love Testsuite Linux
|
name: Love Testsuite Linux
|
||||||
title: test-report-linux-opengles
|
title: test-report-linux-opengles
|
||||||
path: love2d-${{ github.sha }}/testing/output/lovetest_runAllTests.md
|
path: love2d-${{ github.sha }}/testing/output/lovetest_all.md
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Zip Test Output (opengles)
|
- name: Zip Test Output (opengles)
|
||||||
run: |
|
run: |
|
||||||
7z a -tzip test-output-linux-opengles.zip love2d-${{ github.sha }}/testing/output/
|
7z a -tzip test-output-linux-opengles.zip love2d-${{ github.sha }}/testing/output/
|
||||||
- name: Artifact Test Output (opengles)
|
- name: Artifact Test Output (opengles)
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: test-output-linux-opengles-${{ steps.report2.outputs.conclusion }}
|
name: test-output-linux-opengles-${{ steps.report2.outputs.conclusion }}
|
||||||
path: test-output-linux-opengles.zip
|
path: test-output-linux-opengles.zip
|
||||||
# # linux vulkan tests
|
# # linux vulkan tests
|
||||||
# - name: Run Test Suite (vulkan)
|
# - name: Run Test Suite (vulkan)
|
||||||
|
# env:
|
||||||
|
# LOVE_GRAPHICS_DEBUG: 1
|
||||||
# run: |
|
# run: |
|
||||||
# export LOVE_GRAPHICS_DEBUG=1
|
# ./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua --all --isRunner --renderers vulkan
|
||||||
# ./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua --runAllTests --isRunner --renderers vulkan
|
|
||||||
# - name: Love Test Report (vulkan)
|
# - name: Love Test Report (vulkan)
|
||||||
# uses: ellraiser/love-test-report@main
|
# uses: ellraiser/love-test-report@main
|
||||||
# with:
|
# with:
|
||||||
# name: Love Testsuite Linux
|
# name: Love Testsuite Linux
|
||||||
# title: test-report-linux-vulkan
|
# title: test-report-linux-vulkan
|
||||||
# path: love2d-${{ github.sha }}/testing/output/lovetest_runAllTests.md
|
# path: love2d-${{ github.sha }}/testing/output/lovetest_all.md
|
||||||
# - name: Zip Test Output (vulkan)
|
# - name: Zip Test Output (vulkan)
|
||||||
# run: |
|
# run: |
|
||||||
# 7z a -tzip test-output-linux-vulkan.zip love2d-${{ github.sha }}/testing/output/
|
# 7z a -tzip test-output-linux-vulkan.zip love2d-${{ github.sha }}/testing/output/
|
||||||
# - name: Artifact Test Output (vulkan)
|
# - name: Artifact Test Output (vulkan)
|
||||||
# uses: actions/upload-artifact@v3
|
# uses: actions/upload-artifact@v4
|
||||||
# with:
|
# with:
|
||||||
# name: test-output-linux-vulkan
|
# name: test-output-linux-vulkan
|
||||||
# path: test-output-linux-vulkan.zip
|
# path: test-output-linux-vulkan.zip
|
||||||
@@ -125,12 +128,12 @@ jobs:
|
|||||||
kill $XVFBPID
|
kill $XVFBPID
|
||||||
kill $OPENBOXPID
|
kill $OPENBOXPID
|
||||||
- name: Artifact
|
- name: Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: love-linux-x86_64.AppImage
|
name: love-linux-x86_64.AppImage
|
||||||
path: love-${{ github.sha }}.AppImage
|
path: love-${{ github.sha }}.AppImage
|
||||||
- name: Artifact Debug Symbols
|
- name: Artifact Debug Symbols
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: love-x86_64-AppImage-debug
|
name: love-x86_64-AppImage-debug
|
||||||
path: love-${{ github.sha }}.AppImage-debug.tar.gz
|
path: love-${{ github.sha }}.AppImage-debug.tar.gz
|
||||||
@@ -140,7 +143,7 @@ jobs:
|
|||||||
echo "${{ steps.report1.outputs.failed }} opengl tests failed"
|
echo "${{ steps.report1.outputs.failed }} opengl tests failed"
|
||||||
echo "${{ steps.report2.outputs.failed }} opengles tests failed"
|
echo "${{ steps.report2.outputs.failed }} opengles tests failed"
|
||||||
exit 1
|
exit 1
|
||||||
windows-os:
|
Windows:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
permissions:
|
permissions:
|
||||||
checks: write
|
checks: write
|
||||||
@@ -202,31 +205,32 @@ jobs:
|
|||||||
echo nofiles=ignore>> "%GITHUB_OUTPUT%"
|
echo nofiles=ignore>> "%GITHUB_OUTPUT%"
|
||||||
echo moredef=-DLOVE_EXTRA_DLLS=%CD%\angle\libEGL.dll;%CD%\angle\libGLESv2.dll>> "%GITHUB_OUTPUT%"
|
echo moredef=-DLOVE_EXTRA_DLLS=%CD%\angle\libEGL.dll;%CD%\angle\libGLESv2.dll>> "%GITHUB_OUTPUT%"
|
||||||
exit /b 0
|
exit /b 0
|
||||||
- name: Download Windows SDK Setup 10.0.20348
|
- name: Download pdbstr
|
||||||
run: curl -Lo winsdksetup.exe https://go.microsoft.com/fwlink/?linkid=2164145
|
run: curl -Lfo pdbstr.nupkg https://www.nuget.org/api/v2/package/Microsoft.Debugging.Tools.PdbStr/20230731.1609.0
|
||||||
- name: Install Debugging Tools for Windows
|
- name: Download srctool
|
||||||
id: windbg
|
run: curl -Lfo srctool.nupkg https://www.nuget.org/api/v2/package/Microsoft.Debugging.Tools.SrcTool/20230731.1609.0
|
||||||
|
- name: Extract Tools and Add to PATH
|
||||||
run: |
|
run: |
|
||||||
setlocal enabledelayedexpansion
|
mkdir debugtools
|
||||||
start /WAIT %CD%\winsdksetup.exe /features OptionId.WindowsDesktopDebuggers /q /log %CD%\log.txt
|
cd debugtools
|
||||||
echo ERRORLEVEL=!ERRORLEVEL! >> %GITHUB_OUTPUT%
|
if errorlevel 1 exit /b 1
|
||||||
- name: Print Debugging Tools Install Log
|
7z e ..\srctool.nupkg content/amd64/srctool.exe
|
||||||
if: always()
|
if errorlevel 1 exit /b 1
|
||||||
run: |
|
7z e ..\pdbstr.nupkg content/amd64/pdbstr.exe
|
||||||
type log.txt
|
if errorlevel 1 exit /b 1
|
||||||
exit /b ${{ steps.windbg.outputs.ERRORLEVEL }}
|
echo %CD%>>%GITHUB_PATH%
|
||||||
- name: Setup Python 3.10
|
- name: Setup Python 3.10
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: "3.10"
|
python-version: "3.10"
|
||||||
- name: Download source_index.py
|
- name: Download source_index.py
|
||||||
run: curl -Lo source_index.py https://gist.github.com/MikuAuahDark/d9c099f5714e09a765496471c2827a55/raw/df34956052035f3473c5f01861dfb53930d06843/source_index.py
|
run: curl -Lfo source_index.py https://gist.github.com/MikuAuahDark/d9c099f5714e09a765496471c2827a55/raw/df34956052035f3473c5f01861dfb53930d06843/source_index.py
|
||||||
- name: Clone Megasource
|
- name: Clone Megasource
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
path: megasource
|
path: megasource
|
||||||
repository: love2d/megasource
|
repository: love2d/megasource
|
||||||
ref: 12.x
|
ref: main
|
||||||
- id: megasource
|
- id: megasource
|
||||||
name: Get Megasource Commit SHA
|
name: Get Megasource Commit SHA
|
||||||
shell: python
|
shell: python
|
||||||
@@ -238,11 +242,11 @@ jobs:
|
|||||||
commit = result.stdout.split()[0]
|
commit = result.stdout.split()[0]
|
||||||
with open(os.environ["GITHUB_OUTPUT"], "w", encoding="UTF-8") as f: f.write(f"commit={commit}")
|
with open(os.environ["GITHUB_OUTPUT"], "w", encoding="UTF-8") as f: f.write(f"commit={commit}")
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
path: megasource/libs/love
|
path: megasource/libs/love
|
||||||
- name: Download ANGLE
|
- name: Download ANGLE
|
||||||
uses: robinraju/release-downloader@v1.7
|
uses: robinraju/release-downloader@v1.9
|
||||||
if: steps.vars.outputs.angle == '1'
|
if: steps.vars.outputs.angle == '1'
|
||||||
with:
|
with:
|
||||||
repository: MikuAuahDark/angle-winbuild
|
repository: MikuAuahDark/angle-winbuild
|
||||||
@@ -255,19 +259,19 @@ 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
|
- name: Remove Strawbery Perl From Path
|
||||||
# https://github.com/actions/runner-images/issues/6627
|
# https://github.com/actions/runner-images/issues/6627
|
||||||
# In particular, this is not pretty, but even CMAKE_IGNORE_PREFIX_PATH
|
# In particular, this is not pretty, but even CMAKE_IGNORE_PREFIX_PATH
|
||||||
# cannot help in this case. Delete the whole folder!
|
# cannot help in this case.
|
||||||
run: |
|
run: |
|
||||||
rmdir /s /q C:\Strawberry
|
move /y C:\Strawberry C:\Strawberry_not_in_PATH
|
||||||
exit /b 0
|
exit /b 0
|
||||||
- name: Configure
|
- name: Configure
|
||||||
env:
|
env:
|
||||||
CFLAGS: /Zi
|
CFLAGS: /Zi
|
||||||
CXXFLAGS: /Zi
|
CXXFLAGS: /Zi
|
||||||
LDFLAGS: /DEBUG:FULL /OPT:REF /OPT:ICF
|
LDFLAGS: /DEBUG:FULL /OPT:REF /OPT:ICF
|
||||||
run: cmake -Bbuild -Smegasource -T v142 -A ${{ matrix.platform }} --install-prefix %CD%\install -DCMAKE_PDB_OUTPUT_DIRECTORY=%CD%\pdb ${{ steps.vars.outputs.moredef }}
|
run: cmake -Bbuild -Smegasource -T v143 -A ${{ matrix.platform }} --install-prefix %CD%\install -DCMAKE_PDB_OUTPUT_DIRECTORY=%CD%\pdb ${{ steps.vars.outputs.moredef }}
|
||||||
- name: Install
|
- name: Install
|
||||||
run: cmake --build build --target PACKAGE --config Release -j2
|
run: cmake --build build --target PACKAGE --config Release -j2
|
||||||
- name: Copy LuaJIT lua51.pdb
|
- name: Copy LuaJIT lua51.pdb
|
||||||
@@ -285,7 +289,7 @@ jobs:
|
|||||||
--source %CD%\build\libs\LuaJIT https://raw.githubusercontent.com/love2d/megasource/${{ steps.megasource.outputs.commit }}/libs/LuaJIT ^
|
--source %CD%\build\libs\LuaJIT https://raw.githubusercontent.com/love2d/megasource/${{ steps.megasource.outputs.commit }}/libs/LuaJIT ^
|
||||||
pdb\Release\*.pdb
|
pdb\Release\*.pdb
|
||||||
- name: Artifact
|
- name: Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}
|
name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}
|
||||||
path: |
|
path: |
|
||||||
@@ -294,12 +298,12 @@ jobs:
|
|||||||
if-no-files-found: ${{ steps.vars.outputs.nofiles }}
|
if-no-files-found: ${{ steps.vars.outputs.nofiles }}
|
||||||
- name: Artifact JIT Modules
|
- name: Artifact JIT Modules
|
||||||
if: steps.vars.outputs.jitmodules == '1'
|
if: steps.vars.outputs.jitmodules == '1'
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: love-windows-jitmodules
|
name: love-windows-jitmodules
|
||||||
path: build/libs/LuaJIT/src/jit/*.lua
|
path: build/libs/LuaJIT/src/jit/*.lua
|
||||||
- name: Artifact PDB
|
- name: Artifact PDB
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-dbg
|
name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-dbg
|
||||||
path: pdb/Release/*.pdb
|
path: pdb/Release/*.pdb
|
||||||
@@ -317,10 +321,12 @@ jobs:
|
|||||||
# windows opengl tests
|
# windows opengl tests
|
||||||
- name: Run Tests (opengl)
|
- name: Run Tests (opengl)
|
||||||
if: steps.vars.outputs.arch != 'ARM64' && steps.vars.outputs.compatname != '-compat'
|
if: steps.vars.outputs.arch != 'ARM64' && steps.vars.outputs.compatname != '-compat'
|
||||||
|
env:
|
||||||
|
LOVE_GRAPHICS_DEBUG: 1
|
||||||
run: |
|
run: |
|
||||||
echo 'check dir'
|
echo 'check dir'
|
||||||
ls
|
ls
|
||||||
powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua --runAllTests --isRunner
|
powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua --all --isRunner
|
||||||
- name: Love Test Report (opengl)
|
- name: Love Test Report (opengl)
|
||||||
id: report1
|
id: report1
|
||||||
if: steps.vars.outputs.arch != 'ARM64' && steps.vars.outputs.compatname != '-compat'
|
if: steps.vars.outputs.arch != 'ARM64' && steps.vars.outputs.compatname != '-compat'
|
||||||
@@ -328,7 +334,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: Love Testsuite Windows ${{ steps.vars.outputs.arch }} ${{ steps.vars.outputs.compatname }} (opengl)
|
name: Love Testsuite Windows ${{ steps.vars.outputs.arch }} ${{ steps.vars.outputs.compatname }} (opengl)
|
||||||
title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengl
|
title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengl
|
||||||
path: megasource/libs/love/testing/output/lovetest_runAllTests.md
|
path: megasource/libs/love/testing/output/lovetest_all.md
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Zip Test Output (opengl)
|
- name: Zip Test Output (opengl)
|
||||||
if: steps.vars.outputs.arch != 'ARM64' && steps.vars.outputs.compatname != '-compat'
|
if: steps.vars.outputs.arch != 'ARM64' && steps.vars.outputs.compatname != '-compat'
|
||||||
@@ -336,16 +342,18 @@ jobs:
|
|||||||
7z a -tzip test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengl.zip megasource/libs/love/testing/output/
|
7z a -tzip test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengl.zip megasource/libs/love/testing/output/
|
||||||
- name: Artifact Test Output (opengl)
|
- name: Artifact Test Output (opengl)
|
||||||
if: steps.vars.outputs.arch != 'ARM64' && steps.vars.outputs.compatname != '-compat'
|
if: steps.vars.outputs.arch != 'ARM64' && steps.vars.outputs.compatname != '-compat'
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: test-output-windows-${{ steps.vars.outputs.arch }}-opengl-${{ steps.report1.outputs.conclusion }}
|
name: test-output-windows-${{ steps.vars.outputs.arch }}-opengl-${{ steps.report1.outputs.conclusion }}
|
||||||
path: test-output-windows-${{ steps.vars.outputs.arch }}-opengl.zip
|
path: test-output-windows-${{ steps.vars.outputs.arch }}-opengl.zip
|
||||||
# windows opengles tests
|
# windows opengles tests
|
||||||
- name: Run Tests (opengles)
|
- name: Run Tests (opengles)
|
||||||
if: steps.vars.outputs.arch != 'ARM64' && steps.vars.outputs.compatname != '-compat'
|
if: steps.vars.outputs.arch != 'ARM64' && steps.vars.outputs.compatname != '-compat'
|
||||||
|
env:
|
||||||
|
LOVE_GRAPHICS_DEBUG: 1
|
||||||
|
LOVE_GRAPHICS_USE_OPENGLES: 1
|
||||||
run: |
|
run: |
|
||||||
$ENV:LOVE_GRAPHICS_USE_OPENGLES=1
|
powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua --all --isRunner
|
||||||
powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua --runAllTests --isRunner
|
|
||||||
- name: Love Test Report (opengles)
|
- name: Love Test Report (opengles)
|
||||||
id: report2
|
id: report2
|
||||||
if: steps.vars.outputs.arch != 'ARM64' && steps.vars.outputs.compatname != '-compat'
|
if: steps.vars.outputs.arch != 'ARM64' && steps.vars.outputs.compatname != '-compat'
|
||||||
@@ -353,7 +361,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: Love Testsuite Windows ${{ steps.vars.outputs.arch }} ${{ steps.vars.outputs.compatname }} (opengles)
|
name: Love Testsuite Windows ${{ steps.vars.outputs.arch }} ${{ steps.vars.outputs.compatname }} (opengles)
|
||||||
title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengles
|
title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengles
|
||||||
path: megasource/libs/love/testing/output/lovetest_runAllTests.md
|
path: megasource/libs/love/testing/output/lovetest_all.md
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Zip Test Output (opengles)
|
- name: Zip Test Output (opengles)
|
||||||
if: steps.vars.outputs.arch != 'ARM64' && steps.vars.outputs.compatname != '-compat'
|
if: steps.vars.outputs.arch != 'ARM64' && steps.vars.outputs.compatname != '-compat'
|
||||||
@@ -361,7 +369,7 @@ jobs:
|
|||||||
7z a -tzip test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengles.zip megasource/libs/love/testing/output/
|
7z a -tzip test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengles.zip megasource/libs/love/testing/output/
|
||||||
- name: Artifact Test Output (opengles)
|
- name: Artifact Test Output (opengles)
|
||||||
if: steps.vars.outputs.arch != 'ARM64' && steps.vars.outputs.compatname != '-compat'
|
if: steps.vars.outputs.arch != 'ARM64' && steps.vars.outputs.compatname != '-compat'
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: test-output-windows-${{ steps.vars.outputs.arch }}-opengles-${{ steps.report2.outputs.conclusion }}
|
name: test-output-windows-${{ steps.vars.outputs.arch }}-opengles-${{ steps.report2.outputs.conclusion }}
|
||||||
path: test-output-windows-${{ steps.vars.outputs.arch }}-opengles.zip
|
path: test-output-windows-${{ steps.vars.outputs.arch }}-opengles.zip
|
||||||
@@ -387,23 +395,24 @@ jobs:
|
|||||||
# # windows vulkan tests
|
# # windows vulkan tests
|
||||||
# - name: Run Tests (vulkan)
|
# - name: Run Tests (vulkan)
|
||||||
# if: steps.vars.outputs.arch != 'ARM64'
|
# if: steps.vars.outputs.arch != 'ARM64'
|
||||||
|
# env:
|
||||||
|
# LOVE_GRAPHICS_DEBUG: 1
|
||||||
# run: |
|
# run: |
|
||||||
# $ENV:LOVE_GRAPHICS_DEBUG=1
|
# powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua --all --isRunner --renderers vulkan
|
||||||
# powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua --runAllTests --isRunner --renderers vulkan
|
|
||||||
# - name: Love Test Report (vulkan)
|
# - name: Love Test Report (vulkan)
|
||||||
# if: steps.vars.outputs.arch != 'ARM64'
|
# if: steps.vars.outputs.arch != 'ARM64'
|
||||||
# uses: ellraiser/love-test-report@main
|
# uses: ellraiser/love-test-report@main
|
||||||
# with:
|
# with:
|
||||||
# name: Love Testsuite Windows ${{ steps.vars.outputs.arch }} ${{ steps.vars.outputs.compatname }} (vulkan)
|
# name: Love Testsuite Windows ${{ steps.vars.outputs.arch }} ${{ steps.vars.outputs.compatname }} (vulkan)
|
||||||
# title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan
|
# title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan
|
||||||
# path: megasource/libs/love/testing/output/lovetest_runAllTests.md
|
# path: megasource/libs/love/testing/output/lovetest_all.md
|
||||||
# - name: Zip Test Output (vulkan)
|
# - name: Zip Test Output (vulkan)
|
||||||
# if: steps.vars.outputs.arch != 'ARM64'
|
# if: steps.vars.outputs.arch != 'ARM64'
|
||||||
# run: |
|
# run: |
|
||||||
# 7z a -tzip test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan.zip megasource/libs/love/testing/output/
|
# 7z a -tzip test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan.zip megasource/libs/love/testing/output/
|
||||||
# - name: Artifact Test Output (vulkan)
|
# - name: Artifact Test Output (vulkan)
|
||||||
# if: steps.vars.outputs.arch != 'ARM64'
|
# if: steps.vars.outputs.arch != 'ARM64'
|
||||||
# uses: actions/upload-artifact@v3
|
# uses: actions/upload-artifact@v4
|
||||||
# with:
|
# with:
|
||||||
# name: test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan
|
# name: test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan
|
||||||
# path: test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan.zip
|
# path: test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan.zip
|
||||||
@@ -414,9 +423,9 @@ jobs:
|
|||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Clone Dependencies
|
- name: Clone Dependencies
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
path: apple-dependencies
|
path: apple-dependencies
|
||||||
repository: love2d/love-apple-dependencies
|
repository: love2d/love-apple-dependencies
|
||||||
@@ -434,28 +443,30 @@ jobs:
|
|||||||
run:
|
run:
|
||||||
ditto -c -k --sequesterRsrc --keepParent love-macos/love.app love-macos.zip
|
ditto -c -k --sequesterRsrc --keepParent love-macos/love.app love-macos.zip
|
||||||
- name: Artifact
|
- name: Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: love-macos
|
name: love-macos
|
||||||
path: love-macos.zip
|
path: love-macos.zip
|
||||||
# macos opengl tests (metal not supported on runners)
|
# macos opengl tests (metal not supported on runners)
|
||||||
- name: Run Test Suite
|
- name: Run Test Suite
|
||||||
|
env:
|
||||||
|
LOVE_GRAPHICS_DEBUG: 1
|
||||||
run: |
|
run: |
|
||||||
ls
|
ls
|
||||||
love-macos/love.app/Contents/MacOS/love ./testing/main.lua --runAllTests --isRunner
|
love-macos/love.app/Contents/MacOS/love ./testing/main.lua --all --isRunner
|
||||||
- name: Love Test Report
|
- name: Love Test Report
|
||||||
id: report1
|
id: report1
|
||||||
uses: ellraiser/love-test-report@main
|
uses: ellraiser/love-test-report@main
|
||||||
with:
|
with:
|
||||||
name: Love Testsuite MacOS
|
name: Love Testsuite MacOS
|
||||||
title: test-report-macos
|
title: test-report-macos
|
||||||
path: testing/output/lovetest_runAllTests.md
|
path: testing/output/lovetest_all.md
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Zip Test Output
|
- name: Zip Test Output
|
||||||
run: |
|
run: |
|
||||||
7z a -tzip test-output-macos-opengl.zip ./testing/output/
|
7z a -tzip test-output-macos-opengl.zip ./testing/output/
|
||||||
- name: Artifact Test Output
|
- name: Artifact Test Output
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: test-output-macos-opengl-${{ steps.report1.outputs.conclusion }}
|
name: test-output-macos-opengl-${{ steps.report1.outputs.conclusion }}
|
||||||
path: test-output-macos-opengl.zip
|
path: test-output-macos-opengl.zip
|
||||||
@@ -468,9 +479,9 @@ jobs:
|
|||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Clone Dependencies
|
- name: Clone Dependencies
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
path: apple-dependencies
|
path: apple-dependencies
|
||||||
repository: love2d/love-apple-dependencies
|
repository: love2d/love-apple-dependencies
|
||||||
@@ -481,3 +492,76 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run:
|
run:
|
||||||
xcodebuild -project platform/xcode/love.xcodeproj -scheme love-ios -configuration Release -destination 'platform=iOS Simulator,name=iPhone 11'
|
xcodebuild -project platform/xcode/love.xcodeproj -scheme love-ios -configuration Release -destination 'platform=iOS Simulator,name=iPhone 11'
|
||||||
|
Android:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
build_type: [Debug, Release]
|
||||||
|
env:
|
||||||
|
GRADLE_OPTS: "-Dorg.gradle.jvmargs='-Xmx4G'"
|
||||||
|
steps:
|
||||||
|
- name: Prepare Environment
|
||||||
|
run: sudo apt-get update && curl -Lfo kitware-archive.sh https://apt.kitware.com/kitware-archive.sh && sudo bash ./kitware-archive.sh
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: sudo apt-get install ninja-build cmake
|
||||||
|
- name: Checkout love-android
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: love2d/love-android
|
||||||
|
submodules: false
|
||||||
|
- name: Setup Java 17
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: adopt-hotspot
|
||||||
|
java-version: 17
|
||||||
|
cache: gradle
|
||||||
|
- name: Clone Megasource
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
path: app/src/main/cpp/megasource
|
||||||
|
repository: love2d/megasource
|
||||||
|
ref: main
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
path: app/src/main/cpp/love
|
||||||
|
- name: Build Normal Flavor
|
||||||
|
run: bash ./gradlew assembleNormalRecord${{ matrix.build_type }}
|
||||||
|
- name: Build Release-specific Binaries
|
||||||
|
if: ${{ matrix.build_type == 'Release' }}
|
||||||
|
run: bash ./gradlew bundleNormalNoRecordRelease bundleEmbedRecordRelease bundleEmbedNoRecordRelease
|
||||||
|
- name: Artifact (Normal debug APK)
|
||||||
|
if: ${{ matrix.build_type == 'Debug' }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: love-android-debug.apk
|
||||||
|
path: app/build/outputs/apk/normalRecord/debug/app-normal-record-debug.apk
|
||||||
|
- name: Artifact (Normal unsigned APK)
|
||||||
|
if: ${{ matrix.build_type == 'Release' }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: love-android.apk
|
||||||
|
path: app/build/outputs/apk/normalRecord/release/app-normal-record-release-unsigned.apk
|
||||||
|
- name: Artifact (Normal AAB w/o recording)
|
||||||
|
if: ${{ matrix.build_type == 'Release' }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: love-android-ps.aab
|
||||||
|
path: app/build/outputs/bundle/normalNoRecordRelease/app-normal-noRecord-release.aab
|
||||||
|
- name: Artifact (Embed AAB)
|
||||||
|
if: ${{ matrix.build_type == 'Release' }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: love-android-embed-record.aab
|
||||||
|
path: app/build/outputs/bundle/embedRecordRelease/app-embed-record-release.aab
|
||||||
|
- name: Artifact (Embed AAB w/o recording)
|
||||||
|
if: ${{ matrix.build_type == 'Release' }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: love-android-embed.aab
|
||||||
|
path: app/build/outputs/bundle/embedNoRecordRelease/app-embed-noRecord-release.aab
|
||||||
|
- name: Artifact (Debug symbols)
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: love-android-unstripped-debugsyms-${{ matrix.build_type }}
|
||||||
|
path: app/build/intermediates/cxx
|
||||||
|
|||||||
@@ -73,3 +73,4 @@ stamp-h1
|
|||||||
/testing/output/*.html
|
/testing/output/*.html
|
||||||
/testing/output/*.md
|
/testing/output/*.md
|
||||||
/testing/output/actual/*.png
|
/testing/output/actual/*.png
|
||||||
|
/testing/output/difference/*.png
|
||||||
|
|||||||
+2
-2
@@ -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
|
# This software is provided 'as-is', without any express or implied
|
||||||
# warranty. In no event will the authors be held liable for any damages
|
# warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -60,7 +60,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(APPLE OR MEGA_ARM64)
|
if(APPLE)
|
||||||
set(LOVE_DEFAULT_JIT FALSE)
|
set(LOVE_DEFAULT_JIT FALSE)
|
||||||
else()
|
else()
|
||||||
set(LOVE_DEFAULT_JIT TRUE)
|
set(LOVE_DEFAULT_JIT TRUE)
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ Released: N/A
|
|||||||
* Changed RevoluteJoint:getMotorTorque and WheelJoint:getMotorTorque to take 'dt' as a parameter instead of 'inverse_dt'.
|
* 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 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 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 'display' field to 'displayindex' in love.window.setMode/updateMode/getMode and love.conf.
|
||||||
* Renamed love.graphics Text objects to TextBatch.
|
* Renamed love.graphics Text objects to TextBatch.
|
||||||
@@ -120,6 +121,7 @@ Released: N/A
|
|||||||
* Deprecated t.accelerometerjoystick in love.conf (replaced by love.sensor module).
|
* 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 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 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 variant of SpriteBatch:setColor() which turns off all previously set colors.
|
||||||
* Removed the no-argument variant of love.graphics.setColorMask.
|
* Removed the no-argument variant of love.graphics.setColorMask.
|
||||||
|
|||||||
Binary file not shown.
+1
-1
@@ -6,7 +6,7 @@ This distribution contains code from the following projects (full license text b
|
|||||||
- LOVE
|
- LOVE
|
||||||
Website: https://love2d.org/
|
Website: https://love2d.org/
|
||||||
License: zlib
|
License: zlib
|
||||||
Copyright (c) 2006-2023 LOVE Development Team
|
Copyright (c) 2006-2024 LOVE Development Team
|
||||||
|
|
||||||
- ENet
|
- ENet
|
||||||
Website: http://enet.bespin.org/index.html
|
Website: http://enet.bespin.org/index.html
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
<key>NSHighResolutionCapable</key>
|
<key>NSHighResolutionCapable</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>NSHumanReadableCopyright</key>
|
<key>NSHumanReadableCopyright</key>
|
||||||
<string>© 2006-2023 LÖVE Development Team</string>
|
<string>© 2006-2024 LÖVE Development Team</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string>NSApplication</string>
|
<string>NSApplication</string>
|
||||||
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
||||||
|
|||||||
@@ -11,12 +11,13 @@ If you need further help, feel free to ask on our [forums][forums], our [Discord
|
|||||||
Repository
|
Repository
|
||||||
----------
|
----------
|
||||||
|
|
||||||
We use the 'main' branch for patch development of the current major release, and therefore it should not be considered stable.
|
We use the 'main' branch for development of the next 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.
|
|
||||||
|
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.
|
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
|
Builds
|
||||||
------
|
------
|
||||||
@@ -32,12 +33,11 @@ There are also unstable/nightly builds:
|
|||||||
Test Suite
|
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].
|
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, i.e.:
|
You can run the suite locally like you would run a normal LÖVE project, e.g.:
|
||||||
`love testing/main.lua`
|
`love testing`
|
||||||
|
|
||||||
See the [readme][testsuite] in the testing folder for more info.
|
See the [readme][testsuite] in the testing folder for more info.
|
||||||
You can contribute to the test suite [here][testsuitemain]
|
|
||||||
|
|
||||||
Contributing
|
Contributing
|
||||||
------------
|
------------
|
||||||
@@ -70,7 +70,6 @@ Then use the Xcode project found at `platform/xcode/love.xcodeproj` to build the
|
|||||||
### iOS
|
### iOS
|
||||||
Building for iOS requires macOS and Xcode.
|
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],
|
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.
|
unzip it, and place the `iOS/libraries` subfolder into love's `platform/xcode/ios` folder.
|
||||||
|
|
||||||
@@ -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.
|
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
|
### Android
|
||||||
Visit the [Android build repository][android-repository] for build instructions.
|
Visit the [Android build repository][android-repository] for build instructions.
|
||||||
|
|
||||||
@@ -117,6 +108,5 @@ Dependencies
|
|||||||
[codestyle]: https://love2d.org/wiki/Code_Style
|
[codestyle]: https://love2d.org/wiki/Code_Style
|
||||||
[android-repository]: https://github.com/love2d/love-android
|
[android-repository]: https://github.com/love2d/love-android
|
||||||
[releases]: https://github.com/love2d/love/releases
|
[releases]: https://github.com/love2d/love/releases
|
||||||
[testsuite]: https://github.com/love2d/love/tree/12.0-development/testing
|
[testsuite]: https://github.com/love2d/love/tree/main/testing
|
||||||
[testsuitemain]: https://github.com/ellraiser/love-test
|
[workflows]: https://github.com/love2d/love/actions/workflows/main.yml?query=branch%3Amain
|
||||||
[12devworkflows]: https://github.com/love2d/love/actions/workflows/main.yml?query=branch%3A12.0-development
|
|
||||||
|
|||||||
+1
-1
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+18
-1
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -20,10 +20,27 @@
|
|||||||
|
|
||||||
// LOVE
|
// LOVE
|
||||||
#include "Data.h"
|
#include "Data.h"
|
||||||
|
#include "thread/threads.h"
|
||||||
|
|
||||||
namespace love
|
namespace love
|
||||||
{
|
{
|
||||||
|
|
||||||
love::Type Data::type("Data", &Object::type);
|
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
|
} // love
|
||||||
|
|||||||
+20
-6
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -22,15 +22,20 @@
|
|||||||
#define LOVE_DATA_H
|
#define LOVE_DATA_H
|
||||||
|
|
||||||
// LOVE
|
// LOVE
|
||||||
#include "config.h"
|
|
||||||
#include "Object.h"
|
#include "Object.h"
|
||||||
|
|
||||||
// C
|
// C
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
namespace love
|
namespace love
|
||||||
{
|
{
|
||||||
|
|
||||||
|
namespace thread
|
||||||
|
{
|
||||||
|
class Mutex;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is a simple abstraction over all objects which contain data.
|
* This class is a simple abstraction over all objects which contain data.
|
||||||
**/
|
**/
|
||||||
@@ -40,10 +45,8 @@ public:
|
|||||||
|
|
||||||
static love::Type type;
|
static love::Type type;
|
||||||
|
|
||||||
/**
|
Data() {};
|
||||||
* Destructor.
|
virtual ~Data();
|
||||||
**/
|
|
||||||
virtual ~Data() {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a duplicate of Data derived class instance.
|
* Creates a duplicate of Data derived class instance.
|
||||||
@@ -60,6 +63,17 @@ public:
|
|||||||
**/
|
**/
|
||||||
virtual size_t getSize() const = 0;
|
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
|
}; // Data
|
||||||
|
|
||||||
} // love
|
} // love
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -62,9 +62,12 @@ namespace love
|
|||||||
love::Type Module::type("Module", &Object::type);
|
love::Type Module::type("Module", &Object::type);
|
||||||
Module *Module::instances[] = {};
|
Module *Module::instances[] = {};
|
||||||
|
|
||||||
Module::Module()
|
Module::Module(Module::ModuleType moduleType, const char *name)
|
||||||
|
: moduleType(moduleType)
|
||||||
|
, name(name)
|
||||||
{
|
{
|
||||||
initDeprecation();
|
initDeprecation();
|
||||||
|
registerInstance(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
Module::~Module()
|
Module::~Module()
|
||||||
|
|||||||
+9
-11
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -62,13 +62,13 @@ public:
|
|||||||
M_MAX_ENUM
|
M_MAX_ENUM
|
||||||
};
|
};
|
||||||
|
|
||||||
Module();
|
Module(ModuleType moduleType, const char *name);
|
||||||
virtual ~Module();
|
virtual ~Module();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the base type of the 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
|
* Gets the name of the module. This is used in case of errors
|
||||||
@@ -76,14 +76,7 @@ public:
|
|||||||
*
|
*
|
||||||
* @return The full name of the module, eg. love.graphics.opengl.
|
* @return The full name of the module, eg. love.graphics.opengl.
|
||||||
**/
|
**/
|
||||||
virtual const char *getName() const = 0;
|
const char *getName() const { return name.c_str(); }
|
||||||
|
|
||||||
/**
|
|
||||||
* 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);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve module instance from internal registry. May return NULL
|
* Retrieve module instance from internal registry. May return NULL
|
||||||
@@ -106,6 +99,11 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
static void registerInstance(Module *instance);
|
||||||
|
|
||||||
|
ModuleType moduleType;
|
||||||
|
std::string name;
|
||||||
|
|
||||||
static Module *instances[M_MAX_ENUM];
|
static Module *instances[M_MAX_ENUM];
|
||||||
|
|
||||||
}; // Module
|
}; // Module
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+2
-2
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -61,7 +61,7 @@ struct Range
|
|||||||
return first <= other.first && last >= other.last;
|
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);
|
return !(first > other.last || last < other.first);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -385,18 +385,20 @@ struct AssetInfo: public love::filesystem::physfs::PhysfsIo<AssetInfo>
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
AssetInfo *duplicate() const
|
AssetInfo(const AssetInfo &other)
|
||||||
|
: assetManager(other.assetManager)
|
||||||
|
, size(strlen(other.filename) + 1)
|
||||||
{
|
{
|
||||||
AAsset *newAsset = AAssetManager_open(assetManager, filename, AASSET_MODE_RANDOM);
|
asset = AAssetManager_open(assetManager, other.filename, AASSET_MODE_RANDOM);
|
||||||
|
|
||||||
if (newAsset == nullptr)
|
if (asset == nullptr)
|
||||||
{
|
{
|
||||||
PHYSFS_setErrorCode(PHYSFS_ERR_OS_ERROR);
|
PHYSFS_setErrorCode(PHYSFS_ERR_OS_ERROR);
|
||||||
return nullptr;
|
throw new love::Exception("Unable to duplicate AssetInfo");
|
||||||
}
|
}
|
||||||
|
|
||||||
AAsset_seek64(asset, tell(), SEEK_SET);
|
filename = new (std::nothrow) char[size];
|
||||||
return fromAAsset(assetManager, filename, asset);
|
memcpy(filename, other.filename, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
~AssetInfo() override
|
~AssetInfo() override
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -342,6 +342,10 @@ PixelFormat getSRGBPixelFormat(PixelFormat format)
|
|||||||
{
|
{
|
||||||
case PIXELFORMAT_RGBA8_UNORM: return PIXELFORMAT_RGBA8_sRGB;
|
case PIXELFORMAT_RGBA8_UNORM: return PIXELFORMAT_RGBA8_sRGB;
|
||||||
case PIXELFORMAT_BGRA8_UNORM: return PIXELFORMAT_BGRA8_sRGB;
|
case PIXELFORMAT_BGRA8_UNORM: return PIXELFORMAT_BGRA8_sRGB;
|
||||||
|
case PIXELFORMAT_DXT1_UNORM: return PIXELFORMAT_DXT1_sRGB;
|
||||||
|
case PIXELFORMAT_DXT3_UNORM: return PIXELFORMAT_DXT3_sRGB;
|
||||||
|
case PIXELFORMAT_DXT5_UNORM: return PIXELFORMAT_DXT5_sRGB;
|
||||||
|
case PIXELFORMAT_BC7_UNORM: return PIXELFORMAT_BC7_sRGB;
|
||||||
case PIXELFORMAT_PVR1_RGB2_UNORM: return PIXELFORMAT_PVR1_RGB2_sRGB;
|
case PIXELFORMAT_PVR1_RGB2_UNORM: return PIXELFORMAT_PVR1_RGB2_sRGB;
|
||||||
case PIXELFORMAT_PVR1_RGB4_UNORM: return PIXELFORMAT_PVR1_RGB4_sRGB;
|
case PIXELFORMAT_PVR1_RGB4_UNORM: return PIXELFORMAT_PVR1_RGB4_sRGB;
|
||||||
case PIXELFORMAT_PVR1_RGBA2_UNORM: return PIXELFORMAT_PVR1_RGBA2_sRGB;
|
case PIXELFORMAT_PVR1_RGBA2_UNORM: return PIXELFORMAT_PVR1_RGBA2_sRGB;
|
||||||
@@ -374,6 +378,10 @@ PixelFormat getLinearPixelFormat(PixelFormat format)
|
|||||||
{
|
{
|
||||||
case PIXELFORMAT_RGBA8_sRGB: return PIXELFORMAT_RGBA8_UNORM;
|
case PIXELFORMAT_RGBA8_sRGB: return PIXELFORMAT_RGBA8_UNORM;
|
||||||
case PIXELFORMAT_BGRA8_sRGB: return PIXELFORMAT_BGRA8_UNORM;
|
case PIXELFORMAT_BGRA8_sRGB: return PIXELFORMAT_BGRA8_UNORM;
|
||||||
|
case PIXELFORMAT_DXT1_sRGB: return PIXELFORMAT_DXT1_UNORM;
|
||||||
|
case PIXELFORMAT_DXT3_sRGB: return PIXELFORMAT_DXT3_UNORM;
|
||||||
|
case PIXELFORMAT_DXT5_sRGB: return PIXELFORMAT_DXT5_UNORM;
|
||||||
|
case PIXELFORMAT_BC7_sRGB: return PIXELFORMAT_BC7_UNORM;
|
||||||
case PIXELFORMAT_PVR1_RGB2_sRGB: return PIXELFORMAT_PVR1_RGB2_UNORM;
|
case PIXELFORMAT_PVR1_RGB2_sRGB: return PIXELFORMAT_PVR1_RGB2_UNORM;
|
||||||
case PIXELFORMAT_PVR1_RGB4_sRGB: return PIXELFORMAT_PVR1_RGB4_UNORM;
|
case PIXELFORMAT_PVR1_RGB4_sRGB: return PIXELFORMAT_PVR1_RGB4_UNORM;
|
||||||
case PIXELFORMAT_PVR1_RGBA2_sRGB: return PIXELFORMAT_PVR1_RGBA2_UNORM;
|
case PIXELFORMAT_PVR1_RGBA2_sRGB: return PIXELFORMAT_PVR1_RGBA2_UNORM;
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -473,9 +473,6 @@ int luax_register_module(lua_State *L, const WrappedModule &m)
|
|||||||
lua_setfield(L, -3, m.name); // love.graphics = table
|
lua_setfield(L, -3, m.name); // love.graphics = table
|
||||||
lua_remove(L, -2); // love
|
lua_remove(L, -2); // love
|
||||||
|
|
||||||
// Register module instance
|
|
||||||
Module::registerInstance(m.module);
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+15
-8
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -629,22 +629,29 @@ T *luax_optmodule(lua_State *L)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts the value at idx to the specified type without checking that
|
* Converts the value at idx to the specified type. Returns null if the type
|
||||||
* this conversion is valid. If the type has been previously verified with
|
* doesn't match.
|
||||||
* luax_istype, then this can be safely used. Otherwise, use luax_checktype.
|
|
||||||
* @param L The Lua state.
|
* @param L The Lua state.
|
||||||
* @param idx The index on the stack.
|
* @param idx The index on the stack.
|
||||||
* @param type The type of the object.
|
* @param type The type of the object.
|
||||||
**/
|
**/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T *luax_totype(lua_State *L, int idx, const love::Type& /*type*/)
|
T *luax_totype(lua_State *L, int idx, const love::Type &type)
|
||||||
{
|
{
|
||||||
T *o = (T *)(((Proxy *)lua_touserdata(L, idx))->object);
|
if (lua_type(L, idx) != LUA_TUSERDATA)
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
if (o == nullptr)
|
Proxy *p = (Proxy *) lua_touserdata(L, idx);
|
||||||
|
|
||||||
|
if (p->type != nullptr && p->type->isa(type))
|
||||||
|
{
|
||||||
|
if (p->object == nullptr)
|
||||||
luaL_error(L, "Cannot use object after it has been released.");
|
luaL_error(L, "Cannot use object after it has been released.");
|
||||||
|
|
||||||
return o;
|
return (T *) p->object;
|
||||||
|
}
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Simple DDS data parser for compressed 2D textures.
|
* Simple DDS data parser for compressed 2D textures.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2013-2023 Sasha Szpakowski
|
* Copyright (c) 2013-2024 Sasha Szpakowski
|
||||||
*
|
*
|
||||||
* This software is provided 'as-is', without any express or implied
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Simple DDS data parser for compressed 2D textures.
|
* Simple DDS data parser for compressed 2D textures.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2013-2023 Sasha Szpakowski
|
* Copyright (c) 2013-2024 Sasha Szpakowski
|
||||||
*
|
*
|
||||||
* This software is provided 'as-is', without any express or implied
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Simple DDS data parser for compressed 2D textures.
|
* Simple DDS data parser for compressed 2D textures.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2013-2023 Sasha Szpakowski
|
* Copyright (c) 2013-2024 Sasha Szpakowski
|
||||||
*
|
*
|
||||||
* This software is provided 'as-is', without any express or implied
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ local function receiveheaders(sock, headers)
|
|||||||
while line ~= "" do
|
while line ~= "" do
|
||||||
-- get field-name and value
|
-- get field-name and value
|
||||||
name, value = socket.skip(2, string.find(line, "^(.-):%s*(.*)"))
|
name, value = socket.skip(2, string.find(line, "^(.-):%s*(.*)"))
|
||||||
if not (name and value) then return nil, "malformed reponse headers" end
|
if not (name and value) then return nil, "malformed response headers" end
|
||||||
name = string.lower(name)
|
name = string.lower(name)
|
||||||
-- get next line (value might be folded)
|
-- get next line (value might be folded)
|
||||||
line, err = sock:receive()
|
line, err = sock:receive()
|
||||||
@@ -62,7 +62,7 @@ local function receiveheaders(sock, headers)
|
|||||||
-- unfold any folded values
|
-- unfold any folded values
|
||||||
while string.find(line, "^%s") do
|
while string.find(line, "^%s") do
|
||||||
value = value .. line
|
value = value .. line
|
||||||
line = sock:receive()
|
line, err = sock:receive()
|
||||||
if err then return nil, err end
|
if err then return nil, err end
|
||||||
end
|
end
|
||||||
-- save pair in table
|
-- save pair in table
|
||||||
@@ -81,7 +81,7 @@ socket.sourcet["http-chunked"] = function(sock, headers)
|
|||||||
dirty = function() return sock:dirty() end
|
dirty = function() return sock:dirty() end
|
||||||
}, {
|
}, {
|
||||||
__call = function()
|
__call = function()
|
||||||
-- get chunk size, skip extention
|
-- get chunk size, skip extension
|
||||||
local line, err = sock:receive()
|
local line, err = sock:receive()
|
||||||
if err then return nil, err end
|
if err then return nil, err end
|
||||||
local size = base.tonumber(string.gsub(line, ";.*", ""), 16)
|
local size = base.tonumber(string.gsub(line, ";.*", ""), 16)
|
||||||
@@ -219,9 +219,11 @@ local function adjustproxy(reqt)
|
|||||||
local proxy = reqt.proxy or _M.PROXY
|
local proxy = reqt.proxy or _M.PROXY
|
||||||
if proxy then
|
if proxy then
|
||||||
proxy = url.parse(proxy)
|
proxy = url.parse(proxy)
|
||||||
return proxy.host, proxy.port or 3128
|
proxy.port = proxy.port or 3128
|
||||||
|
proxy.create = SCHEMES[proxy.scheme].create(reqt)
|
||||||
|
return proxy.host, proxy.port, proxy.create
|
||||||
else
|
else
|
||||||
return reqt.host, reqt.port
|
return reqt.host, reqt.port, reqt.create
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -279,7 +281,7 @@ local function adjustrequest(reqt)
|
|||||||
if not (host and host ~= "") then
|
if not (host and host ~= "") then
|
||||||
socket.try(nil, "invalid host '" .. base.tostring(nreqt.host) .. "'")
|
socket.try(nil, "invalid host '" .. base.tostring(nreqt.host) .. "'")
|
||||||
end
|
end
|
||||||
-- compute uri if user hasn't overriden
|
-- compute uri if user hasn't overridden
|
||||||
nreqt.uri = reqt.uri or adjusturi(nreqt)
|
nreqt.uri = reqt.uri or adjusturi(nreqt)
|
||||||
-- adjust headers in request
|
-- adjust headers in request
|
||||||
nreqt.headers = adjustheaders(nreqt)
|
nreqt.headers = adjustheaders(nreqt)
|
||||||
@@ -291,7 +293,10 @@ local function adjustrequest(reqt)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- ajust host and port if there is a proxy
|
-- ajust host and port if there is a proxy
|
||||||
nreqt.host, nreqt.port = adjustproxy(nreqt)
|
local proxy_create
|
||||||
|
nreqt.host, nreqt.port, proxy_create = adjustproxy(nreqt)
|
||||||
|
if not reqt.create then nreqt.create = proxy_create end
|
||||||
|
|
||||||
return nreqt
|
return nreqt
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -300,6 +305,8 @@ local function shouldredirect(reqt, code, headers)
|
|||||||
if not location then return false end
|
if not location then return false end
|
||||||
location = string.gsub(location, "%s", "")
|
location = string.gsub(location, "%s", "")
|
||||||
if location == "" then return false end
|
if location == "" then return false end
|
||||||
|
-- the RFC says the redirect URL may be relative
|
||||||
|
location = url.absolute(reqt.url, location)
|
||||||
local scheme = url.parse(location).scheme
|
local scheme = url.parse(location).scheme
|
||||||
if scheme and (not SCHEMES[scheme]) then return false end
|
if scheme and (not SCHEMES[scheme]) then return false end
|
||||||
-- avoid https downgrades
|
-- avoid https downgrades
|
||||||
@@ -323,8 +330,7 @@ end
|
|||||||
local trequest, tredirect
|
local trequest, tredirect
|
||||||
|
|
||||||
--[[local]] function tredirect(reqt, location)
|
--[[local]] function tredirect(reqt, location)
|
||||||
-- the RFC says the redirect URL has to be absolute, but some
|
-- the RFC says the redirect URL may be relative
|
||||||
-- servers do not respect that
|
|
||||||
local newurl = url.absolute(reqt.url, location)
|
local newurl = url.absolute(reqt.url, location)
|
||||||
-- if switching schemes, reset port and create function
|
-- if switching schemes, reset port and create function
|
||||||
if url.parse(newurl).scheme ~= reqt.scheme then
|
if url.parse(newurl).scheme ~= reqt.scheme then
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -167,8 +167,8 @@ const unsigned char http_lua[] =
|
|||||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x28, 0x6e, 0x61,
|
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x28, 0x6e, 0x61,
|
||||||
0x6d, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e,
|
0x6d, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e,
|
||||||
0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x69, 0x6c, 0x2c, 0x20, 0x22, 0x6d, 0x61, 0x6c, 0x66,
|
0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x69, 0x6c, 0x2c, 0x20, 0x22, 0x6d, 0x61, 0x6c, 0x66,
|
||||||
0x6f, 0x72, 0x6d, 0x65, 0x64, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x20, 0x68, 0x65, 0x61, 0x64,
|
0x6f, 0x72, 0x6d, 0x65, 0x64, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x20, 0x68, 0x65, 0x61,
|
||||||
0x65, 0x72, 0x73, 0x22, 0x20, 0x65, 0x6e, 0x64, 0x0a,
|
0x64, 0x65, 0x72, 0x73, 0x22, 0x20, 0x65, 0x6e, 0x64, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x73, 0x74, 0x72,
|
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x73, 0x74, 0x72,
|
||||||
0x69, 0x6e, 0x67, 0x2e, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a,
|
0x69, 0x6e, 0x67, 0x2e, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x67, 0x65, 0x74, 0x20, 0x6e, 0x65, 0x78,
|
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x67, 0x65, 0x74, 0x20, 0x6e, 0x65, 0x78,
|
||||||
@@ -186,8 +186,9 @@ const unsigned char http_lua[] =
|
|||||||
0x22, 0x29, 0x20, 0x64, 0x6f, 0x0a,
|
0x22, 0x29, 0x20, 0x64, 0x6f, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20,
|
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20,
|
||||||
0x3d, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x2e, 0x2e, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x0a,
|
0x3d, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x2e, 0x2e, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x3d,
|
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x2c, 0x20,
|
||||||
0x20, 0x73, 0x6f, 0x63, 0x6b, 0x3a, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x28, 0x29, 0x0a,
|
0x65, 0x72, 0x72, 0x20, 0x3d, 0x20, 0x73, 0x6f, 0x63, 0x6b, 0x3a, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65,
|
||||||
|
0x28, 0x29, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x65, 0x72, 0x72,
|
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x65, 0x72, 0x72,
|
||||||
0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x69, 0x6c, 0x2c, 0x20,
|
0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x69, 0x6c, 0x2c, 0x20,
|
||||||
0x65, 0x72, 0x72, 0x20, 0x65, 0x6e, 0x64, 0x0a,
|
0x65, 0x72, 0x72, 0x20, 0x65, 0x6e, 0x64, 0x0a,
|
||||||
@@ -235,7 +236,7 @@ const unsigned char http_lua[] =
|
|||||||
0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x0a,
|
0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x67, 0x65, 0x74,
|
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x67, 0x65, 0x74,
|
||||||
0x20, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x20, 0x73, 0x69, 0x7a, 0x65, 0x2c, 0x20, 0x73, 0x6b, 0x69, 0x70, 0x20,
|
0x20, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x20, 0x73, 0x69, 0x7a, 0x65, 0x2c, 0x20, 0x73, 0x6b, 0x69, 0x70, 0x20,
|
||||||
0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x0a,
|
0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20,
|
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20,
|
||||||
0x6c, 0x69, 0x6e, 0x65, 0x2c, 0x20, 0x65, 0x72, 0x72, 0x20, 0x3d, 0x20, 0x73, 0x6f, 0x63, 0x6b, 0x3a, 0x72,
|
0x6c, 0x69, 0x6e, 0x65, 0x2c, 0x20, 0x65, 0x72, 0x72, 0x20, 0x3d, 0x20, 0x73, 0x6f, 0x63, 0x6b, 0x3a, 0x72,
|
||||||
0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x28, 0x29, 0x0a,
|
0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x28, 0x29, 0x0a,
|
||||||
@@ -570,12 +571,20 @@ const unsigned char http_lua[] =
|
|||||||
0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
|
0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x75, 0x72,
|
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x75, 0x72,
|
||||||
0x6c, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x28, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x29, 0x0a,
|
0x6c, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x28, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x29, 0x0a,
|
||||||
|
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x70, 0x6f, 0x72, 0x74,
|
||||||
|
0x20, 0x3d, 0x20, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x33,
|
||||||
|
0x31, 0x32, 0x38, 0x0a,
|
||||||
|
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x63, 0x72, 0x65, 0x61,
|
||||||
|
0x74, 0x65, 0x20, 0x3d, 0x20, 0x53, 0x43, 0x48, 0x45, 0x4d, 0x45, 0x53, 0x5b, 0x70, 0x72, 0x6f, 0x78, 0x79,
|
||||||
|
0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x5d, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x28, 0x72, 0x65,
|
||||||
|
0x71, 0x74, 0x29, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x70, 0x72, 0x6f,
|
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x70, 0x72, 0x6f,
|
||||||
0x78, 0x79, 0x2e, 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x70, 0x6f, 0x72,
|
0x78, 0x79, 0x2e, 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x70, 0x6f, 0x72,
|
||||||
0x74, 0x20, 0x6f, 0x72, 0x20, 0x33, 0x31, 0x32, 0x38, 0x0a,
|
0x74, 0x2c, 0x20, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a,
|
0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x65, 0x71,
|
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x65, 0x71,
|
||||||
0x74, 0x2e, 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x72, 0x65, 0x71, 0x74, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x0a,
|
0x74, 0x2e, 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x72, 0x65, 0x71, 0x74, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x2c,
|
||||||
|
0x20, 0x72, 0x65, 0x71, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a,
|
0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a,
|
||||||
0x65, 0x6e, 0x64, 0x0a,
|
0x65, 0x6e, 0x64, 0x0a,
|
||||||
0x0a,
|
0x0a,
|
||||||
@@ -710,7 +719,7 @@ const unsigned char http_lua[] =
|
|||||||
0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a,
|
0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x20, 0x75, 0x72, 0x69,
|
0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x20, 0x75, 0x72, 0x69,
|
||||||
0x20, 0x69, 0x66, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x68, 0x61, 0x73, 0x6e, 0x27, 0x74, 0x20, 0x6f, 0x76,
|
0x20, 0x69, 0x66, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x68, 0x61, 0x73, 0x6e, 0x27, 0x74, 0x20, 0x6f, 0x76,
|
||||||
0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x6e, 0x0a,
|
0x65, 0x72, 0x72, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x6e, 0x72, 0x65, 0x71, 0x74, 0x2e, 0x75, 0x72, 0x69, 0x20, 0x3d, 0x20, 0x72, 0x65,
|
0x20, 0x20, 0x20, 0x20, 0x6e, 0x72, 0x65, 0x71, 0x74, 0x2e, 0x75, 0x72, 0x69, 0x20, 0x3d, 0x20, 0x72, 0x65,
|
||||||
0x71, 0x74, 0x2e, 0x75, 0x72, 0x69, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x75, 0x72,
|
0x71, 0x74, 0x2e, 0x75, 0x72, 0x69, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x75, 0x72,
|
||||||
0x69, 0x28, 0x6e, 0x72, 0x65, 0x71, 0x74, 0x29, 0x0a,
|
0x69, 0x28, 0x6e, 0x72, 0x65, 0x71, 0x74, 0x29, 0x0a,
|
||||||
@@ -736,9 +745,17 @@ const unsigned char http_lua[] =
|
|||||||
0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x61, 0x6a, 0x75, 0x73, 0x74, 0x20, 0x68, 0x6f, 0x73, 0x74, 0x20,
|
0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x61, 0x6a, 0x75, 0x73, 0x74, 0x20, 0x68, 0x6f, 0x73, 0x74, 0x20,
|
||||||
0x61, 0x6e, 0x64, 0x20, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20,
|
0x61, 0x6e, 0x64, 0x20, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20,
|
||||||
0x69, 0x73, 0x20, 0x61, 0x20, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x0a,
|
0x69, 0x73, 0x20, 0x61, 0x20, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x0a,
|
||||||
|
0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x63, 0x72,
|
||||||
|
0x65, 0x61, 0x74, 0x65, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x6e, 0x72, 0x65, 0x71, 0x74, 0x2e, 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x6e, 0x72,
|
0x20, 0x20, 0x20, 0x20, 0x6e, 0x72, 0x65, 0x71, 0x74, 0x2e, 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x6e, 0x72,
|
||||||
0x65, 0x71, 0x74, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x3d, 0x20, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x70,
|
0x65, 0x71, 0x74, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x2c, 0x20, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x63, 0x72,
|
||||||
0x72, 0x6f, 0x78, 0x79, 0x28, 0x6e, 0x72, 0x65, 0x71, 0x74, 0x29, 0x0a,
|
0x65, 0x61, 0x74, 0x65, 0x20, 0x3d, 0x20, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x78, 0x79,
|
||||||
|
0x28, 0x6e, 0x72, 0x65, 0x71, 0x74, 0x29, 0x0a,
|
||||||
|
0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x71, 0x74, 0x2e, 0x63, 0x72,
|
||||||
|
0x65, 0x61, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x6e, 0x72, 0x65, 0x71, 0x74, 0x2e, 0x63, 0x72,
|
||||||
|
0x65, 0x61, 0x74, 0x65, 0x20, 0x3d, 0x20, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74,
|
||||||
|
0x65, 0x20, 0x65, 0x6e, 0x64, 0x0a,
|
||||||
|
0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x72, 0x65, 0x71, 0x74, 0x0a,
|
0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x72, 0x65, 0x71, 0x74, 0x0a,
|
||||||
0x65, 0x6e, 0x64, 0x0a,
|
0x65, 0x6e, 0x64, 0x0a,
|
||||||
0x0a,
|
0x0a,
|
||||||
@@ -757,6 +774,12 @@ const unsigned char http_lua[] =
|
|||||||
0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x3d,
|
0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x3d,
|
||||||
0x20, 0x22, 0x22, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x61,
|
0x20, 0x22, 0x22, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x61,
|
||||||
0x6c, 0x73, 0x65, 0x20, 0x65, 0x6e, 0x64, 0x0a,
|
0x6c, 0x73, 0x65, 0x20, 0x65, 0x6e, 0x64, 0x0a,
|
||||||
|
0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x52, 0x46, 0x43, 0x20, 0x73, 0x61, 0x79,
|
||||||
|
0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x20, 0x55, 0x52, 0x4c,
|
||||||
|
0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x0a,
|
||||||
|
0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x75, 0x72, 0x6c,
|
||||||
|
0x2e, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x28, 0x72, 0x65, 0x71, 0x74, 0x2e, 0x75, 0x72, 0x6c,
|
||||||
|
0x2c, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x29, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x20, 0x3d,
|
0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x20, 0x3d,
|
||||||
0x20, 0x75, 0x72, 0x6c, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x28, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f,
|
0x20, 0x75, 0x72, 0x6c, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x28, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f,
|
||||||
0x6e, 0x29, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x0a,
|
0x6e, 0x29, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x0a,
|
||||||
@@ -820,10 +843,7 @@ const unsigned char http_lua[] =
|
|||||||
0x20, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x29, 0x0a,
|
0x20, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x29, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x52, 0x46, 0x43, 0x20, 0x73, 0x61, 0x79,
|
0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x52, 0x46, 0x43, 0x20, 0x73, 0x61, 0x79,
|
||||||
0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x20, 0x55, 0x52, 0x4c,
|
0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x20, 0x55, 0x52, 0x4c,
|
||||||
0x20, 0x68, 0x61, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74,
|
0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x0a,
|
||||||
0x65, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x0a,
|
|
||||||
0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x20, 0x64, 0x6f, 0x20,
|
|
||||||
0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x73, 0x70, 0x65, 0x63, 0x74, 0x20, 0x74, 0x68, 0x61, 0x74, 0x0a,
|
|
||||||
0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6e, 0x65, 0x77, 0x75, 0x72, 0x6c, 0x20, 0x3d,
|
0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6e, 0x65, 0x77, 0x75, 0x72, 0x6c, 0x20, 0x3d,
|
||||||
0x20, 0x75, 0x72, 0x6c, 0x2e, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x28, 0x72, 0x65, 0x71, 0x74,
|
0x20, 0x75, 0x72, 0x6c, 0x2e, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x28, 0x72, 0x65, 0x71, 0x74,
|
||||||
0x2e, 0x75, 0x72, 0x6c, 0x2c, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x29, 0x0a,
|
0x2e, 0x75, 0x72, 0x6c, 0x2c, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x29, 0x0a,
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ int inet_meth_getsockname(lua_State *L, p_socket ps, int family)
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
lua_pushstring(L, name);
|
lua_pushstring(L, name);
|
||||||
lua_pushstring(L, port);
|
lua_pushinteger(L, (int) strtol(port, (char **) NULL, 10));
|
||||||
switch (family) {
|
switch (family) {
|
||||||
case AF_INET: lua_pushliteral(L, "inet"); break;
|
case AF_INET: lua_pushliteral(L, "inet"); break;
|
||||||
case AF_INET6: lua_pushliteral(L, "inet6"); break;
|
case AF_INET6: lua_pushliteral(L, "inet6"); break;
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
/*-------------------------------------------------------------------------* \
|
/*-------------------------------------------------------------------------* \
|
||||||
* Current socket library version
|
* Current socket library version
|
||||||
\*-------------------------------------------------------------------------*/
|
\*-------------------------------------------------------------------------*/
|
||||||
#define LUASOCKET_VERSION "LuaSocket 3.0.0"
|
#define LUASOCKET_VERSION "LuaSocket 3.1.0"
|
||||||
#define LUASOCKET_COPYRIGHT "Copyright (C) 1999-2013 Diego Nehab"
|
#define LUASOCKET_COPYRIGHT "Copyright (C) 1999-2013 Diego Nehab"
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------*\
|
/*-------------------------------------------------------------------------*\
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# luasocket src/makefile
|
# luasocket src/makefile
|
||||||
#
|
#
|
||||||
# Definitions in this section can be overriden on the command line or in the
|
# Definitions in this section can be overridden on the command line or in the
|
||||||
# environment.
|
# environment.
|
||||||
#
|
#
|
||||||
# These are equivalent:
|
# These are equivalent:
|
||||||
@@ -272,7 +272,7 @@ SOCKET_win64=wsocket.obj
|
|||||||
#
|
#
|
||||||
SO=$(SO_$(PLAT))
|
SO=$(SO_$(PLAT))
|
||||||
O=$(O_$(PLAT))
|
O=$(O_$(PLAT))
|
||||||
SOCKET_V=3.0.0
|
SOCKET_V=3.1.0
|
||||||
MIME_V=1.0.3
|
MIME_V=1.0.3
|
||||||
SOCKET_SO=socket-$(SOCKET_V).$(SO)
|
SOCKET_SO=socket-$(SOCKET_V).$(SO)
|
||||||
MIME_SO=mime-$(MIME_V).$(SO)
|
MIME_SO=mime-$(MIME_V).$(SO)
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -54,6 +54,33 @@ int opt_meth_getoption(lua_State *L, p_opt opt, p_socket ps)
|
|||||||
return opt->func(L, ps);
|
return opt->func(L, ps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------*/
|
||||||
|
/* binds socket to network interface */
|
||||||
|
int opt_set_bindtodevice(lua_State *L, p_socket ps)
|
||||||
|
{
|
||||||
|
#ifndef SO_BINDTODEVICE
|
||||||
|
return luaL_error(L, "SO_BINDTODEVICE is not supported on this operating system");
|
||||||
|
#else
|
||||||
|
const char *dev = luaL_checkstring(L, 3);
|
||||||
|
return opt_set(L, ps, SOL_SOCKET, SO_BINDTODEVICE, (char*)dev, strlen(dev)+1);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int opt_get_bindtodevice(lua_State *L, p_socket ps)
|
||||||
|
{
|
||||||
|
#ifndef SO_BINDTODEVICE
|
||||||
|
return luaL_error(L, "SO_BINDTODEVICE is not supported on this operating system");
|
||||||
|
#else
|
||||||
|
char dev[IFNAMSIZ];
|
||||||
|
int len = sizeof(dev);
|
||||||
|
int err = opt_get(L, ps, SOL_SOCKET, SO_BINDTODEVICE, &dev, &len);
|
||||||
|
if (err)
|
||||||
|
return err;
|
||||||
|
lua_pushstring(L, dev);
|
||||||
|
return 1;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/*------------------------------------------------------*/
|
/*------------------------------------------------------*/
|
||||||
/* enables reuse of local address */
|
/* enables reuse of local address */
|
||||||
int opt_set_reuseaddr(lua_State *L, p_socket ps)
|
int opt_set_reuseaddr(lua_State *L, p_socket ps)
|
||||||
@@ -190,7 +217,7 @@ int opt_set_send_buf_size(lua_State *L, p_socket ps)
|
|||||||
return opt_setint(L, ps, SOL_SOCKET, SO_SNDBUF);
|
return opt_setint(L, ps, SOL_SOCKET, SO_SNDBUF);
|
||||||
}
|
}
|
||||||
|
|
||||||
// /*------------------------------------------------------*/
|
/*------------------------------------------------------*/
|
||||||
|
|
||||||
#ifdef TCP_FASTOPEN
|
#ifdef TCP_FASTOPEN
|
||||||
int opt_set_tcp_fastopen(lua_State *L, p_socket ps)
|
int opt_set_tcp_fastopen(lua_State *L, p_socket ps)
|
||||||
|
|||||||
@@ -53,6 +53,9 @@ int opt_get_tcp_keepintvl(lua_State *L, p_socket ps);
|
|||||||
int opt_set_tcp_defer_accept(lua_State *L, p_socket ps);
|
int opt_set_tcp_defer_accept(lua_State *L, p_socket ps);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int opt_set_bindtodevice(lua_State *L, p_socket ps);
|
||||||
|
int opt_get_bindtodevice(lua_State *L, p_socket ps);
|
||||||
|
|
||||||
int opt_set_keepalive(lua_State *L, p_socket ps);
|
int opt_set_keepalive(lua_State *L, p_socket ps);
|
||||||
int opt_get_keepalive(lua_State *L, p_socket ps);
|
int opt_get_keepalive(lua_State *L, p_socket ps);
|
||||||
|
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ local function adjust_headers(mesgt)
|
|||||||
lower["date"] = lower["date"] or
|
lower["date"] = lower["date"] or
|
||||||
os.date("!%a, %d %b %Y %H:%M:%S ") .. (mesgt.zone or _M.ZONE)
|
os.date("!%a, %d %b %Y %H:%M:%S ") .. (mesgt.zone or _M.ZONE)
|
||||||
lower["x-mailer"] = lower["x-mailer"] or socket._VERSION
|
lower["x-mailer"] = lower["x-mailer"] or socket._VERSION
|
||||||
-- this can't be overriden
|
-- this can't be overridden
|
||||||
lower["mime-version"] = "1.0"
|
lower["mime-version"] = "1.0"
|
||||||
return lower
|
return lower
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -543,7 +543,7 @@ const unsigned char smtp_lua[] =
|
|||||||
0x6c, 0x65, 0x72, 0x22, 0x5d, 0x20, 0x6f, 0x72, 0x20, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x5f, 0x56,
|
0x6c, 0x65, 0x72, 0x22, 0x5d, 0x20, 0x6f, 0x72, 0x20, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x5f, 0x56,
|
||||||
0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x0a,
|
0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x27, 0x74, 0x20,
|
0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x27, 0x74, 0x20,
|
||||||
0x62, 0x65, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x6e, 0x0a,
|
0x62, 0x65, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x5b, 0x22, 0x6d, 0x69, 0x6d, 0x65, 0x2d, 0x76, 0x65,
|
0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x5b, 0x22, 0x6d, 0x69, 0x6d, 0x65, 0x2d, 0x76, 0x65,
|
||||||
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5d, 0x20, 0x3d, 0x20, 0x22, 0x31, 0x2e, 0x30, 0x22, 0x0a,
|
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5d, 0x20, 0x3d, 0x20, 0x22, 0x31, 0x2e, 0x30, 0x22, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x0a,
|
0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x0a,
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ static luaL_Reg tcp_methods[] = {
|
|||||||
|
|
||||||
/* socket option handlers */
|
/* socket option handlers */
|
||||||
static t_opt optget[] = {
|
static t_opt optget[] = {
|
||||||
|
{"bindtodevice", opt_get_bindtodevice},
|
||||||
{"keepalive", opt_get_keepalive},
|
{"keepalive", opt_get_keepalive},
|
||||||
{"reuseaddr", opt_get_reuseaddr},
|
{"reuseaddr", opt_get_reuseaddr},
|
||||||
{"reuseport", opt_get_reuseport},
|
{"reuseport", opt_get_reuseport},
|
||||||
@@ -92,6 +93,7 @@ static t_opt optget[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static t_opt optset[] = {
|
static t_opt optset[] = {
|
||||||
|
{"bindtodevice", opt_set_bindtodevice},
|
||||||
{"keepalive", opt_set_keepalive},
|
{"keepalive", opt_set_keepalive},
|
||||||
{"reuseaddr", opt_set_reuseaddr},
|
{"reuseaddr", opt_set_reuseaddr},
|
||||||
{"reuseport", opt_set_reuseport},
|
{"reuseport", opt_set_reuseport},
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ function _M.parse(url, default)
|
|||||||
url = string.gsub(url, "^([%w][%w%+%-%.]*)%:",
|
url = string.gsub(url, "^([%w][%w%+%-%.]*)%:",
|
||||||
function(s) parsed.scheme = s; return "" end)
|
function(s) parsed.scheme = s; return "" end)
|
||||||
-- get authority
|
-- get authority
|
||||||
url = string.gsub(url, "^//([^/]*)", function(n)
|
url = string.gsub(url, "^//([^/%?#]*)", function(n)
|
||||||
parsed.authority = n
|
parsed.authority = n
|
||||||
return ""
|
return ""
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -402,8 +402,9 @@ const unsigned char url_lua[] =
|
|||||||
0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x67, 0x65, 0x74, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
|
0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x67, 0x65, 0x74, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
|
||||||
0x74, 0x79, 0x0a,
|
0x74, 0x79, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x75, 0x72, 0x6c, 0x20, 0x3d, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67,
|
0x20, 0x20, 0x20, 0x20, 0x75, 0x72, 0x6c, 0x20, 0x3d, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67,
|
||||||
0x73, 0x75, 0x62, 0x28, 0x75, 0x72, 0x6c, 0x2c, 0x20, 0x22, 0x5e, 0x2f, 0x2f, 0x28, 0x5b, 0x5e, 0x2f, 0x5d,
|
0x73, 0x75, 0x62, 0x28, 0x75, 0x72, 0x6c, 0x2c, 0x20, 0x22, 0x5e, 0x2f, 0x2f, 0x28, 0x5b, 0x5e, 0x2f, 0x25,
|
||||||
0x2a, 0x29, 0x22, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x0a,
|
0x3f, 0x23, 0x5d, 0x2a, 0x29, 0x22, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e,
|
||||||
|
0x29, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x64, 0x2e, 0x61, 0x75, 0x74,
|
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x64, 0x2e, 0x61, 0x75, 0x74,
|
||||||
0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x3d, 0x20, 0x6e, 0x0a,
|
0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x3d, 0x20, 0x6e, 0x0a,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x22, 0x22, 0x0a,
|
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x22, 0x22, 0x0a,
|
||||||
|
|||||||
@@ -262,6 +262,7 @@ int socket_recv(p_socket ps, char *data, size_t count, size_t *got,
|
|||||||
if (err != WSAEWOULDBLOCK) {
|
if (err != WSAEWOULDBLOCK) {
|
||||||
if (err != WSAECONNRESET || prev == WSAECONNRESET) return err;
|
if (err != WSAECONNRESET || prev == WSAECONNRESET) return err;
|
||||||
prev = err;
|
prev = err;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;
|
if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;
|
||||||
}
|
}
|
||||||
@@ -291,6 +292,7 @@ int socket_recvfrom(p_socket ps, char *data, size_t count, size_t *got,
|
|||||||
if (err != WSAEWOULDBLOCK) {
|
if (err != WSAEWOULDBLOCK) {
|
||||||
if (err != WSAECONNRESET || prev == WSAECONNRESET) return err;
|
if (err != WSAECONNRESET || prev == WSAECONNRESET) return err;
|
||||||
prev = err;
|
prev = err;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;
|
if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+3
-3
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -150,11 +150,11 @@ enum DoneAction
|
|||||||
static void print_usage()
|
static void print_usage()
|
||||||
{
|
{
|
||||||
// when editing this message, change it at boot.lua too
|
// when editing this message, change it at boot.lua too
|
||||||
printf("LÖVE is an *awesome* framework you can use to make 2D games in Lua\n"
|
printf("LOVE is an *awesome* framework you can use to make 2D games in Lua\n"
|
||||||
"https://love2d.org\n"
|
"https://love2d.org\n"
|
||||||
"\n"
|
"\n"
|
||||||
"usage:\n"
|
"usage:\n"
|
||||||
" love --version prints LÖVE version and quits\n"
|
" love --version prints LOVE version and quits\n"
|
||||||
" love --help prints this message and quits\n"
|
" love --help prints this message and quits\n"
|
||||||
" love path/to/gamedir runs the game from the given directory which contains a main.lua file\n"
|
" love path/to/gamedir runs the game from the given directory which contains a main.lua file\n"
|
||||||
" love path/to/packagedgame.love runs the packaged game from the provided .love file\n"
|
" love path/to/packagedgame.love runs the packaged game from the provided .love file\n"
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -68,6 +68,10 @@ void showRecordingPermissionMissingDialog()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Audio::Audio(const char *name)
|
||||||
|
: Module(M_AUDIO, name)
|
||||||
|
{}
|
||||||
|
|
||||||
bool Audio::setMixWithSystem(bool mix)
|
bool Audio::setMixWithSystem(bool mix)
|
||||||
{
|
{
|
||||||
#ifdef LOVE_IOS
|
#ifdef LOVE_IOS
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -101,9 +101,6 @@ public:
|
|||||||
|
|
||||||
virtual ~Audio() {}
|
virtual ~Audio() {}
|
||||||
|
|
||||||
// Implements Module.
|
|
||||||
virtual ModuleType getModuleType() const { return M_AUDIO; }
|
|
||||||
|
|
||||||
virtual Source *newSource(love::sound::Decoder *decoder) = 0;
|
virtual Source *newSource(love::sound::Decoder *decoder) = 0;
|
||||||
virtual Source *newSource(love::sound::SoundData *soundData) = 0;
|
virtual Source *newSource(love::sound::SoundData *soundData) = 0;
|
||||||
virtual Source *newSource(int sampleRate, int bitDepth, int channels, int buffers) = 0;
|
virtual Source *newSource(int sampleRate, int bitDepth, int channels, int buffers) = 0;
|
||||||
@@ -312,6 +309,10 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void setPlaybackDevice(const char *name);
|
virtual void setPlaybackDevice(const char *name);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
Audio(const char *name);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
static StringMap<DistanceModel, DISTANCE_MAX_ENUM>::Entry distanceModelEntries[];
|
static StringMap<DistanceModel, DISTANCE_MAX_ENUM>::Entry distanceModelEntries[];
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -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
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -28,7 +28,8 @@ namespace null
|
|||||||
{
|
{
|
||||||
|
|
||||||
Audio::Audio()
|
Audio::Audio()
|
||||||
: distanceModel(DISTANCE_NONE)
|
: love::audio::Audio("love.audio.null")
|
||||||
|
, distanceModel(DISTANCE_NONE)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,11 +37,6 @@ Audio::~Audio()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *Audio::getName() const
|
|
||||||
{
|
|
||||||
return "love.audio.null";
|
|
||||||
}
|
|
||||||
|
|
||||||
love::audio::Source *Audio::newSource(love::sound::Decoder *)
|
love::audio::Source *Audio::newSource(love::sound::Decoder *)
|
||||||
{
|
{
|
||||||
return new Source();
|
return new Source();
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user