Package: xmoto
Version: 0.1.16-2
Severity: normal
Hi,
Since xmoto 0.1.16, only 1400x1050 is available in the video configuration. It
looks
like my video driver only returns this mode (which is my actual resolution).
But, I am running in windowed mode, so I think xmoto should not rely on the mode
list returned by SDL but propose a hardcoded list instead.
The following patch adds a "windowed" argument to getDisplayModes so that all
"regular" modes are returned when running windowed.
Thanks,
Brice
-- System Information:
Debian Release: testing/unstable
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1,
'experimental')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17=shepherd
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Versions of packages xmoto depends on:
ii libc6 2.3.6-13 GNU C Library: Shared libraries
ii libcurl3 7.15.4-1 Multi-protocol file transfer libra
ii libgcc1 1:4.1.0-4 GCC support library
ii libgl1-mesa-glx [li 6.5.0.cvs.20060524-1 A free implementation of the OpenG
ii libjpeg62 6b-13 The Independent JPEG Group's JPEG
ii liblua50 5.0.2-6 Main interpreter library for the L
ii liblualib50 5.0.2-6 Extension library for the Lua 5.0
ii libode0c2 1:0.5-5 Open Dynamics Engine - runtime lib
ii libpng12-0 1.2.8rel-5.1 PNG library - runtime
ii libsdl-mixer1.2 1.2.6-1.1+b1 mixer library for Simple DirectMed
ii libsdl1.2debian 1.2.10-3 Simple DirectMedia Layer
ii libstdc++6 4.1.0-4 The GNU Standard C++ Library v3
ii xmoto-data 0.1.16-2 2D motocross platform game
ii zlib1g 1:1.2.3-11 compression library - runtime
xmoto recommends no packages.
-- no debconf information
Index: src/GameMenus.cpp
===================================================================
--- src.orig/GameMenus.cpp 2006-06-18 11:55:51.000000000 -0400
+++ src/GameMenus.cpp 2006-06-18 11:57:26.000000000 -0400
@@ -406,7 +406,7 @@
pDispResList->setFont(m_Renderer.getSmallFont());
pDispResList->addColumn(GAMETEXT_SCREENRES,pDispResList->getPosition().nWidth);
- std::vector<std::string>* modes = getDisplayModes();
+ std::vector<std::string>* modes = getDisplayModes(m_Config.getBool("DisplayWindowed"));
for(int i=0; i < modes->size(); i++) {
pDispResList->addEntry((*modes)[i].c_str());
Index: src/VApp.cpp
===================================================================
--- src.orig/VApp.cpp 2006-06-18 11:53:44.000000000 -0400
+++ src/VApp.cpp 2006-06-18 11:55:25.000000000 -0400
@@ -518,17 +518,21 @@
/*===========================================================================
Return available display modes
===========================================================================*/
- std::vector<std::string>* App::getDisplayModes(){
+ std::vector<std::string>* App::getDisplayModes(int windowed){
std::vector<std::string>* modes = new std::vector<std::string>;
SDL_Rect **sdl_modes;
int i, nFlags;
- /* Always use the fullscreen flags to be sure to
- always get a result (no any modes available like in windowed) */
- nFlags = SDL_OPENGL | SDL_FULLSCREEN;
+ if (windowed) {
+ sdl_modes = (SDL_Rect **)-1;
+ } else {
+ /* Always use the fullscreen flags to be sure to
+ always get a result (no any modes available like in windowed) */
+ nFlags = SDL_OPENGL | SDL_FULLSCREEN;
- /* Get available fullscreen/hardware modes */
- sdl_modes = SDL_ListModes(NULL, nFlags);
+ /* Get available fullscreen/hardware modes */
+ sdl_modes = SDL_ListModes(NULL, nFlags);
+ }
/* Check is there are any modes available */
if(sdl_modes == (SDL_Rect **)0){
@@ -538,7 +542,7 @@
/* Check if or resolution is restricted */
if(sdl_modes == (SDL_Rect **)-1){
- /* Should never happen */
+ /* Should never happen, except in windowed mode */
//Log("All resolutions available.");
modes->push_back("800 X 600");
modes->push_back("1024 X 768");
Index: src/VApp.h
===================================================================
--- src.orig/VApp.h 2006-06-18 11:53:29.000000000 -0400
+++ src/VApp.h 2006-06-18 11:53:42.000000000 -0400
@@ -133,7 +133,7 @@
int getDispHeight(void) {return m_nDispHeight;}
//#endif
- std::vector<std::string>* getDisplayModes();
+ std::vector<std::string>* getDisplayModes(int windowed);
void setFrameDelay(int nDelay) {m_nFrameDelay=nDelay;}