summaryrefslogtreecommitdiff
path: root/games/vegastrike/patch-0.5.1.r1
blob: 4077324d4c9b5c4dd242bc3140e46aa38a424c43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
diff -ruN ./CMakeLists.txt ../b/CMakeLists.txt
--- ./CMakeLists.txt	2012-03-26 02:50:49.000000000 +0200
+++ ../b/CMakeLists.txt	2019-09-20 14:45:44.171890881 +0200
@@ -10,7 +10,7 @@
 
 project (vsUTCS)
 
-
+include(GNUInstallDirs)
 
 include_directories(${vsUTCS_SOURCE_DIR}/src 
 					${vsUTCS_SOURCE_DIR}/src/cmd
@@ -828,33 +828,33 @@
 
 #Find FFMpeg
 
-find_package(FFMPEG)
-IF(FFMPEG_FOUND)
-	SET(TST_INCLUDES ${TST_INCLUDES} ${FFMPEG_INCLUDE_DIRS})
-	SET(TST_LIBS ${TST_LIBS} ${FFMPEG_LIBRARIES})
-	add_definitions(${FFMPEG_DEFINITIONS})
-	SET(HAVE_FFMPEG 1 )
-	IF(swscale1_FOUND)
-        message("++ FFmpeg's libswscale found.")
-	ELSE(swscale1_FOUND)
-        message("-- FFMpeg's libswscale not found... depending on your ffmpeg version, VS might not build.")
-	ENDIF(swscale1_FOUND)
-ELSE(FFMPEG_FOUND)
-	message("-- FFMPEG Not Found")
-ENDIF(FFMPEG_FOUND)
+#find_package(FFMPEG)
+#IF(FFMPEG_FOUND)
+#	SET(TST_INCLUDES ${TST_INCLUDES} ${FFMPEG_INCLUDE_DIRS})
+#	SET(TST_LIBS ${TST_LIBS} ${FFMPEG_LIBRARIES})
+#	add_definitions(${FFMPEG_DEFINITIONS})
+#	SET(HAVE_FFMPEG 1 )
+#	IF(swscale1_FOUND)
+#        message("++ FFmpeg's libswscale found.")
+#	ELSE(swscale1_FOUND)
+#        message("-- FFMpeg's libswscale not found... depending on your ffmpeg version, VS might not build.")
+#	ENDIF(swscale1_FOUND)
+#ELSE(FFMPEG_FOUND)
+#	message("-- FFMPEG Not Found")
+#ENDIF(FFMPEG_FOUND)
 
 #Find Ogre
 
-find_package(OGRE)
-IF(OGRE_FOUND)
-    SET(TST_INCLUDES ${TST_INCLUDES} ${OGRE_INCLUDE_DIR})
-    SET(TST_LIBS ${TST_LIBS} ${OGRE_LIBRARY})
-    add_definitions(${OGRE_DEFINITIONS})
-    SET(HAVE_OGRE 1)
-    message("++ Found Ogre: ${OGRE_VERSION}")
-ELSE(OGRE_FOUND)
-    message("-- Ogre Not Found: compiling without")
-ENDIF(OGRE_FOUND)
+#find_package(OGRE)
+#IF(OGRE_FOUND)
+#    SET(TST_INCLUDES ${TST_INCLUDES} ${OGRE_INCLUDE_DIR})
+#    SET(TST_LIBS ${TST_LIBS} ${OGRE_LIBRARY})
+#    add_definitions(${OGRE_DEFINITIONS})
+#    SET(HAVE_OGRE 1)
+#    message("++ Found Ogre: ${OGRE_VERSION}")
+#ELSE(OGRE_FOUND)
+#    message("-- Ogre Not Found: compiling without")
+#ENDIF(OGRE_FOUND)
 
 IF(NOT BEOS)
 	FIND_LIBRARY(UTIL_LIB util)
@@ -977,12 +977,12 @@
 	HAVE_AVFORMAT_H
 	HAVE_AVCODEC_H
 	HAVE_AVIO_H
-	HAVE_FFMPEG_SWSCALE_H
+#	HAVE_FFMPEG_SWSCALE_H
 	CMAKE_BACKWARDS_COMPATIBILITY
-	FFMPEG_INCLUDE_DIR
-	FFMPEG_FOUND
-	FFMPEG_LIBRARIES
-	FFMPEG_DEFINITIONS
+#	FFMPEG_INCLUDE_DIR
+#	FFMPEG_FOUND
+#	FFMPEG_LIBRARIES
+#	FFMPEG_DEFINITIONS
 	GTK2_ATK_INCLUDE_DIR
 	GTK2_ATK_LIBRARY
 	GTK2_CAIRO_INCLUDE_DIR
diff -ruN ./objconv/basemaker/base_maker_texture.cpp ../b/objconv/basemaker/base_maker_texture.cpp
--- ./objconv/basemaker/base_maker_texture.cpp	2010-03-10 03:56:23.000000000 +0100
+++ ../b/objconv/basemaker/base_maker_texture.cpp	2019-09-20 14:45:44.174891262 +0200
@@ -6,9 +6,12 @@
 #define XMD_H
 #define HAVE_BOOLEAN
 #endif
+
 extern "C" {
 //YUCK it doesn't even have extern c in the headers!
 #include <jpeglib.h>
+#include <string.h>
+
 }
 
 #define strip_16 true
diff -ruN ./objconv/mesher/to_OgreMesh.cpp ../b/objconv/mesher/to_OgreMesh.cpp
--- ./objconv/mesher/to_OgreMesh.cpp	2011-06-02 01:47:36.000000000 +0200
+++ ../b/objconv/mesher/to_OgreMesh.cpp	2019-09-20 14:45:44.176891516 +0200
@@ -1078,10 +1078,15 @@
     Ogre::VertexDeclaration *newDcl =
         data->vertexDeclaration->getAutoOrganisedDeclaration(
             mesh->hasSkeleton() );
-#else
+#elif (OGRE_VERSION_MAJOR == 1) && (OGRE_VERSION_MINOR < 8)
     Ogre::VertexDeclaration *newDcl =
         data->vertexDeclaration->getAutoOrganisedDeclaration(
             mesh->hasSkeleton(), mesh->hasVertexAnimation() || (mesh->getPoseCount() > 0) );
+#else
+    Ogre::VertexDeclaration *newDcl =
+        data->vertexDeclaration->getAutoOrganisedDeclaration(
+            mesh->hasSkeleton(), mesh->hasVertexAnimation() || (mesh->getPoseCount() > 0),
+		    mesh->getSharedVertexDataAnimationIncludesNormals()); // what about Pose objects?
 #endif
     if ( *newDcl != *(data->vertexDeclaration) ) {
         //Usages don't matter here since we're onlly exporting
@@ -1109,35 +1114,35 @@
     }
 }
 
