The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
October 06, 2022, 06:05:40 pm
Home Help Search Login Register
News: Paul & Fred have reached a settlement with Stardock!

+  The Ur-Quan Masters Discussion Forum
|-+  The Ur-Quan Masters Re-Release
| |-+  Technical Issues (Moderator: Death 999)
| | |-+  bitdepth problem in 16-bpp environment
« previous next »
Pages: [1] Print
Author Topic: bitdepth problem in 16-bpp environment  (Read 3632 times)
jku
Zebranky food
*
Offline Offline

Posts: 14



View Profile
bitdepth problem in 16-bpp environment
« on: February 22, 2006, 06:06:02 pm »

I just tried to compile and run uqm on Scratchbox (a cross-compilation toolkit for the Nokia 770 Linux device). Compiling was not that difficult, but trying to run uqm in the 800x480x16 environment (still on my host machine, running ordinary i386 code, just in a Xnest window) resulted in this:
Code:
Initializing base SDL functionality.
Using SDL version 1.2.8 (compiled with 1.2.8)
Using config dir '/home/jussi/.uqm/'
Using '/home/jussi/uqm-0.5.0/content' as base content dir.
Warning: There's no 'packages/addons' directory in the 'content' directory;
        '--addon' options are ignored.
Saved games are kept in /home/jussi/.uqm/save/.
Initializing Pure-SDL graphics.
SDL driver used: x11
SDL initialized.
Initializing Screen.
Couldn't set 640x480 video mode: Maximum supported bitdepth is 16
Could not initialize video: no fallback at start of program!
"Maximum supported bitdepth is 16" comes from SDL_SetVideoMode according to the code...

I'm quite new to SDL -- what the hell does that mean? Is 16-bit not possible without OpenGL?

Thanks for any help.
« Last Edit: February 22, 2006, 06:07:46 pm by jku » Logged
jku
Zebranky food
*
Offline Offline

Posts: 14



View Profile
Re: bitdepth problem in 16-bpp environment
« Reply #1 on: February 22, 2006, 06:30:47 pm »

Hmmm... I just tried setting my host X server to 16bits, and running  uqm there (with same settings as scratchbox). That works fine in a window and in full-screen.

So what's going on?
Logged
Novus
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1938


Fot or not?


View Profile
Re: bitdepth problem in 16-bpp environment
« Reply #2 on: February 22, 2006, 06:38:49 pm »

Two theories:

  • Scratchbox's version of SDL (or Xnest) doesn't support any more than 16 bit colour (and is failing to decrease the bit depth even though UQM is telling SDL to use whatever bit depth is available!). Try editing the SDL_SetVideoMode call in UQM (src/sc2code/libs/graphics/sdl/pure.c) to use 16 bit colour instead of 32.
  • Xnest has some problems with running at a different bit depth than the host server.
Logged

RTFM = Read the fine manual.
RTTFAQ = Read the Ur-Quan Masters Technical FAQ.
jku
Zebranky food
*
Offline Offline

Posts: 14



View Profile
Re: bitdepth problem in 16-bpp environment
« Reply #3 on: February 22, 2006, 08:11:14 pm »

Quote
Xnest has some problems with running at a different bit depth than the host server.

...I actually knew that is the case but somehow didn't connect.

Changing the call to SDL_SetVideoMode works! Thanks Novus.
Logged
jku
Zebranky food
*
Offline Offline

Posts: 14



View Profile
Re: bitdepth problem in 16-bpp environment
« Reply #4 on: February 22, 2006, 11:19:11 pm »

That wasn't too hard...


Logged
Kohr-Ah Death
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1366



View Profile WWW
Re: bitdepth problem in 16-bpp environment
« Reply #5 on: February 23, 2006, 04:58:52 am »

