[fixed]Bug in CIrrDeviceLinux::getVideoModeList

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
jef
Posts: 18
Joined: Sat Nov 13, 2004 10:10 pm

[fixed]Bug in CIrrDeviceLinux::getVideoModeList

Post by jef »

The code to fill the VideoModeList in CIrrDeviceLinux::getVideoModeList is never reached.

Code: Select all

        if (!display)
        {
            s32 eventbase, errorbase;
            s32 defaultDepth=DefaultDepth(display,screennr);
should be...

Code: Select all

        if (display)
        {
            s32 eventbase, errorbase;
            s32 defaultDepth=DefaultDepth(display,screennr);
Here is the patch...

Code: Select all

Index: CIrrDeviceLinux.cpp
===================================================================
--- CIrrDeviceLinux.cpp	(revision 1043)
+++ CIrrDeviceLinux.cpp	(working copy)
@@ -1049,7 +1049,7 @@
 			display = XOpenDisplay(0);
 			temporaryDisplay=true;
 		}
-		if (!display)
+		if (display)
 		{
 			s32 eventbase, errorbase;
 			s32 defaultDepth=DefaultDepth(display,screennr);
I have tested the patch on Ubuntu 7.10 and it worked fine.

// jef
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Oh yes, you're right. I never came to testing it. Will have to do this before the release...
Maybe you want to change the main initialization to use the VideoModeList? There's still lots of redundant code in it?!
jef
Posts: 18
Joined: Sat Nov 13, 2004 10:10 pm

Post by jef »

Sorry for my late reply.
Maybe you want to change the main initialization to use the VideoModeList?
I guess you mean the initialization code in CIrrDeviceLinux. I am quite new to 'X window' programming so I think I'll have to pass on that. I wish I could do more to help, but for now I must try to finish the project I am currently working on.

// jef
Post Reply