WorldCupSokerban (GLFW-version) using OpenAL sound


Linux Build: AdaCore2021 on SL79 [mint is Ok, too].

-------------------------------------------------------------
todo:
.) recompile using w64 for maximum memory for embedded solvers.
-------------------------------------------------------------

22sep22:
.) Upgrading to stand-alone Win64 GNU Ada build.
.) Elliminating use of defunct AdaCore compilers.

12may22:
.) replace utex with generic gtex to allow multiple
	colors of text.

18jan22:
.) Updated zoomwheel.adb to respect zmin, zmax.

4dec21:
.) Delivered to F.S.F. latest version from S.F.

####################################################
## 29oct21 delivery v3.5.9: git,indi,itch,GJ,SF ##
####################################################

27oct21:
.) renamed wcmpa.bat to wcmp.bat

22oct21:
.) updated 64-bit glext64.lib

20oct21:
.) Now buildable under GNAT & all versions of AdaCore Ada.


####################################################
## 14oct21 delivery v3.5.8: git,indi,itch,GJ,SF ##
####################################################

9oct21:
.) updated to latest glfw3.dll, from avent.

14may21:
.) added handling of standard window close event.

31mar21:
.) removed unused variable "pt".
.) moved step:=1; save(step);
	into restart, rather than readPuz.
	This way undo stops at set point.

29mar21:
.) added 1-key = restart Original puzzle
.) Corrected/updated help screen.
	( 0 /= restore view, should be o )


####################################################
## 24mar21 REdelivery v3.5.7: git,indi,itch,GJ,SF ##
####################################################


23mar21:
.) disabled right mouse btn function to restore view angle;
	so it won't interfere with UNhightlight function.

18mar21:
.) added incomplete glfw v3.3.3 libs for win64...
	will update with ver 3.3.4 asap.

18mar21:
.) utiltypes.ads: bumped imaxboxes to 100 for sas4 #49
	with 98 boxes.


################################################
##3mar21 delivery v3.5.7: git,indi,itch,GJ,SF ##
################################################

3mar21:
.) considered omitting maxLevels from command line parms
	when in single file mode (like hbox4) BUT I cannot.
	The app must know maxlevels in order to allow
	normal use of the Next (n-key) and Prev (p-key)
	to access all other levels.

20feb21:
.) rearranged all source code under ./src/
	Adjusted all scripts.
	Adjusted help screen.
.) added 3rd solver "," (ibox)
	2nd "." (hbox4)
	1st "=" (pull)


###################################################
##19feb21 delivery v3.5.6: git,indi,itch,GJ, SF ##
###################################################

18feb21:
.) corrected functioning of hungarian feedback for
	mouseclicks on boxes or goals.
.) replaced old sound system with OpenAL, but...
	.) needed to process kik, andres WAV files
		thru sox; apparently they were bogus!

15feb21:
.) added highlighting of possible box moves,
	goal sources (like asok). Seems working Ok.

13feb21:
.) changed line 63 in emutils.ads to match limits
	in gametypes.ads:  maxrows=maxcols=50.


9feb21:
.) updated emsolver, utils, ibox3r, iplr3r


4feb21:
.) added takaken_14.sok

1feb21:
.) hooked in hbox4 as the embedded solver.
	BUT, its solns are tedious and inefficient.
	Should probably use it only as #2;
	I need to reinsert ipuller as #1. Done.
.) also added hbox standalone solver.


27jan21:
.) updated dpbox

2jan21:
.) updated embedded sok solvers to completely avoid 
	writing files. Should be faster. Affects:
	.) asok, coterm.csok, sban


9dec20:
.) moved timeout test outside inner loop: solver.adb
.) other solver improvements.
.) added <q>-key abort to iplr3r, ibox3r.
.) added "onestep", if time.

6dec20:
.) important fix to emutils/utils

26nov20:
.) updated utils, emutils, solver, iplr3r, ibox3r.
.) no longer call "iboxu" due to strange solns.

