Skip to content

Commit

Permalink
fix(credit): cast denominator to float
Browse files Browse the repository at this point in the history
  • Loading branch information
florianvazelle committed Jul 30, 2023
1 parent 23bd307 commit 5647c81
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
21 changes: 12 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ GODOT_PLATFORM=linux.x86_64
GODOT_FILENAME=Godot_v${GODOT_VERSION}-${RELEASE_NAME}_${GODOT_PLATFORM}
GODOT_TEMPLATE=Godot_v${GODOT_VERSION}-${RELEASE_NAME}_export_templates.tpz

GAME_NAME=GhostSnap
GAME_VERSION=v0.1.0

#############
# Commands #
#############
Expand Down Expand Up @@ -48,19 +51,19 @@ import_resources:

export_release_linux:
mkdir -p .mkflower/build/linux
.mkflower/bin/${GODOT_FILENAME} --export-release "Linux/X11" --headless .mkflower/build/linux/GhostSnap.x86_64
(cd .mkflower/build/linux && zip GhostSnap-linux-0.1.0.zip -r .)
mv .mkflower/build/linux/GhostSnap-linux-0.1.0.zip .mkflower/build/GhostSnap-linux-0.1.0.zip
.mkflower/bin/${GODOT_FILENAME} --export-release "Linux/X11" --headless .mkflower/build/linux/${GAME_NAME}.x86_64
(cd .mkflower/build/linux && zip ${GAME_NAME}-linux-${GAME_VERSION}.zip -r .)
mv .mkflower/build/linux/${GAME_NAME}-linux-${GAME_VERSION}.zip .mkflower/build/${GAME_NAME}-linux-${GAME_VERSION}.zip

export_release_windows:
mkdir -p .mkflower/build/windows
.mkflower/bin/${GODOT_FILENAME} --export-release "Windows Desktop" --headless .mkflower/build/windows/GhostSnap.exe
(cd .mkflower/build/windows && zip GhostSnap-windows-0.1.0.zip -r .)
mv .mkflower/build/windows/GhostSnap-windows-0.1.0.zip .mkflower/build/GhostSnap-windows-0.1.0.zip
.mkflower/bin/${GODOT_FILENAME} --export-release "Windows Desktop" --headless .mkflower/build/windows/${GAME_NAME}.exe
(cd .mkflower/build/windows && zip ${GAME_NAME}-windows-${GAME_VERSION}.zip -r .)
mv .mkflower/build/windows/${GAME_NAME}-windows-${GAME_VERSION}.zip .mkflower/build/${GAME_NAME}-windows-${GAME_VERSION}.zip

export_release_mac:
mkdir -p .mkflower/build/mac
.mkflower/bin/${GODOT_FILENAME} --export-release "macOS" --headless .mkflower/build/GhostSnap-mac-0.1.0.zip
.mkflower/bin/${GODOT_FILENAME} --export-release "macOS" --headless .mkflower/build/${GAME_NAME}-mac-${GAME_VERSION}.zip

editor:
.mkflower/bin/${GODOT_FILENAME} --editor
Expand All @@ -69,7 +72,7 @@ godot:
.mkflower/bin/${GODOT_FILENAME} $(ARGS)

run_release:
.mkflower/build/GhostSnap.x86_64
.mkflower/build/${GAME_NAME}.x86_64

clean_mkflower:
rm -rf .mkflower
Expand All @@ -89,5 +92,5 @@ clean: clean_mkflower clean_godot clean_plug
build: clean_godot clean_plug install_addons import_resources export_release_linux
run: build run_release

export_release_all: export_release_linux export_release_mac export_release_windows
export_release_all: export_release_linux export_release_mac
ci_build: clean install_godot install_templates install_addons import_resources export_release_all
4 changes: 2 additions & 2 deletions scripts/gui/credit.gd
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func _ready():
var num_image: int = len(CreditManager._textures)

for i in range(0, credit_count):
var j: int = floor(lerp(0, num_image, i / credit_count))
var j: int = roundi(lerp(0, num_image, i / float(credit_count)))

var template: Node
if left:
Expand All @@ -66,7 +66,7 @@ func _ready():
var label: Label = template.get_node("Label")
label.set_text(text)

var texture = CreditManager._textures[j]
var texture: ImageTexture = CreditManager._textures[j]
var tex_rect: TextureRect = template.get_node("TextureRect")
tex_rect.set_texture(texture)

Expand Down

0 comments on commit 5647c81

Please sign in to comment.