Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

User projects written in or related to FreeBASIC.
Adigun A. Polack
Posts: 230
Joined: May 27, 2005 15:14
Contact:

Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby Adigun A. Polack » Jan 01, 2016 7:18

Hello and A MOST FANTASTIC 2016 NEW YEAR to all of you amazingly quite excellent FreeBASIC community in fullest absolute entirety!!! Guess who this is? It is me, Adigun Azikiwe Polack, longtime veteran of this very, very community indeed all the way since the first dawning of FreeBASIC from way back in 2004-05. And long time, no see, as it is such a splendid, splendid honor finally to be back with you all after eight (8) straight years!!! (^-^)v !!

And what much better way for me to do that than to kick off the entire New Year with my own all-original, brand-new kickass GFXlib2-compatible game library right here that quite no less promises to be the most easy-to-use, most advanced cutting-edge Hi-/True-color 2D game lib ever conceived in FreeBASIC. Continuing the grand tradition of RelLib and the AFlib series from our QuickBASIC and FreeBASIC days, I now welcome all of us the NEWEST and rather latest member of the AFlib family...

Image

You can now download and test-drive the newer and more current in-development v0.93 beta test release of AFlib III right here, thoroughly tested and certified 100% virus-free:


The all-current and up-to-date FreeBASIC version will work while using this lib, although AFlib III will also work with a bare minimum FB version of 0.20 as well, too. And in addition, the most exciting news of all is that it all even now fully works on the 64-bit edition of FreeBASIC v1.02 or higher, also!!! For now, this lib is for Windows only, since that is the only operating system that I have with which this lib indeed was made so far. And yes, Windows 10 is fully-supported, all the way down to Windows 8.1, 8, and 7. Be sure though to test it out on Windows XP to make sure it works there as well, okay please? ^^

Featuring full-blown support for all 15-, 16-, 24-, and 32-bit color graphic modes, this game library of AFlib III includes a whole grand slew of really hot features such as:

    ● A roster of innovative, NEVER-BEFORE-SEEN graphical effects in FB for custom .BMP tilesets of up to 4096x4096 in size — including new ones like “SphereMap”, “Flowing Sea”, and “Jellify” to name a few!!!

    ● Many other graphical effects from AFlib2 are back in full force, including “Mode-7”, “Waterfall”, and “Tiled Sinewave” making their return appearances for the new AFlib III indeed as they look even more stunning than ever!!!

    ● Accurate frame-rate control to any smooth frames/second you want!!!

    ● 40 built-in 8x8 fonts included to help you get the job done!! ;)

    ● Fuller, much simpler-to-use Gamepad/Joystick support than ever before!

    ● Fullest, easier-to-use, and much more thoroughly pitch-perfect accurate “Score Ranking”-table support for up to a WHOPPING 2,000 slots within any one table alone, plus full-blown support for actually saving/loading them at will with lots of added security features... ALL BUILT-IN just for you!!!

    ● Built-in, grand-class, 5-tiered “Score Extend”-bonus support for awarding extra lives to your players upon them reaching many ever-increasing score plateaus in your own original FreeBASIC game creations... and even higher and higher scores, also!!!

    ● Independent Sprite-and-Screen Scaling/Rotation, plus the ability to store up to a staggering 512 full screens to memory at any one time while your program is running!!!

    ● Accurate, top-of-the-line sprite-collision AND screen-collision detection... especially the pixel-perfect ones too!!!

    ● Custom graphic tweaks that can be *very* easily accessed in your own program using only very few lines of code!!

    ● Scale2X support for Hi-/True-color graphic modes up to 1280x1024, with Resize2X support for such modes up to 1920x1080 True-HD resolution... all WITHOUT slowing down the frame-rate itself at all!!!

    ● Full Resize3X support for the following modes: 720x480, 720x576, 1152x864, 1440x900, 1680x1050, and 1920x1080 Full HD!!

    ● PP256 (PixelPlus 256) support for all 15- to 32-bit graphics modes!!!

    ● Full built-in palette support for enabling you to do such amazing BMP-image conversions, fades, and other tricks quite easily within the constraints of its own individual palette in any 15- to 32-bit graphics mode (using *only* a few lines of code alone!!!), including:
      RGB 12-bit palette (4096 colors)
      RGB 9-bit palette (512 colors)
      ▪ Enterprise 64k/128k Home Computer palette (256 colors)
      ▪ Commodore Plus/4 palette (121 colors)
      ▪ Atari 2600 palette (both the NTSC 128-color and PAL 104-color versions!!)
      ▪ Master System/Mark III palette (64 colors)
      ▪ Famicom/NES palette (56 colors)
      ▪ Amstrad CPC palette (27 colors)
      ▪ MS-DOS EGA palette (16 colors)
      ▪ Commodore-64 palette (16 colors)
      ▪ Intellivision Palette (16 colors)
      ▪ MSX/SG-1000/ColecoVision/ADAM Palette (15 colors + 1 translucent color)
      ▪ Commodore VIC-20 palette (16 colors; both NTSC and PAL versions!!)
      ▪ Apple II/IIc/IIe Palette (16 colors)
      ▪ Aquarius Home Computer Palette (16 colors)

    ● ASCii-based drawing primitives and its own set of blisteringly-fast sprite routines that successfully emulate all the movements of an “8x8 character”-based text mode... all like you have NEVER seen them before in FreeBASIC!!!

    ● ANSI picture support for displaying full-vertical .ANS files of any size of UNLIMITED vertical length as you wish — and this even includes my personal rather favorite ANSI files being shown for you here, here, here, here, here, and here to name quite a few!!! ^-^=b !!

    ● TONS AND TONS more great features too big to list here, but they all will quite massively help you take your game creation in FB to a most phenomenal new level of “awesome” indeed!!!


The lib is not fully finished yet, as it is currently in-development and getting closer and closer to full completion. And along the way throughout this thread, I will be adding brand-new snippets of code specially developed to help you get the very most out of this AFlib III... plus when AFlib III is all finished and finalized, I will be adding in a FULL-color PDF documentation showing you all the commands that are featured in this lib, what they are about, and how they work according to their individual workings on their own. You do not want to even miss any of it, I gotta promise all of ‘ya quite handsomely indeed... all since I really, deeply, and most GENUINELY missed all of you spectacular FreeBASIC community!!! Wow, where the rather hell have I been, huh!? ;)

That said, please especially enjoy my brand-new FB-created game library as we kick off the New Year of 2016 and beyond, ladies and gentlemen, and prepare to be blown away by all of the hard, thorough work so far that I had so lovingly placed into creating this AFlib III. And believe me, I sure do miss Relsoft/Relminator (aka Richard Eric M. Lope) as well... if he is around right now in this very forumboard, I so ever-sincerely hope that he is most truly, wholeheartedly plain proud of me just like I promise that you will with this very GFXlib2-compatible 2D Truecolor game library in FreeBASIC right here also. Peace!!! d=(^-^)=b !!

Image
Image
Image
Image
Image
Image
Image
Last edited by Adigun A. Polack on Sep 07, 2016 2:25, edited 9 times in total.
Pim Scheffers
Posts: 28
Joined: Jun 29, 2014 17:15

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib

Postby Pim Scheffers » Jan 01, 2016 11:05

He, (happy new-year by the way :-)

Thanks you, for this alpha release. (I like surprises on new-years day)
Your first library seriously got me into using FreeBASIC as my hobby language somewhere in 2010 I guess.

I've been creating a 2D platformer for a little over 2 years now (see a few topics down on this thread) and although not many AFlib1 subs / functions are directly used in the game, your library taught me FreeBASIC and retro graphics and got me into making this game.

Just downloaded the library and cannot wait what gems you have hidden in there this time ;-)

Thanks,
dafhi
Posts: 822
Joined: Jun 04, 2005 9:51

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib

Postby dafhi » Jan 01, 2016 13:30

big plus for oldschool vibes and full source

running win, many fullscreen apps takeover and freeze my intel hd gfx.

the one file that did work (i didnt go thru all): ascii_testprimiives. suggestion: reduce num of tests to 2 or 3. triangle fill is always good.

welcome back :)
Imortis
Posts: 1289
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib

Postby Imortis » Jan 03, 2016 14:18

I was just wondering what happened to you and AFLib a few days ago. Good to see you back! I can't wait to give it a shot and see all the neat features.
wallyg
Posts: 64
Joined: May 08, 2009 7:08
Location: Alaska

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby wallyg » Jan 10, 2016 20:14

I downloaded your file and ran a few tests. I would certainly like to try my hand at using your library, do you have any documentation on how to use your system?

Thanks
WallyG
Pritchard
Posts: 5418
Joined: Sep 12, 2005 20:06
Location: Ohio, USA

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby Pritchard » Jan 11, 2016 3:48

I'm just glad you're still alive. Hey!
Adigun A. Polack
Posts: 230
Joined: May 27, 2005 15:14
Contact:

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby Adigun A. Polack » Jan 22, 2016 2:07

First of all, everybody, I *must* quite thank each and every rather one of you for the truly excellent welcome-back indeed... another reason why our FreeBASIC community is seriously a phenomenally brilliant, splendidly well-creative one for sure!!! :D !!

Talking right now of which, the main reason why I am so completely, completely plain homesick for both you guys and our entire community is simply because after eight (8) consecutive years of missing all of you so much, it takes me then currently quite a few weeks straight or more for me to really and fully get back into the groove of things in major terms of what’s going on good with our community and the downright amazing things that you all have been doing using FreeBASIC... including so many of the recent, well-completed games that at least some-to-many of you have done since around 2010 or so... WOW, it has been that damn long ago!! Please, pardon me as I get back in the grand swing of things with all of you, so to speak. ^^