2nov20:
.) resurrected Alsa version as 2nd alternate
	[unused] sound system on linux for
	historical documentation only.
.) installed newest cheapSFX.
.) corrected some scripts.


###################################################
##28oct20 REdelivery v3.5.5: git,indi,itch,GJ, SF ##
###################################################

28oct20:
.) redelivered due to old linux exe

27oct20:
.) cleaner ezSound interface recompiled on linux.

27oct20:
.) removed spurious rufaswap_osx.

###################################################
##27oct20 delivery v3.5.5: git,indi,itch,GJ, SF ##
###################################################

25oct20:
.) completely removed SFML-audio;
.) all tested build/run Ok.


###################################################
##20sep20 delivery v3.5.4: git,indi,itch,GJ, SF ##
###################################################

18sep20:
.) added "sokerban.bat" for Windows users.


02jul20:
.) updated all glfw libs to v3.3.2.


###################################################
##10jun20 delivery v3.5.3: git,indi,itch,GJ, SF ##
###################################################

7apr20:
.) added on-screen "setpoint saved" message
	sokerban.adb::417

4apr20:
.) improved alsa player to read WAV file while "protected"


###################################################
##3apr20 delivery v3.5.2: git,indi,itch,GJ, SF ##
###################################################

2apr20:
.) Updated to newer & faster linux alsa player.

29mar20:
.) updated to latest sfmlFake library that is 100% Ada,
	but otherwise similar to previous lib. It uses
	an Ada alsa player accessed via an ada task,
	with no sound latency.
	See ~/alsaSound/minFakeAlsa/.
	Use lcmpd.sh to build this.


20mar20:
.) Alternatively use lcmp0.sh for a simpler build
	that uses a system shell to "aplay" for all sounds.
	Occasional latency for transient sounds


14mar20:
.) linux kick sound is sometimes tardy? Now fixed.

###################################################
##14mar20 delivery v3.5.1: git,indi,itch,GJ, SF ##
###################################################

13mar20:
.) regenerated *.exe...previous delivery had ERROR!
.) so also rebuilt OSX, Linux binaries,
	using tasking linux sound with less-tardy sound.

13mar20:
.) after a whole lot of trouble, I got a task to directly
	call a C function, similar to aplay. Not impressive...
	:(
.) the nice thing is I can switch back by swapping 2 lines
	in snd4ada_hpp.adb. And it SHOULD work on SL77, too.
	The difference is pretty negligible.

11mar20:
.) sent email to:  Jaroslav Kysela <perex@perex.cz>
	(author of aplay) informing him of PLsound
.) tried using aplay executable copied locally...NO dif!

10mar20:
.) discovered proper parms for aplay are:
	"aplay --quiet "
	i.e. "nonblock" does NOT do what "&" does
	and "nice -20" does NOT seem to help, either.
.) Changed main loop paradigm to only redraw if
	getKey or getMouse inputs warrant a change.
	The effort was to unburden the processors
	when no redraw was required, so that "aplay"
	might respond quicker...

9mar20:
.) now using "nice -20" in front of "aplay..."
	.) checked & works on SL.
	.) BUT, does not totally fix tardiness of 1st kick.

8mar20:
.) tried but cannot help delayed kick sound much!
	Very small improvement over sban-old-deliv
.) of the 2: 
	1) sban-old-deliv : previous delivery
	2) sban : minimal differences, yet improved over osban
		=> sban is this development directory.

###################################################
##20jan20 delivery v3.5.0: git,indi,itch,GJ, SF ##
###################################################

19jan20:
.) vastly improved linux portability by
	removing SFML.

10jan20:
.) updated to glfw v3.3.1


###################################################
## 2jan20 delivery v3.4.0: git,indi,itch,GJ, SF ##
###################################################

2jan20:
.) tested build/run on Windows...Ok
.) tested build/run on OSX...Ok

