QuantiCode games

Zero Ballistics, Full Metal Soccer

Skip to content

[PATCH] Build fixes + porting to modern versions of libs

Post any problems related to the beta version of Zero Ballistics

Moderators: Michael, Bernhard, Christian

[PATCH] Build fixes + porting to modern versions of libs

Postby douggiem on 24 Jun 2012, 12:30

I finally made ZB to complete its built.
Here are patches: http://ftp.osuosl.org/pub/manulix/zeroballistics/
Last edited by douggiem on 23 Jul 2012, 21:38, edited 1 time in total.
douggiem
 
Posts: 20
Joined: 23 Jun 2012, 16:02
Location: Linux@PowerPC

Re: [PATCH] Build fixes + porting to modern versions of libs

Postby douggiem on 24 Jun 2012, 12:33

Now it's time to fix endianess issues.
For example, sound is just noise, i.e. PCM streams are not byte-swapped for target's byte ordering.
douggiem
 
Posts: 20
Joined: 23 Jun 2012, 16:02
Location: Linux@PowerPC

Re: [PATCH] Build fixes + porting to modern versions of libs

Postby Hackeridze on 26 Jun 2012, 16:10

Ask access to SVN from developers!
Hackeridze
 
Posts: 2
Joined: 26 Jun 2012, 16:05
Location: opelpolo

Fork

Postby Hackeridze on 26 Jun 2012, 16:24

Also, just make repo on GITHUB and fork this game.
Hackeridze
 
Posts: 2
Joined: 26 Jun 2012, 16:05
Location: opelpolo

Re: [PATCH] Build fixes + porting to modern versions of libs

Postby douggiem on 26 Jun 2012, 21:38

Yep, to fork this great game is a great idea. Since devs don't care about it anymore.
douggiem
 
Posts: 20
Joined: 23 Jun 2012, 16:02
Location: Linux@PowerPC

Re: [PATCH] Build fixes + porting to modern versions of libs

Postby Michael on 03 Jul 2012, 09:30

douggiem wrote:Yep, to fork this great game is a great idea. Since devs don't care about it anymore.


Hi douggiem

It's not true that we don't care about it anymore, we just do not have time anymore for futher development. Therefore we would appreciate any dev done from people who are interested and would like this game to improve. Just ask on sourceforge for svn+wiki write permissions and we'll grant it, antoher fork/branch would just create more confusion and split up resources that could contribute on the same bugs/features/improvements.

kind regards,
Michael
Michael
Developer
 
Posts: 204
Joined: 29 Mar 2008, 17:19

Re: [PATCH] Build fixes + porting to modern versions of libs

Postby douggiem on 18 Jul 2012, 17:45

douggiem wrote:Now it's time to fix endianess issues.
For example, sound is just noise, i.e. PCM streams are not byte-swapped for target's byte ordering.


I found the source: source/bluebeard/src/OggVobis.cpp; here: "ov_read returns PCM 16-bit little-endian smaples" is wrong. Fourth parameter for ov_read is 0 for endian-little (not normal reverse byte order, a.k.a. little endian), and must be 1 to get playable PCM streams on big-endian.
douggiem
 
Posts: 20
Joined: 23 Jun 2012, 16:02
Location: Linux@PowerPC

Re: [PATCH] Build fixes + porting to modern versions of libs

Postby douggiem on 18 Jul 2012, 18:04

Patch for ov_read calling stuff:

Code: Select all
Index: bluebeard/src/OggStream.cpp
===================================================================
--- bluebeard/src/OggStream.cpp   (revision 4455)
+++ bluebeard/src/OggStream.cpp   (working copy)
@@ -7,12 +7,16 @@
#include "SoundManager.h"
#include "Paths.h"

+#ifdef __BIG_ENDIAN__
+const int bigendianp = 1;
+#else
+const int bigendianp = 0;
+#endif

float UPDATE_PERIOD  = 0.1f; // time between sound buffer updates
float FADE_PERIOD    = 0.1f; // time between volume adjustments when fading
float FADE_CHANGE    = 0.1f; // amount of volume change per adjustment when fading

-
//------------------------------------------------------------------------------
OggStream::OggStream(const std::string & filename, unsigned char flags) :
     filename_(filename),
