Author Topic: Small endianess patch for Movies in FS2 Retail  (Read 1705 times)

0 Members and 1 Guest are viewing this topic.

Offline Fabianx

  • 22
Small endianess patch for Movies in FS2 Retail
Hi,

sorry for posting in "The Source Code Project", but I saw that one of the CVS commiters to FS2 Retail (Linux version) is you taylor and that you can be contacted here.

Its also a really small issue, but I fixed it for myself like 6 months ago and did completely forget to give it back to the community. *shame on me*

Anyway: Colors in Movies were completely messed up for me in FS2-Retail, it was all green.

Applying the following changes did work for me:

Code: [Select]

Index: mveplayer.cpp
===================================================================
RCS file: /cvs/cvsroot/freespace2/src/movie/mveplayer.cpp,v
retrieving revision 1.6
diff -u -u -r1.6 mveplayer.cpp
--- mveplayer.cpp       12 Aug 2005 08:47:24 -0000      1.6
+++ mveplayer.cpp       21 Sep 2005 11:14:27 -0000
@@ -725,7 +725,12 @@
        }

        // NOTE: using NULL instead of pixelbuf crashes some drivers, but then so does pixelbuf so less of two evils...
+#ifdef __APPLE__
        glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB5_A1, wp2, hp2, 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, NULL);
+#else
+       glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, wp2, hp2, 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, NULL);
+#endif
+
 #endif

        memset(g_palette, 0, 768);


I'm on x86 32bit Little Endian ...

I don't know how it would affect running it on a PPC linux, so the fix might not be the correct one.

I hope that this might be helpful for others running retail on Linux x86-32 ...

cu

Fabian

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Small endianess patch for Movies in FS2 Retail
What video card and drivers are you using?

That code was initally written on x86 Linux (and tested on many video cards, drivers, and PPC) so I know it works.  It's done that way (rather than just GL_RGB) since it's much faster on older video cards when used with glTexSubImage2D().  Like 600-800% faster, so it's not going to change unless there is a bigger reason to do so (like it breaks on many systems).  I only ever had a problem with that code on Matrox cards but I consider that a Matrox problem since it's perfect on everything else that I tested.

From what you are describing it sounds just like a driver issue to me with it (GL_RGB5_A1) not being supported properly.

 

Offline Fabianx

  • 22
Small endianess patch for Movies in FS2 Retail
Quote
Originally posted by taylor
What video card and drivers are you using?

[...]

From what you are describing it sounds just like a driver issue to me with it (GL_RGB5_A1) not being supported properly.


Its a crappy notebook Intel i855 with X.org i810 driver and i830/i915 dri kernel module.

Lacking support for that colorspace might explain the other color issues I have with the SCP.

Thanks, I'll go debugging the driver ...

cu

Fabian

[edit:

I just recently (uhm, today) changed to x.org (and thus also Mesa 5, ...). It (the movies) do work now from default on, but lag very much ...

I find this quite interesting ...

]

edit2: I somehow did run in software only mode :eek2:

The lag is now gone and it works now out of the box ... Must've been one of those XF86 bugs ... Sorry for the hassle ... :-(
« Last Edit: September 21, 2005, 12:34:59 pm by 3105 »

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Small endianess patch for Movies in FS2 Retail
Quote
Originally posted by Fabianx
The lag is now gone and it works now out of the box ... Must've been one of those XF86 bugs ... Sorry for the hassle ... :-(

Not a problem.  Glad it's working for you now. :)