1jan20:
.) converted to GLFW3;

#######################################################

19dec19:
.) updated to SDL2 v2.0.10, including binding, libs, scripts.


###################################################
## 27nov19 delivery v3.3.0: git,indi,itch,GJ, SF ##
###################################################

26nov19:
.) Repaired a library problem with GNU/Linux build that limited portability.


###################################################
## 27aug19 delivery v3.3.0: git,indi,itch,GJ, SF ##
###################################################

26aug19
.) reverted to white lettering (gray bkgd)
	away from "high contrast".
.) also improved legibility, size.

22aug19:
.) fixed solver failure after first call;
	Note:  this bug was newly introduced...
	it did not happen with previous release.

19aug19:
.) updated soksolvers.
.) FIXED abort when pressing "=" or "." AFTER
	solution was compete.  This WAS a problem
	with previous release.

31jul19:
.) ipuller3 replaced by iplr3.

28jul19:
.) updated external & internal sok-solvers to latest.

###################################################
## 15jul19 delivery v3.2.9: git,indi,itch,GJ, SF ##
###################################################

10jul19:
.) single commandline parm (float)
	now sets persistent default timeout (sec).
.) resume file now stores timeout.


9jul19:
.) corrected error in commandline mode
	for single user puzzle.

24jun19:
.) updated Ada binding to SDL2;

21jun19:
.) updated sdl to v209;  passed validation check;


###################################################
## 12jun19 delivery v3.2.8: git,indi,itch,GJ, SF ##
###################################################

12jun19:
.) created female soccer avatar;
.) b-key => male(Boy);  g-key => female(Girl).

###################################################
## 10jun19 delivery v3.2.8: git,indi,itch,GJ, SF ##
###################################################

09jun19:
.) corrected bad behavior by adding call to "make_empty"
	in the exception handler for splaylist.adb::addnode...
	Now that I do not use storage pools, it seemed that
	once the storage_error exception was raised, no other
	puzzles could be solved;  even easy ones.


08jun19:
.) added exception handler to solver.adb, both parts.
.) improved timed exit code in solver.adb.
.) disabled use of arena_pools [which cause errors].
.) improved coding in splaylist.adb

17mar19:
.) man now tilts when kicking left or right.

4mar19:
.) now using alternate screen for help;

1mar19:
.) added high contrast help
.) checked file initializations;

8jan19:
.) disabled call to emptyEventQueue...seems unnecessary;

7jan19:
.) minor change in event loop.  See sokerban.adb::2068, 2096
	Commented out test_event.typ := sdl_lastevent
	...seems unnecessary.

##################################################
## 7jan19 delivery v3.2.7: git,indi,itch,GJ, SF ##
##################################################

4jan19:
.) supplemented "emptyEventQueue" with statement:
	test_event.typ := sdl_lastevent; --sokerban.adb::2094
	...which seems MORE effective than emptyEventQ.

31dec18:
.) addendum [line 2073] to handle closeWindow "x" event.
	Saved prior version as sokerban0.adb
.) Now shall deliver 7z archives.

###########################################################
####### 17dec18 delivery v3.2.5: git,indie,itch, SF, GJ ###
####### tgz to Indi,Git, tzip to itchi,SF, zip to GJ
###########################################################

6dec18:
.) updated to sdl v2.0.8;
.) revised linux compile script to use libsnd4ada.so,
	which elliminates need for asound, sndio.

4dec18:
.) added libsndio* to libs/gnu/ for enhanced portability;
	...to be more like agate.  Note that several apps
	do NOT require libsndio*, like rslid, swap, asok ???


#######################################################
####### 28nov18 delivery v3.2.3: git,indie,itch, SF, GJ ###
#######################################################

28nov18:
.) uploaded release to gameJolt;
.) discovered I forgot linux executable...
	.) reUploaded to SF,itchi,indie,github


27nov18:
.) announced on GOL;