@@ -272,8 +276,8 @@

     while(size < BUFFER_SIZE)
     {
-        result = ov_read(&stream_, pcm + size, BUFFER_SIZE - size, 0, 2, 1, &section);
-   
+        result = ov_read(&stream_, pcm + size, BUFFER_SIZE - size, bigendianp, 2, 1, &section);
+
         if(result > 0)
             size += result;
         else
Index: bluebeard/src/OggVorbis.cpp
===================================================================
--- bluebeard/src/OggVorbis.cpp   (revision 4455)
+++ bluebeard/src/OggVorbis.cpp   (working copy)
@@ -6,7 +6,19 @@

#include "Exception.h"

+#ifdef __BIG_ENDIAN__
+const int bigendianp = 1;
+#else
+const int bigendianp = 0;
+#endif

+/* return 0 for little endian, 1 for big endian */
+/*int  bigendian( void )
+{
+    long one = 1;
+    return !(*((char*)(&one)));
+}*/
+
ALboolean loadOgg(  const char *fname,
                     void **wave,
                     ALsizei *format,
@@ -21,7 +33,6 @@
     int eof = 0;
     int current_section;


     long ret;

     FILE * file = fopen(fname,"rb+");
@@ -42,10 +53,10 @@
         *freq = (ALsizei) vi->rate;
         /************* HACK? ************/
         *size = (ALsizei) ov_pcm_total(&vf, -1)*2;
-       
-        *bits = (ALsizei) 16; //ov_read returns PCM 16-bit little-endian samples

-        int channels = vi->channels;       
+        *bits = (ALsizei) 16; //ov_read returns PCM 16-bit samples
+
+        int channels = vi->channels;
         if (channels == 1)
         {
             *format = AL_FORMAT_MONO16;
@@ -64,7 +75,7 @@

     while(!eof)
     {
-      ret=ov_read(&vf,(char *)pcm_data_p,4096,0,2,1,&current_section);
+      ret=ov_read(&vf,(char *)pcm_data_p,4096,bigendianp,2,1,&current_section);
         if (ret == 0)
         {
             /* EOF */
@@ -80,7 +91,6 @@
                you'll have to*/

             pcm_data_p += ret;
-       
         }
     }



See also http://ftp.osuosl.org/pub/manulix/zeroballistics/ (oggvorbis_oggstream-ov_read-big_endian.patch)

Now it's time to fix Windows WAVE to playable PCM issue.

Here http://kcat.strangesoft.net/openal-tutorial.html is written:

Note that the .wav format spec has multibyte sample foramts stored as little-endian. If you were on a big-endian machine, you'd have to iterate over the returned data and flip the bytes for those formats before giving it to OpenAL.
Last edited by douggiem on 23 Jul 2012, 17:45, edited 2 times in total.
douggiem
 
Posts: 20
Joined: 23 Jun 2012, 16:02
Location: Linux@PowerPC

Re: [PATCH] Build fixes + porting to modern versions of libs

Postby douggiem on 18 Jul 2012, 18:41

Michael wrote:It's not true that we don't care about it anymore, we just do not have time anymore for futher development.


So you do care only in management and copyrights? No time does mean (is absolutely equal to) no interest.

Michael wrote:Therefore we would appreciate any dev done from people who are interested and would like this game to improve. Just ask on sourceforge for svn+wiki write permissions and we'll grant it


I'm interesting primarily in porting this game to Linux@PowerPC (and other big endian archs, like MIPS and ARM (MIPSEL and ARMEL are endian-little ones)) at least, and to have it included in repos of at least Debian.

Michael wrote:antoher fork/branch would just create more confusion and split up resources that could contribute on the same bugs/features/improvements.


Let's look at LibreOffice vs OpenOffice.org. Forking may be really good.
douggiem
 
Posts: 20
Joined: 23 Jun 2012, 16:02
Location: Linux@PowerPC

Re: [PATCH] Build fixes + porting to modern versions of libs

Postby douggiem on 21 Jul 2012, 21:42

Patch for debugging info.

Code: Select all
Index: code/CMakeLists.txt
===================================================================
--- code/CMakeLists.txt (revision 4455)
+++ code/CMakeLists.txt (working copy)
@@ -1,6 +1,13 @@

cmake_minimum_required(VERSION 2.6)

+#set(CMAKE_CXX_FLAGS "-Wall")
+set(CMAKE_CXX_FLAGS_DEBUG "-g") # for line numbers
+
+set(CMAKE_BUILD_TYPE Debug)
+#set(CMAKE_BUILD_TYPE Release)
+
+
project(tanks)


douggiem
 
Posts: 20
Joined: 23 Jun 2012, 16:02
Location: Linux@PowerPC

Next

Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests


cron