From 1cbd6d696fa571748bab5e991c60f8b94ff44957 Mon Sep 17 00:00:00 2001 From: TatriX Date: Fri, 16 Jul 2021 22:51:22 +0200 Subject: [PATCH] Use flat file hierarchy --- 01/tutorial-01.lisp => 01-hello-sdl.lisp | 4 ++-- ...2.lisp => 02-getting-an-image-on-the-screen.lisp | 8 ++++---- ...rial-03.lisp => 03-event-driven-programming.lisp | 8 ++++---- {02 => assets/02}/hello_world.bmp | Bin {03 => assets/03}/exit.bmp | Bin sdl2-tutorial.asd | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-) rename 01/tutorial-01.lisp => 01-hello-sdl.lisp (88%) rename 02/tutorial-02.lisp => 02-getting-an-image-on-the-screen.lisp (80%) rename 03/tutorial-03.lisp => 03-event-driven-programming.lisp (82%) rename {02 => assets/02}/hello_world.bmp (100%) rename {03 => assets/03}/exit.bmp (100%) diff --git a/01/tutorial-01.lisp b/01-hello-sdl.lisp similarity index 88% rename from 01/tutorial-01.lisp rename to 01-hello-sdl.lisp index 2c68adc..2d1a366 100644 --- a/01/tutorial-01.lisp +++ b/01-hello-sdl.lisp @@ -1,8 +1,8 @@ -(defpackage #:sdl2-tutorial-01 +(defpackage #:sdl2-tutorial-01-hello-sdl (:use :cl) (:export :run)) -(in-package :sdl2-tutorial-01) +(in-package :sdl2-tutorial-01-hello-sdl) (defparameter *screen-width* 640) (defparameter *screen-height* 480) diff --git a/02/tutorial-02.lisp b/02-getting-an-image-on-the-screen.lisp similarity index 80% rename from 02/tutorial-02.lisp rename to 02-getting-an-image-on-the-screen.lisp index 6bfe19b..9630171 100644 --- a/02/tutorial-02.lisp +++ b/02-getting-an-image-on-the-screen.lisp @@ -1,8 +1,8 @@ -(defpackage #:sdl2-tutorial-02 +(defpackage #:sdl2-tutorial-02-getting-an-image-on-the-screen (:use :cl) (:export :run)) -(in-package :sdl2-tutorial-02) +(in-package :sdl2-tutorial-02-getting-an-image-on-the-screen) (defparameter *screen-width* 640) (defparameter *screen-height* 480) @@ -10,7 +10,7 @@ (defmacro with-window-surface ((window surface) &body body) `(sdl2:with-init (:video) (sdl2:with-window (,window - :title "SDL2 Tutorial" + :title "SDL2 Tutorial 02" :w *screen-width* :h *screen-height* :flags '(:shown)) @@ -26,7 +26,7 @@ (defun run() (with-window-surface (window screen-surface) - (let ((image (load-image #p"./02/hello_world.bmp"))) + (let ((image (load-image #p"./assets/02/hello_world.bmp"))) (sdl2:blit-surface image nil screen-surface nil) (sdl2:update-window window) (sdl2:delay 2000) diff --git a/03/tutorial-03.lisp b/03-event-driven-programming.lisp similarity index 82% rename from 03/tutorial-03.lisp rename to 03-event-driven-programming.lisp index b7a7c2e..92414c3 100644 --- a/03/tutorial-03.lisp +++ b/03-event-driven-programming.lisp @@ -1,8 +1,8 @@ -(defpackage #:sdl2-tutorial-03 +(defpackage #:sdl2-tutorial-03-event-driven-programming (:use :common-lisp) (:export :main)) -(in-package :sdl2-tutorial-03) +(in-package :sdl2-tutorial-03-event-driven-programming) (defparameter *screen-width* 640) (defparameter *screen-height* 480) @@ -10,7 +10,7 @@ (defmacro with-window-surface ((window surface) &body body) `(sdl2:with-init (:video) (sdl2:with-window (,window - :title "SDL2 Tutorial" + :title "SDL2 Tutorial 03" :w *screen-width* :h *screen-height* :flags '(:shown)) @@ -26,7 +26,7 @@ (defun run () (with-window-surface (window screen-surface) - (let ((image (load-image "./03/exit.bmp"))) + (let ((image (load-image "./assets/03/exit.bmp"))) (sdl2:with-event-loop (:method :poll) (:quit () t) (:idle () diff --git a/02/hello_world.bmp b/assets/02/hello_world.bmp similarity index 100% rename from 02/hello_world.bmp rename to assets/02/hello_world.bmp diff --git a/03/exit.bmp b/assets/03/exit.bmp similarity index 100% rename from 03/exit.bmp rename to assets/03/exit.bmp diff --git a/sdl2-tutorial.asd b/sdl2-tutorial.asd index 84dbb7f..344ad94 100644 --- a/sdl2-tutorial.asd +++ b/sdl2-tutorial.asd @@ -3,9 +3,9 @@ :version "0.0.1" :licence "Public Domain" :depends-on ("bordeaux-threads" "sdl2" "sdl2-image" "sdl2-ttf") - :components ((:file "01/tutorial-01") - (:file "02/tutorial-02") - (:file "03/tutorial-03") + :components ((:file "01-hello-sdl") + (:file "02-getting-an-image-on-the-screen") + (:file "03-event-driven-programming") (:file "04/tutorial-04") (:file "05/tutorial-05") (:file "06/tutorial-06")