Now, I have just today updated AFlib III a bit to v0.86 alpha test release for all of you, so please check the first post and replace that old version with the current one, as I have just notably added now a custom 4,096-color palette to be used within this FB game lib itself in any 15-, 16-, 24-, and 32-bit color graphics mode... more about how to use that new palette of mine later in this post. Stay tuned!!!

On the New Year’s Day of 2016, Pim Scheffers proudly wrote:He, (happy new-year by the way :-)

Thanks you, for this alpha release. (I like surprises on new-years day)
Your first library seriously got me into using FreeBASIC as my hobby language somewhere in 2010 I guess.

I've been creating a 2D platformer for a little over 2 years now (see a few topics down on this thread) and although not many AFlib1 subs / functions are directly used in the game, your library taught me FreeBASIC and retro graphics and got me into making this game.

Just downloaded the library and cannot wait what gems you have hidden in there this time ;-)

Thanks,


First of all for you, Pim, I gotta thank you personally for wishing me quite a happy new year for 2016... I TRULY appreciate that from the heart, man!!! ^-^=b !! Secondly, I am even truly happier that my AFlib2 (which was quite indeed my first created library that I did in FreeBASIC from way, wayyy back in 2005, by the way... WOW, that very long ago!!!) most genuinely taught you the ins-and-outs of FB and retro graphics as well as inspired you to create your game entitled “Slimo”. Speaking of your game here that you are currently working on, I have seen a video of it in action on YouTube (which is located right here, by the way) just two days even before I already launched this very thread about AFlib III. And looking at your game and how it is built using your yet-to-be-released Mode13h library in FB, it just takes me back to the grand ‘ol days of DOS, QuickBASIC gaming, and RelLib and how I used to have tons and tons of fun with them all for years on end long before the rather days of FreeBASIC came along and extended QuickBASIC’s proudly masterful legacy in a monumentally resplendent way over to Windows and other OSes... THOSE WERE THE DAYS, my fine man, and they were just downright effing awesome stuff from our own youths, let’s get that most absolutely plain right!!! ;*)

Talking about games made in QuickBASIC, Pim, here is a most awesome-looking, brand-newest 2016 platformer by author ‘mangis’ entitled “Magiduck” that is completely done entirely from scratch using both QB PDS 7.1 and Assembly language... ALL IN MS-DOS using just 16 colors exclusively in CGA 40x25 textmode alone, believe it or not — which is absolutely downright plain amazing in and of itself, as you do not get many top-tier quality new DOS games anymore these rather days, let alone in plain vanilla textmode indeed!!! :o !! Now, you can check out all about it on YouTube right here to see how it was all done, then check out the original game post and as well as the downloadable freeware demo so far at http://www.indiedb.com/games/magiduck and play the game for yourself in DOSBox. Let it and my AFlib III all inspire you and our FB community even further in creating your own next big rockin’ 2D game in FreeBASIC now... let’s all quite do this together, shall we? d=^_~=b !!


Next up, on that same day, dafhi also wrote:big plus for oldschool vibes and full source

running win, many fullscreen apps takeover and freeze my intel hd gfx.

the one file that did work (i didnt go thru all): ascii_testprimiives. suggestion: reduce num of tests to 2 or 3. triangle fill is always good.

welcome back :)


First of all, dafhi, as I was really quite hard at work on the additional features for AFlib III, I have just now updated the very many program examples to start by default at Windowed mode, just to make things a little easier for you and your users as well. What I have not done as of yet currently is the ability to select what specific drawing primitives to test alone, though that will come a little later on shortly as I continue to develop, so do hang tight for just a bit as I get there, ok please? ;)

As well, thank you quite so much for your time and support, and I want to make AFlib III the most easier-to-use Truecolor game lib there is in FreeBASIC... especially for you as well, I promise!!!


And later, on 1/10/2016, wallyg wrote:I downloaded your file and ran a few tests. I would certainly like to try my hand at using your library, do you have any documentation on how to use your system?

Thanks
WallyG


You are most entirely welcome, wallyg, and thank you so much for trying AFlib III out so far. ;) I have not printed out any documentation yet at this moment, but here is what I clearly notified to you from the beginning of this thread:

...when AFlib III is all finished and finalized, I will be adding in a FULL-color PDF documentation showing you all the commands that are featured in this lib, what they are about, and how they work according to their individual workings on their own.


...so to hold you over for now, I will — as I also said from the beginning of this thread — be adding in FB code snippets built specially for AFlib III to help you and our entire FreeBASIC community get the very most out of this very game library. Be sure not to miss ‘em!!


And to all of you, as promised, here come the new AFlib III code snippets.

First off, come the new AFlib III custom palette tests in any 15- to 32-bit custom graphics mode that you can handsomely create yourself to help get you started. These require v0.86 alpha test release or higher of this lib in order for them to work properly. Here we go!!!

The 64-color Custom Palette Test:

Code: Select all

#include "AFlib3_Font.bi"
#include "AFlib3_Palette.bi"
#include "AFlib3_Miscellaneous.bi"

Dim PaletteType as Integer

PaletteType = 0  ' <---------- Pass '0' for Master System/Mark III Palette;
                 '                  '1' FC/FDS/NES Palette; or
                 '                  '2' FamiCube 64-color Palette.

Screenres 640, 480, 24, 0
WindowTitle "My 64-color Palette Display Test in a 15- to 32-bit Graphics Mode using AFlib III!!!"

Dim as Integer ColNumber = 0
Dim as Integer FontSelect = 7
Dim as String SetMessageA, SetMessageB = "64-color Custom Palette Test for AFlib III"

For PalRead_Y as Integer = 0 to 3
  For PalRead_X as Integer = 0 to 15
    Select Case PaletteType
      Case is < 1
        Line(PalRead_X * 16, PalRead_Y * 16)-((PalRead_X * 16) + 14, (PalRead_Y * 16) + 14), SMScol(ColNumber), bf
        SetMessageA = "(Master System/Mark III Palette)"
      Case 1
        Line(PalRead_X * 16, PalRead_Y * 16)-((PalRead_X * 16) + 14, (PalRead_Y * 16) + 14), NEScol(ColNumber), bf
        SetMessageA = "(Famicom/FDS/NES Palette)"
      Case is > 1
        Line(PalRead_X * 16, PalRead_Y * 16)-((PalRead_X * 16) + 14, (PalRead_Y * 16) + 14), FCUBEcol(ColNumber), bf
        SetMessageA = "(Arne's Famicube 64-color Palette)"
    End Select
    ColNumber += 1
  Next
Next

AFlibIII_Print SetMessageA, 1, 280, 1.5, 1, SMSeasy(1, 1, 1), 0, 2, FontSelect
AFlibIII_Print SetMessageA, 1, 281, 1.5, 1, SMSeasy(1, 1, 1), 0, 2, FontSelect
AFlibIII_Print SetMessageA, 0, 281, 1.5, 1, SMSeasy(1, 1, 1), 0, 2, FontSelect
AFlibIII_Print SetMessageA, 0, 280, 1.5, 1, SMSeasy(3, 3, 3), 0, 2, FontSelect

AFlibIII_Print SetMessageB, 1, 464, 1, 1, SMSeasy(1, 1, 1), 0, 2, FontSelect
AFlibIII_Print SetMessageB, 1, 465, 1, 1, SMSeasy(1, 1, 1), 0, 2, FontSelect
AFlibIII_Print SetMessageB, 0, 465, 1, 1, SMSeasy(1, 1, 1), 0, 2, FontSelect
AFlibIII_Print SetMessageB, 0, 464, 1, 1, SMSeasy(3, 3, 3), 0, 2, FontSelect

For R as Integer = 0 to 63
  Select Case PaletteType
    Case is < 1: Line(R * 3, 300)-((R * 3) + 2, 400), SMScol(R), BF
    Case 1: Line(R * 3, 300)-((R * 3) + 2, 400), NEScol(R), BF
    Case is > 1: Line(R * 3, 300)-((R * 3) + 2, 400), FCUBEcol(R), BF
  End Select
Next
Sleep

AFlibIII_EndProgram


Image



The 128-color Custom Palette Test:

Code: Select all

#include "AFlib3_Font.bi"
#include "AFlib3_Palette.bi"
#include "AFlib3_Miscellaneous.bi"

Dim PaletteType as Integer

PaletteType = 0  ' <---------- Pass '0' for Atari 2600 Palette (NTSC version);
                 '                  '1' for Atari 2600 Palette (PAL version);
                 '                  '2' for Commodore Plus/4 Palette; or
                 '                  '3' for Sam Coupe 128-color Palette.

Screenres 640, 480, 24, 0
WindowTitle "My 128-color Palette Display Test in a 15- to 32-bit Graphics Mode using AFlib III!!!"

Dim as Integer ColNumber = 0
Dim as Integer FontSelect = 7
Dim as String SetMessageA, SetMessageB = "128-color Custom Palette Test for AFlib III"

For PalRead_Y as Integer = 0 to 7
  For PalRead_X as Integer = 0 to 15
    Select Case PaletteType
      Case is < 1
        Line(PalRead_X * 16, PalRead_Y * 16)-((PalRead_X * 16) + 14, (PalRead_Y * 16) + 14), ATARI2600col(ColNumber), bf
        SetMessageA = "(Atari 2600 NTSC Palette)"
      Case 1
        Line(PalRead_X * 16, PalRead_Y * 16)-((PalRead_X * 16) + 14, (PalRead_Y * 16) + 14), PAL2600col(ColNumber), bf
        SetMessageA = "(Atari 2600 PAL Palette)"
      Case 2
        Line(PalRead_X * 16, PalRead_Y * 16)-((PalRead_X * 16) + 14, (PalRead_Y * 16) + 14), PLUS4col(ColNumber), bf
        SetMessageA = "(Commodore Plus/4 Palette)"
      Case is > 2
        Line(PalRead_X * 16, PalRead_Y * 16)-((PalRead_X * 16) + 14, (PalRead_Y * 16) + 14), SAMCOUPEcol(ColNumber), bf
        SetMessageA = "(SAM Coup"+chr(130)+" 128-color Palette)"
    End Select
    ColNumber += 1
  Next
