|
This thread is locked; no one can reply to it. |
1
2
|
Allegro and Mappy in VS2022 |
agonvs
Member #15,917
March 2015
|
Hi All, I'm trying to get Mappy to compile with Allegro 5.2.xx in Visual Studio 2022 using Nuget to install Allegro. Anybody have any luck getting these softs to cooperate? |
Edgar Reynaldo
Major Reynaldo
May 2007
|
If mappy for A5 is a single file, just add it to your project. Otherwise compile a .lib and link to it. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
agonvs
Member #15,917
March 2015
|
I tried the single file route. I keep getting a bunch of errors. |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Mappy has to be compiled as C, are you sure you're not compiling as C++? C support in VS is notoriously poor. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
agonvs
Member #15,917
March 2015
|
Any idea how I can compile it as C in VS? |
GullRaDriel
Member #3,861
September 2003
|
Well, tell us more about your errors ? Like a compile log as an attachment ? Maybe you'll have to dig into mappy's source, and check if there are the required 'extern C { }' blocks around the declarations in the headers ? I really don't see how it would not compile C if it's correctly written. "Code is like shit - it only smells if it is not yours" |
agonvs
Member #15,917
March 2015
|
Build started... |
Dizzy Egg
Member #10,824
March 2009
|
Seems like a problem between x86 and x64 - have you tried building your project for 32-bit instead of 64-bit?
---------------------------------------------------- |
agonvs
Member #15,917
March 2015
|
OK, I tried compiling under 32-bit. Here's what I get: Severity Code Description Project File Line Suppression State |
Dizzy Egg
Member #10,824
March 2009
|
I managed to get it to compile in Visual Studio using the attached file (had to make some small changes), and had to add ;_CRT_SECURE_NO_WARNINGS to the project preprocessor definitions (Properties->Configuration Properties->C/C++/). I had to change BITMAP* to ALLEGRO_BITMAP* (only one instance of that) some other bits, but it should now compile and work ok. Try replacing your mappy_A5.c with the one I have attached, and rebuild your solution (after adding the _CRT_SECURE_NO_WARNINGS) and it should be ok... [EDIT:] Also, if you want to build and run the example, you'll have to manually cast (char*) for the SetMap arguments, ie: SetMap((char*)"test8bpp.fmp", (char*)"mappy demo 1 8bpp map animated", FALSE, FALSE))
---------------------------------------------------- |
agonvs
Member #15,917
March 2015
|
Well, it compiles and runs, but then quits with a divide by zero error... |
Dizzy Egg
Member #10,824
March 2009
|
If you right-click your project in solution explorer (not the solution, but the project!) and select properties, you should be able to find it here: {"name":"Wxzupf.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/2\/12c992caef535797c0ceb026bebe63f3.png","w":788,"h":519,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/2\/12c992caef535797c0ceb026bebe63f3"} [EDIT] [EDIT]
---------------------------------------------------- |
agonvs
Member #15,917
March 2015
|
See the attachment. |
Dizzy Egg
Member #10,824
March 2009
|
I think I'd need to see your own code where you load/draw the map to figure out why that is happening.
---------------------------------------------------- |
agonvs
Member #15,917
March 2015
|
Here it is |
Dizzy Egg
Member #10,824
March 2009
|
The problem is you're not loading your map before drawing it; MapLoad returns "0" on success, so change your MapLoad to this (lose the !): if (MapLoad((char*)"myMap.FMP", 1)) //If MapLoad returns a value, exit return -5; If you are running from debugger, make sure you put "myMap.FMP" in the same folder as your project, not in the Project->Debug folder (because VS will run the debugger from the project folder, even though it builds the exe in the Debug folder). You can make it more readable by changing it to this also: if (MapLoad((char*)"myMap.FMP", 1) != 0) //If MapLoad returns a value, exit return -5;
---------------------------------------------------- |
Edgar Reynaldo
Major Reynaldo
May 2007
|
It seems mappy for a5 is no longer available. At least I couldn't find it. I downloaded mappy_a5.h from someone's game repo and am using DizzyEgg's modified mappy_a5.c file. Is there still a website for mappy with A5? The thread that tells about only points to a website with allegro 4 version of mappy. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Dizzy Egg
Member #10,824
March 2009
|
I don't think there's a site hosting it; I grabbed it from the Mappy.zip attachment on this post:
---------------------------------------------------- |
agonvs
Member #15,917
March 2015
|
YAAAY! It worked! Thank you so much for your help. Mappy can be found here: https://www.tilemap.co.uk/mappy.php |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Thanks DizzyEgg, I didn't see the attachments on that thread. Sadly version A5 is not on that website agonvs, at least I can't find it. Hey agonvs, can you upload your mappy.fmp map so I can try your code? I want to play around with mappy a little bit. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Dizzy Egg
Member #10,824
March 2009
|
agonvs said: YAAAY! It worked! Thank you so much for your help You're welcome, we got there in the end
---------------------------------------------------- |
Peter Hull
Member #1,136
March 2001
|
I got it from http://fixbyproximity.com/2011/11/28/2d-game-dev-part-11-2-tile-backgrounds-with-mappy/ but it didn't compile for me without a few tweaks. Maybe we should make a 'definitive version' and put in on Allegro's wiki or somewhere.
|
agonvs
Member #15,917
March 2015
|
Here you go. Enjoy! |
Dizzy Egg
Member #10,824
March 2009
|
Peter Hull said: Maybe we should make a 'definitive version' and put in on Allegro's wiki or somewhere. That sounds like a plan, would be useful to have a working version that A5 users can easily find.
---------------------------------------------------- |
Edgar Reynaldo
Major Reynaldo
May 2007
|
It's got some problems with 64 bit pointer casts from integers of a different size. I also fixed the ridiculous (char*) shenanigans and made them const. I'll put a project up on Github, we can mirror it there. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|
1
2
|