|
|
@ -555,12 +555,28 @@ Rush Hour database from Michael Fogleman.\n\n") |
|
|
|
;; Scale the render to fit the window |
|
|
|
(SDL_RenderSetLogicalSize renderer g-window-width g-window-height) |
|
|
|
|
|
|
|
(scope ;; Show loading screen |
|
|
|
(var loading-texture (* SDL_Texture) (sdl-texture-from-bmp (in-data-dir "Loading.bmp") |
|
|
|
renderer)) |
|
|
|
(unless loading-texture (return 1)) |
|
|
|
(SDL_RenderClear renderer) |
|
|
|
(var loading-width int (* 2 200)) ;; Scale it up a bit |
|
|
|
(var loading-height int (* 2 80)) |
|
|
|
(var loading-rect SDL_Rect (array (/ (- g-window-width loading-width) 2) |
|
|
|
(/ (- g-window-height loading-height) 2) |
|
|
|
loading-width loading-height)) |
|
|
|
(unless (= 0 (SDL_RenderCopy renderer loading-texture null (addr loading-rect))) |
|
|
|
(sdl-print-error) |
|
|
|
(return 1)) |
|
|
|
(SDL_RenderPresent renderer) |
|
|
|
(SDL_DestroyTexture loading-texture)) |
|
|
|
|
|
|
|
(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 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 |
|
|
@ -795,6 +811,15 @@ 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 pieces-texture) |
|
|
|
(set pieces-texture null) |
|
|
|
(SDL_DestroyTexture win-texture) |
|
|
|
(set win-texture null) |
|
|
|
|
|
|
|
(SDL_DestroyRenderer renderer) |
|
|
|
|
|
|
|
(sdl-shutdown window) |
|
|
|
(return 0)) |
|
|
|
|
|
|
|