ELF(š4hR4 ( pNÎÎðð44€4€44�4�€€OO€OOOüp €OOO  PP�P�DDQåtd/lib/ld-linux-armhf.so.3GNUGNU�Ôëïr!'i™feüs=¤‚+%:-!"1* ,4%$9 )(+#3 /&. 0'58 726% ÀD€ PB!0ÄšL€ …­†à²A�€"@(‘Ab 4A&  "$%')+./02458]‚ÜAEÈ6ZÍUéêÓï}‹s¯4èÞÜ�}0`¸+k[˧•xž| O[1/N=öåÅ||íFu)Œ2Žu‘². ¼î�Ê¡2>®Xï—yíéC+>~–|@Qò’»lAØßIì–©ºÚ‘u‚ zƒ¬?³Y~AµZ+Ê–“%‰Ê HåÙqXºã’|!Ï ý&”vU µ¥_–“íÞ“K±?ÒÕª?ÑèBEÕì·“Ý4qÆÃÂ{œ|¾ÚW¹�ñvT<”¶ Ù ƒ¤: ¾¯to7ì#reX0XCQ=Ñ(›ºto€ˆ{ÁÞ Jibwúû¶”QÂtoQ¤^6rE�QN‰®to4œ�  Q"libSDL-1.2.so.0__gmon_start___Jv_RegisterClasses_init_finilibSDL_image-1.2.so.0libSGE.so.0SDL_FreeSurfaceSDL_QuitSDL_PollEventSDL_GetMouseStateIMG_LoadSDL_DisplayFormatSDL_MapRGBSDL_SetColorKeySDL_GetErrorSDL_UpperBlitSDL_SetPalettesge_GetPixelsge_PutPixelSDL_FillRectSDL_CreateRGBSurfacesge_transformSDL_FlipSDL_DelaySDL_SetVideoModeSDL_InitSDL_GetVideoInfoSDL_WM_SetCaptionlibstdc++.so.6_Znwjlibm.so.6libgcc_s.so.1__aeabi_unwind_cpp_pr0__aeabi_unwind_cpp_pr1libc.so.6strcpysprintf_IO_putcsrandfopenputstimeputcharabortstrtolfseekstdoutmemcpyfclosefreadstrcmp__libc_start_mainbasename__cxa_atexit_edata__bss_start__bss_start____bss_end____end___endGCC_3.5GLIBC_2.4GLIBCXX_3.4´ U&y Çð ii Ï•t)’ÙôPQ@PDPHP/LP0PP.TPXP'\P`P dP5hPlP pPtP3xP|P €P„PˆP"ŒP%�P#”P˜PœP P&¤P+¨P¬P°P´P¸P$¼P9ÀP ÄP!ÈP*ÌP,ÐP4ÔP-ØPÜPàP1äPèPìP @-é&뀽èà-åàŸåà�àð¾å|ÂÆ�â ÊŒâ|ò¼åÆ�â ÊŒâtò¼åÆ�â ÊŒâlò¼åÆ�â ÊŒâdò¼åÆ�â ÊŒâ\ò¼åÆ�â ÊŒâTò¼åÆ�â ÊŒâLò¼åÆ�â ÊŒâDò¼åÆ�â ÊŒâ<ò¼åÆ�â ÊŒâ4ò¼åÆ�â ÊŒâ,ò¼åÆ�â ÊŒâ$ò¼åÆ�â ÊŒâò¼åÆ�â ÊŒâò¼åÆ�â ÊŒâ ò¼åÆ�â ÊŒâò¼åÆ�â ÊŒâüñ¼åÆ�â ÊŒâôñ¼åÆ�â ÊŒâìñ¼åÆ�â ÊŒâäñ¼åÆ�â ÊŒâÜñ¼åÆ�â ÊŒâÔñ¼åÆ�â ÊŒâÌñ¼åÆ�â ÊŒâÄñ¼åÆ�â ÊŒâ¼ñ¼åÆ�â ÊŒâ´ñ¼åÆ�â ÊŒâ¬ñ¼åÆ�â ÊŒâ¤ñ¼åÆ�â ÊŒâœñ¼åÆ�â ÊŒâ”ñ¼åÆ�â ÊŒâŒñ¼åÆ�â ÊŒâ„ñ¼åÆ�â ÊŒâ|ñ¼åÆ�â ÊŒâtñ¼åÆ�â ÊŒâlñ¼åÆ�â ÊŒâdñ¼åÆ�â ÊŒâ\ñ¼åÆ�â ÊŒâTñ¼åÆ�â ÊŒâLñ¼åÆ�â ÊŒâDñ¼åÆ�â ÊŒâ<ñ¼åÆ�â ÊŒâ4ñ¼åÆ�â ÊŒâ,ñ¼åÆ�â ÊŒâ$ñ¼åPãðO-ép á ÐMâP á[Ú@‘åäŸå áàÿÿëPã ÔŸå áÛÿÿëPãV ë ã|ÿÿ븟å áÓÿÿëPã0N 뤟åzÿÿë Ÿåxÿÿ뜟åvÿÿ똟åtÿÿ딟årÿÿë�Ÿåpÿÿ댟ånÿÿ눟ålÿÿ넟åjÿÿ뀟åhÿÿë|ŸåcÿÿëxŸådÿÿëtŸåbÿÿëpŸå`ÿÿëlŸå^ÿÿëhŸå\ÿÿëdŸåZÿÿë`ŸåXÿÿë\ŸåVÿÿëXŸåTÿÿëTŸåRÿÿëPŸåPÿÿë  ãWÿÿë ãFÿÿë<Ÿå á�ÿÿëPãÝ ,Ÿå á˜ÿÿëPãØ Ÿå á“ÿÿëPã Ÿå áŽÿÿëPã÷•å ë ã.ÿÿëÁ @ ãäfŸå€ á(ë0 ã0�åTá ª±•çÈŸå  á{ÿÿë¡ áPã  á°ŸåuÿÿëPã�  6Ÿå� ã€Æç °•ç  á�ŸåkÿÿëPã  á€ŸåfÿÿëPãt6Ÿå� ã€Æç °•ç  ádŸå]ÿÿëPã  áTŸåXÿÿëPã� ã0 ãI0Æå •ç8ŸåPÿÿë4ŸåPã€Æ •ç� Jÿÿë ŸåPã� 6Ÿ€Æ •çCÿÿë ŸåPã� 6Ÿ€Æ •ç<ÿÿëøŸåPãJ€Æ •ç� 6ÿÿëäŸåPã� Ü5Ÿ€Æ •ç/ÿÿëПåPãL„Æ •ç� )ÿÿëPâ@„âTáÉ  ã•ç¾þÿëœ5ŸåPãd  †ç�  † dPã� ã|5Ÿ€ÆxŸå•çÿÿëPâ@„âTá· •ç  ã¨þÿëP5ŸåPã†ç� €† Pã�  05ŸåPã� ã€Æç0C²€Æ·Ÿå•çùþÿëPâ@„âTá¡ •ç  ãŽþÿë� ãX†åìŸå•çìþÿëPâ@„âTᘠ•ç  ã�þÿë� ãP†å¼Ÿå•çßþÿëPâ@„âTá� •ç  ãtþÿë”4Ÿå� ã†ç¡•çˆŸå  áÐþÿëPãL@„âTá„ lŸå•ç’þÿëK€Æå@„âCÿÿêB ëtŸånþÿëpŸålþÿëlŸåjþÿëÿÿê: ë4Ÿåfþÿë0Ÿådþÿë,ŸåbþÿëHŸå`þÿë Ÿå^þÿëŸåŸåXþÿëŸåŸåUþÿë  ã_þÿë ŸåTþÿëŸåRþÿëŸåPþÿëŸåNþÿëüŸåLþÿëøŸåJþÿëôŸåHþÿëðŸåFþÿëìŸåDþÿëèŸåBþÿë ã:þÿëÜŸå á‘þÿëPã ÌŸå áŒþÿëPãÿÿ¼ŸåxŸå0þÿë ã+þÿëpŸå,þÿë ã'þÿëYã·ÿÿ0�å  á@„â†àF€â€âBþÿë0�å0ƒâ0�åòþÿêœBŸå0�åd4„åœ2ŸåÓ0”áSã 0�åSãM @Ÿå( ëÑëpë”2Ÿå`ŸåÓ0”áSã d4�åSãoŸåþÿë ãþÿëŸåþÿë ãüýÿëüŸåþÿë ãøýÿëðŸåüýÿë ãôýÿëäŸåøýÿë ãðýÿëØŸåôýÿë ãìýÿëÌŸåðýÿë ãèýÿëÛ4ÐáSã ã PãñŸ—üÿÿêð–è–à–Ø–|–|–|–|–Ä–°–\4”å ã0ƒâ\4„åíÿÿê‘ ë Pãêÿÿ ãÍýÿëb ëùÿÿê ë÷ÿÿêšëõÿÿê±ëóÿÿêL€âÕëÜÿÿê™ ë$ŸåÂýÿëH1ŸåÓ0”áSã)  ãÈýÿëŸå½ýÿëŸå»ýÿëŸå¹ýÿëüŸå·ýÿëøŸåµýÿëôŸå³ýÿëðŸå±ýÿëìŸå¯ýÿëèŸå­ýÿëäŸå«ýÿëàŸå©ýÿëÜŸå§ýÿëØŸå¥ýÿëÔŸå£ýÿëПå¡ýÿëÌŸåŸýÿëÈŸå�ýÿëÄŸå›ýÿëÄÿÿê~ë7ëÁÿÿê°Ÿå•ýÿë¾ÿÿê˜Á¤Á¨Á°ÁÐÁøÁ Â,Â`Â�ÂÐÂÃHÃtÃÀà Ä@ÄtļÄôÄ ÅHÅlŌŴÅäÅèÅÉ ÉQ0É<É£ÌHÉTÉ¢ÌXÉdÉpÉxÉ€É¤ÌŒÉ‘ÌœÉ¤É¡Ì°É”Ì’ÌØÉœÌ˜ÌÊ(ÊPÊhÌ|ÊTQðÅ Æ0ÆLÆy¯ˆÆ`ÇÄÆÇ@ÇhǤÇÐÇÈ$ȤÈÌÈäÈÉ É,ɰšÄ͸ÉäÉ Ê0Ê\ʌʰÊÄÊäÊË,ËTˀˬËàËÌ<Ì`Ì|Ì ÌÄÌØÌÍ<ÍPÍxÍ8@-é ã ýÿë\0Ÿå\@ŸåP ã@ Câ΂â áØ åP€åÔ å£å Sáüÿÿ4Ÿå ãô‚å.‚âRá0 ãúÿÿ ŸåŒ=åˆ=å0„ç„=å8€½èL#Ð0lm >° ãà ã�ä  á -å-åÀŸåÀ-å Ÿå 0Ÿå]ýÿëýÿët¾Ì�¾0Ÿå Ÿå0�à0“çSãÿ/UýÿêäµÀ0Ÿå ÓåRã   Ãÿ/áQ Ÿå@-é0�åS〽0ŸåS〽3ÿ/ွèOðA-éH1ŸåH�ŸåÓ0˜áSãHÐ0ØáSãE0AŸåp ãDPDân„â”äPã íüÿëpåTáøÿÿAŸå` ãô•åPã äüÿëôa…å^…âUá÷ÿÿä@ŸåäPŸå”çPã Úüÿë0 ã0„çŒ åPã Ôüÿë´0Ÿå  ãŒ-åˆ åPã Íüÿë˜0Ÿå  ãˆ-å„ åPã Æüÿë|0Ÿå  ã„-å`0ŸåÓ0˜áSãT0ŸåÐ0ÓáSã„üÿë<0ŸåÓ0˜áSã00ŸåÐ0ÓáSãð�½4ŸåðA½èŽüÿê,ŸåŒüÿë¶ÿÿê$Ÿå‰üÿëíÿÿê¢ÌQP#lmÐ0 >ؾ¬¾Ä¾dÀŸå@-é  ã\àŸå\0ŸåÒ Œâ ÌçàŽâ á ÌçàŽâ ÌçƒäSá  ãûÿÿ00Ÿå ÌçÒ< ã Ìç0ƒâ ÌçŸåjüÿëPãûÿÿ€½èQ¥Ð°!Ò Q@-éÐMâø@Ÿå�â  áªüÿë0�å„â(0„å0�å,0„åVüÿëPã 0Ôå0Câ SãñŸ—êL� �<�„�<�<�<�<�<�<�D� 0”åpS〠Ÿ0‚ :ƒ  ¥ ÃÐ�‽è ã0üÿë 0”å  ã@„à J„âpS㥠ÄåD0Ÿå @„âòÿÿØÓáQã  H Ãåíÿÿê0Ôå ŸåSãŸ0Âçÿÿ Sã0Ÿ ÂâÿÿêQÅÐÀÐ8@-érüÿëPPâ Eüÿë@Pâ@   á1üÿë ã  á0 á”åüÿë ã  á áCüÿë á8€½è40Ÿå4 ŸåÒ “áRãÐ@ÓáTãõÿÿ üÿë@ ã áŸåõûÿë á8€½èQ¢Ì¿p@-é@ áèPŸåŒ åPã üÿë0 ãŒ=å áBüÿë`Pâ üÿë@Pâ@   áüÿë ã0 á  á”åÒûÿë ã  á áüÿë ã á  áŒMåp@½è üÿêl@Ÿål0ŸåÓ0”áSãÐ0ÔáSãŒ= Öûÿë áHŸåÁûÿë0 ãŒ=å40Ÿå0ÔçSã Ìûÿë á$Ÿåp@½è¶ûÿêÐ0ÔáSãp€½öÿÿêÐ0Q¢Ì¿¿p@-éP áhAŸåˆ åPã Êûÿë0 ãˆ=å áÿûÿë`Pâ. ÒûÿëPPâP   á¾ûÿë ã0 á  á•å�ûÿë ã  á áÐûÿëˆ]åQŸå ãŒ å  áÊûÿëÙ4ÕáSãp€½ˆ åà`ŸåÀ ãP�å à�å¶À„á`†â  á¶À„áÄÀŸå�-åÀ0Ÿå¼P„áÀŒâ¼à„á“ûÿëPãp€½¨‡ûÿë á Ÿåp@½èqûÿê„PŸå”0ŸåÓ0•áSãÐ0ÕáSãˆ= yûÿë ápŸådûÿë0 ãˆ=å\0Ÿå0ÕçSã oûÿë áHŸåZûÿëÙ4ÕáSãp€½ÍÿÿêÐ0ÕáSãôÿÿÙ4ÕáSãp€½ÆÿÿêÐ0Q�>”>`o,¿¢Ì¿@-éÛMâÐMâë�âqïær ïæs0ïæÀ�âàŽâ@ ã@Íå @Íå @ÍåÌå Ìå0ÌåÀŒâ\áùÿÿÌ ã ã �â0 ãÀ�åXûÿëÐ�âÛ�‽èø@-éP ã”aŸå”Ÿåƒûÿë0Eâ@PâY 0CâSãñŸ—êܢ̬¢X¢¢ áKûÿë ã0 á  áp á�å ûÿë ã  á áMûÿë áÔq†å/ûÿëUãE P…â`†âÝÿÿê ã  á 0 ã á¹ÿÿë á2ûÿë ã0 á  áP á�åóúÿë ã  á á4ûÿëÌ0Ÿå áÜ[åø@½èûÿêÿ  ã á ã0 á£ÿÿë áûÿë ã0 á  áp á�åÝúÿë ã  á áûÿë áÔq†åûÿëÑÿÿê ã áÿ  ã0 áŽÿÿëéÿÿêÿ ã á  á0 ãˆÿÿëãÿÿê  ã áÿ ã0 á‚ÿÿëÝÿÿêÚúÿë áŸåÅúÿë ãÀúÿëø€½è #D¿Ð0T¿ €àRã  Ó  Ã2Pã  £Rã �àPã Ó Ã–Qã £ÿ/á áÿ/áðG-ép0¿ælpŸåq ¿æ áˆ åÖúÿë\`Ÿå\ Ÿå 0–çS〠áð‡½Ø� ã@ ãyP¿æt¿æ0 á„ å  áøúÿë 0–ç@„âSáöÿÿÊ�‰â Sáð‡½ØSãïÿÿÊð‡½èÐ0QœÌp@-éqÀ¿æ0@Ÿåp¿æ` á á  áˆ åP á±úÿëv¿æu ¿æ0 á„ åp@½èÛúÿêÐ0ðO-é‹-ídUŸådEŸå ãÐMâ� å  á\úÿëÚ4Ôá„ åSãD5ŸD5ŸPãp”ç0ƒâ€”ç Šúÿë5Ÿå  ã„-å 5ŸåÓ0”áSãp 5Ÿå%ŸåÓ0’áSãk ˆ=å�zîŠî “å 0“ååj¸î�*î�:îÇjøîÿ  ãçz¸îåzøî �åÿä ãÿ, ãÿh ã ãD@�éІî 0 ã§jÆî抴îúñîfа^z(î'zhîÇz½îçzýîî�*îªî�šî~úÿë°Pâ.  áhúÿ몯Šà©Ÿ‰à` á  áTúÿëÿ ã0 á  ã–å%úÿë ã  á áúÿëÿ ã0 á  ã–åúÿë ã  á á]úÿëÊà áÉÀ á  ã~àÿæ|Àÿæ 0 áH ðîˆå�â  áó ŸíH°îÀ�åÀ ãD�è À�å„måTúÿë  ãÈŸå�âSúÿëÀ3Ÿå  ã Äç0ƒâ ÄçÐ0ÔáSãÊ„=åSãÏ  “å 0“姇à¢/‚à£?ƒà¨�ˆàÃ0 áÈ€càx3Ÿå  áÇpbàp„ç0ƒâ€„çeê`#Ÿå<3ŸåÒ ”áRã™ P#ŸåÈzßí0“ç�:îÐ0Ôáæz¸îSã'Їî�ˆ=åÿ ãÿÈ ã “å 0“å ã�*î�:îÿ, ã 0 ãçz¸îåzøî�èÿ$ ã �åz'îˆzgîÇz½îçzýîªî�šîZá  ¡Yá� ¡  á  á úÿë°Pâ�  áóùÿ몯Šà©Ÿ‰àÊ  áÉ� áz ÿæy�ÿæ` á  áÛùÿëÿ ã0 á  ã–å¬ùÿë ã  á á™ùÿëÿ ã0 á  ã–å£ùÿë ã  á áäùÿëÀ ã 0 áH ðîˆå�â  á~ ŸíH°îÀ�åÀ ã À�å„må �å��åÞùÿëôŸå�â  ãÝùÿëè1Ÿå0ÔçSãŠÿÿÜ!Ÿå€ áp á0„ç ‚â0„çŒ å ÁŸåPã ÀqŸåà ã`�å €�å·àŒáp‡â á·àŒá¤áŸå�-å 1Ÿå¾`ŒáàŽâ¾€Œá�ùÿëPã@ºp1Ÿåp”ç0ƒâ€”ç„å<ÁŸåQã`AŸåˆ à‘ `‘à� `�´pŒá@„â ´€Œá@„â�-´àŒá8áŸå �-(1Ÿå¾`ŒátùÿëPãº� åFùÿë ãbùÿë ãÐ�⋽ìð�½èü ŸåÒ “áRã ð Ÿå “çRã Ú*îÐ0ÔáSãÇŠ¸îaÿÿ Èz·îÌŸå+Sì>ùÿë\ÿÿê” Ÿå0Óç©ÿÿêKùÿë á¬Ÿå6ùÿëÝÿÿꤟå6ùÿë1ÿÿêCùÿë áŒŸå.ùÿë¹ÿÿê80Ÿå§‡à¨�ˆàˆ=å “å 0“å¢/‚à£?ƒà,ÿÿê5ùÿë á\Ÿå ùÿë\ÿÿêÈBÐ0QpÌx̡̠Ìho‘̀̒̔Ì�>”>`o–>˜ÌœÌ ¿,¿¼¿€¿ùÿë áåùÿëËþÿêpÁŸå0-é@ ãI@ÌådAŸåU^ ã  ãPŒç@„â\ ãPŒç@„â2^ ãPŒç@„â–_ ãPŒç@„â0 ã Œç@„â 0Œå Œç@„â$0Œå Œç@„â 1Ÿå ŒçAŸåÒ Œâ á Ìç@„â Ìå Ìç@„âJ ÌåK Ìå ÌçƒäSá  ãûÿÿÒ ã0 ã Ìç�àd ã Ìç�à<0Œå Ìç ãPŒå¤Ÿå0 Œå4 Œå Œç�â8 Œå Œç&�â@ Œå Ìç�âE ÌåŒç�âF Ìå Ìç�âH Ìå0Œç\0ŸåL$ÌåT$Œå Ìç0ƒâX$Œå Ìç0ƒâ\$Œå Ìç0ƒâ`$Œå Ìç0ƒâd$Œå Ìç 0Ÿå Ìç0½èÿ/áQp̰!¥ÐhÌ ÌÒ@-é ãõøÿëùÿëT0ŸåT ŸåÒ “áRã H ŸåÒ“áQã Ã8 Ÿå“çQã Ÿ�$ Ÿå0“çSãd 0Ÿƒ€½èQ˜Ì’̜̔Ì@-é  ã\@Ÿå\0Ÿå”ç0ƒâ”ç2 ãœøÿëH0Ÿå  ãJ ÄåÓ0”áSã80Ÿå� åÐ0ÔáS〽0Ÿå Ÿå”ç0ƒâ ”ç@½ècøÿêQpÌ¢ÌÐ0Ô¿@-é  ã\@Ÿå\0Ÿå”ç0ƒâ”ç2 ã|øÿëH0Ÿå  ãJ ÄåÓ0”áSá80Ÿå� åÐ0ÔáSွ0Ÿå Ÿå”ç0ƒâ ”ç@½èCøÿêQxÌ¢ÌÐ0ô¿ðA-é  ãYøÿëPãTºdAŸåÐ0ÔáSãpøÿëÙÔáP�ŸåPqŸåQã@QŸå �å0�å „ç0„ç 41ŸåÓ0•áSãÐ0ÕáSãð�½ŸåðA½è#øÿêŸå!øÿëçÿÿê Ÿå áGøÿëÚdÕáVãø0Ÿå  áôpŸå•ç0ƒâ•ç2 ã6øÿëÈ0ŸåJ`ÅåÓ0•áSã� åÐ0ÕáSã ¼Ÿå°0Ÿå”ç0ƒâ ”çøÿë� åPãð�½øÿë á”Ÿåù÷ÿë ãô÷ÿë•ç  ã2 ã•çøÿëT0ŸådpŸå  ãÓ0•áJ ÅåSã� åÐ0ÕáSãçÿÿ HŸå0Ÿåßÿÿêõ÷ÿë á8Ÿåà÷ÿë ãÛ÷ÿëQpÌt̢̄À4ÀTÀxÌÐ0ô¿`ÀÔ¿Àp@-é ãÜ@Ÿå  á� å¶÷ÿëŒ åPã Ä`ŸåÀ ãP�å à�å¶À„á`†â  á¶À„á¨ÀŸå�-å¤0Ÿå¼P„áÀŒâ¼à„áÔ÷ÿëP㺈 å|`ŸåÀ ãP�å à�å¶À„á`†â  á¶À„á`ÀŸå�-å\0Ÿå¼P„áÀŒâ¼à„áÂ÷ÿëPãº� å”÷ÿë ãp@½è¯÷ÿê±÷ÿë á(Ÿåœ÷ÿëõÿÿê¬÷ÿë áŸå—÷ÿëÞÿÿêÐ0�>”>`o,¿@-é 0Ÿå @ŸåÓ0”áSã”0Ÿå0”çSã ýÿëpã Ð0ÔáS〽p0Ÿå„=åSã dŸå@½è}÷ÿê\Ÿå@½èz÷ÿêT0Ÿå0”çdSãëÿÿH0ŸåÓ0”áSã <0ŸåÓ0”áSããÿÿ˜ÿÿëÐ0ÔáSãåÿÿ€½è‘ÌQœÌÐ0 À¸À”̡̠Ì0ŸåŸåˆ=å“å “åW÷ÿêÐ0ÔÀ@-é•÷ÿë0Ÿåˆ=å “å 0“å áŸå@½èK÷ÿêÐ0ÜÀ@-é@ÐMâˆ÷ÿëŒ0ŸåŒŸåŒ@ŸåˆÍå0œå ÀœåÀ�å  á �â�÷ÿëp0ŸåÓ0”áSãd0ŸåÓ0”áSã X0ŸåHÀŸå �âPŸå  á0œç~÷ÿë �â@ŸåW÷ÿë@Ð�‽è40Ÿå �â0Ÿå  á0”çs÷ÿëèÿÿêÐ0èÀQ’̘̜ÌÁTÀ”ÌôÀø@-étAŸå\$”åd4”åRáW dQŸåˆ åPã 0÷ÿë0 ãˆ=å„ åPã *÷ÿë81Ÿå  ã„-å\”å$aŸå„àF€â€âZ÷ÿëpPâ% -÷ÿë`Pâ`   á÷ÿë ã0 á  á–åêöÿë ã  á á+÷ÿë ã  á áˆmå&÷ÿëÀ Ÿå\”å°0ŸåÒ ”á`„åRã ¨ Ÿå ãÃç Bâ ãÃç ‚âd ãƒç ãø€½è€0ŸåÓ0–áSãÐ0ÖáSãˆ= Þöÿë á\ŸåÉöÿë Ôå<0ŸåRã  ãˆ-å \$“å<Ÿå5ƒàFƒâ�â½öÿë  ãø€½è  ãø€½è ãø€½èQÐ0¡Ì Ì¢Ì¿ Á0ŸåØ$Óá râ  3H Ãåÿ/áQ8@-é AŸåÙ4ÔáSã8€½Ú4ÔáSã7 ˆ1Ÿå  ã„QŸå”ç0ƒâ”ç2 ãÀöÿëp1Ÿå  ãJ ÄåÓ0”áSá� åÐ0ÔáSá @1ŸåHŸå”ç0ƒâ ”ç‰öÿë81Ÿå !Ÿå0ÔçSã (Ÿå’çdQã ŸÂ!ŸåôŸåÒ ”áRã!Ÿå ‘çRã$ ùûÿëpã+ Ð0ÔáSã8€½„=åSã* ØŸå8@½èlöÿêÐ0Ÿå  ã¤PŸå”ç0ƒâ”ç2 ãˆöÿë�0Ÿå  ãJ ÄåÓ0”áSã� åÐ0ÔáSãÍÿÿ ˆ0ŸåˆŸå”ç0ƒâ ”çQöÿëÆÿÿêX Ÿå ‘çdRãÖÿÿSã D0ŸåÓ0‘áSãÐÿÿsþÿëÐ0ÔáSãÒÿÿ8€½è8Ÿå8@½èAöÿêQxÌÐ0¢Ìô¿¡Ì”̠̜̠̑ÀpÌÔ¿¸À@-é ãÐMâ;öÿë0DŸå�â  á|öÿë0�å„â(0„å0�å,0„å(öÿëPã 0Ôå0Câ SãñŸ—êĶصôµü¶ôµôµôµôµôµôµ¼¶ 0”åpSã¸#Ÿ0‚ :ƒ  ¥ è3Ÿå #Ÿå0ÔçSã ”#Ÿå0 ã  ã0ÄçV ‚â0ÄçÐ�‽èx3Ÿå0ÒçSãóÿÿlŸåÒçPãP`#ŸåL3ŸåÔçQã-P#Ÿå ÓçRã7D#Ÿå ÓçRã38ŸåÓçPãB ØÓá ÃçPãH Ã\4”åSã ð"Ÿ0C \4‚Øÿÿê ãÒõÿë ”å ã0„à :ƒâpRã¥Ãå¼"ŸåÃÿÿØ4ÒáSã0 H0ÂH½ÿÿê0ÔåSã Sã¸ÿÿ¼ÿÿêLÓå ãÃçPá ã»ÿÿêØ$Óá ãRá  HÃH ôÿÿêØ$Ôá0 ãRáT"Ÿå0ÄçP"Ÿå0Äçîÿÿ ,"Ÿå ãH0Âå¨ÿÿê,"ŸåŸå0Áç™ÿÿê0Âç÷þÿë«ÿÿê "ŸåÓçQã ØÓáÃçQãH÷ÿÿêŸå ÓçRã Ø$ÓáÃçRãHà �ÿÿêØŸåÓçPãbÌ!Ÿåœ1ŸåÔçQãS¼!Ÿåˆ1ŸåÔçQã  ãÃç¤!ŸåÒ “áRá ˜!ŸÃ”1Ÿå”Ÿå”ç ”ç@âPã Bâ „ç8ŸÕ„ç Ó�×`”å Rãd  Ó\1ŸÕ„àF€â€â „×þÿëÎýÿëD!Ÿåü0ŸåÔçQã  ãÃç!ŸåÒ “áRá  !ŸÃ1ŸåŸå”ç ”ç€âP㠂⠄笟ńç Ã�Ç`”å2Rãd  ÃÐ0ŸÅ„àF€â€â „Çôýÿë«ýÿëØ$Ôáp0ŸåRã ã8ÿÿêL$ÓåRãúÿÿP“åPã Ó Ã0ÿÿꄟå ãÃçÑ “á`à pâ ¢à Ãç”ýÿë¡ÿÿêÛÓá Ãç pâ  3K Ãå�ýÿë•ÿÿêQÀÐÑÉÑÅвдѭйѸÑÑѲѡ̜̳̒̔ёÌp@-éÐMâ8AŸå81ŸåP á` á  ã Äç ãõÿë�â  áRõÿë0�åŸå(0„å0�å,0„åþôÿëPã$ 0Õå0Câ SãñŸ—#ê캼ºäºˆºäºäºäºäºäºäº€º ãáôÿë0ÔåSã# Sã0Õçœ Ÿ ÅSãÖÿÿ  ãÐ�âp€½è 0”åpSã0… :ƒ  ¥ Ã0ÕçSãÊÿÿ òÿÿê0Ôçúÿÿê ”å ã0„à :ƒâpRã¥ÃåòÿÿØ4ÕáSã0 H0ÅHÅ0Õçìÿÿê ŸåŸå0ÁçÞÿÿêQÅÐ QÀÐ@-é ã õÿëè@ŸåÙ4ÔáSã8„å `4”åE„àF„â€âêôÿëÄ0Ÿåˆ=å “å 0“å á´Ÿå¡ôÿë ã€½è`”å„àF€â€âPýÿë”0ŸåÓ0”áSãˆ0Ÿå0”çSã úÿëpã Ð0ÔáSãêÿÿ T0Ÿå„=åSãXŸXŸ‰ôÿë ã€½èL0Ÿå0”çdSãíÿÿ@0ŸåÓ0”áSã 40ŸåÓ0”áSãåÿÿ¥üÿëæÿÿêQÐ0ÜÀ‘̜̠À¸À”̡̠Ì8@-é”@ŸåØTÔáUãL4ÔåSã P4”åSãÚ á¹ôÿëP4”å< ”å8”å’àaàQá@„å ³@P„µ8€½¸Ð0Ôá4 ”åSã �à4 „å0 ã@0„å ã8€½è ã8€½è ã8€½èŸåEôÿëôÿÿêQ(ÁL0Ÿå\“åd$“åQá  ÿ/8 Ÿå “çRã  Óÿ/Ñ(ŸåÀ“ç Rá ÃÀŒÂÀƒÇ\ƒÅ`ƒÅ  Óÿ/áQhÌlÌŸåŸå'ôÿêXÁtÁ0@-é ÐMâpŸåP á5ôÿë@Pâ `Ÿå  ãôÿëXPŸåêÝå•åôÿë ã�â  á0 áGôÿëPãõÿÿ á[ôÿë Ð�â0€½èßÿÿëŸå áôÿë  ãôÿë|Á‡PÿÿQ€ÁøE-é` áHPŸåH ŸåP�à  �à  eàp á€ á×óÿëJ¡°áø…½@ ã0•ä á á  á@„â3ÿ/á Tá÷ÿÿø…½èØ�Ü�ÿ/á0Ÿå Ÿå0�à ã “çRã ’ôÿꬑ¼@-逽èinfo: Cleaning Up...info: Free Imagesinfo: ...Done Cleaning Up Thank You for using sdlSlideimage: %s background: %s BlitSurface error: %s defaultFont.pngCouldn't load game font! (%s) Exitting. CreateRGBSurface failed: %s info: scaling image %f:1 info: image is centeredinfo: set %dx%dx16 video mode info: set %dx%d window mode Couldn't initialize SDL: %s info: probing video for W x HsdlSlideerror: Couldn't set video mode: %s info: video output disabledinfo: image is scaledinfo: image is not scaled%dx%d%s: %dx%d %s (%dx%d)%s - %d%%%s - %d:1info: failed loading: %s sdlSlide.timeTaken=%d sdlSlide.totalTime=%d sdlSlide (one-file) v%s 1.2.3rberror: cant open '%s' --version-v--helpCopyright 2016 MiNTed Games View graphics files, using SDL v1.2. usage: sdlSlide-1f [_option_] []_option_: --1f one-file (1f) source information --background instead of black screen --slideshow Slideshow images list (with options) then exit --delay Delay between slides seconds (number keys, default 4) --repeat Show images list times --center Show image centered (C key) --zoom Set zoom to %% (same as below) (default 100, +/- keys) --pixels Pixels size or skip (-) pixels, (default 1, +/- keys) --fullscreen Set window to fullscreen (F11 key) --fit Scale and Center image to fit page --format Display file information (no shows all formats) --novideo Dont display images (use with verbose) --size Only output size (no image) --help This help information -v|--version Version information -V|--verbose Verbose output --debug Extra verbose output special thanks to: www.parallelrealities.co.uk-1f--1fCopyright 2016 MiNTed Gamesone-file (1f) source information. usage: sdlSlide-1f _option_ --src|--source output attached one-file (1f) source file --src-size size of appended source (in bytes) (%d) --src-type type of source appended (TXT/ZIP) (%s) To save one-file (1f) source to file use one of the following: sdlSlide-1f --src > sdlSlide-1f.cpp sdlSlide-1f --src > sdlSlide-1f`sdlSlide-1f --src-type`To verify one-file (1f) source file size: sdlSlide-1f --src-size (match this to the size in a directory listing)or use:NAME=sdlSlide; if [ `ls -l $NAME-1f.cpp|cut -d \ -f 5` = `./$NAME-1f --src-size` ]; then echo Verified; else echo Failed; fione-file (1f) options exit with status: 31 successful (0x1f) 32 an error occured (0x20)--source--src--src-type--src-size%d--format--formats--verbose-V--novideo---no-video--debug--size--center--fullscreen--fit--slideshow--zoomerror: --zoom needs a number--pixelserror: --pixels needs a number--fpserror: --fps needs a number--delayerror: --delay needs a number--repeaterror: --repeat needs a number--backgrounderror: --repeat needs a filename[15] image formats: .ICO Microsoft Icon format .CUR Microsoft Cursor format .BMP Microsoft Bit Map image .GIF Graphics Interchange Format .JPG JPEG encoded graphic image (lossy) .JPEG JPEG encoded graphic image (lossy) .ILBM InterLeaved BitMap image (IFF containers) .LBM InterLeaved BitMap image (IFF containers) .PCX PC Paintbrush eXtended graphic .PNG Portable Network Graphic .PNM Portable Network M .TIF 32bit Image File Format .TIFF 32bit Image File Format .XCF GIMP image .XBM X Windows mono Bit Map image (ASCII) .XPM X Windows color Pixel Map image (ASCII) .XV X Windows .WEBP Cell/Mobile phone Web graphic ICO CUR BMP GIF JPG JPEG ILBM LBM PCX PNG PNM TIF TIFF XCF XBM XPM XV WEBPerror: --size needs at least one file±�°°„�²�°°¨É�°°¯€¼Áÿ°¯€lËÿ�Ìÿ°°¬€ÎÿÀÿÿxÎÿ°¨€„Ïÿ©±€Ðÿ°°ª€´Òÿ¬ÿÿÓÿ«±€ÈÔÿÕÿ°°®€„Õÿ°°ª€ÀÕÿ�ÿÿ”Ûÿ Ýÿ°°¨€˜Þÿ°°¬€Dàÿ°°ª€<áÿ°°¨€âÿLâÿ°¨€ ãÿ«±€ äÿ´äÿ©±€�æÿ°¨€ëÿ°ª€lìÿ°°¨€ˆíÿ©±€(îÿ”îÿ°©€ïÿ€š„™dš@V•ª´ð œ�  ¾O O”�õþÿoƒpˆЄ å 4P`<Œ,ŒþÿÿoÌ‹ÿÿÿoðÿÿoV‹O¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�¨�üPGCC: (Debian 4.6.3-14+rpi1) 4.6.3A.aeabi$6  ,.symtab.strtab.shstrtab.interp.note.ABI-tag.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rel.dyn.rel.plt.init.text.fini.rodata.ARM.extab.ARM.exidx.eh_frame.init_array.fini_array.jcr.dynamic.got.data.bss.comment.ARM.attributes4�4#P�P 1p�p$H”�”„Döÿÿoƒ¸N ЄÐ Vpˆpå^ÿÿÿoV‹V tkþÿÿoÌ‹Ì `z ,Œ, ƒ B<Œ< ` Œœ�œ ‡¨�¨ $’Ì�ÌÔ.˜ ¾ >ž¨¾¨>D¦ìÍìM$±p‚ÎNð¼ÏOÆOOÒ O OÞOOãOO ì4P4PÄñøPøP÷QQtü0Q"p"Q/QQhW`£ ÈgA4�P�p�”�ƒЄpˆV‹Ì‹ ,Œ <Œ œ� ¨� Ì� ¾¨¾ìÍÎÏO OOO4PøPQñÿJP�MšJ ÎJ4šJ¨¾JøPPñÿM@š™@šJ\šMœ� M ¾©ñÿM¤� M¤¾òñÿM°šJœJ ÎM(œJ”œJìÍM¨œJôœM �J°�M¼�JLžMXžJPŸMdŸJÜ Mü Jœ¡M°¡J£M £Jà£Mì£J,¤M0¤Jœ©Mø©J„«M «J ¬M ¬JŒ¬M ¬J ­M ­J ®MÔ®JÀ¯MÔ¯J€°M¤°J¼°MİJì°Mô°J”±M¼±J<³MX³Jp³Mt³J µMXµJ¬µMصJ ¹Mì¹JTºM€ºJ4»MD»J@¼Mh¼J½M½Jd½Mp½J|½M„½J¾MÌ�Jˆ–M°–JÔ—JÎM„™„™€Jô™JOJ¬¾JQñÿ%OJüPMdš2dšJ|šHQJ OW OM€š~€šJ¨šJOŠOJQ©ñÿM¾Jl¾Mt¾µñÿMx¾J˜¾ñÿJÏ¿ÏJOÍOñÿÙüPæOï OO4PM¨� J¸� M¼� )<I¼�œXaj°šxvÔ®ˆQ�¡²øP ½¨¾Ìì¹XÜXž ñüÌ�¸ #to+(œ€; ­´Kİ0Zj «€w…¨œ— ¬€«¿Òx¾(Ùã ¾éöto$2ô°ÈDtoOXj ¬€{‹œ« #hL´ÆšÍÚìd£ˆÿX³!Ô¯Ð5½`Eœ� KdŸ˜^ rŠ›t³ä±ÁÕh¼¨åQóD»$øPtoì£D$9GYQe0¤Üx¾`ˆ¼±œš¬¿„½�ÎîQ ª”%QÒ.@Pü prl¡´ˆt¾˜¸¤° ÆXµ”Ôáþ  £D1p½/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/crt1.o$d$a/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/crti.ocall_gmon_start/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/crtn.osdlSlide-1f.cpp_GLOBAL__sub_I_sdlSlidecrtstuff.c__JCR_LIST____do_global_dtors_auxcompleted.5637__do_global_dtors_aux_fini_array_entryframe_dummy__frame_dummy_init_array_entryelf-init.oSatexit.oS__FRAME_END____JCR_END____dso_handle_DYNAMIC__init_array_end__init_array_start_GLOBAL_OFFSET_TABLE__Znwj@@GLIBCXX_3.4SDL_FillRect_Z9loadImagePcSDL_QuitSDL_Flip_Z7cleanUpv_Z12redrawNormalv_edatastrtol@@GLIBC_2.4fseek@@GLIBC_2.4data_start_IO_stdin_used_Z10slidePausev_Z14loadBackgroundPcSDL_MapRGBmainexit@@GLIBC_2.4printf@@GLIBC_2.4__end___Z10flushInputv_Z10initSystemv_Z9imageInfoPcputs@@GLIBC_2.4_Z8initVarsvSDL_PollEvent_Z12getUserInputv_Z14setVideoWindowv_IO_putc@@GLIBC_2.4putchar@@GLIBC_2.4atexitSDL_Delay_finiSDL_GetError__bss_end__fopen@@GLIBC_2.4abort@@GLIBC_2.4SDL_UpperBlit_Z11updateTitlePc_bss_end__SDL_Initstrcpy@@GLIBC_2.4_Z11setVideoMaxvSDL_FreeSurfaceSDL_SetVideoModeSDL_SetPalettegraphicsSDL_WM_SetCaption_startsge_GetPixelSDL_DisplayFormat_Z12scalePixelUpiifread@@GLIBC_2.4_Z11togglePausev_Z14sdlUpdateVideov_Z10showRepeatv_init_Z12loadCurImagePc_Jv_RegisterClasses__cxa_atexit@@GLIBC_2.4SDL_GetVideoInfo_Z16toggleFullScreenvSDL_SetColorKeybasename@@GLIBC_2.4_Z10slideDelayv__bss_start___Z9slideShowv__data_start_end_Z9copyPixeliiiiSDL_CreateRGBSurfacesge_transformmemcpy@@GLIBC_2.4__bss_start_Z13redrawComplexv__libc_csu_init_Z12getImageFilevfclose@@GLIBC_2.4sprintf@@GLIBC_2.4_Z9output_1fPc__aeabi_unwind_cpp_pr1@@GCC_3.5SDL_GetMouseStatestdout@@GLIBC_2.4_Z13sdlSlide_InitvsdlSlidestrcmp@@GLIBC_2.4time@@GLIBC_2.4_Z12setFontColorP11SDL_Surfaceiii_Z8loadFontvIMG_Load__libc_csu_fini__aeabi_unwind_cpp_pr0@@GCC_3.5_Z9imageSizev_Z9checkKeysvsge_PutPixel__libc_start_main@@GLIBC_2.4__gmon_start__srand@@GLIBC_2.4_Z10isOnScreeniiii_Z10version_1fv/* sdlSlide-1f one-file (1f) image viewer (SDL 1.2 image & SGE) Copyright (C) 2016 MiNTed Games All Rights Reserved This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* one-file (-1f) compile g++ `sdl-config --cflags` -Wall -O3 -DVERSION=\"1.2.3\" `sdl-config --libs` -lSDL_image -lSGE -o sdlSlide-1f sdlSlide-1f.cpp ; \ g++ `sdl-config --cflags` -Wall -O3 -DVERSION=\"1.2.3\" -DPRG_SIZE=`ls -l sdlSlide-1f|cut -d \ -f 5` -DSRC_SIZE=`ls -l sdlSlide-1f.cpp|cut -d \ -f 5` `sdl-config --libs` -lSDL_image -lSGE -o sdlSlide-1f sdlSlide-1f.cpp ; \ cat sdlSlide-1f.cpp >> sdlSlide-1f */ /* one-file (-1f) requires libsdl1.2-dev libsdl-image-dev libsdl-sge-dev */ /* one-file (1f) headers */ #include #include #include #include #include "SDL/SDL.h" #include "SDL/SDL_image.h" #include "SDL/sge.h" /* one-file source appendage */ #define NO_SIZE 45678 //#define SRC_TYPE ".zip" // if its a ZIP appendage #define SRC_TYPE ".cpp" // if its a TEXT appendage, name the extention #ifndef PRG_SIZE //#define PRG_SIZE 27142 // last checked binary size was ... #define PRG_SIZE NO_SIZE // .. this should be close to actual #endif #ifndef SRC_SIZE // size of 1 text file or 1 zip file //#define SRC_SIZE 44921 // last checked source size was ... #define SRC_SIZE NO_SIZE // .. affects binary size if too small #endif const long offset_1f = PRG_SIZE; // this has never been accurate (EXT4) const long sizeOf_1f = SRC_SIZE; // we use this (-sizeOf_1f) as offset /* one-file (1f) start */ /* one-file (1f) defines */ #define SCREEN_WIDTH 1360 // these are actually dynamic #define SCREEN_HEIGHT 768 #define WINDOW_WIDTH 800 // size when not --fullscreen (ie. windowed) #define WINDOW_HEIGHT 600 #define LINUX 1 #define MAX_TEXTSHAPES 70 #define MAX_FONTSHAPES 6 #define MAX_SHAPES 100 /* one-file (1f) enums */ // Font Colors enum { FONT_WHITE, FONT_RED, FONT_YELLOW, FONT_GREEN, FONT_CYAN, FONT_OUTLINE // a dark blue color }; /* one-file (1f) structs */ typedef struct sdlSlideEngineVariables { signed char debug; SDL_Event event; signed char done; SDL_RWops *sdlrw; float ssx; float ssy; int cursor_x, cursor_y; int eventTimer; int totalTime; int startTime; int stopTime; int timeTaken; // In seconds signed char timePlayed; signed char seconds; signed char minutes; signed char hours; signed char paused; signed char useVideo; signed char fullscreen; signed char useBackground; char background[1024]; signed char slideshow; int delay; int delayCount; int fps; int next; int current; int playlist; char playList[50][1024]; int repeat; int repeatCount; int display_w; int display_h; int window_w; int window_h; int ox; int oy; int ow; int oh; signed char oneIn; signed char center; signed char useZoom; int zoom; signed char useScale; int scale; signed char doFit; signed char fitPage; signed char info; signed char showFormat; signed char showSize; // This really only applies to Linux users. char userHomeDirectory[1024]; char keyState[350]; signed char section; }; sdlSlideEngineVariables sdlSlide; typedef struct bRect { int x, y, w, h; bRect *next; } bRect; typedef struct textObject { SDL_Surface *image; unsigned char life; float x, y; signed char fontColor; char text[255]; }; /* one-file (1f) classes */ class sdlSlideGraphics { public: Uint32 red; Uint32 darkRed; Uint32 yellow; Uint32 darkYellow; Uint32 green; Uint32 darkGreen; Uint32 blue; Uint32 darkBlue; Uint32 darkerBlue; Uint32 black; Uint32 white; Uint32 lightGrey; Uint32 darkGrey; SDL_Surface *screen, *background; SDL_Surface *cur_image, *scale_image; SDL_Surface *shape[MAX_SHAPES]; SDL_Surface *fontShape[MAX_FONTSHAPES]; bRect *bufferHead; bRect *bufferTail; textObject textShape[MAX_TEXTSHAPES]; SDL_Rect blitRect; SDL_Rect scale_rect; SDL_Surface *messageBox; sdlSlideGraphics() { bufferHead = new bRect; bufferHead->next = NULL; bufferTail = bufferHead; for (int i = 0 ; i < MAX_SHAPES ; i++) shape[i] = NULL; for (int i = 0 ; i < MAX_TEXTSHAPES ; i++) textShape[i].image = NULL; messageBox = NULL; background = NULL; cur_image = NULL; scale_image = NULL; } SDL_Surface *setTransparent(SDL_Surface *sprite) { SDL_SetColorKey(sprite, (SDL_SRCCOLORKEY|SDL_RLEACCEL), SDL_MapRGB(sprite->format, 0, 0, 0)); return sprite; } void addBuffer(int x, int y, int w, int h) { bRect *rect = new bRect; rect->next = NULL; rect->x = x; rect->y = y; rect->w = w; rect->h = h; bufferTail->next = rect; bufferTail = rect; } void blit(SDL_Surface *image, int x, int y, SDL_Surface *dest) { // Set up a rectangle to draw to blitRect.x = x; blitRect.y = y; blitRect.w = image->w; blitRect.h = image->h; /* Blit onto the screen surface */ if(SDL_BlitSurface(image, NULL, dest, &blitRect) < 0) { printf("BlitSurface error: %s\n", SDL_GetError()); } // addBuffer(blitRect.x, blitRect.y, blitRect.w, blitRect.h); } void blit(SDL_Surface *image, int x, int y) { blit(image, x, y, screen); } void blitText(int i) { blit(textShape[i].image, (int)textShape[i].x, (int)textShape[i].y, screen); } void flushBuffer() { bRect *prevRect = bufferHead; bRect *rect = bufferHead; bufferTail = bufferHead; while (rect->next != NULL) { rect = rect->next; prevRect->next = rect->next; delete rect; rect = prevRect; } bufferHead->next = NULL; } void unBuffer() { bRect *prevRect = bufferHead; bRect *rect = bufferHead; bufferTail = bufferHead; while (rect->next != NULL) { rect = rect->next; blitRect.x = rect->x; blitRect.y = rect->y; blitRect.w = rect->w; blitRect.h = rect->h; if (SDL_BlitSurface(background, &blitRect, screen, &blitRect) < 0) { printf("BlitSurface error: %s\n", SDL_GetError()); } prevRect->next = rect->next; delete rect; rect = prevRect; } bufferHead->next = NULL; } /* In 16 bit mode this is slow. VERY slow. Don't write directly to a surface that constantly needs updating (eg - the main game screen) */ int renderString(char *in, int x, int y, int fontColor, signed char wrap, SDL_Surface *dest) { SDL_Rect area; area.x = x; area.y = y; area.w = 8; area.h = 14; SDL_Rect letter; letter.y = 0; letter.w = 8; letter.h = 14; while (*in != '\0') { if (*in != 32) { letter.x = (*in - 33); letter.x *= 8; letter.x--; // Temp fix /* Blit onto the screen surface */ if(SDL_BlitSurface(fontShape[fontColor], &letter, dest, &area) < 0) { printf("BlitSurface error: %s\n", SDL_GetError()); } } area.x += 9; if (wrap) { if ((area.x > (dest->w - 70)) && (*in == 32)) { area.y += 16; area.x = x; } } *in++; } return area.y; } int drawString(char *in, int x, int y, int fontColor, signed char wrap, SDL_Surface *dest) { renderString(in, x, y - 1, FONT_OUTLINE, wrap, dest); renderString(in, x, y + 1, FONT_OUTLINE, wrap, dest); renderString(in, x, y + 2, FONT_OUTLINE, wrap, dest); renderString(in, x - 1, y, FONT_OUTLINE, wrap, dest); renderString(in, x - 2, y, FONT_OUTLINE, wrap, dest); renderString(in, x + 1, y, FONT_OUTLINE, wrap, dest); return renderString(in, x, y, fontColor, wrap, dest); } int drawString(char *in, int x, int y, int fontColor, SDL_Surface *dest) { if (x == -1) x = (dest->w - (strlen(in) * 9)) / 2; return drawString(in, x, y, fontColor, 0, dest); } int drawString(char *in, int x, int y, int fontColor) { if (x == -1) x = (800 - (strlen(in) * 9)) / 2; return drawString(in, x, y, fontColor, 0, screen); } /* Finds the location of the requested color within the palette and returns it's number. This colors are used for drawing rectangles, circle, etc in the correct colors. */ void setColorIndexes() { red = SDL_MapRGB(screen->format, 0xff, 0x00, 0x00); darkRed = SDL_MapRGB(screen->format, 0x66, 0x00, 0x00); yellow = SDL_MapRGB(screen->format, 0xff, 0xff, 0x00); darkYellow = SDL_MapRGB(screen->format, 0x66, 0x66, 0x00); green = SDL_MapRGB(screen->format, 0x00, 0xff, 0x00); darkGreen = SDL_MapRGB(screen->format, 0x00, 0x66, 0x00); blue = SDL_MapRGB(screen->format, 0x00, 0x00, 0xff); darkBlue = SDL_MapRGB(screen->format, 0x00, 0x00, 0x99); darkerBlue = SDL_MapRGB(screen->format, 0x00, 0x00, 0x44); black = SDL_MapRGB(screen->format, 0x00, 0x00, 0x00); white = SDL_MapRGB(screen->format, 0xff, 0xff, 0xff); lightGrey = SDL_MapRGB(screen->format, 0xcc, 0xcc, 0xcc); darkGrey = SDL_MapRGB(screen->format, 0x99, 0x99, 0x99); } /* Draws the background surface that has been loaded */ void drawBackGround() { blit(background, 0, 0, screen); } void drawCurImage() { blit(cur_image, 0, 0, screen); } void clearScreen(Uint32 color) { SDL_FillRect(screen, NULL, color); } void updateScreen() { SDL_Flip(screen); // Give the audio (and possibly the X server) time to work SDL_Delay(1); } /* * get the pixel at (x, y) to the given value */ /* Uint32 getpixel(SDL_Surface *surface, int x, int y) { // Uint32 pixel; unsigned char pixel[4]; int bpp = surface->format->BytesPerPixel; // Here p is the address to the pixel we want to set Uint8 *p = (Uint8 *)surface->pixels + y * surface->pitch + x * bpp; if(SDL_BYTEORDER == SDL_BIG_ENDIAN) { switch(bpp) { case 1: pixel[0] = p; break; case 2: pixel[0] = (p[0] >> 8) & 0xff; pixel[1] = p[1] & 0xff; break; case 3: pixel[0] = (p[0] >> 16) & 0xff; pixel[1] = (p[1] >> 8) & 0xff; pixel[2] = p[2] & 0xff; break; case 4: pixel = p; break; } }else{ switch(bpp) { case 1: pixel[0] = p; break; case 2: pixel[0] = p[0] & 0xff; pixel[1] = (p[1] >> 8) & 0xff; break; case 3: pixel[0] = p[0] & 0xff; pixel[1] = (p[1] >> 8) & 0xff; pixel[2] = (p[2] >> 16) & 0xff; break; case 4: pixel = p; break; } } return(pixel); } */ /* * Set the pixel at (x, y) to the given value * NOTE: The surface must be locked before calling this! */ void putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel) { int bpp = surface->format->BytesPerPixel; /* Here p is the address to the pixel we want to set */ Uint8 *p = (Uint8 *)surface->pixels + y * surface->pitch + x * bpp; switch(bpp) { case 1: *p = pixel; break; case 2: *(Uint16 *)p = pixel; break; case 3: if(SDL_BYTEORDER == SDL_BIG_ENDIAN) { p[0] = (pixel >> 16) & 0xff; p[1] = (pixel >> 8) & 0xff; p[2] = pixel & 0xff; } else { p[0] = pixel & 0xff; p[1] = (pixel >> 8) & 0xff; p[2] = (pixel >> 16) & 0xff; } break; case 4: *(Uint32 *)p = pixel; break; } } void drawLine(SDL_Surface *dest, int x1, int y1, int x2, int y2, int col) { int counter = 0; if ( SDL_MUSTLOCK(dest) ) { if ( SDL_LockSurface(dest) < 0 ) { printf("Can't lock screen: %s\n", SDL_GetError()); } } while(1) { putpixel(dest, x1, y1, col); if (x1 > x2) x1--; if (x1 < x2) x1++; if (y1 > y2) y1--; if (y1 < y2) y1++; if ((x1 == x2) && (y1 == y2)) {break;} if (counter == 1000) {printf("Loop Error!\n"); break;} counter++; } if ( SDL_MUSTLOCK(dest) ) { SDL_UnlockSurface(dest); } } void drawLine(int x1, int y1, int x2, int y2, int col) { drawLine(screen, x1, y1, x2, y2, col); } /* A quick(?) circle draw function. This code was posted to the SDL mailing list... I didn't write it myself. */ void circle(int xc, int yc, int R, SDL_Surface *PIX, int col) { int x = 0, xx = 0; int y = R, yy = R+R; int p = 1-R; putpixel(PIX, xc, yc - y, col); putpixel(PIX, xc, yc + y, col); putpixel(PIX, xc - y, yc, col); putpixel(PIX, xc + y, yc, col); while(x < y) { xx += 2; ++x; if (p >= 0) { yy -= 2; --y; p -= yy; } p += xx + 1; putpixel(PIX, xc - x, yc - y, col); putpixel(PIX, xc + x, yc - y, col); putpixel(PIX, xc - x, yc + y, col); putpixel(PIX, xc + x, yc + y, col); putpixel(PIX, xc - y, yc - x, col); putpixel(PIX, xc + y, yc - x, col); putpixel(PIX, xc - y, yc + x, col); putpixel(PIX, xc + y, yc + x, col); } if ((x = y)) { putpixel(PIX, xc - x, yc - y, col); putpixel(PIX, xc + x, yc - y, col); putpixel(PIX, xc - x, yc + y, col); putpixel(PIX, xc + x, yc + y, col); } } void blevelRect(SDL_Surface *dest, int x, int y, int w, int h, Uint8 red, Uint8 green, Uint8 blue) { SDL_Rect r = {x, y, w, h}; SDL_FillRect(dest, &r, SDL_MapRGB(screen->format, red, green, blue)); drawLine(dest, x, y, x + w, y, SDL_MapRGB(screen->format, 255, 255, 255)); drawLine(dest, x, y, x, y + h, SDL_MapRGB(screen->format, 255, 255, 255)); drawLine(dest, x, y + h, x + w, y + h, SDL_MapRGB(screen->format, 128, 128, 128)); drawLine(dest, x + w, y + 1, x + w, y + h, SDL_MapRGB(screen->format, 128, 128, 128)); } void blevelRect(int x, int y, int w, int h, Uint8 red, Uint8 green, Uint8 blue) { blevelRect(screen, x, y, w, h, red, green, blue); } SDL_Surface *createSurface(int width, int height) { SDL_Surface *surface, *newImage; Uint32 rmask, gmask, bmask, amask; /* SDL interprets each pixel as a 32-bit number, so our masks must depend on the endianness (byte order) of the machine */ #if (SDL_BYTEORDER == SDL_BIG_ENDIAN) rmask = 0xff000000; gmask = 0x00ff0000; bmask = 0x0000ff00; amask = 0x000000ff; #else rmask = 0x000000ff; gmask = 0x0000ff00; bmask = 0x00ff0000; amask = 0xff000000; #endif surface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32, rmask, gmask, bmask, amask); if (surface == NULL) { printf("CreateRGBSurface failed: %s\n", SDL_GetError()); } newImage = SDL_DisplayFormat(surface); SDL_FreeSurface(surface); return newImage; } SDL_Surface *textSurface(char *inString, int color) { SDL_Surface *surface = createSurface(strlen(inString) * 9, 16); drawString(inString, 1, 1, color, surface); return setTransparent(surface); } void textSurface(int index, char *inString, int x, int y, int fontColor) { strcpy(textShape[index].text, inString); textShape[index].x = x; textShape[index].y = y; textShape[index].fontColor = fontColor; if (textShape[index].image != NULL) { SDL_FreeSurface(textShape[index].image); } textShape[index].image = textSurface(inString, fontColor); if (x == -1) textShape[index].x = (800 - textShape[index].image->w) / 2; } SDL_Surface *alphaRect(int width, int height, Uint8 red, Uint8 green, Uint8 blue) { SDL_Surface *surface = createSurface(width, height); SDL_FillRect(surface, NULL, SDL_MapRGB(surface->format, red, green, blue)); SDL_SetAlpha(surface, SDL_SRCALPHA|SDL_RLEACCEL, 128); return surface; } SDL_Surface *transparentRect(int width, int height, Uint8 red, Uint8 green, Uint8 blue) { SDL_Surface *surface = createSurface(width, height); SDL_FillRect(surface, NULL, SDL_MapRGB(surface->format, red, green, blue)); SDL_SetColorKey(surface, (SDL_SRCCOLORKEY|SDL_RLEACCEL), SDL_MapRGB(surface->format, red, green, blue)); // SDL_SetColorKey(surface, (SDL_SRCCOLORKEY|SDL_RLEACCEL), sge_GetPixel(bitmap,0,0)); return surface; } void createMessageBox(SDL_Surface *face, char *message, signed char transparent) { if (messageBox != NULL) { SDL_FreeSurface(messageBox); messageBox = NULL; } if (transparent) messageBox = alphaRect(550, 60, 0x00, 0x00, 0x00); else messageBox = createSurface(550, 60); signed char x = 60; if (face != NULL) { blevelRect(messageBox, 0, 0, messageBox->w - 1, messageBox->h - 1, 0x00, 0x00, 0xaa); blit(face, 5, 5, messageBox); } else { blevelRect(messageBox, 0, 0, messageBox->w - 1, messageBox->h - 1, 0x00, 0x00, 0x00); x = 10; } drawString(message, x, 5, FONT_WHITE, 1, messageBox); } void freeGraphics() { for (int i = 0 ; i < MAX_SHAPES ; i++) { if (shape[i] != NULL) { SDL_FreeSurface(shape[i]); shape[i] = NULL; } } for (int i = 0 ; i < MAX_TEXTSHAPES ; i++) { if (textShape[i].image != NULL) { SDL_FreeSurface(textShape[i].image); textShape[i].image = NULL; } } if (messageBox != NULL) { SDL_FreeSurface(messageBox); messageBox = NULL; } if (background != NULL) { SDL_FreeSurface(background); background = NULL; } if (cur_image != NULL) { SDL_FreeSurface(cur_image); cur_image = NULL; } if (scale_image != NULL) { SDL_FreeSurface(scale_image); scale_image = NULL; } } }; sdlSlideGraphics graphics; /* one-file (1f) functions */ /* key handling */ void flushInput() { for (int i = 0 ; i < 350 ; i++) sdlSlide.keyState[i] = 0; while (SDL_PollEvent(&sdlSlide.event)){} } void getUserInput() { // Get the current mouse position int x, y; SDL_GetMouseState(&x, &y); sdlSlide.cursor_x = x; sdlSlide.cursor_y = y; if (SDL_PollEvent(&sdlSlide.event)) { switch (sdlSlide.event.type) { case SDL_QUIT: exit(0); break; case SDL_MOUSEBUTTONDOWN: if (sdlSlide.event.button.button == SDL_BUTTON_LEFT) sdlSlide.keyState[SDLK_SPACE] = 1; if (sdlSlide.event.button.button == SDL_BUTTON_RIGHT) sdlSlide.keyState[SDLK_ESCAPE] = 1; break; case SDL_KEYDOWN: sdlSlide.keyState[sdlSlide.event.key.keysym.sym] = 1; if (sdlSlide.event.key.keysym.sym == SDLK_p) { if (sdlSlide.paused) sdlSlide.paused = 0; else sdlSlide.paused = 1; } break; case SDL_KEYUP: if (sdlSlide.event.key.keysym.sym != SDLK_p) sdlSlide.keyState[sdlSlide.event.key.keysym.sym] = 0; break; default: break; } } } /* This bit is just for Linux users. It attempts to get the user's home directory, then creates the .parallelrealities and .parallelrealities/starfighter directories so that saves and temporary data files can be written there. Good, eh? :) */ /* #if LINUX void setupUserHomeDirectory() { char *userHome; char *name = getlogin(); passwd *pass; if (name != NULL) pass = getpwnam(name); else pass = getpwuid(geteuid()); if (pass == NULL) { printf("Couldn't determine the user home directory. Exitting.\n"); exit(1); } userHome = pass->pw_dir; char dir[PATH_MAX]; strcpy(dir, ""); sprintf(dir, "%s/.parallelrealities", userHome); if ((mkdir(dir, S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH) != 0) && (errno != EEXIST)) showErrorAndExit(2, dir); sprintf(dir, "%s/.1f/sdlSlide", userHome); if ((mkdir(dir, S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH) != 0) && (errno != EEXIST)) showErrorAndExit(2, dir); sprintf(sdlSlide.userHomeDirectory, "%s/.1f/sdlSlide/", userHome); } #endif */ /* image handling */ SDL_Surface *loadImage(char *filename) { SDL_Surface *image, *newImage; image = IMG_Load(filename); if (image == NULL) { if (sdlSlide.info || sdlSlide.debug) printf("image: %s\n", SDL_GetError()); return NULL; } newImage = SDL_DisplayFormat(image); if ( newImage ) { SDL_FreeSurface(image); } else { // This happens when we are loading the window icon image newImage = image; } return graphics.setTransparent(newImage); } void loadBackground(char *filename) { if (graphics.background != NULL) { SDL_FreeSurface(graphics.background); graphics.background = NULL; } graphics.background = loadImage(filename); if (graphics.background == NULL) { if (sdlSlide.info || sdlSlide.debug) printf("background: %s\n", SDL_GetError()); }else SDL_SetColorKey(graphics.background, 0, 0); // if (sdlSlide.useVideo) // graphics.drawBackGround(); } void loadCurImage(char *filename) { if (graphics.cur_image != NULL) { SDL_FreeSurface(graphics.cur_image); graphics.cur_image = NULL; } graphics.cur_image = loadImage(filename); if (graphics.cur_image == NULL) { if (sdlSlide.info || sdlSlide.debug) printf("image: %s\n", SDL_GetError()); }else SDL_SetColorKey(graphics.background, 0, 0); if (sdlSlide.useVideo) graphics.drawCurImage(); } void setFontColor(SDL_Surface *image, int red, int green, int blue) { SDL_Color colors[256]; colors[0].r = 0; colors[0].g = 0; colors[0].b = 0; for (int i = 1 ; i < 256 ; i++) { colors[i].r = red; colors[i].g = green; colors[i].b = blue; } SDL_SetPalette(image, SDL_LOGPAL|SDL_PHYSPAL, colors, 0, 256); } /* Custom loading to alter the font color before doing all other things */ void loadFont() { SDL_Surface *image, *newImage; for (int i = 0 ; i < MAX_FONTSHAPES ; i++) { image = IMG_Load("defaultFont.png"); if (image == NULL) { printf("Couldn't load game font! (%s) Exitting.\n", SDL_GetError()); exit(1); } switch(i) { case 1: setFontColor(image, 255, 0, 0); break; case 2: setFontColor(image, 255, 255, 0); break; case 3: setFontColor(image, 0, 255, 0); break; case 4: setFontColor(image, 0, 255, 255); break; case 5: setFontColor(image, 0, 0, 10); break; } newImage = SDL_DisplayFormat(image); graphics.fontShape[i] = graphics.setTransparent(newImage); SDL_FreeSurface(image); } } int isOnScreen(int x, int y, int w, int h) { if ((x + w > 0) && (x < 800) && (y + h > 0) && (y < 600)) return 1; return 0; } void cleanUp() { if (sdlSlide.info || sdlSlide.debug) printf("info: Cleaning Up...\n"); graphics.freeGraphics(); if (sdlSlide.info || sdlSlide.debug) printf("info: Free Images\n"); SDL_Quit(); if (sdlSlide.info || sdlSlide.debug) printf("info: ...Done Cleaning Up\nThank You for using sdlSlide\n"); } /* Pixel Stuff */ void scalePixelUp(int x, int y) { int pc; pc = sge_GetPixel(graphics.cur_image, x, y); for (int yy = 0; yy < sdlSlide.scale; yy++) for (int xx = 0; xx < sdlSlide.scale; xx++) sge_PutPixel(graphics.scale_image, xx, yy, pc); } void copyPixel(int x, int y, int xx, int yy) { int pc; pc = sge_GetPixel(graphics.cur_image, x, y); sge_PutPixel(graphics.scale_image, xx, yy, pc); } int redrawComplex() { signed char scaleDone; int cw, ch, iw, ih, m; float scale, tw, th; graphics.clearScreen(0); if (sdlSlide.fullscreen) { cw = sdlSlide.display_w; ch = sdlSlide.display_h; }else{ cw = sdlSlide.window_w; ch = sdlSlide.window_h; } if (graphics.scale_image != NULL) { SDL_FreeSurface(graphics.scale_image); graphics.scale_image = NULL; } // scaleDone = 0; if (sdlSlide.fitPage && sdlSlide.doFit) { tw = (float) cw / graphics.cur_image->w; th = (float) ch / graphics.cur_image->h; if(tw < th) scale = tw; else scale = th; iw = scale * graphics.cur_image->w; ih = scale * graphics.cur_image->h; graphics.scale_image = graphics.transparentRect(iw, ih, 255, 0, 255); graphics.scale_rect = sge_transform(graphics.cur_image, graphics.scale_image, 0, scale, scale, 0, 0, iw/2, ih/2, SGE_TTMAP); sdlSlide.center = 1; sdlSlide.doFit = 0; }else if ( sdlSlide.useZoom || (sdlSlide.useScale && sdlSlide.scale >= 1) ) { if (sdlSlide.useZoom) scale = (float) sdlSlide.zoom / 100; else scale = (float) sdlSlide.scale; if (sdlSlide.debug) printf("info: scaling image %f:1\n", scale); iw = scale * graphics.cur_image->w; ih = scale * graphics.cur_image->h; if (iw > cw) iw = cw; if (ih > ch) ih = ch; graphics.scale_image = graphics.transparentRect(iw, ih, 255, 0, 255); graphics.scale_rect = sge_transform(graphics.cur_image, graphics.scale_image, 0, scale, scale, 0, 0, iw/2, ih/2, SGE_TTMAP); // scaleDone = 1; } /* else{ scaleDone = 1; } if (sdlSlide.useZoom && !scaleDone) { sdlSlide.useScale = 1; sdlSlide.oneIn = 0; while(true){ if (sdlSlide.zoom==90){ sdlSlide.oneIn = 1; sdlSlide.scale = -5; break; } if (sdlSlide.zoom==80){ sdlSlide.oneIn = 1; sdlSlide.scale = -4; break; } if (sdlSlide.zoom==70){ sdlSlide.oneIn = 1; sdlSlide.scale = -3; break; } if (sdlSlide.zoom==60){ sdlSlide.oneIn = 1; sdlSlide.scale = -2; break; } if (sdlSlide.zoom==50){ sdlSlide.oneIn = 0; sdlSlide.scale = -1; break; } if (sdlSlide.zoom==33){ sdlSlide.oneIn = 0; sdlSlide.scale = -2; break; } if (sdlSlide.zoom==25){ sdlSlide.oneIn = 0; sdlSlide.scale = -3; break; } if (sdlSlide.zoom==13){ sdlSlide.oneIn = 0; sdlSlide.scale = -4; break; } if (sdlSlide.zoom==12){ sdlSlide.oneIn = 0; sdlSlide.scale = -4; break; } if (sdlSlide.zoom==6) { sdlSlide.oneIn = 0; sdlSlide.scale = -5; break; } if (sdlSlide.zoom==5) { sdlSlide.oneIn = 0; sdlSlide.scale = -5; break; } sdlSlide.scale = 1; break; } } if (sdlSlide.useScale && !scaleDone) { if (sdlSlide.oneIn) // { / * scale down (50%, 33%, 25%, 12.5%, 6.25%) * / iw = (int)(graphics.cur_image->w / (-1 * sdlSlide.scale)); ih = (int)(graphics.cur_image->h / (-1 * sdlSlide.scale)); if (iw > cw) iw = cw; if (ih > ch) ih = ch; graphics.scale_image = graphics.transparentRect(iw, ih, 255, 0, 255); if (graphics.scale_image == NULL) return -1; sdlSlide.ox = 0; sdlSlide.oy = 0; for (int j=0; j= ih) j = ih - 1; for (int i=0; i= iw) i = iw - 1; copyPixel(i, j, sdlSlide.ox, sdlSlide.oy); sdlSlide.ox++; } sdlSlide.oy++; } // }else{ / * scale down (90%, 80%, 75%, 70%, 66%) * / iw = (int)(graphics.cur_image->w - (graphics.cur_image->w / (-1 * sdlSlide.scale))); ih = (int)(graphics.cur_image->h - (graphics.cur_image->h / (-1 * sdlSlide.scale))); if (iw > cw) iw = cw; if (ih > ch) ih = ch; graphics.scale_image = graphics.transparentRect(iw, ih, 255, 0, 255); if (graphics.scale_image == NULL) return -1; for (int j=0; j= ih) { j = ih; continue; } for (int i=0; iw/2); sdlSlide.oy = (ch/2)-(graphics.scale_image->h/2); }else{ sdlSlide.ox = (cw/2)-(graphics.cur_image->w/2); sdlSlide.oy = (ch/2)-(graphics.cur_image->h/2); } }else{ sdlSlide.ox = 0; sdlSlide.oy = 0; } if(graphics.background != NULL) graphics.drawBackGround(); if (graphics.scale_image != NULL) graphics.blit(graphics.scale_image, sdlSlide.ox, sdlSlide.oy, graphics.screen); else graphics.blit(graphics.cur_image, sdlSlide.ox, sdlSlide.oy, graphics.screen); graphics.updateScreen(); return 0; } /* initialization */ void sdlSlide_Init() { sdlSlide.debug = 0; if (sdlSlide.debug) printf("info: initializing engine\n"); sdlSlide.useVideo = 1; sdlSlide.fullscreen = 0; sdlSlide.useBackground = 0; sdlSlide.display_w = SCREEN_WIDTH; // default display size sdlSlide.display_h = SCREEN_HEIGHT; sdlSlide.window_w = WINDOW_WIDTH; // default window size sdlSlide.window_h = WINDOW_HEIGHT; sdlSlide.ox = 0; sdlSlide.oy = 0; sdlSlide.ow = 0; sdlSlide.oh = 0; sdlSlide.ssx = 0; sdlSlide.ssy = 0; for (int i = 0 ; i < 350 ; i++) sdlSlide.keyState[i] = 0; sdlSlide.eventTimer = 0; sdlSlide.totalTime = 0; sdlSlide.startTime = 0; sdlSlide.stopTime = 1; sdlSlide.timeTaken = 0; sdlSlide.seconds = 0; sdlSlide.minutes = 0; sdlSlide.paused = 0; sdlSlide.slideshow = 0; sdlSlide.delay = 4; sdlSlide.delayCount = 0; sdlSlide.fps = 0; sdlSlide.next = 0; sdlSlide.current = 0; sdlSlide.playlist = 0; sdlSlide.repeat = 0; sdlSlide.repeatCount = 0; sdlSlide.useZoom = 0; sdlSlide.zoom = 100; sdlSlide.useScale = 0; sdlSlide.scale = 1; sdlSlide.doFit = 0; sdlSlide.fitPage = 0; sdlSlide.info = 0; sdlSlide.showFormat = 0; sdlSlide.showSize = 0; sdlSlide.section = 0; } void initVars() { srand(time(NULL)); // for randomise playlist if (sdlSlide.useScale && sdlSlide.useZoom) sdlSlide.useZoom = 0; if (sdlSlide.scale == 0) sdlSlide.scale = 1; if (sdlSlide.zoom == 0) sdlSlide.zoom = 100; } void setVideoMax() { graphics.screen = SDL_SetVideoMode(sdlSlide.display_w, sdlSlide.display_h, 16, SDL_HWSURFACE|SDL_HWPALETTE|SDL_FULLSCREEN); sdlSlide.fullscreen = 1; if (sdlSlide.info || sdlSlide.debug) printf("info: set %dx%dx16 video mode\n", sdlSlide.display_w, sdlSlide.display_h); } void setVideoWindow() { graphics.screen = SDL_SetVideoMode(sdlSlide.window_w, sdlSlide.window_h, 0, SDL_HWSURFACE|SDL_HWPALETTE); sdlSlide.fullscreen = 0; if (sdlSlide.info || sdlSlide.debug) printf("info: set %dx%d window mode\n", sdlSlide.window_w, sdlSlide.window_h); } void initSystem() { const SDL_VideoInfo* videoInfo; /* Initialize the SDL library */ if (SDL_Init(SDL_INIT_VIDEO) < 0) { printf("Couldn't initialize SDL: %s\n", SDL_GetError()); exit(1); } if (sdlSlide.debug) printf("info: probing video for W x H\n"); videoInfo = SDL_GetVideoInfo(); sdlSlide.display_w = videoInfo->current_w; sdlSlide.display_h = videoInfo->current_h; if (sdlSlide.useVideo) { SDL_WM_SetCaption("sdlSlide", "sdlSlide"); // SDL_WM_SetIcon(loadImage("gfx/alienDevice.png"), NULL); if (sdlSlide.fullscreen) setVideoMax(); else setVideoWindow(); if (graphics.screen == NULL) { printf("error: Couldn't set video mode: %s\n", SDL_GetError()); exit(1); } }else{ if (sdlSlide.info || sdlSlide.debug) printf("info: video output disabled\n"); } } void redrawNormal() { graphics.clearScreen(0); if(graphics.background != NULL) graphics.drawBackGround(); graphics.drawCurImage(); graphics.updateScreen(); } void sdlUpdateVideo() { if (sdlSlide.center || (sdlSlide.scale != 1) || (sdlSlide.zoom != 100) || (sdlSlide.fitPage && sdlSlide.doFit) ) { if (redrawComplex() == -1) redrawNormal(); }else{ redrawNormal(); } if (sdlSlide.debug) { if (graphics.scale_image != NULL) printf("info: image is scaled\n"); else printf("info: image is not scaled\n"); } } /* slideshow states */ void imageSize() { printf("%dx%d", graphics.cur_image->w, graphics.cur_image->h); } void imageInfo(char *file) { char *filename; filename = basename(file); printf("%s: %dx%d\n", filename, graphics.cur_image->w, graphics.cur_image->h); } void updateTitle(char *file) { char title[50]; sprintf(title,"%s (%dx%d)", basename(file), graphics.cur_image->w, graphics.cur_image->h); if (sdlSlide.useZoom) sprintf(title,"%s - %d%%", title, sdlSlide.zoom); if (sdlSlide.useScale) sprintf(title,"%s - %d:1", title, sdlSlide.scale); SDL_WM_SetCaption(title, "sdlSlide"); } int getImageFile() //#0 { if (sdlSlide.next == sdlSlide.playlist) return 8; if (graphics.cur_image != NULL) { SDL_FreeSurface(graphics.cur_image); graphics.cur_image = NULL; } if (graphics.scale_image != NULL) { SDL_FreeSurface(graphics.scale_image); graphics.scale_image = NULL; } graphics.cur_image = loadImage(sdlSlide.playList[sdlSlide.next]); if (graphics.cur_image == NULL) { if (sdlSlide.debug) printf("info: failed loading: %s\n",sdlSlide.playList[sdlSlide.next]); return 9; } SDL_SetColorKey(graphics.cur_image, 0, 0); sdlSlide.current = sdlSlide.next; if (sdlSlide.fitPage) { sdlSlide.doFit = 1; sdlSlide.useZoom = 0; sdlSlide.zoom = 100; } return 2; } void togglePause() { if(sdlSlide.paused) sdlSlide.paused = 0; else sdlSlide.paused = 1; } void toggleFullScreen() { if (!sdlSlide.useVideo) return; if(sdlSlide.fullscreen) { setVideoWindow(); }else{ setVideoMax(); } if (sdlSlide.fitPage && sdlSlide.zoom != 100) sdlSlide.doFit = 1; sdlUpdateVideo(); } int checkKeys() //#1 { SDL_Delay(1); getUserInput(); if (sdlSlide.keyState[SDLK_ESCAPE] || sdlSlide.keyState[SDLK_q]) { sdlSlide.keyState[SDLK_ESCAPE] = 0; sdlSlide.keyState[SDLK_q] = 0; return 10; } if (sdlSlide.keyState[SDLK_F11]) { sdlSlide.keyState[SDLK_F11] = 0; toggleFullScreen(); } if (sdlSlide.keyState[SDLK_SPACE]) { sdlSlide.keyState[SDLK_SPACE] = 0; if(!sdlSlide.slideshow) return 8; togglePause(); return 3; } if (sdlSlide.keyState[SDLK_RETURN] || sdlSlide.keyState[SDLK_KP_ENTER]) { sdlSlide.keyState[SDLK_RETURN] = 0; sdlSlide.keyState[SDLK_KP_ENTER] = 0; if (sdlSlide.paused) togglePause(); return 8; } if (sdlSlide.keyState[SDLK_BACKSPACE]) { sdlSlide.keyState[SDLK_BACKSPACE] = 0; if (sdlSlide.paused) togglePause(); if (sdlSlide.next == 0) return 1; --sdlSlide.next; return 0; } if (sdlSlide.keyState[SDLK_LEFT]) { sdlSlide.keyState[SDLK_LEFT] = 0; if (sdlSlide.paused) togglePause(); if (sdlSlide.next == 0) return 1; --sdlSlide.next; return 0; } if (sdlSlide.keyState[SDLK_RIGHT]) { sdlSlide.keyState[SDLK_RIGHT] = 0; if (sdlSlide.paused) togglePause(); return 8; } if (sdlSlide.keyState[SDLK_b]) { sdlSlide.keyState[SDLK_b] = 0; sdlSlide.useBackground = !sdlSlide.useBackground; sdlUpdateVideo(); } if (sdlSlide.keyState[SDLK_c]) { sdlSlide.keyState[SDLK_c] = 0; sdlSlide.center = !sdlSlide.center; sdlUpdateVideo(); } if (sdlSlide.keyState[SDLK_KP_MINUS]) { sdlSlide.keyState[SDLK_KP_MINUS] = 0; if(sdlSlide.fitPage) sdlSlide.useZoom = 1; sdlSlide.scale--; sdlSlide.zoom -= 10; if(sdlSlide.scale < 1) sdlSlide.scale = 1; if(sdlSlide.zoom < 10) sdlSlide.zoom = 100; updateTitle(sdlSlide.playList[sdlSlide.current]); sdlUpdateVideo(); } if (sdlSlide.keyState[SDLK_KP_PLUS]) { sdlSlide.keyState[SDLK_KP_PLUS] = 0; if(sdlSlide.fitPage) sdlSlide.useZoom = 1; sdlSlide.scale++; sdlSlide.zoom += 10; if(sdlSlide.scale > 8) sdlSlide.scale = 8; if(sdlSlide.zoom > 800) sdlSlide.zoom = 100; updateTitle(sdlSlide.playList[sdlSlide.current]); sdlUpdateVideo(); } if(!sdlSlide.paused || sdlSlide.slideshow || sdlSlide.delay > 0) return 3; return 1; } int slidePause() { sdlSlide.keyState[SDLK_SPACE] = 0; while (!sdlSlide.keyState[SDLK_SPACE]) { SDL_Delay(1); getUserInput(); } return 8; } int slideShow() //#2 { sdlSlide.startTime = time(NULL); if (sdlSlide.useVideo) { updateTitle(sdlSlide.playList[sdlSlide.current]); sdlUpdateVideo(); }else{ imageInfo(sdlSlide.playList[sdlSlide.current]); } return 3; } int slideDelay() //#3 { int timeNow; if(sdlSlide.paused || !sdlSlide.slideshow || sdlSlide.delay < 1) return 1; if (sdlSlide.delay > 0) { timeNow = time(NULL); sdlSlide.timeTaken = timeNow - sdlSlide.startTime; if (sdlSlide.timeTaken >= (sdlSlide.delay * sdlSlide.stopTime)) { sdlSlide.totalTime += sdlSlide.timeTaken; if (sdlSlide.debug) printf("sdlSlide.timeTaken=%d\nsdlSlide.totalTime=%d\n", sdlSlide.timeTaken, sdlSlide.totalTime); sdlSlide.timeTaken = 0; }else{ sdlSlide.timeTaken = 0; return 1; } } return 8; } int showRepeat() //#8 { if (sdlSlide.next != sdlSlide.playlist) return 9; if (sdlSlide.repeat > 0) if (sdlSlide.repeatCount < sdlSlide.repeat) { sdlSlide.repeatCount++; sdlSlide.next = 0; sdlSlide.current = 0; return 0; } return 10; } /* one-file (1f) specific */ void version_1f() { printf("sdlSlide (one-file) v%s\n", VERSION); } void output_1f(char *file_1f) { FILE *source_1f; char out_1f[1]; if (offset_1f == NO_SIZE || sizeOf_1f == NO_SIZE) { version_1f(); printf("error: no source file or zip\n"); exit(32); }else{ source_1f = fopen(file_1f, "rb"); if (source_1f == NULL) { version_1f(); printf("error: cant open '%s'\n", file_1f); exit(32); } // fseek(source_1f, offset_1f + 223, SEEK_SET); // off by ? fseek(source_1f, -sizeOf_1f, SEEK_END); while(true) { if (!fread(out_1f, 1, 1, source_1f)) { fclose(source_1f); break; }else putchar((int) out_1f[0]); } } } /* one-file (1f) main */ int main(int argc, char *argv[]) { /* place used variables here */ int j, argDone, section; /* this is the begining of commandline argument processing */ if ( (argc > 1) && ( (strcmp("--version", argv[1]) == 0) || (strcmp("-v", argv[1]) == 0) ) ) { version_1f(); exit(0); } if ( (argc == 1) || ( (argc > 1) && (strcmp("--help", argv[1]) == 0) ) ) { version_1f(); printf("Copyright 2016 MiNTed Games\n\n"); printf("View graphics files, using SDL v1.2.\n\n"); printf("usage: sdlSlide-1f [_option_] []\n"); if (argc > 1) { printf("_option_:\n"); printf("\t--1f one-file (1f) source information\n"); printf("\t--background instead of black screen\n"); printf("\t--slideshow Slideshow images list (with options) then exit\n"); printf("\t--delay Delay between slides seconds (number keys, default 4)\n"); printf("\t--repeat Show images list times\n"); printf("\t--center Show image centered (C key)\n"); printf("\t--zoom Set zoom to %% (same as below) (default 100, +/- keys)\n"); printf("\t--pixels Pixels size or skip (-) pixels, (default 1, +/- keys)\n"); printf("\t--fullscreen Set window to fullscreen (F11 key)\n"); printf("\t--fit Scale and Center image to fit page\n"); printf("\t--format Display file information (no shows all formats)\n"); printf("\t--novideo Dont display images (use with verbose)\n"); printf("\t--size Only output size (no image)\n"); printf("\t--help This help information\n"); printf("\t-v|--version Version information\n"); printf("\t-V|--verbose Verbose output\n"); printf("\t--debug Extra verbose output\n"); printf("\nspecial thanks to: www.parallelrealities.co.uk\n"); } printf("\n"); exit(0); } if ( (argc > 1 ) && ( (strcmp("-1f", argv[1]) == 0) || (strcmp("--1f", argv[1]) == 0) ) ) { version_1f(); printf("Copyright 2016 MiNTed Games\n"); printf("one-file (1f) source information.\n\n"); if (offset_1f == NO_SIZE || sizeOf_1f == NO_SIZE) { printf("no source file or zip\n"); exit(32); }else{ printf("usage: sdlSlide-1f _option_\n"); printf("_option_:\n"); printf("\t--src|--source output attached one-file (1f) source file\n"); printf("\t--src-size size of appended source (in bytes) (%d)\n", SRC_SIZE); printf("\t--src-type type of source appended (TXT/ZIP) (%s)\n", SRC_TYPE); printf("\n"); printf("To save one-file (1f) source to file use one of the following:\n"); printf("\tsdlSlide-1f --src > sdlSlide-1f.cpp\n"); // printf("\tsdlSlide-1f --src > sdlSlide-1f.zip\n"); printf("\tsdlSlide-1f --src > sdlSlide-1f`sdlSlide-1f --src-type`\n"); printf("To verify one-file (1f) source file size:\n"); printf("\tsdlSlide-1f --src-size (match this to the size in a directory listing)\n"); printf("or use:\n"); printf("NAME=sdlSlide; if [ `ls -l $NAME-1f.cpp|cut -d \\ -f 5` = `./$NAME-1f --src-size` ]; then echo Verified; else echo Failed; fi\n"); printf("one-file (1f) options exit with status:\n"); printf("\t31 successful (0x1f)\n"); printf("\t32 an error occured (0x20)\n"); exit(31); } } if ( (argc > 1) && ( (strcmp("--source", argv[1]) == 0) || (strcmp("--src", argv[1]) == 0) ) ) { output_1f(argv[0]); exit(31); } if ( (argc > 1) && (strcmp("--src-type", argv[1]) == 0) ) { printf(SRC_TYPE); exit(31); } if ( (argc > 1) && (strcmp("--src-size", argv[1]) == 0) ) { printf("%d", SRC_SIZE); exit(31); } sdlSlide_Init(); // Must do this first j = 0; for (int i = 1; i < argc; i++) { argDone = 0; if ( (strcmp(argv[i], "--format") == 0) || (strcmp(argv[i], "--formats") == 0) ) { sdlSlide.showFormat = 1; argDone = 1; } if ( (strcmp(argv[i], "--verbose") == 0) || (strcmp(argv[i], "-V") == 0) ) { sdlSlide.info = 1; argDone = 1; } if ( (strcmp(argv[i], "--novideo") == 0) || (strcmp(argv[i], "---no-video") == 0) ) { sdlSlide.useVideo = 0; argDone = 1; } if (strcmp(argv[i], "--debug") == 0) { sdlSlide.debug = 1; argDone = 1; } if (strcmp(argv[i], "--size") == 0) { sdlSlide.showSize = 1; argDone = 1; } if (strcmp(argv[i], "--center") == 0) { sdlSlide.center = 1; argDone = 1; } if (strcmp(argv[i], "--fullscreen") == 0) { sdlSlide.fullscreen = 1; argDone = 1; } if (strcmp(argv[i], "--fit") == 0) { sdlSlide.fitPage = 1; argDone = 1; } if (strcmp(argv[i], "--slideshow") == 0) { sdlSlide.slideshow = 1; argDone = 1; } if (strcmp(argv[i], "--zoom") == 0) { i++; if (i == argc) { printf("error: --zoom needs a number\n"); exit(1); } sdlSlide.zoom = atoi(argv[i]); if (sdlSlide.zoom == 0) sdlSlide.zoom = 100; if (sdlSlide.zoom != 100) sdlSlide.useZoom = 1; argDone = 1; } if (strcmp(argv[i], "--pixels") == 0) { i++; if (i == argc) { printf("error: --pixels needs a number\n"); exit(1); } sdlSlide.scale = atoi(argv[i]); if (sdlSlide.scale == 0) sdlSlide.scale = 1; if (sdlSlide.scale != 1) sdlSlide.useScale = 1; if (sdlSlide.scale < 0) sdlSlide.oneIn = 1; argDone = 1; } if (strcmp(argv[i], "--fps") == 0) { i++; if (i == argc) { printf("error: --fps needs a number\n"); exit(1); } sdlSlide.fps = atoi(argv[i]); argDone = 1; } if (strcmp(argv[i], "--delay") == 0) { i++; if (i == argc) { printf("error: --delay needs a number\n"); exit(1); } sdlSlide.delay = atoi(argv[i]); argDone = 1; } if (strcmp(argv[i], "--repeat") == 0) { i++; if (i == argc) { printf("error: --repeat needs a number\n"); exit(1); } sdlSlide.repeat = atoi(argv[i]); argDone = 1; } if (strcmp(argv[i], "--background") == 0) { i++; if (i == argc) { printf("error: --repeat needs a filename\n"); exit(1); } strcpy(sdlSlide.background, argv[i]); sdlSlide.useBackground = 1; argDone = 1; } if (argDone == 0) { strcpy(sdlSlide.playList[j], argv[i]); j++; } } sdlSlide.playlist = j; if (sdlSlide.showFormat && sdlSlide.playlist == 0) { version_1f(); printf("[15] image formats:"); if(sdlSlide.info) { printf("\n"); printf("\t.ICO Microsoft Icon format\n"); printf("\t.CUR Microsoft Cursor format\n"); printf("\t.BMP Microsoft Bit Map image\n"); printf("\t.GIF Graphics Interchange Format\n"); printf("\t.JPG JPEG encoded graphic image (lossy)\n"); printf("\t.JPEG JPEG encoded graphic image (lossy)\n"); printf("\t.ILBM InterLeaved BitMap image (IFF containers)\n"); printf("\t.LBM InterLeaved BitMap image (IFF containers)\n"); printf("\t.PCX PC Paintbrush eXtended graphic\n"); printf("\t.PNG Portable Network Graphic\n"); printf("\t.PNM Portable Network M\n"); printf("\t.TIF 32bit Image File Format\n"); printf("\t.TIFF 32bit Image File Format\n"); printf("\t.XCF GIMP image\n"); printf("\t.XBM X Windows mono Bit Map image (ASCII)\n"); printf("\t.XPM X Windows color Pixel Map image (ASCII)\n"); printf("\t.XV X Windows\n"); printf("\t.WEBP Cell/Mobile phone Web graphic\n"); }else{ printf(" ICO CUR BMP GIF JPG JPEG ILBM LBM PCX PNG PNM TIF TIFF XCF XBM XPM XV WEBP\n"); } exit(0); } atexit(cleanUp); initSystem(); // Opens video mode and sound initVars(); if (sdlSlide.showSize) { if (!sdlSlide.playlist) { printf("error: --size needs at least one file\n"); exit(1); } getImageFile(); imageSize(); exit(0); } if (sdlSlide.useBackground) { loadBackground(sdlSlide.background); } section = 0; while (true) { // non-blocking (shows high CPU usage) // should be event driven, but this is faster //printf("%d ",section); switch(section) { case 0: section = getImageFile(); break; case 1: section = checkKeys(); break; case 2: section = slideShow(); break; case 3: section = slideDelay(); break; case 8: section = showRepeat(); break; case 9: sdlSlide.next++; section = 0; break; } if (section == 10) exit(0); } return(0); }