Next

AFlibIII_Print SetMessageA, 1, 280, 1.5, 1, ATARI2600col(1), 0, 2, FontSelect
AFlibIII_Print SetMessageA, 1, 281, 1.5, 1, ATARI2600col(1), 0, 2, FontSelect
AFlibIII_Print SetMessageA, 0, 281, 1.5, 1, ATARI2600col(1), 0, 2, FontSelect
AFlibIII_Print SetMessageA, 0, 280, 1.5, 1, ATARI2600col(7), 0, 2, FontSelect

AFlibIII_Print SetMessageB, 1, 464, 1, 1, ATARI2600col(1), 0, 2, FontSelect
AFlibIII_Print SetMessageB, 1, 465, 1, 1, ATARI2600col(1), 0, 2, FontSelect
AFlibIII_Print SetMessageB, 0, 465, 1, 1, ATARI2600col(1), 0, 2, FontSelect
AFlibIII_Print SetMessageB, 0, 464, 1, 1, ATARI2600col(7), 0, 2, FontSelect

For R as Integer = 0 to 127
  Select Case PaletteType
    Case is < 1: Line(R * 2, 300)-((R * 2) + 1, 400), ATARI2600col(R), B
    Case 1: Line(R * 2, 300)-((R * 2) + 1, 400), PAL2600col(R), B
    Case 2: Line(R * 2, 300)-((R * 2) + 1, 400), PLUS4col(R), B
    Case is > 2: Line(R * 2, 300)-((R * 2) + 1, 400), SAMCOUPEcol(R), B
  End Select
Next
Sleep

AFlibIII_EndProgram


Image



The 256-color Custom Palette Test:

Code: Select all

#include "AFlib3_Font.bi"
#include "AFlib3_Palette.bi"
#include "AFlib3_Miscellaneous.bi"

Dim PaletteType as Integer

PaletteType = 0  ' <---------- Pass '0' for VGA Mode13h Normal Palette;
                 '                  '1' for Relsoft Palette;
                 '                  '2' for The Adigun Azikiwe Polack 256-Color Palette;
                 '                  '3' for Atari 400/800/XL/XE Palette;
                 '                  '4' for Atari 7800 Palette; or
                 '                  '5' for Enterprise Home Computer (64k and 128k models).

Screenres 640, 480, 24, 0
WindowTitle "My 256-color Palette Display Test in a 15- to 32-bit Graphics Mode using AFlib III!!!"

Dim as Integer ColNumber = 0
Dim as Integer FontSelect = 7
Dim as String SetMessageA, SetMessageB = "256-color Custom Palette Test for AFlib III"

For PalRead_Y as Integer = 0 to 15
  For PalRead_X as Integer = 0 to 15
    Select Case PaletteType
      Case is < 1
        Line(PalRead_X * 16, PalRead_Y * 16)-((PalRead_X * 16) + 14, (PalRead_Y * 16) + 14), VGAcol(ColNumber), bf
        SetMessageA = "(VGA Mode13h Normal Palette)"
      Case 1
        Line(PalRead_X * 16, PalRead_Y * 16)-((PalRead_X * 16) + 14, (PalRead_Y * 16) + 14), RELcol(ColNumber), bf
        SetMessageA = "(Relsoft Palette)"
      Case 2
        Line(PalRead_X * 16, PalRead_Y * 16)-((PalRead_X * 16) + 14, (PalRead_Y * 16) + 14), AAPcol(ColNumber), bf
        SetMessageA = "(The AAP 256-color Palette)"
      Case 3
        Line(PalRead_X * 16, PalRead_Y * 16)-((PalRead_X * 16) + 14, (PalRead_Y * 16) + 14), ATARIcol(ColNumber), bf
        SetMessageA = "(Atari 400/800/XL/XE Palette)"
      Case 4
        Line(PalRead_X * 16, PalRead_Y * 16)-((PalRead_X * 16) + 14, (PalRead_Y * 16) + 14), ATARI7800col(ColNumber), bf
        SetMessageA = "(Atari 7800 Palette)"
      Case is > 4
        Line(PalRead_X * 16, PalRead_Y * 16)-((PalRead_X * 16) + 14, (PalRead_Y * 16) + 14), ENTERPRISEcol(ColNumber), bf
        SetMessageA = "(Enterprise 64k/128k Palette)"
    End Select
    ColNumber += 1
  Next
Next

AFlibIII_Print SetMessageA, 1, 280, 1.5, 1, VGAcol(8), 0, 2, FontSelect
AFlibIII_Print SetMessageA, 1, 281, 1.5, 1, VGAcol(8), 0, 2, FontSelect
AFlibIII_Print SetMessageA, 0, 281, 1.5, 1, VGAcol(8), 0, 2, FontSelect
AFlibIII_Print SetMessageA, 0, 280, 1.5, 1, VGAcol(15), 0, 2, FontSelect

AFlibIII_Print SetMessageB, 1, 464, 1, 1, VGAcol(8), 0, 2, FontSelect
AFlibIII_Print SetMessageB, 1, 465, 1, 1, VGAcol(8), 0, 2, FontSelect
AFlibIII_Print SetMessageB, 0, 465, 1, 1, VGAcol(8), 0, 2, FontSelect
AFlibIII_Print SetMessageB, 0, 464, 1, 1, VGAcol(15), 0, 2, FontSelect

For R as Integer = 0 to 255
  Select Case PaletteType
    Case is < 1: Line(R, 300)-(R, 400), VGAcol(R)
    Case 1: Line(R, 300)-(R, 400), RELcol(R)
    Case 2: Line(R, 300)-(R, 400), AAPcol(R)
    Case 3: Line(R, 300)-(R, 400), ATARIcol(R)
    Case 4: Line(R, 300)-(R, 400), ATARI7800col(R)
    Case is > 4: Line(R, 300)-(R, 400), ENTERPRISEcol(R)
  End Select
Next
Sleep

AFlibIII_EndProgram


Image



The 512-color Custom Palette Test:

Code: Select all

#include "AFlib3_Font.bi"
#include "AFlib3_Palette.bi"
#include "AFlib3_Miscellaneous.bi"

Dim PaletteType as Integer

PaletteType = 0  ' <---------- Pass '0' for RGB 9-bit Custom Palette;
                 '                  '1' for Relsoft Extended 512-color Palette; or
                 '                  '2' for AAP Super-512 Palette (512 colors).

Screenres 640, 480, 24, 0
WindowTitle "My 512-color Palette Display Test in a 15- to 32-bit Graphics Mode using AFlib III!!!"

Dim as Integer ColNumber = 0
Dim as Integer FontSelect = 7
Dim as String SetMessageA, SetMessageB = "512-color Custom Palette Test for AFlib III"

For PalRead_Y as Integer = 0 to 15
  For PalRead_X as Integer = 0 to 31
    Select Case PaletteType
      Case is < 1
        Line(PalRead_X * 16, PalRead_Y * 16)-((PalRead_X * 16) + 14, (PalRead_Y * 16) + 14), RGB512col(ColNumber), bf
        SetMessageA = "(RGB 9-bit Palette)"
      Case 1
        Line(PalRead_X * 16, PalRead_Y * 16)-((PalRead_X * 16) + 14, (PalRead_Y * 16) + 14), REL512col(ColNumber), bf
        SetMessageA = "(Relsoft Extended 512-color Palette)"
      Case is > 1
        Line(PalRead_X * 16, PalRead_Y * 16)-((PalRead_X * 16) + 14, (PalRead_Y * 16) + 14), AAP512col(ColNumber), bf
        SetMessageA = "(AAP Super-512 Palette)"
    End Select
    ColNumber += 1
  Next
Next

AFlibIII_Print SetMessageA, 1, 280, 1.5, 1, AAP512col(13), 0, 2, FontSelect
AFlibIII_Print SetMessageA, 1, 281, 1.5, 1, AAP512col(13), 0, 2, FontSelect
AFlibIII_Print SetMessageA, 0, 281, 1.5, 1, AAP512col(13), 0, 2, FontSelect
AFlibIII_Print SetMessageA, 0, 280, 1.5, 1, AAP512col(31), 0, 2, FontSelect

AFlibIII_Print SetMessageB, 1, 464, 1, 1, AAP512col(13), 0, 2, FontSelect
AFlibIII_Print SetMessageB, 1, 465, 1, 1, AAP512col(13), 0, 2, FontSelect
AFlibIII_Print SetMessageB, 0, 465, 1, 1, AAP512col(13), 0, 2, FontSelect
AFlibIII_Print SetMessageB, 0, 464, 1, 1, AAP512col(31), 0, 2, FontSelect

For R as Integer = 0 to 511
  Select Case PaletteType
    Case is < 1: Line(R, 300)-(R, 400), RGB512col(R)
    Case 1: Line(R, 300)-(R, 400), REL512col(R)
    Case is > 1: Line(R, 300)-(R, 400), AAP512col(R)
  End Select
Next
Sleep

AFlibIII_EndProgram


Image
Image



The 4,096-color Custom Palette Test:

Code: Select all

#include "AFlib3_Font.bi"
#include "AFlib3_Palette.bi"
#include "AFlib3_Miscellaneous.bi"



