I finally made ZB to complete its built.
Here are patches: http://ftp.osuosl.org/pub/manulix/zeroballistics/
Moderators: Michael, Bernhard, Christian
douggiem wrote:Yep, to fork this great game is a great idea. Since devs don't care about it anymore.
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.
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, §ion);
-
+ result = ov_read(&stream_, pcm + size, BUFFER_SIZE - size, bigendianp, 2, 1, §ion);
+
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,¤t_section);
+ ret=ov_read(&vf,(char *)pcm_data_p,4096,bigendianp,2,1,¤t_section);
if (ret == 0)
{
/* EOF */
@@ -80,7 +91,6 @@
you'll have to*/
pcm_data_p += ret;
-
}
}
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.
Michael wrote:It's not true that we don't care about it anymore, we just do not have time anymore for futher development.
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
Michael wrote:antoher fork/branch would just create more confusion and split up resources that could contribute on the same bugs/features/improvements.
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)
Users browsing this forum: No registered users and 4 guests