|
|
@ -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) |
|
|
|