Screenres 640, 480, 24, 0
WindowTitle "My RGB 4096-color Palette Display Test in a 15- to 32-bit Graphics Mode using AFlib III!!!"

Dim as Integer ColNumber = 0
Dim as Integer FontSelect = 7
Dim as String SetMessageA, SetMessageB = "4096-color Custom Palette Test for AFlib III"
SetMessageA = "(RGB 12-bit Palette)"

For PalRead_Y as Integer = 0 to 31
  For PalRead_X as Integer = 0 to 127
      Line(PalRead_X * 5, PalRead_Y * 5)-((PalRead_X * 5) + 3, (PalRead_Y * 5) + 3), RGB4096col(ColNumber), bf
    ColNumber += 1
  Next
Next

AFlibIII_Print SetMessageA, 1, 240, 1.5, 1, RGB4096easy(3, 3, 3), 0, 2, FontSelect
AFlibIII_Print SetMessageA, 1, 241, 1.5, 1, RGB4096easy(3, 3, 3), 0, 2, FontSelect
AFlibIII_Print SetMessageA, 0, 241, 1.5, 1, RGB4096easy(3, 3, 3), 0, 2, FontSelect
AFlibIII_Print SetMessageA, 0, 240, 1.5, 1, RGB4096easy(15, 15, 15), 0, 2, FontSelect

AFlibIII_Print SetMessageB, 1, 464, 1, 1, RGB4096easy(3, 3, 3), 0, 2, FontSelect
AFlibIII_Print SetMessageB, 1, 465, 1, 1, RGB4096easy(3, 3, 3), 0, 2, FontSelect
AFlibIII_Print SetMessageB, 0, 465, 1, 1, RGB4096easy(3, 3, 3), 0, 2, FontSelect
AFlibIII_Print SetMessageB, 0, 464, 1, 1, RGB4096easy(15, 15, 15), 0, 2, FontSelect

For R as Integer = 0 to 511
  For Lin as Integer = 0 to 7
    Line(R, 260 + (Lin * 20))-(R, 279 + (Lin * 20)), RGB4096col(R + (Lin * 512))
  Next
Next
Sleep

AFlibIII_EndProgram


Image



These should warm all of you up in using AFlib III indeed. And here are quite some easy to use commands straight from the “AFlib3_Palette.bi” module to help you out even further:

    ENTERPRISEeasy

    Code: Select all

    Declare Function ENTERPRISEeasy ( Byval R_col as Integer, _
                                      Byval G_col as Integer, _
                                      Byval B_col as Integer ) as Integer

      R_col = the red shade level (0 to 7)
      G_col = the green shade level (0 to 7)
      B_col = the blue shade level (0 to 7)

    SAMCOUPEeasy

    Code: Select all

    Declare Function SAMCOUPEeasy ( Byval R_col as Integer, _
                                    Byval G_col as Integer, _
                                    Byval B_col as Integer, _
                                    Byval Intensity as Integer = 0 ) as Integer

      R_col = the red shade level (0 to 3)
      G_col = the green shade level (0 to 3)
      B_col = the blue shade level (0 to 3)
      Intensity = the intensity shade level of the resulting color (0 = Normal; 1 = Bright)

    SMSeasy

    Code: Select all

    Declare Function SMSeasy ( Byval R_col as Integer, _
                               Byval G_col as Integer, _
                               Byval B_col as Integer ) as Integer

      R_col = the red shade level (0 to 3)
      G_col = the green shade level (0 to 3)
      B_col = the blue shade level (0 to 3)

    RGB512easy

    Code: Select all

    Declare Function RGB512easy ( Byval R_col as Integer, _
                                  Byval G_col as Integer, _
                                  Byval B_col as Integer ) as Integer

      R_col = the red shade level (0 to 7)
      G_col = the green shade level (0 to 7)
      B_col = the blue shade level (0 to 7)

    RGB4096easy

    Code: Select all

    Declare Function RGB4096easy ( Byval R_col as Integer, _
                                   Byval G_col as Integer, _
                                   Byval B_col as Integer ) as Integer

      R_col = the red shade level (0 to 15)
      G_col = the green shade level (0 to 15)
      B_col = the blue shade level (0 to 15)

And I have even included full palettes from two very, VERY absolute rarest 1985-1990 computers that originated in the UK: the SAM Coupé and the Enterprise 64/128 home computers... both of which were actually quite “8-bit”-based. For instance, do check out the full, original SAM Coupé 128-color palette in all its glory right here, and then check out these videos on YouTube showcasing the games and demonstration programs on the Enterprise 64/128 here and here, respectively.

Goes to actually show you that I am a MASSIVE fan of high-quality, back-in-the-day retro graphics and the phenomenal classic gaming that it sure entails, to be quite flatly honest. ;) !! That is most seriously why I am sharing all this stuff with you amazing entire FB community, and creating for you AFlib III in the process as well.

That said, ladies and gentlemen, do fully enjoy this lib in FreeBASIC to your absolute heart’s content, and stay tuned for even more exciting new AFlib III code snippets from yours truly!!!
relsoft
Posts: 1758
Joined: May 27, 2005 10:34
Location: Philippines
Contact:

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby relsoft » Jan 22, 2016 16:17

I miss you too my friend. How are you these days?
I've lost count of the emails I've sent you. Was kinda worried you disappeared.


Btw, I'm usually on facebook.

Account: Anya Therese Lope
Adigun A. Polack
Posts: 230
Joined: May 27, 2005 15:14
Contact:

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby Adigun A. Polack » Jan 22, 2016 17:33

relsoft has just returned to our FreeBASIC community at long, LONG last and wrote:I miss you too my friend. How are you these days?
I've lost count of the emails I've sent you. Was kinda worried you disappeared.


Btw, I'm usually on facebook.

Account: Anya Therese Lope


As for me in terms of how I am myself, I am most currently and *finally* fully proud and even rather ecstatically happier to have at least shown the FreeBASIC community the new AFlib III in style so far, and how exceedingly well I have created it, Rel my great, GREAT man... which is exactly what I am doing right now!!! I mean, just where the hell have you even been for the past couple of years or so, huh!? ;*)

I would furthermore quite bet that all of our very FreeBASIC community would be utterly plain overjoyed to have you back with us in our main FreeBASIC forumboard right here, let us get that most positively correct for sure. And come to absolutely think of it, I am so TRULY plain excited to have you back indeed and then some, as rather well. ^^=b !!

First grandly important order of business for you, Rel: I fully plain dedicate this entire AFlib III project quite 100% especially to you personally from the bottom of my wildly deepest heart. Saying that, I have quite faithfully restored your original 256-color palette as one of the very many built-in palettes that are featured in AFlib III indeed:

Image

...as it used to be one of my all-time favourite palettes to use since my QuickBASIC days way back in 2000-2005, to be thoroughly honest in spades. :D So much so, that I have actually made a brand-new, completely built-in 512-color palette in your ever-glorious honor entitled Relsoft Extended 512-color Palette for use in any 15- to 32-bit color graphics mode in FB using this very lib of mine:

Image

...and here, I have kept and fully preserved your original essence of all the colors while adding in many shades of natural brightness to the colors simultaneously, making this palette even more stunningly amazing in how much more impressive it really is... and it is all in your very own honor indeed, compliments of Adigun Azikiwe Polack!!! d=^-^=b !!!

Keeping all of that in mind, Rel, have you thoroughly downloaded and tried the new AFlib III yet as well as tested all of its many program examples for yourself? If so on all of that, please tell me in crisp, full, thorough detail about what you think of it so far, and how it inspires you and lights a shining fire in you to create your new games in FB much more easily, all in your own, own words. I would really, REALLY love to hear your input on that as well.

And by the way, A MOST RESPLENDENTLY FANTASTIC WELCOME-BACK to you indeed, especially!!! Long time, no damn see!!! ;) !!!
Dr_D
Posts: 2343
Joined: May 27, 2005 4:59
Contact:

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby Dr_D » Feb 06, 2016 0:52

Whoa... Hey, buddy. :) How ya been? Looks like you've been pretty busy! Nice work there. :)
Adigun A. Polack
Posts: 230
Joined: May 27, 2005 15:14
Contact:

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby Adigun A. Polack » Feb 10, 2016 13:42

Dr_D, from this past Friday, you wrote:Whoa... Hey, buddy. :) How ya been? Looks like you've been pretty busy! Nice work there. :)


Well Dr_D my great man, I have been doing quite well on the FreeBASIC programming front these days, as I have been very, *very* plain busy currently indeed in coming up with brand-new and most absolutely innovative for AFlib III that I am just about to tell you and all of our own amazingly well-phenomenal FreeBASIC community about... and my, you are really gonna love this next ALL-NEW AFlib III update that I have in store for us all right now, so keep reading and get rather, rather excited!!! ;)

Alright. AFlib III has just been updated again today for all of you, this time to v0.87 alpha test release, so please check back to the very first post of this thread and get that newly current version pronto!!!

For openers right here on this, please take a look upon this:
Image
Here, as promised (as per a really good suggestion to me by dafhi earlier, I must say!! ;) ), I have finally enabled us all to select which specific AFlib III drawing primitives — both the main graphics and ASCii-graphics ones — for us to test as we please, instead of necessarily all at once.

And also for this *very* important update now, I have just now fully created my own self-made, custom-built original algorithms for all the image color conversions to successfully emulate all of the exact very proper colors based on many a good amount of retro-based computers and set-top/handheld game consoles of the 1980s and 1990s (including the Commodore Amiga, the Amstrad CPC/CPC+ series, the Atari ST/STe series, the PC-Engine/TurboGrafx-16, the original Game Boy, and even the original WonderSwan to name just a few!! :D ), as well as so many classic arcade machines of the early 80s, and even the earliest 80s Japanese computers like the NEC PC-88 and even the Toshiba Pasopia 7. And best of all, all these color conversions support ANY 15-, 16-, 24-, or 32-bit graphics mode in FreeBASIC you wish... WITHOUT even having to switch any of your current modes at all!!! ^_~=b !!!

