Browse Source

Texture changes, added night mode

master
Macoy Madson 2 years ago
parent
commit
562a920517
  1. BIN
      assets/Board.xcf
  2. BIN
      assets/Board_Night.xcf
  3. BIN
      assets/Grid.xcf
  4. BIN
      assets/Loading.xcf
  5. BIN
      assets/Win.xcf
  6. BIN
      data/Board.bmp
  7. BIN
      data/Board_Night.bmp
  8. BIN
      data/Grid.bmp
  9. 19
      src/Main.cake

BIN
assets/Board.xcf

Binary file not shown.

BIN
assets/Board_Night.xcf

Binary file not shown.

BIN
assets/Grid.xcf

Binary file not shown.

BIN
assets/Loading.xcf

Binary file not shown.

BIN
assets/Win.xcf

Binary file not shown.

BIN
data/Board.bmp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

BIN
data/Board_Night.bmp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

BIN
data/Grid.bmp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 54 KiB

19
src/Main.cake

@ -574,9 +574,12 @@ Rush Hour database from Michael Fogleman.\n\n")
(var background-texture (* SDL_Texture) (sdl-texture-from-bmp (in-data-dir "Board.bmp")
renderer))
(unless background-texture (return 1))
;; (var grid-texture (* SDL_Texture) (sdl-texture-from-bmp (in-data-dir "Grid.bmp")
;; renderer))
;; (unless grid-texture (return 1))
(var background-night-texture (* SDL_Texture) (sdl-texture-from-bmp (in-data-dir "Board_Night.bmp")
renderer))
(unless background-night-texture (return 1))
(var grid-texture (* SDL_Texture) (sdl-texture-from-bmp (in-data-dir "Grid.bmp")
renderer))
(unless grid-texture (return 1))
(var pieces-texture (* SDL_Texture)
(sdl-texture-from-bmp-color-to-transparent
@ -627,8 +630,10 @@ Rush Hour database from Michael Fogleman.\n\n")
(var counter-num-ticks-per-second (const Uint64) (SDL_GetPerformanceFrequency))
(var last-frame-perf-count Uint64 (* 0.016f counter-num-ticks-per-second))
(var is-day-mode bool false)
(var selected-piece (* board-piece) null)
(var selection-start-position vec2 (array 0))
(var exit-reason (* (const char)) null)
(while (not exit-reason)
(var event SDL_Event)
@ -719,7 +724,8 @@ Rush Hour database from Michael Fogleman.\n\n")
(SDL_RenderClear renderer)
(unless (= 0 (SDL_RenderCopy renderer background-texture null null))
(unless (= 0 (SDL_RenderCopy renderer (? is-day-mode background-texture background-night-texture)
null null))
(sdl-print-error)
(set exit-reason "Render error"))
@ -737,6 +743,7 @@ Rush Hour database from Michael Fogleman.\n\n")
;; 166 166))
;; (SDL_RenderCopy renderer pieces-texture (addr src-rect) (addr dest-rect)))
;; (when (not is-day-mode) ;; Draw grid
(ignore ;; Draw grid
(var row int 0)
(while (< row g-game-board-grid-size)
@ -811,8 +818,8 @@ Rush Hour database from Michael Fogleman.\n\n")
(SDL_DestroyTexture background-texture)
(set background-texture null)
;; (SDL_DestroyTexture grid-texture)
;; (set grid-texture null)
(SDL_DestroyTexture grid-texture)
(set grid-texture null)
(SDL_DestroyTexture pieces-texture)
(set pieces-texture null)
(SDL_DestroyTexture win-texture)

Loading…
Cancel
Save