-void AutoLOD( void *outputcontext, bool force, int numLod, float reductionFactor, float refDistance )
-{
-    struct outputContext *ctxt = (struct outputContext*) outputcontext;
-    MeshPtr newMesh = ctxt->top;
-    if ( force || (newMesh->getNumLodLevels() <= 1) ) {
-        if (newMesh->getNumLodLevels() <= 1)
-            newMesh->removeLodLevels();
-        const Ogre::ProgressiveMesh::VertexReductionQuota quota = Ogre::ProgressiveMesh::VRQ_PROPORTIONAL;
-        const Real reduction  = Real( 1-reductionFactor );
-        
-        Real currDist = refDistance;
-        
-    #if (OGRE_VERSION >= 0x010700)
-        Ogre::Mesh::LodValueList distanceList;
-
-        // pixel area is squared length, and length is proportional to triangle count
-        const Real distFactor = reductionFactor * reductionFactor; 
-        newMesh->setLodStrategy(Ogre::LodStrategyManager::getSingletonPtr()->
-            getStrategy( "PixelCount" ) );
-    #else
-        Ogre::Mesh::LodDistanceList distanceList;
-        const Real distFactor = ( (reduction > 0.00001) ? 1/reduction : 1 );
-    #endif
-
-        for (int iLod = 0; iLod < numLod; ++iLod, currDist *= distFactor)
-            distanceList.push_back( currDist );
-        newMesh->generateLodLevels( distanceList, quota, reduction );
-    }
-}
+//void AutoLOD( void *outputcontext, bool force, int numLod, float reductionFactor, float refDistance )
+//{
+//    struct outputContext *ctxt = (struct outputContext*) outputcontext;
+//    MeshPtr newMesh = ctxt->top;
+//    if ( force || (newMesh->getNumLodLevels() <= 1) ) {
+//        if (newMesh->getNumLodLevels() <= 1)
+//            newMesh->removeLodLevels();
+//        const Ogre::ProgressiveMesh::VertexReductionQuota quota = Ogre::ProgressiveMesh::VRQ_PROPORTIONAL;
+//        const Real reduction  = Real( 1-reductionFactor );
+//        
+//        Real currDist = refDistance;
+//        
+//    #if (OGRE_VERSION >= 0x010700)
+//        Ogre::Mesh::LodValueList distanceList;
+//
+//        // pixel area is squared length, and length is proportional to triangle count
+//        const Real distFactor = reductionFactor * reductionFactor; 
+//        newMesh->setLodStrategy(Ogre::LodStrategyManager::getSingletonPtr()->
+//            getStrategy( "PixelCount" ) );
+//    #else
+//        Ogre::Mesh::LodDistanceList distanceList;
+//        const Real distFactor = ( (reduction > 0.00001) ? 1/reduction : 1 );
+//    #endif
+//
+//        for (int iLod = 0; iLod < numLod; ++iLod, currDist *= distFactor)
+//            distanceList.push_back( currDist );
+//        newMesh->generateLodLevels( distanceList, quota, reduction );
+//    }
+//}
 
 void DoneMeshes( void *outputcontext )
 {
diff -ruN ./objconv/mesher/to_OgreMesh.h ../b/objconv/mesher/to_OgreMesh.h
--- ./objconv/mesher/to_OgreMesh.h	2010-02-25 16:22:25.000000000 +0100
+++ ../b/objconv/mesher/to_OgreMesh.h	2019-09-20 14:45:44.179891897 +0200
@@ -20,7 +20,7 @@
 float RadialSize( void *outputcontext );     //returns the size of the resulting mesh (it's maximum distance from 0,0,0). Useful for LODding.
 
 void Optimize( void *outputcontext );     //a good idea - reorganizes internal buffers so that the output mesh is more efficient
-void AutoLOD( void *outputcontext, bool force, int numLod, float reductionFactor, float refDistance );     //autogenerates LOD levels - if force==true, will discard current LOD data
+//void AutoLOD( void *outputcontext, bool force, int numLod, float reductionFactor, float refDistance );     //autogenerates LOD levels - if force==true, will discard current LOD data
 void AutoEdgeList( void *outputcontext );     //a good idea - prepares the mesh for stencil shadows
 void AutoTangents( void *outputcontext );     //prepares the mesh for normal mapping (only needed if the material uses normal mapping)
 }