For example, here is the normal picture that I took myself while I was on a special trip to Philadelphia, PA, USA for an Open House at the University of the Arts from all the way back on November 21, 2008:
Image

And when you add in all of the now-available image color conversions on this picture using AFlib III on FreeBASIC, here is the entire roster of what I am talking about, ladies and gentlemen:

    RGB 4,096-color (12-bit) Image Conversion:
    Image

    RGB 512-color (9-bit) Image Conversion:
    Image

    • Enterprise 64k/128k Home Computer 256-color Image Conversion:
    Image

    • Master System/Mark III 64-color Image Conversion:
    Image

    • Amstrad CPC 27-color Image Conversion:
    Image

    RGB 8-color (3-bit) Image Conversion:
    Image

    • CGA 4-color Image Conversion (1st Palette; Normal and High Intensities):
    Image Image

    • CGA 4-color Image Conversion (2nd Palette; Normal and High Intensities):
    Image Image

    • CGA 4-color Image Conversion (3rd Palette; Normal and High Intensities):
    Image Image

    • Game Boy 4-shaded Natural Greyscale Image Conversion:
    Image

    • Virtual Boy 4-shaded Red-scale Image Conversion:
    Image

    • WonderSwan 8-shaded Greyscale Image Conversion:
    Image

And please note that AFlib III is the VERY first FreeBASIC game-creation library of its very kind to present to you so many image conversions based *directly* on classic retro computers/console/handheld/arcade game systems that were immensely rather damn popular for its time, and still just as plain revered today as ever. And yes, entire FreeBASIC community (and all retro-game fans alike), I have created all these color-conversion algorithms myself indeed... all for you. ;) Perfect for converting a lot of your own game sprites into an easy-to-digest retro game format on the order of what I am clearly talking about throughout this entire post, so go for it!!!

Here comes an all-new AFlib III code snippet (for v0.87 or higher) on the color image conversions to inspire you greatly.

Code: Select all

#include "AFlib3_Palette.bi"
#include "AFlib3_Sprite.bi"
#include "AFlib3_Miscellaneous.bi"

Dim as Integer ImgConversionType
Dim as String  BMPfile
Dim as Integer BMPsize_x, BMPsize_y


BMPfile = "samplefile.bmp"  ' <--- Place any .BMP filename you want right here!!  ;)

ImgConversionType = 0  ' <---------- Pass '0'  for an RGB 4,096-color (12-bit) Conversion;
                       '                  '1'  for an RGB 512-color (9-bit) Conversion;
                       '                  '2'  for an Enterprise Home Computer 256-color Conversion;
                       '                  '3'  for a Master System/Mark III 64-color Conversion;
                       '                  '4'  for an Amstrad CPC 27-color Conversion;
                       '                  '5'  for an RGB 8-color (3-bit) Conversion;
                       '                  '6'  for a CGA 4-color Palette (1st palette; Normal);
                       '                  '7'  for a CGA 4-color Palette (1st palette; High Intensity);
                       '                  '8'  for a CGA 4-color Palette (2nd palette; Normal);
                       '                  '9'  for a CGA 4-color Palette (2nd palette; High Intensity);
                       '                  '10' for a CGA 4-color Palette (3rd palette; Normal);
                       '                  '11' for a CGA 4-color Palette (3rd palette; High Intensity);
                       '                  '12' for a Game Boy 4-shaded Natural Greyscale Conversion;
                       '                  '13' for a Virtual Boy 4-shaded Red-scale Conversion; or
                       '                  '14' for a WonderSwan 8-shaded Greyscale Conversion.
                       
BMPsize_x = AFlibIII_checkBMPsize_x(BMPfile)
BMPsize_y = AFlibIII_checkBMPsize_y(BMPfile)
If BMPsize_x < 1 or BMPsize_y < 1 then AFlibIII_EndProgram

ScreenRes BMPsize_x, BMPsize_y, 24, , 0
Bload BMPfile
WindowTitle "AFlib III -- Press any Key..."

Sleep
Select Case ImgConversionType
  Case is < 1: AFlibIII_ConvertSolidImage_RGB4096
  Case  1: AFlibIII_ConvertSolidImage_RGB512
  Case  2: AFlibIII_ConvertSolidImage_ENTERPRISE
  Case  3: AFlibIII_ConvertSolidImage_SMS
  Case  4: AFlibIII_ConvertSolidImage_CPC
  Case  5: AFlibIII_ConvertSolidImage_RGB8
  Case  6: AFlibIII_ConvertSolidImage_CGA , 0
  Case  7: AFlibIII_ConvertSolidImage_CGA , 1
  Case  8: AFlibIII_ConvertSolidImage_CGA , 2
  Case  9: AFlibIII_ConvertSolidImage_CGA , 3
  Case 10: AFlibIII_ConvertSolidImage_CGA , 4
  Case 11: AFlibIII_ConvertSolidImage_CGA , 5
  Case 12: AFlibIII_ConvertSolidImage_GB
  Case 13: AFlibIII_ConvertSolidImage_VB
  Case is > 13: AFlibIII_ConvertSolidImage_WS
End Select
WindowTitle "AFlib III -- Image Color Conversion Complete!!!"

Sleep
AFlibIII_EndProgram


Please enjoy this brand new update, and let’s see some pictures from all of you that are successfully converted using any of my hand-crafted color conversions that I have just now added in for AFlib III indeed... so show us what you got!!! d=(^-^)=b !!
cha0s
Site Admin
Posts: 5317
Joined: May 27, 2005 6:42
Location: Illinois
Contact:

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby cha0s » Feb 15, 2016 7:16

Man, after all this time... still hustling. I am truly impressed by your work and your dedication.
D.J.Peters
Posts: 6930
Joined: May 28, 2005 3:28
Location: Germany

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby D.J.Peters » Feb 15, 2016 11:10

256-color (332) Image Conversion in FreeBASIC

Joshy

Yes the right image has only 256 colors :-)
Image

Code: Select all

' Copyright D.J.Peters (Joshy)

dim shared as integer rtab(1,15) = { _
  {-16,  4, -1, 11,-14,  6, -3,  9,-15,  5, -2, 10,-13,  7, -4,  8}, _
  { 15, -5,  0,-12, 13, -7,  2,-10, 14, -6,  1,-11, 12, -8,  3, -9}}
dim shared as integer gtab(1,15) = { _
  { 11,-15,  7, -3,  8,-14,  4, -2, 10,-16,  6, -4,  9,-13,  5, -1}, _
  {-12, 14, -8,  2, -9, 13, -5,  1,-11, 15, -7,  3,-10, 12, -6,  0}}
dim shared as integer btab(1,15) = { _
  { -3,  9,-13,  7, -1, 11,-15,  5, -4,  8,-14,  6, -2, 10,-16,  4}, _
  {  2,-10, 12, -8,  0,-12, 14, -6,  3, -9, 13, -7,  1,-11, 15, -5}}

' create RGB 3:3:2 Palette (rrrgggbb)
sub Palette332()
  dim as integer i,r,g,b
  for i = 0 to 255
    r=(((i shr 5) and &H07) * 255) / 7
    g=(((i shr 2) and &H07) * 255) / 7
    b=(((i shr 0) and &H03) * 255) / 3
    palette i,r,g,b
  next
end sub

'r,g,b dithering to rrrgggbb
sub dither332(byval x as single, _
              byval y as single, _
              byval r as integer, _
              byval g as integer, _
              byval b as integer)
  dim as integer i,j
  i=int(y) mod 16:j=int(x) mod 2
  r+=rtab(j,i)
  g+=gtab(j,i)
  b+=btab(j,i)
  if (r > 255) then
    r=224 ' &HE0
  elseif r>0 then
    r=r and &HE0
  else
    r=0
  end if
  if (g > 255) then
    g=28 ' &HE0 shr 3
  elseif g>0 then
    g=(g and &HE0) shr 3
  else
    g=0
  end if
  if (b > 255) then
    b=3 ' &HC0 shr 6
  elseif b>0 then
    b=(b and &HC0) shr 6
  else
    b=0
  end if
  i=r or g or b
  pset(x,y),i
end sub

union RGB32
  type field=1
   as ubyte b,g,r,a
  end type
  as ulong col32
end union

