Sprite2Mem question

Previous topic - Next topic

CptnRoughnight

Hi,

I have a problem by using Sprite2Mem. First my image was warped and now i got only a white screen. Could anybody help me, please?
https://dl.dropbox.com/u/51078888/Sprite2Mem.zip

I have already used the search function but found nothing.

edit : I want to use Sprite2Mem to load a Bitmap and convert it to my MAP- format.

Thansk in advance!


hardyx

#1
You are using a function analyseMap() wich only returns true or false, and you are only painting white (255,255,255) pixels. The function ExtractColor is returning true of false, ignoring the colour components: red, green, blue. Briefly, you are painting the black pixels in the .bmp image with the colour white.

P.S. You can post the .gbas code in your message too.

CptnRoughnight

Yes, thats true.

It's only extracted from the main project to test this function. The problem is that the image is distorted, i want to know why?

hardyx

If your image has 500x500 pixels, then you must to use curMapBuffer%[x+y*500] in the analyseMap() function. And I think you must to change the FOR loops putting first "FOR y" and then "FOR x". The inner loop moves in the horizontal direction.

CptnRoughnight

Thank you that has helped first. But I have another problem. I made a completely white bitmap and interrogated by white. Everything works fine so far. Then I clean painted a black line and it works very well. Only now when I query to red, even if no red in the picture, then he painted all white and red points.
It is the same code as in the first post. Hope someone can see what I'm doing wrong.

powered by Google-Translator ;)

MfG

hardyx

You can use the debug button before compiling and use breakpoints to see the values of variables. You can compare the colour value at once without extracting the components using RGB(r,g,b) function with RGB(255,0,0) // red

BTW: You must to compare with the exact colour value, for example RGB(255,0,0) if you used pure light red in your graphic. Maybe the colour in the graphic is other tone.