Small problem with SDL_SetAlpha()

Started by
2 comments, last by garyfletcher 18 years, 10 months ago
Hi all. I've almost got everything working on my mouse. I've just got 1 small problem. That I've been looking at for HOURS, so I thought I'd ask some of you nice people to lend a hand. Anyway. I've got my SDL engine, that takes over control of the mouse when it's instansiated. I've added functions to disable, enable, toggle the mouse and these work very nicely. My problem seems to be when I change the alpha setting of the mouse sprite to make add transparency. When it's solid (alpha 255) everythings fine, but when the aplha settings anything else I get the mouse cursor being traced all over the screen. The mouse project can be found here. Am sorry that it comes with extra source code but the moudles that are being used are SiSEAnimation, SiSEBaseSprite and SiSECursor, oh and main. It's C++ and built with DEV-C++. If you take a look then I extend my thanks to you...and if not then thanks for reading anyhow. The code is all my current SDL engine source, so please feel free to look and play and improve, comment or whatever with the other stuff as well. Thanks Again. [Edited by - garyfletcher on May 26, 2005 8:39:50 AM]
Gary.Goodbye, and thanks for all the fish.
Advertisement
tried to compile but i didnt have boost/function.hpp. well since i cant see how it looks its hard to guess whats wrong.. have you tried with different colorsettings? (16/32bit)
Yes...same thing happens...boohoo!!!!

Sorry about the boost library thing...forgot that I was using that...darn. That's going to ct down on the number of people that can try it out...BOOHOO!!!

I would recommend using it. The functionality that I'm using...mapping function pointers...does make things easier.
Gary.Goodbye, and thanks for all the fish.
Okay...sorted it out.

If anyone's interested it's because I wasn't working with the correct animation.

To correct it either add the following to the gamePlay() function in main.cpp before trying to set the alpha value:

aCursor->mSetAnimKey(CURSKEY);

Or add the following to the mProcessClrCursor() function in the SiSECursor class before returning:

mAnimKey = mCursAnimKey;

Thanks if you took a look. And anyone interested in contributing to the engine then even better..:)

Now to try to sort out the problems of running FULLSCREEN...anyone?

EDIT: Sorted..:)

[Edited by - garyfletcher on May 26, 2005 11:21:37 AM]
Gary.Goodbye, and thanks for all the fish.

This topic is closed to new replies.

Advertisement