diff -ruN ./setup/src/c/setup.cpp ../b/setup/src/c/setup.cpp
--- ./setup/src/c/setup.cpp	2011-03-15 01:28:47.000000000 +0100
+++ ../b/setup/src/c/setup.cpp	2019-09-20 14:45:44.180892025 +0200
@@ -110,10 +110,22 @@
                 return 1;
             }
         }
-        
+
 #ifdef DATA_DIR
         data_paths.push_back( DATA_DIR );
 #endif
+		/* whatever the plan was, it does not work on Linux - at least
+		 * not at this stage. Hence, use fixed absolute paths to
+		 * find data directory
+		 */ 
+		data_paths.push_back( "/usr/share/games/vegastrike/data");
+		data_paths.push_back( "/usr/share/vegastrike/data");
+		data_paths.push_back( "/usr/games/vegastrike/data");
+		data_paths.push_back( "/usr/local/share/games/vegastrike/data");
+		data_paths.push_back( "/usr/local/share/vegastrike/data");
+		data_paths.push_back( "/usr/local/games/vegastrike/data");
+		data_paths.push_back( "/opt/vegastrike/data");
+
         data_paths.push_back( origpath );
         data_paths.push_back( string( origpath )+"/.." );
         data_paths.push_back( string( origpath )+"/../data4.x" );
@@ -133,22 +145,7 @@
         data_paths.push_back( "../Resources" );
         data_paths.push_back( "../Resources/data" );
         data_paths.push_back( "../Resources/data4.x" );