17nov18:
.) updated sokSolvers ibox3, ipuller3, and
	embedded solvers.  Now use memory pools
	to more gracefully control memory overloads.
	Checked versus MsWin32, OSX, & Linux.

3nov18:
.) further improvements in sok-solvers including
	more precise cell-validity test.

28oct18:
.) improved sok-solvers now handle restarts,
	and use utils combined for both ibox, puller.
	Also use updated splaylist.

11sep18:
.) updated sok-solvers.

17aug18:
.) converted all to sdl207;

29jul18:
.) made critical updates to libs, scripts...
	to use sfml250, etc.
	need to fully test on osx, w32...
	Ok w32, gnu.



#######################################################
####### 8jul18 delivery v3.2.3: git,indie,itch, SF ###
#######################################################

8jul18:
.) checked that stand-alone ibox, puller also work on
	DOS-formatted *.sok files...Ok

5jul18:
.) updated osx to sdl207...NEED to test:Ok
.) updated win to sdl207...NEED to test:Ok
.) updated gnu to sdl207...NEED to test:Ok

4jul18:
.) fixed handling of DOS-format resume.txt file

#######################################################
####### 3jul18 delivery v3.2.2: git,indie,itch, SF ###
#######################################################


2jul18:
.) created ./binw32/ for *.exe *.dll
.) added local libm, libz

1jun18: solvers:
.) added the allowance of 1 pull into tunnel;
.) NOTE that ibox is push-optimal but is often
	clearly not move-optimal.

30may18:
.) now, ibox triggered by KeyPad "=";
.) puller triggered by normal keyboard "=";
.) puller now has timeout limit;
.) added "10sec soln not found" mesg.


29may18:
.) added "puller" to solver.adb to use when
	"ibox" fails.  See calx_25.sok, level 14.


#######################################################
####### 1apr18 delivery v3.2.1: git,indie,itch, SF ###
#######################################################

todo:  prep 4 delivery

30mar18:
.) simplified OSX builds using static libs.

26mar18:
.) Added ./buildScriptsGpr/

26mar18:
.) fixed Undo to prevent aborts @ step=0.

10mar18:
.) improved names in matutils.

2mar18:
.) fixed utex.adb so rods3x.png no longer
	needs to be inverted.


19feb18:
.) now using nice new font noto.png


#######################################################
####### 11nov17 delivery v3.2.0: git,indie,itch, SF ###
#######################################################


9nov17:
.) now using ada.directories.exists(fname)


4nov17:
.) !!! now compiles/runs on MSwin !!!
	...just need some dlls collocated w/exe.
	Also needed glext.lib (sourceforge glext-win32),
	and glfw, sfml libs for win32;
	and libz.a for win32.




22oct17:
.) added IJKL-keys for movement, in addition to WASD-keys
	and arrow keys.
.) added step, push count to output.

19oct17:
.) elliminated unneeded freetype.framework, libjpeg.a

9sep17:
.) added required pumpevents into emptyqueue;
.) corrected logic inside equal-key handler.

4jul17:
.) modified *.sh to avoid large exe in ~/obj/

3jul17 (mini):
.) updated linux scripts to use AdaCore 2017 as well as
	updated SFML 2.4.2 libs.
.) revised lcmp16.sh script for linux;
.) put older linux libs into ~/libs/gnu16


2jul17 (mini):
.) added OGL version query to startup messages.
.) added OGL profile queries too.



#######################################################
####### 14may17 delivery v3.1.9: git,indie,itch, SF ###
#######################################################


12may17:
.) FIXED vanishing soker balls problem:
	I needed to disable key/mouse responses while
	the boolean stillRolling = true.  Otherwise
	my logic for defining rolling source & destination
	was disrupted, eg: oldbr, oldbc, newbr, newbc

12may17:
.) problem: vanishing soker balls during rapid play.

12may17:
.) now call sdl_getkeyboardstate after each sdl_pumpevents call.
	I think this is the correct way to handle the update
	of keyboard events.
	Action now seems perfect.



