Skip to content

Commit

Permalink
Update to Love 11.3 (with some minor bugfixes) (#2589)
Browse files Browse the repository at this point in the history
* Love 11.3

* Update conf.lua

* Update i18n.lua

* Update application.lua

* commit

* Update Makefile

* Update .travis.yml

* Update conf.lua

* Fix for run

* fix version

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* fix color

* little fixe

* fix color more

* fix more

* fix color again

* fix color...

* fix

* Little fix

* fix

* fix color again

* fix

* fix

* fix

* update

* fix

* update

* Update make.ps1

* More color fixes and minor cleanup

---------

Co-authored-by: liberodark <liberodark@gmail.com>
  • Loading branch information
niamu and liberodark authored Nov 18, 2024
1 parent 3e11f97 commit 031a39d
Show file tree
Hide file tree
Showing 67 changed files with 303 additions and 321 deletions.
48 changes: 25 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
language: python
os: linux
language: generic
os:
- linux
dist: bionic
services:
- xvfb
before_install:
- "export DISPLAY=:99.0"
install:
- sudo apt-get update -y
- sudo apt-get install python-dev libffi-dev libssl-dev -y
- sudo apt-get install python-virtualenv lua5.1 -y
# download Love2D 0.10.1 and the liblove dependency (links are for x64 architecture)
- wget https://github.com/love2d/love/releases/download/0.10.1/liblove0_0.10.1ppa1_amd64.deb
- wget https://github.com/love2d/love/releases/download/0.10.1/love_0.10.1ppa1_amd64.deb
# install Love2D 0.10.1
- sudo apt install libphysfs1 # required dependency
- sudo apt-get install ./liblove0_0.10.1ppa1_amd64.deb
- sudo apt-get install ./love_0.10.1ppa1_amd64.deb
- mkdir -p $TRAVIS_BUILD_DIR/share/love/
env:
global:
- XDG_DATA_HOME="$TRAVIS_BUILD_DIR/share"
script: make deploy
addons:
apt:
packages:
- xvfb
- python-dev
- libffi-dev
- libssl-dev
- python-virtualenv
- lua5.1
- libpulse0
- pulseaudio
- sndiod
- virtualenv
- libsdl2-2.0-0
- alsa
- alsa-tools
artifacts:
paths:
- ./build/hawkthorne-osx.zip
- ./build/hawkthorne-win-x86.zip
- ./build/hawkthorne-win-x86_64.zip
- ./build/hawkthorne.love
env:
global:
- XDG_DATA_HOME="$TRAVIS_BUILD_DIR/share"
script:
- "mkdir -p $TRAVIS_BUILD_DIR/share/love/"
- "xvfb-run make deploy"
66 changes: 31 additions & 35 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@

UNAME := $(shell uname)

LOVE2D_DOWNLOAD_URL = https://github.com/love2d/love/releases/download
LOVE2D_VERSION = 0.10.1

ifeq ($(UNAME), Darwin)
TMXDIR = osx
TMXTAR = tmx2lua.osx.zip
LOVE = bin/love.app/Contents/MacOS/love
else
TMXDIR = linux
LOVE = /usr/bin/love
TMXTAR = tmx2lua.linux.tar.gz
LOVE = bin/love-11.3-x86_64.AppImage
endif

ifeq ($(shell which wget),)
Expand Down Expand Up @@ -41,25 +38,24 @@ src/maps/%.lua: src/maps/%.tmx bin/tmx2lua
# brew update && brew install golang
bin/tmx2lua:
mkdir -p bin
git clone https://github.com/hawkthorne/tmx2lua bin/tmx2lua-git
cd bin/tmx2lua-git; go mod init .git/config
cd bin/tmx2lua-git; go get github.com/kyleconroy/go-tmx/tmx
cd bin/tmx2lua-git; make
mv bin/tmx2lua-git/$(TMXDIR)/tmx2lua bin
rm -rf bin/tmx2lua-git
$(wget) https://github.com/hawkthorne/tmx2lua/releases/download/v1.0.0/$(TMXTAR)
tar -xzvf $(TMXTAR)
rm -f $(TMXTAR)
mv tmx2lua bin

bin/love.app/Contents/MacOS/love:
mkdir -p bin
$(wget) $(LOVE2D_DOWNLOAD_URL)/$(LOVE2D_VERSION)/love-$(LOVE2D_VERSION)-macosx-x64.zip
unzip -q love-$(LOVE2D_VERSION)-macosx-x64.zip
rm -f love-$(LOVE2D_VERSION)-macosx-x64.zip
$(wget) https://github.com/love2d/love/releases/download/11.3/love-11.3-macos.zip
unzip -q love-11.3-macos.zip
rm -f love-11.3-macos.zip
mv love.app bin
cp osx/Info.plist bin/love.app/Contents

/usr/bin/love:
sudo add-apt-repository -y ppa:bartbes/love-stable
sudo apt-get update -y -f
sudo apt-get install -y love
bin/love-11.3-x86_64.AppImage:
mkdir -p bin
$(wget) https://github.com/love2d/love/releases/download/11.3/love-11.3-x86_64.AppImage
mv love-11.3-x86_64.AppImage bin
chmod +x bin/love-11.3-x86_64.AppImage

######################################################
# THE REST OF THESE TARGETS ARE FOR RELEASE AUTOMATION
Expand All @@ -80,23 +76,23 @@ positions: $(patsubst %.png,%.lua,$(wildcard src/positions/*.png))
src/positions/%.lua: psds/positions/%.png
overlay2lua src/positions/config.json $<

win32/love.exe:
$(wget) $(LOVE2D_DOWNLOAD_URL)/$(LOVE2D_VERSION)/love-$(LOVE2D_VERSION)-win32.zip
unzip -q love-$(LOVE2D_VERSION)-win32.zip
mv love-$(LOVE2D_VERSION)-win32 win32
rm -f love-$(LOVE2D_VERSION)-win32.zip
rm win32/changes.txt win32/game.ico win32/license.txt win32/love.ico win32/readme.txt
win64/love.exe:
$(wget) https://github.com/love2d/love/releases/download/11.3/love-11.3-win64.zip
unzip -q love-11.3-win64.zip
mv love-11.3-win64 win64
rm -f love-11.3-win64.zip
rm win64/changes.txt win64/game.ico win64/license.txt win64/love.ico win64/readme.txt

win32/hawkthorne.exe: build/hawkthorne.love win32/love.exe
cat win32/love.exe build/hawkthorne.love > win32/hawkthorne.exe
win64/hawkthorne.exe: build/hawkthorne.love win64/love.exe
cat win64/love.exe build/hawkthorne.love > win64/hawkthorne.exe

build/hawkthorne-win-x86.zip: win32/hawkthorne.exe
build/hawkthorne-win-x86_64.zip: win64/hawkthorne.exe
mkdir -p build
rm -rf hawkthorne
rm -f hawkthorne-win-x86.zip
cp -r win32 hawkthorne
zip --symlinks -q -r hawkthorne-win-x86 hawkthorne -x "*/love.exe"
mv hawkthorne-win-x86.zip build
rm -f hawkthorne-win-x86_64.zip
cp -r win64 hawkthorne
zip --symlinks -q -r hawkthorne-win-x86_64 hawkthorne -x "*/love.exe"
mv hawkthorne-win-x86_64.zip build

OSXAPP=Journey\ to\ the\ Center\ of\ Hawkthorne.app

Expand All @@ -114,12 +110,12 @@ build/hawkthorne-osx.zip: $(OSXAPP)
productionize: venv
venv/bin/python scripts/productionize.py

binaries: build/hawkthorne-osx.zip build/hawkthorne-win-x86.zip
binaries: build/hawkthorne-osx.zip build/hawkthorne-win-x86_64.zip

upload: binaries post.md venv
venv/bin/python scripts/release.py

appcast: venv build/hawkthorne-osx.zip win32/hawkthorne.exe
appcast: venv build/hawkthorne-osx.zip win64/hawkthorne.exe
venv/bin/python scripts/sparkle.py
cat sparkle/appcast.json | python -m json.tool > /dev/null
venv/bin/python scripts/upload.py / sparkle/appcast.json
Expand All @@ -144,7 +140,7 @@ contributors: venv
venv/bin/python scripts/credits.py > src/credits.lua

test: $(LOVE) maps
$(LOVE) src --test
$(LOVE) src - --test

validate: venv lint
venv/bin/python scripts/validate.py src
Expand Down
14 changes: 7 additions & 7 deletions make.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ if($check -eq $false){
}

$webclient = New-Object System.Net.WebClient
$lovedir = "bin\love-0.10.1-win32\"
$check = Test-Path "bin\love-0.10.1-win32\love.exe"
$lovedir = "bin\love-11.3-win64\"
$check = Test-Path "bin\love-11.3-win64\love.exe"

#add love to the path if necessary
$foundlove = $env:Path.Contains($lovedir)
Expand All @@ -27,13 +27,13 @@ if($foundlove -eq $false){

if($check -eq $false){

$filename = (Get-Location).Path + "\bin\love-0.10.1-win32.zip"
$filename = (Get-Location).Path + "\bin\love-11.3-win64.zip"

$check = Test-Path $filename

if($check -eq $false){
Write-Host "Downloading love2d..."
$url = "https://github.com/love2d/love/releases/download/0.10.1/love-0.10.1-win32.zip"
$url = "https://github.com/love2d/love/releases/download/11.3/love-11.3-win64.zip"
try {
$webclient.DownloadFile($url,$filename)
} catch {
Expand Down Expand Up @@ -95,11 +95,11 @@ foreach($fileName in $fileEntries)
if($args[0] -eq "run"){
Write-Host "Running Journey to the Center of Hawkthorne..."
if($args.Length -ne 1){
.\bin\love-0.10.1-win32\love.exe src $args[1..($args.Length-1)]
.\bin\love-11.3-win64\love.exe src $args[1..($args.Length-1)]
}else{
.\bin\love-0.10.1-win32\love.exe src
.\bin\love-11.3-win64\love.exe src
}
}elseif($args[0] -eq "test"){
Write-Host "Testing Journey to the Center of Hawkthorne..."
.\bin\love-0.10.1-win32\love.exe src --test --console
.\bin\love-11.3-win64\love.exe src --test --console
}
4 changes: 2 additions & 2 deletions src/autosave_warning.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ end

function state:draw()

love.graphics.setColor( 255, 255, 255, 255 )
love.graphics.setColor( 1, 1, 1, 1 )
VerticalParticles.draw()

local width = self.background:getWidth()
Expand All @@ -49,7 +49,7 @@ function state:draw()
self.savingAnimation:draw(self.savingImage, x + 10, y + height - 26)
self.savingAnimation:draw(self.savingImage, x + width - 27, y + height - 26)

love.graphics.setColor( 0, 0, 0, 255 )
love.graphics.setColor( 0, 0, 0, 1 )
love.graphics.printf(self.text, x + 10, y + 65, width - 20, "center")

end
Expand Down
18 changes: 9 additions & 9 deletions src/blackjackgame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function state:keypressed(button, player)
betDelta = -((self.currentBet-250)%100) -- subtract out the portion that is not part of the standard increment
end
elseif self.currentBet > 125 then
if self.currentBet%25 == 0 then
if self.currentBet%25 == 0 then
betDelta = -25
else
betDelta = -(self.currentBet%25) -- subtract out the portion that is not part of the standard increment
Expand Down Expand Up @@ -634,9 +634,9 @@ function state:draw()
love.graphics.draw(self.screenshot, camera.x, camera.y, 0,
window.width / love.graphics:getWidth(), window.height / love.graphics:getHeight() )
else
love.graphics.setColor(0, 0, 0, 255)
love.graphics.setColor(0, 0, 0, 1)
love.graphics.rectangle('fill', 0, 0, love.graphics:getDimensions() )
love.graphics.setColor(255, 255, 255, 255)
love.graphics.setColor(1, 1, 1, 1)
end
love.graphics.draw( self.table, self.center_x - ( self.table:getWidth() / 2 ), self.center_y - ( self.table:getHeight() / 2 ))

Expand Down Expand Up @@ -679,14 +679,14 @@ function state:draw()
local co = 0 -- color offset
if not n.active then co = 180 end
if i == self.selection + 1 then
love.graphics.setColor( 255, 255, 255, 255 )
love.graphics.setColor( 1, 1, 1, 1 )
love.graphics.draw( self.options_arrow, x - 5, y + 4 )
co = 255
end
love.graphics.setColor( 255 - co, 255 - co, 255 - co )
love.graphics.setColor( (255 - co) / 255, (255 - co) / 255, (255 - co) / 255 )
love.graphics.print( n.name, x + 3, y + 3, 0, 0.5 )
end
love.graphics.setColor( 255, 255, 255, 255 )
love.graphics.setColor( 1, 1, 1, 1 )

cx = 0 -- chip offset x
for color,count in pairs( cardutils.getChipCounts( self.player.money ) ) do
Expand Down Expand Up @@ -748,7 +748,7 @@ function state:draw()
-- print current bet
love.graphics.print('Bet $ ' .. self.currentBet, 361+camera.x, 141+camera.y, 0, 0.5)

love.graphics.setColor( 255, 255, 255, 255 )
love.graphics.setColor( 1, 1, 1, 1 )

-- Ensure font is reverted
fonts.revert()
Expand All @@ -775,7 +775,7 @@ function state:drawCard( card, suit, flip, x, y, overlay )
darkness = 150
end

love.graphics.setColor( darkness, darkness, darkness )
love.graphics.setColor( darkness/255, darkness/255, darkness/255 )
love.graphics.draw(
self.cardSprite, _card, -- image, quad
x + utils.map( flip, 50, limit, w / 2, 0 ), -- offset for flip
Expand All @@ -785,7 +785,7 @@ function state:drawCard( card, suit, flip, x, y, overlay )
utils.map( flip, 50, limit , 1 + st, 1 ) -- scale height for flip
)

love.graphics.setColor( 255, 255, 255, 255 )
love.graphics.setColor( 1, 1, 1, 1 )
end

return state
6 changes: 3 additions & 3 deletions src/board.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ function Board:draw(x, y)
local halfWidth = math.floor(self.width / 2)
local halfHeight = math.floor(self.height / 2)

love.graphics.setColor( 0, 0, 0, 255 )
love.graphics.setColor( 0, 0, 0, 1 )
love.graphics.rectangle('fill', x - halfWidth, y - halfHeight, width, height)
love.graphics.setColor( 112, 28, 114, 255 )
love.graphics.setColor( 112/255, 28/255, 114/255, 1 )
love.graphics.rectangle('line', x - halfWidth, y - halfHeight, width, height)
love.graphics.setColor( 255, 255, 255, 255 )
love.graphics.setColor( 1, 1, 1, 1 )
love.graphics.draw(corner, x - halfWidth - 3, y - halfHeight - 3)
love.graphics.draw(corner, x - halfWidth - 3, y + halfHeight - 3)
love.graphics.draw(corner, x + halfWidth - 3, y + halfHeight - 3)
Expand Down
6 changes: 3 additions & 3 deletions src/brewing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ function state:draw()
if self.screenshot then
love.graphics.draw( self.screenshot, camera.x, camera.y, 0, window.width / love.graphics:getWidth(), window.height / love.graphics:getHeight() )
else
love.graphics.setColor( 0, 0, 0, 255 )
love.graphics.setColor( 0, 0, 0, 1 )
love.graphics.rectangle( 'fill', 0, 0, love.graphics:getWidth(), love.graphics:getHeight() )
love.graphics.setColor( 255, 255, 255, 255 )
love.graphics.setColor( 1, 1, 1, 1 )
end

self.hud:draw( self.player )
Expand All @@ -243,7 +243,7 @@ function state:draw()
love.graphics.newQuad(0,0,selectionSprite:getWidth(),selectionSprite:getHeight(),selectionSprite:getWidth(),selectionSprite:getHeight()),
firstcell_right, firstcell_top + ((self.selected-1) * 22))

love.graphics.setColor( 255, 255, 255, 255 )
love.graphics.setColor( 1, 1, 1, 1 )
love.graphics.printf(self.player.controls:getKey('JUMP') .. " BREW", 0, 200, width, 'center')
love.graphics.printf(self.player.controls:getKey('START') .. " CANCEL", 0, 213, width, 'center')

Expand Down
5 changes: 3 additions & 2 deletions src/camera.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ function camera:setPosition(x, y)
end

function camera:setScale(sx, sy)
self.scaleX = sx or self.scaleX
self.scaleY = sy or self.scaleY
local scale = math.min(sx, sy)
self.scaleX = scale
self.scaleY = scale
end

return camera
8 changes: 4 additions & 4 deletions src/character.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ function Character:getOverworld()
end

function module.pick(name, costume)
if not love.filesystem.exists("characters/" .. name .. ".json") then
if not love.filesystem.getInfo("characters/" .. name .. ".json") then
error("Unknown character " .. name)
end

if not love.filesystem.exists("images/characters/" .. name .. "/" .. costume .. ".png") then
if not love.filesystem.getInfo("images/characters/" .. name .. "/" .. costume .. ".png") then
error("Unknown costume " .. costume .. " for character " .. name)
end

Expand All @@ -83,7 +83,7 @@ function module.pick(name, costume)
end

function module.load(character)
if not love.filesystem.exists("characters/" .. character .. ".json") then
if not love.filesystem.getInfo("characters/" .. character .. ".json") then
error("Unknown character " .. character)
end

Expand All @@ -101,7 +101,7 @@ function module.current()
local basePath = 'images/characters/' .. _character .. '/base.png'
local characterPath = "characters/" .. _character .. ".json"

if not love.filesystem.exists(characterPath) then
if not love.filesystem.getInfo(characterPath) then
error("Unknown character " .. _character)
end

Expand Down
Loading

0 comments on commit 031a39d

Please sign in to comment.