''' main
dim as RGB32   c
dim as integer pitch
dim as ulong ptr pixels,row

ScreenRes 360,520,32
var RGBimg = imagecreate(360,520)
imageinfo RGBimg,,,,pitch,pixels
pitch shr=2 ' bytes to ulong
bload "test.bmp",RGBimg
put (0,0),RGBimg,pset
ScreenRes 360,520,8
Palette332
row=pixels
for y as integer = 0 to 519
  for x as integer = 0 to 359
    c.col32=row[x]
    dither332(x,y,c.r,c.g,c.b)
  next
  row+=pitch
next
bsave "256color.bmp",0
sleep
frisian
Posts: 224
Joined: Oct 08, 2009 17:25

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby frisian » Feb 15, 2016 17:10

@Adigun A. Polack

Just some thoughts about speed.
When possible avoid using floating point calculations, it's slower then integer calculations.
Don't send variables to a subroutine that are not used in that subroutine.
Don't test for conditions that never can occur.
Don't store values if you can avoid it.

x = Int(10 / 3) gives the same result as x = 10 \ 3
/ is a floating point division, \ is a integer division which is much faster.

Example: (original and some alternative versions)

Code: Select all

Dim Shared As Uinteger GBcol(4) ' just to let it compile and run

Function pal_solid_GB( ByVal src As UInteger, ByVal dest As UInteger, ByVal param As Any Ptr ) As UInteger

    Dim As Integer r,g,b,c

    r = Int(((src Shr 16) And &hFF))
    g = Int(((src Shr 8) And &hFF))
    b = Int(src And &hFF)

    c = (0.1 * b) + (0.6 * g) + (0.3 * r)
    If c > 255 Then c = 255
    Select Case Int(c / 64)
        Case Is < 1
            c = 3: Exit Select
        Case 1
            c = 2: Exit Select
        Case 2
            c = 1: Exit Select
        Case Is > 2
            c = 0: Exit Select
    End Select

     Return GBcol(c)
End Function

Function pal_solid_GB_new1( ByVal src As UInteger, ByVal dest As UInteger, ByVal param As Any Ptr ) As UInteger

    Dim As UInteger r,g,b,c

    r = (src Shr 16) And &hFF
    g = (src Shr 8) And &hFF
    b = src And &hFF

    ' c = (0.1 * b) + (0.6 * g) + (0.3 * r)
    c = (b + 6 * g + 3 * r ) \ 10

    ' If c > 255 Then c = 255
    ' Select Case Int(c / 64)
    Select Case (c \ 64)
        Case Is < 1
            c = 3: Exit Select
        Case 1
            c = 2: Exit Select
        Case 2
            c = 1: Exit Select
        Case Is > 2
            c = 0: Exit Select
    End Select

     Return GBcol(c)
End Function

Function pal_solid_GB_new2( ByVal src As UInteger) As UInteger

    Dim As UInteger r = (src Shr 16) And &hFF
    Dim As UInteger g = (src Shr 8) And &hFF
    Dim As UInteger b = src And &hFF

    /'
    c = (0.1 * b) + (0.6 * g) + (0.3 * r)
    If c > 255 Then c = 255
    Select Case Int(c / 64)
        Case Is < 1
            c = 3: Exit Select
        Case 1
            c = 2: Exit Select
        Case 2
            c = 1: Exit Select
        Case Is > 2
            c = 0: Exit Select
    End Select

    ' Return GBcol(c)
    '/

    Return  GBcol(3 - ((b + 6 * g + 3 * r) \ 640))   ' \ 640 = \ 10 \ 64

End Function


Function pal_solid_GB_new3( ByVal src As UInteger) As UInteger

    Dim As UInteger r = (src Shr 16) And &hFF
    Dim As UInteger g = (src Shr 8) And &hFF
    Dim As UInteger b = src And &hFF

    /'
    c = (0.1 * b) + (0.6 * g) + (0.3 * r)
    If c > 255 Then c = 255
    Select Case Int(c / 64)
        Case Is < 1
            c = 3: Exit Select
        Case 1
            c = 2: Exit Select
        Case 2
            c = 1: Exit Select
        Case Is > 2
            c = 0: Exit Select
    End Select

    ' Return GBcol(c)
    '/

    Return GBcol(3 - ((b + (g * 2 + r) * 3 ) \ 640))    ' \640 = \ 10 \ 64

End Function


Const As UInteger max = 2^28
Dim As UInteger src, dest, x, a1, a2, c1
Dim As Any Ptr param
Dim As Double t1

t1 = Timer
For x = 0 To max
    a1 = pal_solid_GB(x, dest, param)
Next
t1= Timer - t1
Print "time for pal_solid_GB     : ";t1

t1 = Timer
For x = 0 To max
    a1 = pal_solid_GB_new1(x, dest, param)
Next
t1= Timer - t1
Print "time for pal_solid_GB_new1: ";t1

t1 = Timer
For x = 0 To max
    a1 = pal_solid_GB_new2(x)
Next
t1= Timer - t1
Print "time for pal_solid_GB_new2: ";t1

t1 = Timer
For x = 0 To max
    a1 = pal_solid_GB_new3(x)
Next
t1= Timer - t1
Print "time for pal_solid_GB_new3: ";t1

t1 = Timer
For x = 0 To max
    Dim As UInteger r = (src Shr 16) And &hFF
    Dim As UInteger g = (src Shr 8) And &hFF
    Dim As UInteger b = src And &hFF
    a1 = 3 - ((b + (g * 2 + r) * 3 ) \ 640)    ' \640 = \ 10 \ 64
Next
t1= Timer - t1
Print "time for no function call1: ";t1

t1 = Timer
For x = 0 To max
    Dim As UInteger r = (src Shr 16) And &hFF
    Dim As UInteger g = (src Shr 8) And &hFF
    Dim As UInteger b = src And &hFF
    a1 = 3 - ((r * 299 + g * 587 + b * 114) \ 64000)
Next
t1= Timer - t1
Print "time for no function call2: ";t1

Print : Print "done"
Sleep

Function pal_solid_GB.
r = Int(((src Shr 16) And &hFF)) the Int statement is not needed (FBC does ignore it), all operations are integer. Also Shr and And are not allowed for floating point.

Function pal_solid_GB_new1.
Changed c = (0.1 * b) +? (0.6 * g) + (0.3 * r) into c = (b + 6 * g + 3 * r ) \ 10. The FP value's are multiplied with 10 to make them integers, but to get the correct result I need to divide the result with 10.
R, b, and g can't be smaller then 0 and can't be greater then 255 (And &hFF), since 1+6+3 = 10 resulting in 0<=c<=255.
Select Case Int(c / 64) is changed into Select Case (c \ 64)

Function pal_solid_GB_new2.
ByVal dest As UInteger, ByVal param As Any Ptr if dropped since the value's are never used in the function.
Select Case it completely dropped, and the return value if directly calculated.

Function pal_solid_GB_new3.
Managed to reduce the time even a little more.

No function call1 and no function call2 are to see how much time the function call takes. Call2 should be slower the call1. This is caused by timer not being very accurate.

Timings for the different functions.

Code: Select all

time for pal_solid_GB     :  10.84848432947184
time for pal_solid_GB_new1:  4.929414189892321
time for pal_solid_GB_new2:  4.546485527780368
time for pal_solid_GB_new3:  4.384135840095814
time for no function call1:  2.889785598217018
time for no function call2:  2.889474551849686


Code: Select all

Function pal_solid_CGA( ByVal src As UInteger, ByVal dest As UInteger, ByVal param As Any Ptr ) As UInteger

    Dim As Integer r,g,b,c,fpalc

    r = Int(((src Shr 16) And &hFF))
    g = Int(((src Shr 8) And &hFF))
    b = Int(src And &hFF)

    c = (0.1 * b) + (0.6 * g) + (0.3 * r)
    If c > 255 Then c = 255
    Select Case Int(c / 64)
        Case Is < 1
            c = 0: Exit Select
        Case 1
            c = 2: Exit Select
        Case 2
            If CGAimgconv_Pal = 2 Then
                c = 3: Exit Select
            Else
                c = 1: Exit Select
            End If
        Case Is > 2
            If CGAimgconv_Pal = 2 Then
                c = 1: Exit Select
            Else
                c = 3: Exit Select
            End If
    End Select

    Select Case CGAimgconv_Pal
        Case Is < 1: If c = 0 Then fpalc = EGAcol(CGAimgconv_BGcol) Else fpalc = CGAcol_A(c)
        Case 1:      If c = 0 Then fpalc = EGAcol(CGAimgconv_BGcol) Else fpalc = CGAcol_B(c)
        Case 2:      If c = 0 Then fpalc = EGAcol(CGAimgconv_BGcol) Else fpalc = CGAcol_C(c)
        Case 3:      If c = 0 Then fpalc = EGAcol(CGAimgconv_BGcol) Else fpalc = CGAcol_D(c)
        Case 4:      If c = 0 Then fpalc = EGAcol(CGAimgconv_BGcol) Else fpalc = CGAcol_E(c)
        Case Is > 4: If c = 0 Then fpalc = EGAcol(CGAimgconv_BGcol) Else fpalc = CGAcol_F(c)
    End Select

    Return fpalc
End Function

Code: Select all

Function pal_solid_CGA_new( ByVal src As UInteger, ByVal dest As UInteger, ByVal param As Any Ptr ) As UInteger

    Dim As UInteger r = (src Shr 16) And &hFF
    Dim As UInteger g = (src Shr 8) And &hFF
    Dim As UInteger b = src And &hFF

    Dim As UInteger c = (b + (g * 2 + r) * 3 ) \ 640

    ' if c = 0 then take shortcut
    If c = 0 Then Return EGAcol(CGAimgconv_BGcol)
    ' incase of EGAcol() not being a 32 bit (u)integer
    ' If c = 0 Then Return CUInt(EGAcol(CGAimgconv_BGcol))  ' convert to 32bit uinteger

    Select Case c
        Case 1
            c = 2: Exit Select
        Case 2
            If CGAimgconv_Pal = 2 Then
                c = 3: Exit Select
            Else
                c = 1: Exit Select
            End If
        Case Is > 2
            If CGAimgconv_Pal = 2 Then
                c = 1: Exit Select
            Else
                c = 3: Exit Select
            End If
    End Select

    Dim As UInteger fpalc
    Select Case CGAimgconv_Pal
        Case Is < 1
            fpalc = CGAcol_A(c)
        Case 1
            fpalc = CGAcol_B(c)
        Case 2
            fpalc = CGAcol_C(c)
        Case 3
            fpalc = CGAcol_D(c)
        Case 4
            fpalc = CGAcol_E(c)
        Case Is > 4
            fpalc = CGAcol_F(c)
    End Select

    Return fpalc
End Function

Function pal_solid_CGA_new.
When c = 0 then the return value is same for all CGAimgconv_Pal values.
This make the second Select Case much simpler.

Code: Select all

Function pal_solid_CPC( ByVal src As UInteger, ByVal dest As UInteger, ByVal param As Any Ptr ) As UInteger

    Dim As Integer r,g,b

    r = Int(((src Shr 16) And &hFF) / 85)
    g = Int(((src Shr 8) And &hFF) / 85)
    b = Int((src And &hFF) / 85)

    Return CPCeasy(r, g, b)
End Function

Code: Select all

Function pal_solid_CPC_new1( ByVal src As UInteger, ByVal dest As UInteger, ByVal param As Any Ptr ) As UInteger

    Dim As UInteger r,g,b

    r = ((src Shr 16) And &hFF) \ 85
    g = ((src Shr 8) And &hFF) \ 85
    b = (src And &hFF) \ 85

    Return CPCeasy(r, g, b)
End Function

Function pal_solid_CPC_new1.
Can't do much here because of the division by 85 just changed the division type to integer wich in turn make it possible to drop the Int statement.

Code: Select all

Function pal_solid_RGB8( ByVal src As UInteger, ByVal dest As UInteger, ByVal param As Any Ptr ) As UInteger

    Dim As Integer r,g,b,result

    r = Int(((src Shr 16) And &hFF) / 128)
    g = Int(((src Shr 8) And &hFF) / 128)
    b = Int((src And &hFF) / 128)

    If r < 0 Then r = 0
    If r > 1 Then r = 1
    If g < 0 Then g = 0
    If g > 1 Then g = 1
    If b < 0 Then b = 0
    If b > 1 Then b = 1

    result = RGB8col((r * 2) + (g * 4) + (b))
    Return result
End Function

Code: Select all

Function pal_solid_RGB8_new1( ByVal src As UInteger, ByVal dest As UInteger, ByVal param As Any Ptr ) As UInteger

    Dim As UInteger r,g,b

    r = ((src Shr 23) And 1
    g = ((src Shr 15) And 1
    b = src Shr 7 And 1

    Return RGB8col(r * 2 + g * 4 + b)
End Function

Function pal_solid_RGB8_new1.
Shr is a division which makes it possible to combine it with / 128 (128 = 2^7), simply add 7 to the Shr value.
Also the mask need to be adjusted &hFF ==> &hFF Shr 7 = 1.
Now it also should be clear that the If Then's are no longer needed. The value can only be 0 to 1.

D.J.Peters wrote:' create RGB 3:3:2 Palette (rrrgggbb)
sub Palette332()
dim as integer i,r,g,b
for i = 0 to 255
r=(((i shr 5) and &H07) * 255) / 7
g=(((i shr 2) and &H07) * 255) / 7
b=(((i shr 0) and &H03) * 255) / 3
palette i,r,g,b
next
end sub

Better use \ instead of / to avoid a internal Int call.
Change b=(((i shr 0) and &H03) * 255) / 3 to b=((i shr 0) and &H03) * 85, 255 / 3 = 85. (saves a division)
Adigun A. Polack
Posts: 230
Joined: May 27, 2005 15:14
Contact:

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby Adigun A. Polack » Mar 01, 2016 20:02

Okay. AFlib III has once more been updated now to v0.88 alpha test release for all of you, so please return to the *very* first post of this entire thread and get that all-new version on the double, as they now feature such amazingly simple-to-implement Score Ranking routines that are now FULLY-OPERATIONAL for you to create in FreeBASIC to help you make your game programming a whole lot damn easier and much more plain fun!!! More on that later in this post. ;)

But first, on to some serious business.

frisian, back on February 15, 2016, you originally addressed me and wrote:@Adigun A. Polack

Just some thoughts about speed.
When possible avoid using floating point calculations, it's slower then integer calculations.
Don't send variables to a subroutine that are not used in that subroutine.
Don't test for conditions that never can occur.
Don't store values if you can avoid it.

x = Int(10 / 3) gives the same result as x = 10 \ 3
/ is a floating point division, \ is a integer division which is much faster.


Now THAT is some splendidly great advice indeed in a nutshell ( ^-^=b !! ), frisian, because when I have thoroughly reworked and optimized the original image-conversion routines based on what you told me and some excellent coding ideas that you have shown me as quite inspiring examples (and using “\” for integer division calculations, just like you said!), the conversions themselves have gotten a WHOLE LOT faster speed-wise indeed. So much so, that you have successfully inspired an AFlib III Image Conversion Benchmark Test that I had to program... and guess what the results were now!? ;) !!

Image
And they were all taken from my very own current 3ghz computer called the Acer Aspire M3970 with 6GB DDR3 RAM memory and an Intel Core i3 processor 2100 with HD Graphics support up to a 1920x1080 32-bit color graphics mode. Amazing stuff right here, isn’t it? And I quite, *quite* thank you rather especially for such an outstanding piece of optimization advice the you so handsomely gave to me; WOW, I sure did not even know about that one at all in all of my 12 years of coding in FreeBASIC indeed!! :D !!


And from you, D.J.Peters, you quite handsomely wrote:256-color (332) Image Conversion in FreeBASIC

Joshy

Yes the right image has only 256 colors :-)
Image

Code: Select all

' Copyright D.J.Peters (Joshy)

dim shared as integer rtab(1,15) = { _
  {-16,  4, -1, 11,-14,  6, -3,  9,-15,  5, -2, 10,-13,  7, -4,  8}, _
  { 15, -5,  0,-12, 13, -7,  2,-10, 14, -6,  1,-11, 12, -8,  3, -9}}
dim shared as integer gtab(1,15) = { _
  { 11,-15,  7, -3,  8,-14,  4, -2, 10,-16,  6, -4,  9,-13,  5, -1}, _
  {-12, 14, -8,  2, -9, 13, -5,  1,-11, 15, -7,  3,-10, 12, -6,  0}}
dim shared as integer btab(1,15) = { _
  { -3,  9,-13,  7, -1, 11,-15,  5, -4,  8,-14,  6, -2, 10,-16,  4}, _
  {  2,-10, 12, -8,  0,-12, 14, -6,  3, -9, 13, -7,  1,-11, 15, -5}}

' create RGB 3:3:2 Palette (rrrgggbb)
sub Palette332()
  dim as integer i,r,g,b
  for i = 0 to 255
    r=(((i shr 5) and &H07) * 255) / 7
    g=(((i shr 2) and &H07) * 255) / 7
    b=(((i shr 0) and &H03) * 255) / 3
    palette i,r,g,b
  next
end sub

'r,g,b dithering to rrrgggbb
sub dither332(byval x as single, _
              byval y as single, _
              byval r as integer, _
              byval g as integer, _
              byval b as integer)
  dim as integer i,j
  i=int(y) mod 16:j=int(x) mod 2
  r+=rtab(j,i)
  g+=gtab(j,i)
  b+=btab(j,i)
  if (r > 255) then
    r=224 ' &HE0
  elseif r>0 then
    r=r and &HE0
  else
    r=0
  end if
  if (g > 255) then
    g=28 ' &HE0 shr 3
  elseif g>0 then
    g=(g and &HE0) shr 3
  else
    g=0
  end if
  if (b > 255) then
    b=3 ' &HC0 shr 6
  elseif b>0 then
    b=(b and &HC0) shr 6
  else
    b=0
  end if
  i=r or g or b
  pset(x,y),i
end sub

union RGB32
  type field=1
   as ubyte b,g,r,a
  end type
  as ulong col32
end union

''' main
dim as RGB32   c
dim as integer pitch
dim as ulong ptr pixels,row