#######################################################
####### 2may17 REdelivery v3.1.8: git,indie,itch, SF ###
#######################################################

3may17:
.) corrected too-large stack allocation that caused error
	of rufasok on OS-X.

.) corrected serious error in solver.adb, ibox.adb
	involving win_key.

3may17:
.) increased maxrubies from 256 to 512 (sas8:49)
.) removed exception raised in solver.adb,
	changed to failure:=true;
.) also in solver.adb now check that #rows is Ok.


#######################################################
####### 2may17 REdelivery v3.1.8: git,indie,itch, SF ###
#######################################################

1may17:
.) made corrections to ibox, solver.

23apr17:
.) added step countdown during solve.

#######################################################
####### 23apr17 delivery v3.1.8: git,indie,itch, SF ###
#######################################################


22apr17:
.) added takaken7.
.) autosolver (ibox) is now attached:
	Press (=)-key at any time to try 10sec solver versus
	the current puzzle state.  If success then keep
	pressing (=)-key to step towards solved state.
	...NEEDS MORE TESTING...

.) restructured similar to asok:
	.) created proc loadGames WITH EMBEDDED alphabetical SORT;
		This requires new resume.txt file.
	.) created proc checkForUserFile;
	.) created proc handleKeysAndMouse;
	.) created proc Draw;

#######################################################
####### 15apr17 delivery v3.1.7: git,indie,itch, SF ###
#######################################################


12apr17:
.) Now, we save mylev array to preserve the current levels
	in each file.

7apr17:
.) reduced volume of kick from 99 to 30.  Much better.

######################################################
####### 7apr17 delivery v3.1.6: git,indie,itch, SF ###
######################################################


6apr17:
.) revised, improved directory structure;
.) added another compile script for linux using libsnd4ada.so;
.) slightly enlarged balls;

28feb17:
.) removed OpenGL-deprecated glshademodel function that could
	cause aborts.

17feb17:
.) elliminated utex-load*
.) added full error checking in shader.adb following example
	from C++:
	.) checks vshader compilation;  gives error message;
	.) checks fshader compilation;  gives error message;
	.) checks shader program link;  gives error message;

11jan17:
.) now, ball spins twice for more dazzle.
	See sokerban.adb:1915

######################################################
####### 4jan17 delivery v3.1.4: git,indie,itch, SF ######
######################################################


3jan17:
.) minor error message (libopenal.a) corrected by
	using shared lib.

1jan17:
.) Fixed erroneous multiple windows due to multisample logic.
.) refined scripts.

######################################################
####### 30dec16 delivery v3.1.4: git,indie,itch ######
######################################################

26dec16:
.) Improved build system to be compatible with more linux distros.
.) Improved OpenGL coding to run on less capable graphics hardware.

23dec16:
.) added WASD keys for movement.

28nov16:
.) now uses more elegant SFML interface.
.) BUT NOTE:  still using SFML v2.1;  this means that the
	compile scripts might have to be revised when updating
	to SFML v2.4

23nov16:
.) increased max # balls to 300 to handle sas6_50.sok #50.

#########################################################
####### 16aug16 delivery v3.1.3: git,indie,itch,sf ######
#########################################################

14aug16:
.) Now includes latest sok-solvers, written in Ada.

5aug16:
.) updated ignore_this_line.
.) now allow next(n), prev(p) to work in single file mode, as well.

27apr16:
.) updated snd4ada.cpp to use dynamic SFML allocation per AdaGate.



#####################################################################
shared sfml,sdl2 ( using lcmp.sh but not scmp.sh ):
12apr16 ============== deliver v3.1.2 to GitHub ====================
12apr16 ============== deliver v3.1.2 to indieDB ===================
12apr16 ============== deliver v3.1.2 to itch.io ===================
12apr16 ============== deliver v3.1.2 to S.F. ======================


