Update of /project/pal/cvsroot/pal
In directory clnet:/tmp/cvs-serv26552
Added Files:
changes.txt default-font.fnt default-font.png ffi.lisp
license.txt package.lisp pal-macros.lisp pal.asd pal.lisp
todo.txt vector.lisp
Log Message:
--- /project/pal/cvsroot/pal/changes.txt 2007/06/28 20:14:05 NONE
+++ /project/pal/cvsroot/pal/changes.txt 2007/06/28 20:14:05 1.1
Release 3
- Renamed GL-PAL system to PAL.
- MESSAGE is now a function that just prints it argument.
- Added DRAW-ARROW.
- Changed TEXT-SIZE to GET-TEXT-SIZE.
- Changed REGISTER-RESOURCE, FREE-RESOURCE, FREE-ALL-RESOURCES, OPEN-PAL and
CLOSE-PAL into public generic functions.
- Foreign libraries are now loaded with CFFI:USE-FOREIGN-LIBRARIES. There is now
a function PAL:LOAD-FOREIGN-LIBRARIES that can be used to (re)load the shared
libs when needed (mainly to be used when delivering images with CLisp)
- Renamed SDL packages name to PAL-FFI and sdl.lisp file to ffi.lisp
- Samples and musics are now wrapped in structures, cleaned up resource
handling.
- Replaced WITH-MATRIX and WITH-TRANSLATION with WITH-TRANSFORMATION.
- Added RANDOMLY macro.
Release 2, May 19 2007
- Tested on Linux/ia32 (Ubuntu 7.04, SBCL 1.05).
- Cleaned up the font reader a bit.
- Pathname fixing; added ext:probe-directory for clisp, pathnamified the
application folder/file functions and added basic *nix app-dir support.
- Cleaned up the type declarations a bit.
- MATCH-PRESSED-KEYS is now called TEST-KEYS.
- Fixed V-ANGLE since (atan 0 0) errors with DIVISION-BY-ZERO under (at least)
CLisp.
- Some of the examples had floating point errors under CLisp. Fixed with #+CLISP
EXT:WITHOUT-FLOATING-POINT-UNDERFLOWS.
- Source directory of PAL is automatically added to the default search paths (to
allow PAL to find 'DEFAULT-FONT).
- Added a default font (tag 'PAL::DEFAULT-FONT, mainly for debuggin purposes)
and changed the order of font & position args in text functions.
- Removed the font argument from DRAW-FPS. It now uses the default font.
- Added the MESSAGE macro.
Release 1, March 14 2007
- I changed my original Pixel Art Library from using software rendering to
OpenGL. First release.
--- /project/pal/cvsroot/pal/default-font.fnt 2007/06/28 20:14:05 NONE
+++ /project/pal/cvsroot/pal/default-font.fnt 2007/06/28 20:14:05 1.1
[HGEFONT]
Bitmap=default-font.png
Char=" ",1,1,3,13,-1,2
Char="!",5,1,4,13,1,0
Char=""",10,1,5,13,0,1
Char="#",16,1,10,13,0,-1
Char="$",27,1,9,13,-1,0
Char="%",37,1,12,13,0,-1
Char="&",50,1,10,13,0,0
Char="'",61,1,3,13,0,0
Char="(",65,1,5,13,0,0
Char=")",71,1,5,13,0,0
Char="*",77,1,7,13,-1,0
Char="+",85,1,9,13,0,0
Char=",",95,1,5,13,-1,0
Char="-",101,1,5,13,0,0
Char=".",107,1,4,13,0,0
Char="/",112,1,6,13,-1,-1
Char="0",1,15,8,13,0,0
Char="1",10,15,8,13,0,0
Char="2",19,15,8,13,0,0
Char="3",28,15,8,13,0,0
Char="4",37,15,9,13,0,-1
Char="5",47,15,8,13,0,0
Char="6",56,15,8,13,0,0
Char="7",65,15,8,13,0,0
Char="8",74,15,8,13,0,0
Char="9",83,15,8,13,0,0
Char=":",92,15,4,13,0,0
Char=";",97,15,5,13,-1,0
Char="<",103,15,9,13,0,0
Char="=",113,15,9,13,0,0
Char=">",1,29,9,13,0,0
Char="?",11,29,7,13,0,-1
Char="@",19,29,12,13,0,-1
Char="A",32,29,10,13,-1,-1
Char="B",43,29,9,13,0,0
Char="C",53,29,9,13,0,0
Char="D",63,29,9,13,0,0
Char="E",73,29,8,13,0,0
Char="F",82,29,8,13,0,0
Char="G",91,29,9,13,0,0
Char="H",101,29,9,13,0,0
Char="I",111,29,4,13,0,0
Char="J",116,29,6,13,-2,0
Char="K",1,43,10,13,0,-1
Char="L",12,43,8,13,0,-1
Char="M",21,43,11,13,0,0
Char="N",33,43,9,13,0,0
Char="O",43,43,10,13,0,0
Char="P",54,43,9,13,0,-1
Char="Q",64,43,10,13,0,0
Char="R",75,43,9,13,0,-1
Char="S",85,43,8,13,0,0
Char="T",94,43,10,13,-1,-1
Char="U",105,43,9,13,0,0
Char="V",115,43,10,13,-1,-1
Char="W",1,57,13,13,0,0
Char="X",15,57,10,13,-1,-1
Char="Y",26,57,10,13,-1,-1
Char="Z",37,57,9,13,0,-1
Char="[",47,57,6,13,0,-1
Char="\",54,57,6,13,-1,-1
Char="]",61,57,6,13,-1,0
Char="^",68,57,9,13,0,0
Char="_",78,57,8,13,-1,-1
Char="`",87,57,5,13,0,1
Char="a",93,57,8,13,0,0
Char="b",102,57,8,13,0,0
Char="c",111,57,7,13,0,0
Char="d",1,71,8,13,0,0
Char="e",10,71,8,13,0,0
Char="f",19,71,7,13,-1,-1
Char="g",27,71,8,13,0,0
Char="h",36,71,8,13,0,0
Char="i",45,71,4,13,0,0
Char="j",50,71,5,13,-1,0
Char="k",56,71,9,13,0,-2
Char="l",66,71,4,13,0,0
Char="m",71,71,12,13,0,-1
Char="n",84,71,8,13,0,0
Char="o",93,71,8,13,0,0
Char="p",102,71,8,13,0,0
Char="q",111,71,8,13,0,0
Char="r",120,71,6,13,0,-1
Char="s",1,85,7,13,0,0
Char="t",9,85,7,13,-1,-1
Char="u",17,85,8,13,0,0
Char="v",26,85,9,13,-1,-1
Char="w",36,85,11,13,0,0
Char="x",48,85,9,13,-1,-1
Char="y",58,85,9,13,-1,-1
Char="z",68,85,7,13,0,0
Char="{",76,85,8,13,0,0
Char="|",85,85,3,13,0,1
Char="}",89,85,8,13,0,0
Char="~",98,85,9,13,0,0
--- /project/pal/cvsroot/pal/default-font.png 2007/06/28 20:14:05 NONE
+++ /project/pal/cvsroot/pal/default-font.png 2007/06/28 20:14:05 1.1
PNG
IHDRÃ>aË0IDATxí]1Ì+GþôRhò
B "ŒW
P)A^
DÈ)Ò¥4)-QP
Q8]$G(ÒX!þ¥Hà'dä_~S
ÅíŒgv÷îìßÿûw?ießÞÜììîÜÞÞÌÎÞ"BE¹ø¹š8/ªìc`£ò6!ÿV"ŠÎ¯i&Švòc|fáú]øÏXG®Ø¢ß+Cç|Àg*ÿ³?ÊäsNÌÐÔ=Ç&á÷]ßÄáÝc+ì+ÕQŒÒCÿßFdxÀsîßOUþ§ê<cV1gáØÃu)ÉþÑåc+ÀW<ÿ¿
à_Í»^ðv8îÒQ+A£.Ãï,BcáB>wÕyÆ}ßÿÏoøC§+ÈK»b4&€elÂïÆÏaÊØ&äªrg¢ÌT],Ycç?³LðÎiÇ!iÑ>)vrR;j:jiðÙX$xooDùÜ9DD«Fs±k,äŽeWú%Å°³tI1Lú1]ó[Aëñ¿ ¶wáú1*ä3£}XrÈŽ×ZõÛl!mC¿¥FñŠ]
5w0wÒïÎXÃùÃîè¬/Má8g$ãI+ÊDñ<
tikÖj¬tÌIàþæué9?õŠØõGhß 4ÞðGqü!7qø/ñ-4Àï|àâ³tø]ø} òšó7?ðÏ>Þ!:ëk,!ÿ5í:°@3Û¿'ò6þ
à9ðEõn¶>îs}Uóc
à¯èßùpnš83ª/ pT(U
VÚW4ËJÈó²ÉŽBóÊ&1E3»fMÈó iSåyr] ñ,vá£érä¡uvípÓ]ÉÂ(À¹)µ6õæ£<+")CgÈXQkбÊÌ
¹ŠRŠ×r³y
QÜë?uóÚ±OQã?b|ädeÃzÖ¹FŽ1+7U¡ï#yG :M¯/@Ëå±Ú±k]d§só̺d+%ž%L`-µÄ=Ú»j4ÆÊà%ËñÊÓ
i)ÿö}[:T*>/G-wª.V®©étOc8ðPò ÌEuCÊNÊ)ÓãÅân1¹á]5Š}EË;ç&J)@¯di®lŽŸ~fçz§,~1tåeÕÍâ3êXï<Ìoèó:çËû1üÀ«ØÕ~Òc^¹ðÛö[Í
À¯ŒfüGÑh19ù/®t8i ]÷÷±Ãÿ1G×Dåy`~Rù^]Œü÷Cb¯xYÑô3©+5,÷gåÐðóš .)=ŽyÚ¬á-üXP;o!¹w?šÞù1@á¿5`ìÈ~HÕeÈhÑ)U_ÀÍÁ1ŒQàæà,^Áª
£ú
GUÂQ pôQé)ÛÂÀ¢õ±çlîÐ2fÞãkyìÖ°œ¶SŽ1~kØTsŒ
94üeÛì"rõÉË9(ÚwB¶.u15zïËÀOZù: ±<=:]Šçã¥ÒjzŸßZk^îÕµ+t~q[ruÍËGXŠÆ2°ADÛ§¢rÒËFŠÅÝÌ+j¡X.g¢Ž9ÚãòòõUOÁrxåæõRNlwæ¶ìØܱï|ªÄ×°³D_'ãìä¯Rº£ÐÅò4úÒäÊ5_²,ËÀ¶æ|
Àö×Éó³°íÏŒÔÛZò;·Acg6ïÐØÙSeOÑh9s|]n^¯ì>2€ú"*ÎÑtÂoÐ8.Ñpë`CÖó®GpíÄånÈó6f`°Ãéyÿ(üÆYàåkW¯ËóårÎ!àeCÛé?FëÒÍ.¯Ð4ú%öñøÿaL¯ßKŽÊu©ÎyàÖ^¹ß£QŽ Õóz=#ïëOæûNêºñ,êúlQzèMäs×z1
Ù^9]ï·XD·&hú<ßy¢ÌØÒá|*¬Ì€<§ò,|ûñjc?CÀYqz°wñ1/yDÏx'â~àUŽG>:Qyûm}Uo`᚟ÂQ pT(Rô»ýM{æÒ^&ßû¶v®·bœrrc-ÏÜ
¶q©/Ï
cò¶.GŸ§1ÇuÍ+óÎȶxk+¶Ü÷] ~G«|~gäéwh¢}û€¯çzY¬><=Gš]õÌuOÅ%Zuícà๪m0ád3Ùù^øTJXI³_Òþ²j~Eû<j:Çy]<xÇæéµÃkÃS)µŒñÀ»ëݱ±Ø¹®
Àw×X{P< Ô+;ÖúòôÂÃ@ñ©`NO®
zDè$Oâ1})a5ÍV€Ê°v©tVÂ
Âsgð㎠}ol¿BO>
À>§ö`ö§ÅlŠþCŽ?UÞ{×¢ú°R_ülMmDé)ó©Ïñv¿.ßXÈœv*@Êìº!@/1OéšÊåÉrjSMseåNü(á;Û[:³Œ.ÎkêÀÃ1`áÐqÉ¡U¯?ìªO«ÞOÞYEk:ôBW-O©ôhsFòêp°@óЬžµš@¯ YØòÒ+jÔ pÔ pT(·ARaXÇŸ®+°A98µl{
À+ôÌÃñE8¡`ïô²÷ÉóZªTÌ^ª³¬¥ê±ØÅ¥íËP^êc1Üðß<NñNžPï:ôß+õÞAóÁÛ±£B%6|t±ö-ïʱëù[þæØbu;JÒ¢¶%€X>wA¶;R&6H;uj+UoëÖT#å|KǺ[¥%oCÇW ki»ç€"¯-
Àòºx¢¶á§°)Sû)·ï
n]ê[w2ú7¶#W¬¬XhçF;Aòv(cÈ)µY}&œö#ÖÜÉ!ÌÒN®w*Q|H.áXçÏŸkRßÓK]ªdµ:/fððŒ£vûëyZ&µy]Qî;8õEÍA
8 ÉÇs;7ŠSÒ¯¿wÑ|£hŸE{W£$~àû!]
<k\.6¡ÜØ£9xMÄñYNÿ!œsÊíÓ#uc(/ÐfêgøÖÈãÄ
yÆVÊäjn]ï%ùÒAwÐ$]1> Œ
Ÿ]ëÝ~æß2F.çº[Û pªàÐR³J>š
0OMG{ž
Î )ÀOÔñOŽ¥Ð%ô,'?W{ßnN5<Dóÿ6nÁ0y{ÈÝfíØ×ãúŸü]ît4«¥ YãÐÂFê¿æ¥ËÇçvÈPNÉ?õAG3l1ùýýÝË4-Û;§=ýsÂ*ıïÝÉÝ>ÙKgYûb)¹
k*NpNûÞÀ2bü&ÔZ:c;y²cO¶üV{{ûÇhrúMÊãZõðg
¹ïœ±¡ŽK9]hbùRîÇhìêïeÈ#˱ä¿N'è; Œ£ÒÓ+4ÛÑ~çÜÜHCÐ#/ÀÞ+qÆËwÆëײ/öäÑ÷Ð<¿ßÇ×ú&«œµ§£Éé7ây ?y*ò<Y4^~n9:/Š÷qè>²ô_>¿ìN
Ëا=o7pàhöô}6A:2¿s¢Ïki§kÎåZwà×Gäû9ÄïÖãÜ#@ÅQA
£*@áš
0sä{=¥Y8µôÚÐUs&ð#4^Ï_À·H2ẮÀâŒe €LÞœ>ät#À^%OçY4;FoCŸŠã<Rçì¡©ktD®d¢õjZuy+ÙòŠ?Ó÷³ÜÂ*óåXør¬_ìMäöê("ÈV.¹É€åÜPBÆ_Õ4ëÈV7Ç«³*ÛK1ÆÓjkOZž²²cûbBës-»O¹¹£uY2šíšX4ñHÔ!Ê
Åu6·P¥tPê\ï¢,£µu,ìB¹]N®+,mÓ]C±õ9Vú¯l82z£ìXAH&áëDö,÷H2"vœ{þs]bÛöM
çÆï"ŒvGhå¢"»åÂngNüàÀ»³¥¬^Ð(©µG,ß;wíÉƪü
¢çrbÝdgÅ;ɺÞã;·à»ûu[Äê¡#|S
à:[*Õ°F³0Äý^&fhW@«p¬U9ì¬:çZ'(12Ð..x#Þû5JTÙçBõO
¢U(U
GUÂQ pT(U
GUÂQ pT(U
GUÂQ pT(U
GUÂQ pT(U
GUÂQ pT(U
GUÂQ pT(U
GUÂQ pT(ÿ$%#:
IEND®B`--- /project/pal/cvsroot/pal/ffi.lisp 2007/06/28 20:14:05 NONE
+++ /project/pal/cvsroot/pal/ffi.lisp 2007/06/28 20:14:05 1.1
(declaim (optimize (speed 3)
(safety 3)))
(in-package :pal-ffi)
(cffi:define-foreign-library sdl
(:windows "SDL")
(:linux "libSDL-1.2.so.0"))
(cffi:define-foreign-library sdl-mixer
(:windows "SDL_mixer")
(:linux "libSDL_mixer-1.2.so.0"))
(cffi:define-foreign-library sdl-image
(:windows "SDL_image")
(:linux "libSDL_image-1.2.so.0"))
(cffi:define-foreign-library opengl
(:windows "opengl32.dll")
(:linux "libGL.so"))
#+win32 (cffi:define-foreign-library shell32
(:windows "shell32.dll"))
(defun load-foreign-libraries ()
(cffi:use-foreign-library sdl)
(cffi:use-foreign-library sdl-mixer)
(cffi:use-foreign-library sdl-image)
(cffi:use-foreign-library opengl)
#+win32 (cffi:use-foreign-library shell32))
(load-foreign-libraries)
(deftype u8 () '(unsigned-byte 8))
(deftype u11 () '(unsigned-byte 11))
(deftype u16 () '(unsigned-byte 16))
(defconstant +init-audio+ #x00000010)
(defconstant +init-video+ #x00000020)
(defconstant +fullscreen+ #x80000000)
(defconstant +opengl+ #x00000002)
(defconstant +audio-s8+ #x8008)
(defconstant +audio-s16lsb+ #x8010)
(defconstant +audio-s16msb+ #x9010)
(defconstant +audio-s16+ +audio-s16lsb+)
(defconstant +channels+ 8)
(defconstant +default-frequency+ 22050)
(defconstant +default-channels+ 2)
(defconstant +max-value+ 128)
(defconstant +channel-post+ -2)
(defconstant +no-fading+ 0)
(defconstant +fading-out+ 1)
(defconstant +fading-in+ 2)
(defconstant +mus-none+ 0)
(defconstant +mus-cmd+ 1)
(defconstant +mus-wav+ 2)
(defconstant +mus-mod+ 3)
(defconstant +mus-mid+ 4)
(defconstant +mus-ogg+ 5)
(defconstant +mus-mp3+ 6)
(defconstant +button-left+ 1)
(defconstant +button-middle+ 2)
(defconstant +button-right+ 3)
(defconstant +button-wheelup+ 4)
(defconstant +button-wheeldown+ 5)
(cffi:defcstruct rectangle
(x :short)
(y :short)
(w :uint16)
(h :uint16))
(cffi:defcstruct color
(r :uint8)
(g :uint8)
(b :uint8)
(unused :uint8))
(cffi:defcstruct surface
(flags :uint)
(pixelformat :pointer)
(w :int)
(h :int)
(pitch :uint16)
(pixels :pointer)
(offset :int)
(hwdata :pointer)
(clip-rect rectangle)
(unused1 :uint)
(locked :uint)
(map :pointer)
(format-version :uint)
(refcount :int))
(cffi:defcstruct pixelformat
(palette :pointer)
(BitsPerPixel :uint8)
(BytesPerPixel :uint8)
(Rloss :uint8)
(Gloss :uint8)
(Bloss :uint8)
(Aloss :uint8)
(Rshift :uint8)
(Gshift :uint8)
(Bshift :uint8)
(Ashift :uint8)
(Rmask :uint)
(Gmask :uint)
(Bmask :uint)
(Amask :uint)
(colorkey :uint)
(alpha :uint8))
(cffi:defcstruct keysym
(scancode :uint8)
(sym :int)
(mod :int)
(unicode :uint16))
(cffi:defcstruct keyboard-event
(type :uint8)
(state :uint8)
(keysym keysym))
(cffi:defcstruct mouse-button-event
(type :uint8)
(which :uint8)
(button :uint8)
(state :uint8)
(x :uint16) (y :uint16))
(cffi:defcstruct mouse-motion-event
(type :uint8)
(which :uint8)
(state :uint8)
(x :uint16) (y :uint16)
(xrel :int16) (yrel :int16))
(cffi:defcstruct quit-event
(type :uint8))
(cffi:defcstruct active-event
(type :uint8)
(gain :uint8)
(state :uint8))
(cffi:defcstruct resize-event
(type :uint8)
(w :int) (h :int))
(defconstant +no-event+ 0)
(defconstant +active-event+ 1)
(defconstant +key-down-event+ 2)
(defconstant +key-up-event+ 3)
(defconstant +mouse-motion-event+ 4)
(defconstant +mouse-button-down-event+ 5)
(defconstant +mouse-button-up-event+ 6)
(defconstant +quit-event+ 12)
(defconstant +resize-event+ 16)
(defconstant +expose-event+ 17)
(cffi:defcenum sdl-key
(:key-unknown 0)
(:key-first 0)
(:key-backspace 8)
(:key-tab 9)
(:key-clear 12)
(:key-return 13)
(:key-pause 19)
(:key-escape 27)
(:key-space 32)
(:key-exclaim 33)
(:key-quotedbl 34)
(:key-hash 35)
(:key-dollar 36)
(:key-ampersand 38)
(:key-quote 39)
(:key-leftparen 40)
(:key-rightparen 41)
(:key-asterisk 42)
(:key-plus 43)
(:key-comma 44)
(:key-minus 45)
(:key-period 46)
(:key-slash 47)
(:key-0 48)
(:key-1 49)
(:key-2 50)
(:key-3 51)
(:key-4 52)
(:key-5 53)
(:key-6 54)
(:key-7 55)
(:key-8 56)
(:key-9 57)
(:key-colon 58)
(:key-semicolon 59)
[646 lines skipped]
--- /project/pal/cvsroot/pal/license.txt 2007/06/28 20:14:05 NONE
+++ /project/pal/cvsroot/pal/license.txt 2007/06/28 20:14:05 1.1
[667 lines skipped]
--- /project/pal/cvsroot/pal/package.lisp 2007/06/28 20:14:05 NONE
+++ /project/pal/cvsroot/pal/package.lisp 2007/06/28 20:14:05 1.1
[1106 lines skipped]
--- /project/pal/cvsroot/pal/pal-macros.lisp 2007/06/28 20:14:05 NONE
+++ /project/pal/cvsroot/pal/pal-macros.lisp 2007/06/28 20:14:05 1.1
[1278 lines skipped]
--- /project/pal/cvsroot/pal/pal.asd 2007/06/28 20:14:05 NONE
+++ /project/pal/cvsroot/pal/pal.asd 2007/06/28 20:14:05 1.1
[1295 lines skipped]
--- /project/pal/cvsroot/pal/pal.lisp 2007/06/28 20:14:05 NONE
+++ /project/pal/cvsroot/pal/pal.lisp 2007/06/28 20:14:05 1.1
[2001 lines skipped]
--- /project/pal/cvsroot/pal/todo.txt 2007/06/28 20:14:05 NONE
+++ /project/pal/cvsroot/pal/todo.txt 2007/06/28 20:14:05 1.1
[2023 lines skipped]
--- /project/pal/cvsroot/pal/vector.lisp 2007/06/28 20:14:05 NONE
+++ /project/pal/cvsroot/pal/vector.lisp 2007/06/28 20:14:05 1.1
[2264 lines skipped]