|
Bitmaps Display Problem |
nico_c++
Member #16,940
January 2019
|
I have a little problem: I am trying to load a lot of Bitmaps, which are making a map. Does someone know, what this boxes are and why they are there and how I get them away? The tile-bitmaps are all transparent, also the bitmaps from the units (that means, there is no white background or something like that, it is a transparent background). Please help me, if you know something to do there. |
Edgar Reynaldo
Major Reynaldo
May 2007
|
First off, are you using Allegro 4 or 5? And please note the sub-versions as well. Second, can you post the two (or more) sprites used in that screenshot as an attachment? I doubt there's anything wrong with the images though. It sounds like a blending mode problem. Have you changed it at all? It could be a loading problem as well, as bitmaps are converted to the current format upon loading. If they're png, this shouldn't matter, as they are 32bit RGBA to begin with. Third, post code in <code>code goes here</code> tags. Post the display code and the loading and setup code. Then maybe we can pinpoint what is wrong. Honestly, I've never seen anything like that happen before. 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 |
nico_c++
Member #16,940
January 2019
|
Sorry, I am not on the PC right now. And x and y are And for all i.y % 2 * != 0 At least I think so, thats because of the form of the tiles, u can see that in the screenshot. But that's all not my point, when the bitmaps are "overlap", there are these orange boxes, u can see that in the screenshot. And the tiles are overlapping because I drawed them a bit longer than the 75 and 50 pixel rims and so on. I hope you understand a bit what I wrote, I will upload the tile and the unit bmp later, also so code. Thanks for now |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Allegro 5 is still too vague to be helpful. But your using binaries for MSVC so they could be at least a few years old by now. Unless, actually, you're using Nuget, right? That means version 5.2.4 . Which is the latest stable release. Your loops look okay. Each column overlaps the next by half its width. Hold on I'll be right back. Gotta get off my phone and go inside to my computer. Honestly, I don't know why they're orange 🍊. BRB 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 |
nico_c++
Member #16,940
January 2019
|
Yes I use Nuget. |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Okay that solves that. One thing I saw in your code is : Image = al_load_image("path"); al_draw_image(Image, x, y, 0); al_destroy_image(Image); I hope you don't do all three of those things in the same loop. That would be a terrible waste of resources and cpu and disk access reloading your images on every frame. It's not a memory leak at least. Really I can't tell anything else without seeing code and the particular images that are overlapping in orange. Just make a zip file of your source and your resources and I'll build it myself. Include the solution for MSVC 2017. I have it installed and I can test your code myself. 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 |
nico_c++
Member #16,940
January 2019
|
Okay, Edit: Just solved the problem myself. |
|