-/*
- *               data_paths.push_back( "/usr/share/local/vegastrike/data");
- *               data_paths.push_back( "/usr/local/share/vegastrike/data");
- *               data_paths.push_back( "/usr/local/vegastrike/data");
- *               data_paths.push_back( "/usr/share/vegastrike/data");
- *               data_paths.push_back( "/usr/local/games/vegastrike/data");
- *               data_paths.push_back( "/usr/games/vegastrike/data");
- *               data_paths.push_back( "/opt/share/vegastrike/data");
- *               data_paths.push_back( "/usr/share/local/vegastrike/data4.x");
- *               data_paths.push_back( "/usr/local/share/vegastrike/data4.x");
- *               data_paths.push_back( "/usr/local/vegastrike/data4.x");
- *               data_paths.push_back( "/usr/share/vegastrike/data4.x");
- *               data_paths.push_back( "/usr/local/games/vegastrike/data4.x");
- *               data_paths.push_back( "/usr/games/vegastrike/data4.x");
- *               data_paths.push_back( "/opt/share/vegastrike/data4.x");
- */
+
         //Win32 data should be "."
         char tmppath[16384];
         for (vector< string >::iterator vsit = data_paths.begin(); vsit != data_paths.end(); vsit++) {
diff -ruN ./src/cmd/music.cpp ../b/src/cmd/music.cpp
--- ./src/cmd/music.cpp	2012-03-19 09:20:14.000000000 +0100
+++ ../b/src/cmd/music.cpp	2019-09-20 14:45:44.182892279 +0200
@@ -448,7 +448,9 @@
             if (foundcache) {
                 *me->music_load_info = wherecache->second;
                 me->freeWav = false;
-            }
+            } else if ( ! AUDLoadSoundFile(songname, me->music_load_info, true)) {
+				VSFileSystem::vs_dprintf(1, "Failed to load music file \"%s\"", songname);
+			}
         }
         if (me->freeWav && docacheme) {
             me->freeWav = false;
diff -ruN ./src/cmd/unit_jump.h ../b/src/cmd/unit_jump.h
--- ./src/cmd/unit_jump.h	2012-03-19 09:20:14.000000000 +0100
+++ ../b/src/cmd/unit_jump.h	2019-09-20 14:45:44.184892533 +0200
@@ -108,7 +108,7 @@
                      (tester = *i) != NULL; ++i)
                     if (tester->isUnit() == UNITPTR && tester != this)
                         if ( ( this->LocalPosition()-tester->LocalPosition() ).Magnitude() < this->rSize()+tester->rSize() )
-                            SetCurPosition( this->LocalPosition()+this->cumulative_transformation_matrix.getR()
+                            this->SetCurPosition( this->LocalPosition()+this->cumulative_transformation_matrix.getR()
                                            *( 4*( this->rSize()+tester->rSize() ) ) );
             DealPossibleJumpDamage( this );
             static int jumparrive = AUDCreateSound( vs_config->getVariable( "unitaudio", "jumparrive", "sfx43.wav" ), false );
diff -ruN ./src/gfx/quadsquare.cpp ../b/src/gfx/quadsquare.cpp
--- ./src/gfx/quadsquare.cpp	2010-03-10 06:27:01.000000000 +0100
+++ ../b/src/gfx/quadsquare.cpp	2019-09-20 14:45:44.186892787 +0200
@@ -13,9 +13,9 @@
 #include <float.h>
 #include <math.h>
 #include <assert.h>
-#include "quadsquare.h"
 #include "gfxlib.h"
 #include "aux_texture.h"
+#include "quadsquare.h"
 using std::vector;
 
 unsigned int*quadsquare::VertexAllocated;
diff -ruN ./src/networking/lowlevel/packetmem.cpp ../b/src/networking/lowlevel/packetmem.cpp
--- ./src/networking/lowlevel/packetmem.cpp	2008-03-31 10:20:19.000000000 +0200
+++ ../b/src/networking/lowlevel/packetmem.cpp	2019-09-20 14:45:44.187892914 +0200
@@ -102,7 +102,7 @@
     }
     else
     {
-        _buffer.reset( 0 );
+        _buffer.reset();
         _len = 0;
     }
 }
diff -ruN ./src/vsfilesystem.cpp ../b/src/vsfilesystem.cpp
--- ./src/vsfilesystem.cpp	2012-03-19 09:20:14.000000000 +0100
+++ ../b/src/vsfilesystem.cpp	2019-09-20 14:45:44.190893296 +0200
@@ -563,6 +563,18 @@
     data_paths.push_back( DATA_DIR );
 #endif
     if ( !vegastrike_cwd.empty() ) {
+		/* whatever the plan was, it does not work on Linux - at least
+		 * not at this stage. Hence, use fixed absolute paths to
+		 * find data directory
+		 */ 
+		data_paths.push_back( "/usr/share/games/vegastrike/data");
+		data_paths.push_back( "/usr/share/vegastrike/data");
+		data_paths.push_back( "/usr/games/vegastrike/data");
+		data_paths.push_back( "/usr/local/share/games/vegastrike/data");
+		data_paths.push_back( "/usr/local/share/vegastrike/data");
+		data_paths.push_back( "/usr/local/games/vegastrike/data");
+		data_paths.push_back( "/opt/vegastrike/data");
+
         data_paths.push_back( vegastrike_cwd );
         data_paths.push_back( vegastrike_cwd+"/.." );
         data_paths.push_back( vegastrike_cwd+"/../data4.x" );