the only problem i see is the lack of buttons (unless they're on the back, or you use those that are next to the pad)

Otherwise it looks kick ass  Cool
Logged

The artist once again known as Kohr-Ah Death.

Get your MegaMod HERE
jku
Zebranky food
*
Offline Offline

Posts: 14



View Profile
Re: bitdepth problem in 16-bpp environment
« Reply #6 on: February 23, 2006, 10:09:47 am »

The controls are a problem.

There are enough buttons I believe (although my muscle memory doesn't tell me how many were used in SC2...). There are 7 (not counting the four-way rocker) of which 2 shouldn't / can't be overridden:
Left of screen
* enter (inside the rocker)
* cancel
* menu
* home  [maybe should not be used]
On top
* maximize/unmaximize [should not be used]
* plus
* minus
* on/off  [should not be used]

The biggest problem is that the four-way rocker is actually very uncomfortable for fast action -- it is ok for starmap, but pretty much unusable in Melee in UQM. . . On the other hand using the stylus to fly might work: There is a Doom port (the true sign of a living platform Wink) that has this "stylus control area" on the bottom of the screen, so you achieve somtehing-like-mouse-precision control without covering the screen with your hand.

Logged
meep-eep
Forum Admin
Enlightened
*****
Offline Offline

Posts: 2847



View Profile
Re: bitdepth problem in 16-bpp environment
« Reply #7 on: February 24, 2006, 08:51:54 pm »

Nice. Did you have to change much?
Logged

“When Juffo-Wup is complete
when at last there is no Void, no Non
when the Creators return
then we can finally rest.”
jku
Zebranky food
*
Offline Offline

Posts: 14



View Profile
Re: bitdepth problem in 16-bpp environment
« Reply #8 on: February 24, 2006, 09:01:39 pm »

Meep-eep: Surprisingly little. The only "real code changes" were the bitdepth thing discussed here and fixing too high sampling frequency in music playback. The rest were packaging problems related to getting the app installed and running on the device.

It took me one evening, but someone more familiar with maemo (the dev platform) would probably have done it in less than an hour -- this is a good indication that Nokia made a good choice when they decided to put a more-or-less standard Linux distro in the 770.

« Last Edit: February 24, 2006, 09:05:06 pm by jku » Logged
meep-eep
Forum Admin
Enlightened
*****
Offline Offline

Posts: 2847



View Profile
Re: bitdepth problem in 16-bpp environment
« Reply #9 on: February 24, 2006, 11:31:53 pm »

How's the speed?
Logged

“When Juffo-Wup is complete
when at last there is no Void, no Non
when the Creators return
then we can finally rest.”
jku
Zebranky food
*
Offline Offline

Posts: 14



View Profile
Re: bitdepth problem in 16-bpp environment
« Reply #10 on: February 25, 2006, 11:42:02 am »

Sometimes there are quite bad slowdowns in melee, sometimes it's entirely playable* -- the difference seems to be related to whether I start the app from the command line or from a menu (...odd, I know. I don't currently give maemo-desktop the "Hello-my-name-is-UQM--please-add-me-to-runnning-apps-list-etc" -signal, maybe this is related to that).
 
EDIT:
*) entirely playable == slow, but not slow as molasses
« Last Edit: February 25, 2006, 11:56:04 am by jku » Logged
Novus
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1938


Fot or not?


View Profile
Re: bitdepth problem in 16-bpp environment
« Reply #11 on: February 25, 2006, 02:03:14 pm »

Looking at pure.c again, there seems to be a lot of 32-bit surfaces being created. Changing them to 16-bit may speed things up, if you haven't done that already. You may have to do a lot of hacking to do this, though, as UQM seems to be running at 32 bits internally. However, I think the graphics system is probably the greatest time sink right now. Does turning the scaling off (using 320x240 mode graphics) speed things up much?
Logged

RTFM = Read the fine manual.
RTTFAQ = Read the Ur-Quan Masters Technical FAQ.
jku
Zebranky food
*
Offline Offline

Posts: 14



View Profile
Re: bitdepth problem in 16-bpp environment
« Reply #12 on: February 25, 2006, 06:12:13 pm »

Quote
Does turning the scaling off (using 320x240 mode graphics) speed things up much?

I've been working on unscaled mode all along (the screen on the 770 has a whopping 225 pixels per inch so pixel doubling doesn't look that bad) -- it does seem to help a little.

I'll take a look at the surface creation, although I have to admit I don't understand much when it comes to SDL (or graphics in general).
Logged
Novus
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1938


Fot or not?


View Profile
Re: bitdepth problem in 16-bpp environment
« Reply #13 on: February 25, 2006, 06:39:37 pm »

I did some experimenting; on my hardware (Athlon XP at 1800 MHz, nVidia GeForce 4) pure SDL mode is noticeably slower (15-20 % CPU) in Melee than OpenGL mode (5-10 %) (640x480 graphics, pure pixel doubling, no sound). Changing between 16 and 32 bit colour X server, however, doesn't seem to have any effect. I'm not entirely sure what's causing the slowdown on my system, let alone your 770.
Logged

RTFM = Read the fine manual.
RTTFAQ = Read the Ur-Quan Masters Technical FAQ.
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!