Bug #15192, was updated on 2009-Feb-03 22:56
Here is a current snapshot of the bug.

Project: LinCityNG
Category: None
Status: Closed
Resolution: Fixed
Bug Group: None
Priority: 5
Submitted by: goneri
Assigned to : none
Summary: fails to start is screen doesn't support 1024x768

Details: Hi,

I'm on of the co-maintainer of the Debian package. The screen of my netBook 
computer doesn't support the default resolution.

I applied this change on the package to avoid the problem.

Best regards,

    Gonér

diff --git a/src/lincity-ng/main.cpp b/src/lincity-ng/main.cpp
index b6a1d1b..549c7a4 100644
--- a/src/lincity-ng/main.cpp
+++ b/src/lincity-ng/main.cpp
@@ -217,6 +217,14 @@ void initVideo(int width, int height)
     SDL_Surface* screen
         = SDL_SetVideoMode(width, height, bpp, flags);
     SDL_WM_SetCaption(PACKAGE_NAME " " PACKAGE_VERSION, 0);
+
+    if(!screen) {
+        // Debian: Try harder to get a working screen
+        // The default 1024x768 is to large for most of the
+        // netBook computer.
+        screen = SDL_SetVideoMode(800, 600, bpp, flags);
+    }
+
     if(!screen) {
         std::stringstream msg;
         msg << "Couldn't set video mode ("

Follow-Ups:

Date: 2010-Mar-21 01:09
By: wolfgangb

Comment:
What error message do you get? Does it work if you start in a window using 
"lincity-ng -w?
-------------------------------------------------------

Date: 2010-Mar-20 21:43
By: julieh

Comment:
Still doesn't work on a widescreen computer monitor. My desktop computer won't 
launch it.
-------------------------------------------------------

Date: 2010-Jan-31 12:50
By: wolfgangb

Comment:
Fixed in svn r1528 
* Bug #15192: If video fails, try to fall back to 1024x768 and 800x600.


-------------------------------------------------------

Date: 2009-Feb-10 23:35
By: wolfgangb

Comment:
Ok, r1528 will try 1024x768 and 800x600, too. Now I need a netbook to run some 
test :-)
-------------------------------------------------------

Date: 2009-Feb-09 19:41
By: jaky_lincity

Comment:
We could also add 1024x768 as a first fallback in case the user specified a 
resolution which is not working in userconfig.xml. 
Maybe we can pop up an error message in case everything fails. This would be 
useful for users who start the game from a desktop icon or menu.
Is there an OS-independent way to do it ?

Jaky
-------------------------------------------------------

Date: 2009-Feb-06 11:00
By: goneri

Comment:
Most of the players use the desktop icon to launch the game and since the game 
won't start if you screen doesn't support 1024x768 unless you use --size. They 
will think the game is just broken whereas 800x600 seems to be fine.

Ps: This 2.0 release is impressive :)
-------------------------------------------------------

Date: 2009-Feb-05 22:10
By: wolfgangb

Comment:
The user can select any geometry he likes with --size . All but the default
1024x768 might look strange. Any problems playing with 800x600? It that
works well we could add the automatic fallback for all players. 
-------------------------------------------------------

Date: 2009-Feb-05 08:43
By: alainb

Comment:
i m afraid 640x480 is not playable:
The statistic window is too big and cannot be closed once it is open !
-------------------------------------------------------

Date: 2009-Feb-05 01:50
By: danielsantos

Comment:
Better yet:
+
+ if(!screen) {
+ // Debian: Try harder to get a working screen
+ // The default 1024x768 is to large for most of the
+ // netBook computer.
+ screen = SDL_SetVideoMode(800, 600, bpp, flags);
+ if(!screen) {
+ screen = SDL_SetVideoMode(640, 480, bpp, flags);
+ }
+ if(screen) {
+ // TODO: write new resolution to userdata.xml here
+ }
+ }
+

I wish this bug manager let you post formatted code.
-------------------------------------------------------

For detailed info, follow this link:
http://developer.berlios.de/bugs/?func=detailbug&bug_id=15192&group_id=2929
_______________________________________________
Lincity-ng-devel mailing list
Lincity-ng-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/lincity-ng-devel

Reply via email to