ScreenRes 360,520,32
var RGBimg = imagecreate(360,520)
imageinfo RGBimg,,,,pitch,pixels
pitch shr=2 ' bytes to ulong
bload "test.bmp",RGBimg
put (0,0),RGBimg,pset
ScreenRes 360,520,8
Palette332
row=pixels
for y as integer = 0 to 519
  for x as integer = 0 to 359
    c.col32=row[x]
    dither332(x,y,c.r,c.g,c.b)
  next
  row+=pitch
next
bsave "256color.bmp",0
sleep


Well D.J.Peters, my man, you will be TRULY happy to know that based well on your wonderful code that you presented me in FB in your post on this very thread of mine right here, I have proudly implemented it for AFlib III just now as a set of custom .BMP loaders... only that on a successful load, your selected picture at run-time will be beautifully dithered in the style of a classic computer/game console. Observe and watch carefully!!! ;)

First, the original picture:
Image

Then, after any of the .BMP Dithered-Load Routines, the magic begins:

    RGB 332 Palette 256-color (8-bit) .BMP Dithered Load:
    Image

    • SAM Coupé 128-color .BMP Dithered Load:
    Image

    • Master System/Mark III 64-color .BMP Dithered Load:
    Image

    • Amstrad CPC 27-color .BMP Dithered Load:
    Image

    • EGA 16-color .BMP Dithered Load:
    Image

    RGB 8-color (3-bit) .BMP Dithered Load:
    Image

    • CGA 4-color .BMP Dithered Load:
    Image

    ...and SO MANY more!!!

Perfect for pixel-art, especially, as I will give you in just one more example of the image-dithering routines for AFlib III right here that I am talking about now:

Image

And now for something that took me QUITE some helluva doing to successfully implement and get fully working right now in AFlib III: the Score Ranking routines. Yep, you have not even heard me wrong period, ladies and gentlemen, as this rather thoroughly cements AFlib III now as most officially the very, VERY RATHER FIRST FreeBASIC game-creation library ever in existence to have full-blown support for custom Score Ranking tables all automatically built into the entire library itself. No damn kidding!!! ^-^=b !!!

And now, let us go to an all-new AFlib III code snippet (for v0.88 or higher) on how to implement you a simple, displayable arcade-quality Top-10 high-score table.

Code: Select all

