red,green and blue dot? |
insomniac
|
Sorry the image didnt show up!You can see the dots by the bottom left hand side of her dress.
|
|||||||||||
|
Naith
|
Is the image you've posted the original image or a screenshot from when the program runs?
My guess is that it's something with the color key'ing you're doing in the render function. |
|||||||||||
|
insomniac
|
Thanks for the quick reply I will look into the color keying. That is a screen shot here is one of the bmps that is effected: |
|||||||||||||
|
insomniac
|
After I adjusted my color key SDL_SRCCOLORKEY to SDL_TRUE it produces this which will show exactly where the dots are being placed on the bott bmps. |
|||||||||||||||
|
Naith
|
May I look at your code (and not just the one you posted in your first post)? I have an idea on what might cause the problem. I will also need the affected image. I can't see the image you've posted.
|
|||||||||||
|
insomniac
|
I cant really share the whole source code or I would I'm building this project for someone else and theres alot of vultures that would like to get a hold of it! I am remaking a client for an old mmorpg that were trying to keep alive. I noticed someone else is having similar problems rebuilding his version of the client using sdl 2.0. Can be seen here http://www.treos.org/viewtopic.php?f=17&t=135&start=60 |
|||||||||||||
|
Naith
|
Oh, okay. I understand.
What I think you should do is: 1. Move the SDL_SetColorKey code from the render function into the function where you're creating the character and such, since the color keying only has to been done once for each surface, and not every frame. Might eventually cause some problems if color keying is being made every frame during rendering. Shouldn't be any problems but it might case some weird effect. Example:
2. Make sure that the background on the image you're loading only contains black so there isn't any pixels in another color (like the pixels that appears at the left when rendering). There will be problems with the color keying if that's the case. |
|||||||||||||
|
insomniac
|
I tried moving the color function to each instance and I got the same result. I checked the bmps and their background/transparency and the bmps were fine.I removed the color key function completely to see what would happen and the dots still appear by the boots. |
|||||||||||||||
|
Naith
|
Are the dots appearing only for some of the bmp's or all of them?
Have you considered switching to SDL_Image and loading the images as png files instead? By doing that, you don't have to have a black background on each of the images and you don't have do to any color keying, since SDL_Image takes care of the alpha layer and doesn't render it. |
|||||||||||
|
insomniac
|
Its only on some bitmaps for instance most of the the boot bmps which are 34 x 27. I havnt tried SDL_Image because I would have to convert thousands of bmps to png files.If I can find a strait forward method to convert my bmps to png I will give your idea a shot. I had a few ideas over night. 1: I'm going to try and slow down the program in between loading those bmps. 2: Instead of drawing the boots to the original screen I am going to draw them on the character. |
|||||||||||||
|
Naith
|
I still feel like it's something wrong with some of the bmp images since the error only occur on some of the images. I doubt that there's some bug in SDL_LoadBMP and / or SDL_BlitSurface that would occur only on some of the surfaces. The only time when I've had rendering problems using SDL_BlitSurface is when I've made something wrong with the background color and color keying and such.
Yeah, that might be a good idea. Also, if I were you, I would try to turn off all the other assets that's being rendered (backgrounds, menu buttons and so on) to see if it's maybe some background or something that causes the rendering error(s). Might be a long shot but it's worth to check. |
|||||||||||
|
insomniac
|
Heres a zip files of the boot bmp's https://www.mediafire.com/?rm2ua7di11n76vu maybe try and render a few of um . I can't find anything wrong with them! |
|||||||||||||
|
Naith
|
A lot of images there. Can you check for one of the images that the error occurs on and I will try to render it on my computer?
|
|||||||||||
|
insomniac
|
It happens at random I have a program I made to convert individual bmps to sheets and full sheets to bmps.I converted all those bmps to sprite sheets multiple times and it happens at random.Each time I turned the bmps to sheets the dots appeared on different instances! Here is the last result produced from bmp_2_spritesheet https://www.mediafire.com/?4kiuf646mq5t68q |
|||||||||||||
|
Naith
|
I've now located the error.
Here's a screenshot from a program I wrote to render 962 images at the same time (didn't have room in the window to render more). As you can see in the image, some of the rendered surfaces has the small dots in them. We can therefore be sure that there's nothing wrong with your code. Link to image: http://tinypic.com/view.php?pic=2qnqpg2&s=8#.U-FNeGPDUe9 In my program I counted which surface was the first to have the dot's on it when rendered and opened up that image in Photoshop. I also located some more images to check. Here's an image showing the images zoomed in a lot: http://tinypic.com/view.php?pic=n4tcm0&s=8#.U-FOQ2PDUe9 There's the reason why you're having dot's on some surfaces during rendering. As you can see the issue seems to be very random since Bitmap_18.bmp and Bitmap_353 doesn't have the dots but Bitmap_354 has. The issue is on some images in a row but there's also images here and there that have the dots. |
|||||||||||
|
insomniac
|
This seems to be a bug in SDL and should be addressed! Im not doing anything abnormal with my program, I am just rendering at times thousands of bmps at the same time. My thoughts: what whould happen if I changed the bmp size to 34 x 28 instead of 34 x 27,its just theirs to many figures I have to test alone |
|||||||||||||
|
Naith
|
Like I said, the dot's are on the images even before they are loaded. Check the second of my images. That image shows a screenshot from Photoshop where I've openede some of the images and the dot's are there. So the issue is in the images.
|
|||||||||||
|
insomniac
|
In your post you said bitmap 354 has the dots,but it doesnt here is the original copy of the the image . none of the boot bms have those dots Ive looked over them multiple times! How would the original game have been able to use the 0,0,0 transparency with those dots they would have and trust me I,ve been working with the server emulator for almost four years I know every in and out of the game and there was no weird rgb dots in the bottem of some bms. |
|||||||||||||
|
insomniac
|
Holly craPP the dots that show up on that link I posted last are not on the original image!!!!???? I have it inlarged in photo shop 700% and the whole surface beside the boot gfx is 0,0,0 |
|||||||||||||||
|
insomniac
|
I am going to change the background to 255,255,255 and see if it still happens! |
|||||||||||||||||
|
Naith
|
Well, my Photoshop doesn't lie (as far as I know) and if you take a look at my Photoshop screenshot you can see that the file Bitmap_354.bmp is open (look at the file names of the images that are open) and you will see that Bitmap_354.bmp is open and does indeed has the dots.
I tryed to remove the dots in Bitmap_16.bmp and Bitmap_17.bmp, kept the black background in both of them, tried to render them and the error is gone. |
|||||||||||
|
Naith
|
I had some time to kill so I fixed all the images that had the dot's in them. Images: http://speedy.sh/TXGJG/Textures.zip
Enjoy. |
|||||||||||
|
insomniac
|
Thanks! I still don't see how this is happening but the people who made the original game did some weird stuff and it seems like Im spending more time finding and fixing thier garbage . |
|||||||||||||
|
Naith
|
Are the images rendered correct after they've been fixed?
|
|||||||||||
|
insomniac
|
Yes like you said alls you have to do is edit the images that the dots some how show up on when rendered or uploaded and displayed! I'm just wondering how or what the original artist of thoses bmps did to make a pure black background render those dots,maybe just an old type of bmp file that modern computers have trouble rendering. Those files were made in the early 90's. I checked new files that were made for server and created with modern programs and none of them have that defect,only the original gfx..still brain boggling to think something was wrong with my code and it was just the defective images. |
|||||||||||||
|
Naith
|
Yeah, it's weird.
Glad it turned out good in the end! If you got the same problems with other images you know what to do with that / those image(s). |
|||||||||||
|