11apr16:
.) important fix:  73% no problem
	added softlinks for ogg vorbis flac so runtime linker
	would use local copies.
.) using lcmp.sh for this delivery, however I could/should have
	used scmp.sh to use static SFML,SDL2 ?

5apr16:
.) revised compilation directory structure
.) repaired error in data...ogg formats are invalid on osx
	with this older version of sfml.


10apr16 ============== deliver v3.1.1 to itch.io ===================

9apr16 ============== deliver v3.1.1 to GitHub ===================
9apr16 ============== deliver v3.1.1 to indieDB ===================

20feb16 ============== deliver v3.1.1 to S.F. ===================

11feb16
.) normalized utex;  caller sets filename.

12jan16 ============== deliver v3.1 to S.F. ===================

11jan16
.) further improved pusher man texture but had to add height
	and width scale factors, since new texture has no margin.
.) fixed error in #columns so the field widths are now correct.
.) moved puzzle centroid to window center for improved view.
.) closer key (c) now zooms directly toward window center.
.) key delay now bifurcated to separately affect :
	(a) arrow-keys
	(b) all other keys
.) fixed single file mode (was not previously working).
.) Now every file in the games directory is read dynamically.
	Any files added to the games directory must have correct format;  
	and the name must follow the convention of having the form
	*_####.sok
	where * contains no [other] underscore characters,
	and ####, is a 1,2,3 or 4 digit integer indicating the
	maximum number of levels.  Thus, the single file mode is 
	now even more critical for checking the format of
	prospective additions.


10jan16 ============== deliver v3.0 to S.F. ===================

10jan16
.) fine adjustments...
.) thinner nets, smaller balls
.) pusherman: cleaned, reduced transparency

9jan16
.) sokerban::1574 changed 0.1 to 0.01 to make man edge invisible.
.) added keyboard controls for view...
	c closer
	f further
	d defaults
	/ tilt up
	\ tilt down

8jan16:
.) pusher-man now has a bit of an upward tilt.
.) the mouse can now be used to improve the game viewpoint...
	the mouse wheel moves the eye closer or further;
	a left button drag changes the view angle;
	a right button click restores the default settings.
.) on a MacBook trackpad, a 2-finger-swipe seems to simulate a mouse wheel;
	and a 2-finger click simulates a rightBtn click to restore settings.

4jan16:
.) updated year to 2016

26dec15:
.) corrected ytop in cyl2obj.adb per adagate.


6dec15
.) created README.md
.) put on SF.


29nov15 ============== deliver v2.8 to S.F. ===================

28nov15:
.) no disappearances since namespace was decluttered by changing
"barrel" to "ball" within cyl2obj.ad*

27nov15:  error...ball still disappears within 1st five games ??
I have carefully checked my indexing...Ok.

24nov15:
.) experienced a graphical anomaly, on two distinct linux systems,
	where soccer balls occasionally disappear!  See cyl2obj.adb:140 
	and sokerban.adb:1516.  I changed the loop index from i to something
	more distinctive in case the compiler namespace is problematic.  
	Don't recall seeing this problem in C++.
	Also reduced mxbarrels from 512 to 256.
.) revised goal logic.
.) changed...secPerMove to 0.10, secPerRoll to 0.25


22nov15 :  upgraded pngloader.ad? to accomodate both RGBA and RGB images.

15nov15:
.) redrew pusher with soccer shorts, shoes...much better!


15nov15 ============== delivery to S.F. ===================

15nov15:
.) problem...stack overflow on osx !!!  It seems this was solved
	by declaring large objects in gametypes.ads as per adagate.

14nov15:
.) seems to be working well;  needs more testing
.) removed use png_io from pngloader.adb to clarify all uses;
.) clarified difference between rectobj and pictobj.

13nov15:  
.) foot not displayed ???
.) ball rolls too far (X2) ???

12nov15:
.) beginning efforts to compile, after having fleshed out most code