#include "AFlib3_Font.bi"
#include "AFlib3_Screen.bi"
#include "AFlib3_Sprite.bi"
#include "AFlib3_Resize2X.bi"
#include "AFlib3_ScoreRanking.bi"
#include "AFlib3_Miscellaneous.bi"

ScreenRes 640, 480, 24

'---------------------------------------------------------------
ScreenLock
AFlibIII_PrepareScreenTrans
AFlibIII_DisplayAllChars 0, 0, rgb(255, 255, 255), rgb(255, 255, 255), 0, 15
AFlibIII_OptimizeFontSet 0, 0, 1
ScreenUnlock
'---------------------------------------------------------------

AFlibIII_ClearDisplay


'============================================================================
' Let's create a simple yet arcade-quality Top-10 score ranking screen with
' just three (3) letters in the player's names... made SO MUCH even more
' easier than ever with AFlib III in FreeBASIC!!!  (^-^)=b !!!
'============================================================================
AFlibIII_LaunchRankings 10, 3

For RankSetup as Integer = 1 to 10 step 1
  AFlibIII_CreateRankingSpot RankSetup, 10000000 - (1000000 * (RankSetup - 1)), Chr((RankSetup * 2) + 64, (RankSetup * 1) + 65, (RankSetup * 2) + 63), , _
                             3 - (((RankSetup - 1) mod 10) \ 4), _
                             4 - ((RankSetup - 1) mod 4)
Next

AFlibIII_OptimizedPrint_color "BEST TEN PLAYERS!!", 88, 24, 1, 0, RGB(255, 0, 0)

AFlibIII_OptimizedPrint_color "RANK", 48, 48, 1, 0, RGB(85, 215, 255)
AFlibIII_OptimizedPrint_color "SCORE", 104, 48, 1, 0, RGB(85, 215, 255)
AFlibIII_OptimizedPrint_color "NAME", 192, 48, 1, 0, RGB(85, 215, 255)
AFlibIII_OptimizedPrint_color "AREA", 240, 48, 1, 0, RGB(85, 215, 255)

For Listing as Integer = 1 to AF3_RankTable_LimitPlacings step 1
  Color RGB(255 - (Listing * 12), 165, 155 - (Listing * 12))
  Select Case Listing
    Case 1
      AFlibIII_OptimizedPrint_color Ltrim(Str(Listing)) + "st", 56, (Listing * 16) + 48, 1, 0, RGB(255 - (Listing * 12), 165, 155 - (Listing * 12))
    Case 2
      AFlibIII_OptimizedPrint_color Ltrim(Str(Listing)) + "nd", 56, (Listing * 16) + 48, 1, 0, RGB(255 - (Listing * 12), 165, 155 - (Listing * 12))
    Case 3
      AFlibIII_OptimizedPrint_color Ltrim(Str(Listing)) + "rd", 56, (Listing * 16) + 48, 1, 0, RGB(255 - (Listing * 12), 165, 155 - (Listing * 12))
    Case 10
      AFlibIII_OptimizedPrint_color Ltrim(Str(Listing)) + "th", 48, (Listing * 16) + 48, 1, 0, RGB(255 - (Listing * 12), 165, 155 - (Listing * 12))
    Case Else
      AFlibIII_OptimizedPrint_color Ltrim(Str(Listing)) + "th", 56, (Listing * 16) + 48, 1, 0, RGB(255 - (Listing * 12), 165, 155 - (Listing * 12))
  End Select
 
  AFlibIII_OptimizedScoreR_color AF3_HSScore(Listing), 56, (Listing * 16) + 48, 8, 1, RGB(255, 255, 255 - (Listing * 2))
  AFlibIII_OptimizedPrint_color AF3_HSName(Listing), 200, (Listing * 16) + 48, 1, 0, RGB(255, 255, 255 - (Listing * 2))
  AFlibIII_OptimizedPrint_color Ltrim(Str(AF3_HSStat_A(Listing))), 248, (Listing * 16) + 48, 1, 0, RGB(255, 255, 255 - (Listing * 2))
  AFlibIII_OptimizedPrint_color "-", 256, (Listing * 16) + 48, 1, 0, RGB(255, 255, 255 - (Listing * 2))
  AFlibIII_OptimizedPrint_color Ltrim(Str(AF3_HSStat_B(Listing))), 264, (Listing * 16) + 48, 1, 0, RGB(255, 255, 255 - (Listing * 2))
Next



'============================================================================
' Now, let's make the viewing of the ranking screen a lot more easier on the
' eyes with just one use of "AFlibIII_Resize2X_auto", which only works in
' a certain wide variety of 15- to 32-bit color graphics modes!!  ;)
'============================================================================
AFlibIII_Resize2X_auto

Sleep


AFlibIII_RemoveFontSet 1
AFlibIII_EndProgram

Image

There. That should really, really get you so excitedly inspired ever more for some real serious FB programming action in adding a whole ton more fun in creating your own games with AFlib III, I must quite very honestly say!!! :D !!

Remember all those times on how excruciatingly damned difficult and painful it was when you first tried to create your own Score Ranking table(s) in both QuickBASIC and FreeBASIC from back in the day, let alone save them to a custom file to load for later use? Yeah, THAT sort of thing. You had to prepare and jot in all the variables as well as update them all for each and every game played on which a player got a high-enough score to be qualified a guaranteed spot on that high-score table itself (including all the scores, names, and other stats including “Max-Chain/Combo Counters”, as well as the current stage/round/area the player was last on from just before his/her game was over, too!). I mean, it was a fricking rather hassle with all those sudden error pop-ups and awkwardly bad code which resulted in the tables themselves not acting right the way they first should. Well with AFlib III and the way I have now successfully implemented full and much richer and rather easier-to-use Score Ranking routines, all your very troubles are finally, FINALLY over at longest last!!! d=^-^=b !!

And ohhhh... while we are well-seriously on the subject of the Score Ranking routines built-in to AFlib III, you can even *actually* indeed save your entire custom-made score ranking tables to a single file, and then load them anytime for your game that you are developing in FB... ALL BUILT-IN for you as well!! ;*) And what’s more, you can even give those very high-score tables indeed of yours a lot more added security, using a special three-password tiered system that I have just added to the Score Ranking saving/loading system... A FreeBASIC GRAND EXCLUSIVE!!! Take a look at these two saving/loading commands straight from the from the all-new “AFlib3_ScoreRanking.bi” module that is now included for you in this newest version of AFlib III:

    AFlibIII_SaveRankings

    Code: Select all

    Declare Sub AFlibIII_SaveRankings ( Byref FileName as String, _
                                        Byref Password_1_of_3 as String = "", _
                                        Byref Password_2_of_3 as String = "", _
                                        Byref Password_3_of_3 as String = "" )

      FileName = the custom filename to save your entire Score Ranking table.
      Password_1_of_3 = the 1st security password (max: 24 characters, including spaces) to add to your Score Ranking table file.
      Password_2_of_3 = the 2nd security password (max: 24 characters, including spaces) to add to your Score Ranking table file.
      Password_3_of_3 = the 3rd security password (max: 24 characters, including spaces) to add to your Score Ranking table file.

      NOTE: ALL passwords are case-sensitive.

    AFlibIII_LoadRankings

    Code: Select all

    Declare Sub AFlibIII_LoadRankings ( Byref FileName as String, _
                                        Byref Password_1_of_3 as String = "", _
                                        Byref Password_2_of_3 as String = "", _
                                        Byref Password_3_of_3 as String = "" )

      FileName = the custom filename to load your entire Score Ranking table.
      Password_1_of_3 = the 1st security password (max: 24 characters, including spaces) for accessing your Score Ranking table file.
      Password_2_of_3 = the 2nd security password (max: 24 characters, including spaces) for accessing your Score Ranking table file.
      Password_3_of_3 = the 3rd security password (max: 24 characters, including spaces) for accessing your Score Ranking table file.

      WARNING!!! Please be sure to remember all your own passwords in the exact high-score table(s) of yours that you are trying to load in your own game, because as an important security measure, if you get even just one single password wrong, your current high-score table is automatically erased in entirety, but *not* the file itself on which that very table was last saved at all. That is why when it comes to your own game creations in FB, it is so splendidly very wise to know all your passwords for yourself and ONLY yourself without giving any of them away at all to anybody whatsoever... ever in secret as well, too! And, even when you are finally ready to distribute your game for the world to see, please be sure NEVER to give your source code away which contains any of your passwords themselves. Just wanting you to feel secure and have as truest peace-of-mind as possible with confidence regarding your own Score Ranking tables that you create using this very library itself!!! ^-^=b !!!

And one final thing for you awesomely quite amazing FreeBASIC people on this critically important AFlib III update... as clearly mentioned from right about the very start of this post, I have indeed updated and optimized the color image conversion routines for them to be much, much faster... with the brand-newest addition of the “Sam Coupé”-based and EGA-based image conversion routines that I myself have also made custom built-in algorithms of just now:

    • SAM Coupé 128-color Image Conversion:
    Image

    •EGA 16-color Image Conversion:
    Image

...and with that *plus* all the outstandingly plain wonderful updates that I have just generously given you now in the ever-continued development of AFlib III in FreeBASIC created in entirely by yours ever-truly (Adigun Azikiwe Polack) — including the grandest addition of the Score Ranking routines, as a masterfully innovative first for any library period in FreeBASIC quite thoroughly that I am deeply sharing with you especially from the very bottom of my deepest heart — I quite handsomely hope that you quite resplendently enjoy this brand new AFlib III version in spades, alright now? ;)

Thank you all so much for your incredibly plain awesome continued support, FreeBASIC community, and do continue to richly enjoy this lib!!! (^-^)v !!!

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 2 guests