Allegro 4

DOS specific questions.
Post Reply
Dinosaur
Posts: 1491
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Allegro 4

Post by Dinosaur »

Hi All

Tried to re-compile with FB 1.02 an application that cannot use Allegro 5 , and encountered numerous path's error.
Editing them manually , eventually got stuck on one path error that really was not a path error, as the path existed
and the file (i386go32.x ) also existed. Putting the location in the Path statement did not cure the problem.

Does this mean that I can now no longer upgrade the compiler ??

Regards

EDIT:
On previous updates I have always retained my, /inc/allegro & /inc/cgui folders and overwrote all the other updated files.
This time I made a clean new install (with fbc 1.02.1.dos.zip) on another drive and copied only my libraries & cgui.bi over.
Other then a few duplicate definitions, everything compiled without errors.
dkl
Site Admin
Posts: 3235
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Allegro 4

Post by dkl »

Hi,

in FB 1.01 there were new (recreated) Allegro 4 headers added, so there were massive changes in this area indeed. Although for the most part they should work as before.

One of the changes was that the many individual files in inc/allegro/ were merged into the main inc/allegro.bi (except for the alpng and algif extensions).

Due to cases like that it's better to delete the old folder before installing the new one, otherwise there could be problems, if the old/new headers are mixed. Although I don't know how this affects the Allegro 4 headers, since the "entry point" header (inc/allegro.bi) was updated.
Dinosaur
Posts: 1491
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: Allegro 4

Post by Dinosaur »

Hi All
One of the changes was that the many individual files in inc/allegro/ were merged into the main inc/allegro.bi (except for the alpng and algif extensions).
Yes noticed that.

There were also changes made to the cgui.bi
The latest (and last) change to cgui is now 2.0.4 , which is what I use, but the one modified for the last few releases was 2.0.3.

cgui 2.0.4

Code: Select all

declare function InitCguiEx cdecl alias "InitCguiEx" (byval w as integer, byval h as integer, byval colour_depth as integer, byval errno_ptr as integer ptr, byval atexit_ptr as function cdecl(byval as sub cdecl()) as integer) as integer
cgui 2.0.3 (I dont have the original anymore, so can't see what has been changed)

Code: Select all

declare function InitCguiEx(byval w as long, byval h as long, byval colour_depth as long, byval errno_ptr as long ptr, byval atexit_ptr as function(byval f as sub()) as long) as long
#define InitCguiLoadMode() InitCguiEx(0, CGUI_INIT_LOAD, CGUI_INIT_CODE, @errno, cptr(function cdecl(byval as sub cdecl()) as long, atexit))
#define InitCguiFullscreenMode() InitCguiEx(0, CGUI_INIT_FULLSCREEN, CGUI_INIT_CODE, @errno, cptr(function cdecl(byval as sub cdecl()) as long, atexit))
#define InitCguiWindowedMode() InitCguiEx(0, CGUI_INIT_WINDOWED, CGUI_INIT_CODE, @errno, cptr(function cdecl(byval as sub cdecl()) as long, atexit))
#define InitCguiKeepCurrent() InitCguiEx(0, CGUI_INIT_KEEP_CURRENT, CGUI_INIT_CODE, @errno, cptr(function cdecl(byval as sub cdecl()) as long, atexit))
#define InitCgui(w, h, bpp) InitCguiEx(w, h, bpp, @errno, cptr(function cdecl(byval as sub cdecl()) as long, atexit))
Error it creates

Code: Select all

WinMain.bas(8) error 1: Argument count mismatch, found ')' in 'InitCgui(1024,768,16)   		    ' set to full screen'
I can send 2.0.4 .bi file if it helps.

Regards
dkl
Site Admin
Posts: 3235
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Allegro 4

Post by dkl »

Oh, I think in the #define InitCgui, atexit should be @atexit. Classic translation problem, the same exists with the Allegro 4 headers...

I also found CGUI 2.0.4 in CGUI's CVS, on the Branch_CGUI_1-6-7 branch, but it doesn't seem to have any notable changes to the .h files, except the version number. (well, at least then I can update to it without having to adjust .bi files manually - previously that wasn't possible as I didn't find the CGUI 2.0.4 sources -- there doesn't seem to be a download for it at CGUI's Sourceforge site)
Dinosaur
Posts: 1491
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: Allegro 4

Post by Dinosaur »

Hi All

Thanks for that dkl, that fixed it, and means sofar I can use all the latest releases to compile my earlier projects.

I did think there was an additional Function in 2.0.4 or functional change, and that is why it became 2.0.4
I will try to find the reference to it, and if I find it, post it here.

For those of you who thought i was still retired, I have been seconded back to the usa for a 2 year consultancy period.
But at 68 this will definitely be my last. The caravan and the Aussie outback is calling.

Regards
Post Reply