Skip to content

Commit

Permalink
more manageable CI
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimbbp committed Mar 11, 2024
1 parent bb4ebe9 commit d72d4b4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Binary file modified .DS_Store
Binary file not shown.
11 changes: 9 additions & 2 deletions src/main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func main() {

switch mode {
case "database":
fmt.Printf("Creating database")
fmt.Println("Creating database")
util.TimeIt(
"database creation",
sprite.Database,
Expand All @@ -33,15 +33,21 @@ func main() {
util.PrintColorDatabase("/Users/joachimpfefferkorn/Documents/GitHub/spritefire/ignore/database/sprite_color_db")

case "resize":
fmt.Printf("Resizing Sprites")
spriteResIndices := []int{5} //hard coded at just 5 for CI for no
fmt.Println("Resizing Sprites to resolutions:")
for _, index := range spriteResIndices {
fmt.Println(util.SpriteSizes[index])
}
util.TimeIt(
"resizing",
sprite.Resize,
util.SpriteInput,
util.SpriteSizes,
spriteResIndices,
)

case "video":
fmt.Println("Generating Video")
util.TimeIt(
"Generating Video",
video.Sequence,
Expand All @@ -50,6 +56,7 @@ func main() {
5, //set this to choose the desired resolution. Hard coded at 5 for CI for now
)
case "batchRes":
fmt.Println("Generating video for multiple resolutions")
batchResIndices := []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
util.TimeIt(
"Generating video for multiple resolutions",
Expand Down
6 changes: 4 additions & 2 deletions src/sprite/resize.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ import (

//TODO run in parallel with goroutines or (better yet) raylib

func Resize(spriteFolder string, resizedFolder string) {
func Resize(spriteFolder string, resizedFolder string, spriteResIndices []int) {
util.CreateIfNotExist(resizedFolder)

for _, resolution := range util.ResizeResolutions {
for _, index := range spriteResIndices {
resolution := int(util.SpriteSizes[index])

sprites, readDirErr := os.ReadDir(spriteFolder)
if readDirErr != nil {
log.Fatal(readDirErr)
Expand Down

0 comments on commit d72d4b4

Please sign in to comment.