Page 2 of 3

Posted: Fri Oct 27, 2006 3:44 pm
by Rambus
I've only compiled the code under dev c++, as you could imagine it's not as picky as the (microsoft?) compiler you are using. I will update the code in the next few days when I have a moment to get ride of those pesky warnings for you ;)

Posted: Fri Oct 27, 2006 4:47 pm
by DavidR
Halan, I have the same warnings as you under VS 2005.

Just declare this after the #define at the top of the header:

Code: Select all

#pragma warning( disable : 4996  4244  4156 4154)
It fixes the annoying warnings very nicely :)

Posted: Sun Oct 29, 2006 1:05 am
by Halan
oh i dont really care about the warnings i just wanted to inform you cause i didnt know if they could maybe cause some problems...

Posted: Fri Nov 10, 2006 4:30 am
by Rambus
Hey Halen, I *think* I fixed warnings you pointed out. (I don't have irrlicht set up in visual studios at the moment) Could you double check the code in visual studio and confirm they are gone?

Thanks.

*Edit, the current version is in this post only, I havent uploaded it to the direct download location yet.

Posted: Fri Nov 10, 2006 1:44 pm
by stodge
No, no, no! Don't just ignore the warnings - fix them! One of them is a potential loss during a conversion. This should be fixed. The other seems to be implying you're mis-using delete.

Ignoring warnings is bad! :!:

Posted: Fri Nov 10, 2006 3:58 pm
by Rambus
stodge- the warnings have been fixed in the code posted on the first page of this thread, and they had no affect on the running of the program. They were only a little inefficient.

Oh and if you were replying to ether halan or DavidR, don't mind me!

Posted: Fri Nov 10, 2006 11:04 pm
by Rambus
I uploaded the changes to the download version. So feel free to get the changes via direct download.

Re: (C++) chatQue class [v0.2.3] *Visual Studio Warnings Fix

Posted: Sun Nov 12, 2006 6:56 pm
by ssexton
Rambus wrote: -Somehow implement alpha fade rather then fade to black
(If you make any of these changes, please post the code befor I do it myself!)
Here's the code for an alpha fade. In the existing code, you have this:

Code: Select all

//Fade code
f32 l_alpha = (   (f32)(l_time - iter->fade)/(f32)chatQue_fadeTime );
iter->color1 = iter->color1Fade.getInterpolated(SColor(0,0,0,0),1-l_alpha);
iter->color2 = iter->color2Fade.getInterpolated(SColor(0,0,0,0),1-l_alpha);
Change it to this:

Code: Select all

//Fade code
f32 l_alpha = (   (f32)(l_time - iter->fade)/(f32)chatQue_fadeTime );
iter->color1.setAlpha(iter->color1Fade.getAlpha() * (1-l_alpha));
iter->color2.setAlpha(iter->color2Fade.getAlpha() * (1-l_alpha));

Posted: Sun Nov 12, 2006 7:05 pm
by ssexton
Oh yeah, a couple more things.

1. gcc complains about the switch statements that don't have a default: case. Its just a warning, but it gets in the way if you use -Werror (warnings as errors).

2. I can confirm that the code works fine on Mac OS X too. Give me a month or so and I'll be able to check Linux as well. Not that I expect any problems.

Posted: Sun Nov 12, 2006 7:58 pm
by Rambus
@ssexton
-Fade code,
What version of irrlicht are you using, that makes that fade code work? My problem is that regardless of what alpha value I give the text, it won't become transparent.

-I didn't know about the default warning in gcc, thanks for the heads up. I will fix it right now.

-Thanks for testing it on other OS's, If you find any problems with it running under linux be sure to let me know.

Posted: Wed Nov 15, 2006 1:39 am
by ssexton
Hm. Come to think of it, I didn't look too closely to see if the alpha fade was actually fading. I was just happy to get rid of the black. My bad.

Still, I'm 99% sure that the setAlpha() is the code you want to do a fade effect. That's what alpha *is*, and it's how I've done it before in "pure" OpenGL apps. So if its not actually fading out, my guess is that alpha blending is disabled in the video driver when you're drawing the font textures. I don't know Irrlicht well enough yet to know where to start looking for that. But I'd almost bet money that's what the issue is.

Posted: Wed Nov 15, 2006 7:45 pm
by Veylon
Very nice looking!

I'll have to glom it on to my networking thingie and then I'll be able to chat with myself in style!

Posted: Wed Nov 15, 2006 10:22 pm
by ssexton
@Rambus: Quick followup...

1) The fade code did work for me, as of svn 272, on Win with DX9.
2) It didn't work on Mac or Linux with OpenGL driver.
3) Yes, it works on Linux too.

Posted: Thu Nov 16, 2006 4:16 am
by Rambus
Ah, well I'm using irrlicht 1.1 release, so I imagine the dx fading is fixed in the svn version. For the time being I will leave your alternative code commented out, and the fade to black in. Thanks for checking that for me ssexton!

Edit: actually I can't recall if I tested the fade code for dx9 and irr 1.1, I will give that a check on the weekend. If that works I will probably make the dx driver fade alpha, and the opengl fall back of fading to black.

Double Edit: No, both dx and openGL of the current irrlicht release fail to alter the alpha. I guess I will have to wait for the next release.

Posted: Sun Nov 19, 2006 2:39 pm
by rogerborg
This looks useful. Have you asked hybrid or bitplane if it's a possible candidate for integration into the core?