mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-16 19:50:19 +01:00
games/vegastrike: Patched and rebuilt.
Signed-off-by: Dave Woodfall <dave@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
parent
95c615f37c
commit
75c736d27b
7 changed files with 1003 additions and 352 deletions
|
@ -1,31 +1,31 @@
|
|||
Welcome to Vega Strike, a 3d OpenGL spaceflight simulator being developed
|
||||
for multi-platform play.
|
||||
Welcome to Vega Strike, a 3d OpenGL spaceflight simulator being
|
||||
developed for multi-platform play.
|
||||
|
||||
Vega Strike allows players to explore a vastly dynamic universe where
|
||||
frontiers collide and you're just a pilot trying to make ends meet. How?
|
||||
That's your decision. Vega Strike is designed as a non-linear gaming
|
||||
experience, where you choose what action you want to take.
|
||||
|
||||
Vega Strike features a dynamic trading economy, allowing your character to
|
||||
operate as a merchant. Discover what trade routes bring in the most profit,
|
||||
what commodities make you the most money given your ship's cargo space
|
||||
limitations, accept cargo missions and learn to avoid areas of danger
|
||||
(repairs eat into your profits!).
|
||||
Vega Strike features a dynamic trading economy, allowing your character
|
||||
to operate as a merchant. Discover what trade routes bring in the most
|
||||
profit, what commodities make you the most money given your ship's cargo
|
||||
space limitations, accept cargo missions and learn to avoid areas of
|
||||
danger (repairs eat into your profits!).
|
||||
|
||||
If you are tired of making money on milk runs, or want to try something
|
||||
different, then there are other paths to success. Vega Strike features a
|
||||
mission generator, providing multiple missions to the experienced
|
||||
(and not so experienced) pilots. Engage in bounty hunting, patrols,
|
||||
battles and escort missions. Feel like traveling? Explore the dynamic
|
||||
battles and escort missions. Feel like travelling? Explore the dynamic
|
||||
universe and see the farthest reaches of known space.
|
||||
Want a walk on the wild side? You could always turn pirate! Just be
|
||||
prepared for the consequences.
|
||||
|
||||
Your ship just not doing the job you want it to? Vega Strike gives you the
|
||||
ability to purchase from a wide variety of ships capable of doing different
|
||||
jobs. Want to haul cargo? Fight battles? There's a ship for you. Your ship
|
||||
is fully customizable, so if you've got the credit, outfit your craft
|
||||
with the right tools for the job at hand.
|
||||
Your ship just not doing the job you want it to? Vega Strike gives you
|
||||
the ability to purchase from a wide variety of ships capable of doing
|
||||
different jobs. Want to haul cargo? Fight battles? There's a ship for
|
||||
you. Your ship is fully customizable, so if you've got the credit,
|
||||
outfit your craft with the right tools for the job at hand.
|
||||
|
||||
Have a chat with the bartender or view the news broadcasts to find out
|
||||
what's going on in the universe. While you're there, talk to the fixers,
|
||||
|
|
23
games/vegastrike/README.SlackBuild
Normal file
23
games/vegastrike/README.SlackBuild
Normal file
|
@ -0,0 +1,23 @@
|
|||
Following features are new in this build:
|
||||
|
||||
- Contains a few bugfixes for version 0.5.1.r1.
|
||||
- Corrects the stats of a few ship-parts because they do not
|
||||
behave in the same way that similiar parts behave.
|
||||
This is done by default. If this is not wanted then use
|
||||
|
||||
PARTSFIX=NO ./vegastrike.SlackBuild
|
||||
|
||||
to build the package.
|
||||
- The server will not be build by default since it is experimental
|
||||
at this stage. If you want to build the server anyway then use
|
||||
|
||||
DISABLE_SERVER=OFF ./vegastrike.SlackBuild
|
||||
|
||||
|
||||
HINTS:
|
||||
|
||||
- After installation run 'vssetup' and adjust the settings
|
||||
before you launch 'vegastrike'.
|
||||
- You can quit the game either by pressing ESC and then 'q'
|
||||
during flight or by clicking 'Quit Game' on a save screen.
|
||||
|
|
@ -1,326 +0,0 @@
|
|||
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" );
|
616
games/vegastrike/patches/patch-0.5.1.r1_2
Normal file
616
games/vegastrike/patches/patch-0.5.1.r1_2
Normal file
|
@ -0,0 +1,616 @@
|
|||
diff -ruN ./CMakeLists.txt ../c/CMakeLists.txt
|
||||
--- ./CMakeLists.txt 2012-03-26 02:50:49.000000000 +0200
|
||||
+++ ../c/CMakeLists.txt 2020-09-03 16:25:55.870086658 +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 ../c/objconv/basemaker/base_maker_texture.cpp
|
||||
--- ./objconv/basemaker/base_maker_texture.cpp 2010-03-10 03:56:23.000000000 +0100
|
||||
+++ ../c/objconv/basemaker/base_maker_texture.cpp 2020-09-03 16:25:55.871086646 +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 ../c/objconv/mesher/to_OgreMesh.cpp
|
||||
--- ./objconv/mesher/to_OgreMesh.cpp 2011-06-02 01:47:36.000000000 +0200
|
||||
+++ ../c/objconv/mesher/to_OgreMesh.cpp 2020-09-03 16:25:55.872086633 +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 ../c/objconv/mesher/to_OgreMesh.h
|
||||
--- ./objconv/mesher/to_OgreMesh.h 2010-02-25 16:22:25.000000000 +0100
|
||||
+++ ../c/objconv/mesher/to_OgreMesh.h 2020-09-03 16:25:55.873086621 +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 ../c/setup/src/c/setup.cpp
|
||||
--- ./setup/src/c/setup.cpp 2011-03-15 01:28:47.000000000 +0100
|
||||
+++ ../c/setup/src/c/setup.cpp 2020-09-03 16:25:55.873086621 +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 ./setup/src/include/central.cpp ../c/setup/src/include/central.cpp
|
||||
--- ./setup/src/include/central.cpp 2004-10-25 04:27:13.000000000 +0200
|
||||
+++ ../c/setup/src/include/central.cpp 2020-09-03 17:45:35.786329482 +0200
|
||||
@@ -20,6 +20,8 @@
|
||||
struct group GROUPS;
|
||||
struct global_settings CONFIG;
|
||||
|
||||
+static char EMPTY_STR[] = "";
|
||||
+
|
||||
// Primary initialization function. Sets everything up and takes care of the program
|
||||
void Start(int * argc, char ***argv) {
|
||||
LoadMainConfig();
|
||||
@@ -65,7 +67,7 @@
|
||||
if (CUR->name == NULL) { continue; }
|
||||
if (strcmp(CUR->name, group) == 0) { return CUR->setting; }
|
||||
} while ((CUR = CUR->next) > 0);
|
||||
- return '\0';
|
||||
+ return EMPTY_STR;
|
||||
}
|
||||
|
||||
struct catagory *GetCatStruct(char *name) {
|
||||
diff -ruN ./src/cmd/music.cpp ../c/src/cmd/music.cpp
|
||||
--- ./src/cmd/music.cpp 2012-03-19 09:20:14.000000000 +0100
|
||||
+++ ../c/src/cmd/music.cpp 2020-09-03 16:25:55.874086608 +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.cpp ../c/src/cmd/unit.cpp
|
||||
--- ./src/cmd/unit.cpp 2012-03-19 09:20:14.000000000 +0100
|
||||
+++ ../c/src/cmd/unit.cpp 2020-09-03 16:25:55.875086596 +0200
|
||||
@@ -80,6 +80,7 @@
|
||||
template < class UnitType >GameUnit< UnitType >::GameUnit( int ) : sparkle_accum( 0 )
|
||||
, phalos( new HaloSystem() )
|
||||
{
|
||||
+ VSFileSystem::vs_dprintf(3, "Unit created by Constructor: template < class UnitType >GameUnit< UnitType >::GameUnit( int ) : sparkle_accum( 0 ), phalos( new HaloSystem() )\n");
|
||||
this->Unit::Init();
|
||||
}
|
||||
|
||||
@@ -99,6 +100,14 @@
|
||||
, phalos( new HaloSystem() )
|
||||
{
|
||||
Unit::Init( filename, SubU, faction, unitModifications, flightgrp, fg_subnumber, netxml );
|
||||
+
|
||||
+ std::string fn = string(filename);
|
||||
+ std::string str_faction = string(FactionUtil::GetFaction(faction));
|
||||
+ std::string objtype = UniverseUtil::LookupUnitStat( fn, str_faction, "Object_Type");
|
||||
+ if (objtype.compare("Vessel") == 0) {
|
||||
+ VSFileSystem::vs_dprintf(3, "Recomputing upgrades for (units.csv) Object_Type: %s\n", objtype.c_str());
|
||||
+ UnitUtil::RecomputeUnitUpgrades(this);
|
||||
+ }
|
||||
}
|
||||
|
||||
template < class UnitType >GameUnit< UnitType >::~GameUnit()
|
||||
diff -ruN ./src/cmd/unit_collide.h ../c/src/cmd/unit_collide.h
|
||||
--- ./src/cmd/unit_collide.h 2012-03-19 09:20:14.000000000 +0100
|
||||
+++ ../c/src/cmd/unit_collide.h 2020-09-03 17:34:09.178913256 +0200
|
||||
@@ -94,9 +94,9 @@
|
||||
{
|
||||
if ( !hugeobjects.empty() )
|
||||
hugeobjects.clear();
|
||||
- if ( this->active_huge.size() )
|
||||
+ if ( this->active_huge->size() )
|
||||
ha.clear();
|
||||
- if ( this->accum_huge.size() )
|
||||
+ if ( this->accum_huge->size() )
|
||||
hb.clear();
|
||||
acc_huge.clear();
|
||||
act_huge.clear();
|
||||
diff -ruN ./src/cmd/unit_generic.cpp ../c/src/cmd/unit_generic.cpp
|
||||
--- ./src/cmd/unit_generic.cpp 2012-03-19 09:20:14.000000000 +0100
|
||||
+++ ../c/src/cmd/unit_generic.cpp 2020-09-03 16:25:55.879086546 +0200
|
||||
@@ -4903,16 +4903,26 @@
|
||||
|
||||
static const string LOAD_FAILED = "LOAD_FAILED";
|
||||
|
||||
+//const Unit * makeFinalBlankUpgrade( string name, int faction )
|
||||
+//{
|
||||
+// char *unitdir = GetUnitDir( name.c_str() );
|
||||
+// string limiternam = name;
|
||||
+// if (unitdir != name)
|
||||
+// limiternam = string( unitdir )+string( ".blank" );
|
||||
+// free( unitdir );
|
||||
+// const Unit *lim = UnitConstCache::getCachedConst( StringIntKey( limiternam, faction ) );
|
||||
+// if (!lim)
|
||||
+// lim = UnitConstCache::setCachedConst( StringIntKey( limiternam, faction ), makeBlankUpgrade( limiternam, faction ) );
|
||||
+// if (lim->name == LOAD_FAILED)
|
||||
+// lim = NULL;
|
||||
+// return lim;
|
||||
+//}
|
||||
+
|
||||
const Unit * makeFinalBlankUpgrade( string name, int faction )
|
||||
{
|
||||
- char *unitdir = GetUnitDir( name.c_str() );
|
||||
- string limiternam = name;
|
||||
- if (unitdir != name)
|
||||
- limiternam = string( unitdir )+string( ".blank" );
|
||||
- free( unitdir );
|
||||
- const Unit *lim = UnitConstCache::getCachedConst( StringIntKey( limiternam, faction ) );
|
||||
+ const Unit *lim = UnitConstCache::getCachedConst( StringIntKey( name, faction ) );
|
||||
if (!lim)
|
||||
- lim = UnitConstCache::setCachedConst( StringIntKey( limiternam, faction ), makeBlankUpgrade( limiternam, faction ) );
|
||||
+ lim = UnitConstCache::setCachedConst( StringIntKey( name, faction ), makeBlankUpgrade( name, faction ) );
|
||||
if (lim->name == LOAD_FAILED)
|
||||
lim = NULL;
|
||||
return lim;
|
||||
@@ -6387,21 +6397,48 @@
|
||||
int tmpammo = mounts[jmod].ammo;
|
||||
if (mounts[jmod].ammo != -1 && up->mounts[i].ammo != -1) {
|
||||
tmpammo += up->mounts[i].ammo;
|
||||
- if (templ) {
|
||||
- if (templ->GetNumMounts() > jmod) {
|
||||
- if (templ->mounts[jmod].volume != -1) {
|
||||
- if (templ->mounts[jmod].volume < mounts[jmod].type->volume*tmpammo) {
|
||||
- tmpammo =
|
||||
- (int) floor( .125
|
||||
- +( (0
|
||||
- +templ->mounts[jmod].volume)
|
||||
- /mounts[jmod].type->volume ) );
|
||||
+ if (ismissiletype) {
|
||||
+ if (templ) {
|
||||
+ if (templ->GetNumMounts() > jmod) {
|
||||
+ if (templ->mounts[jmod].volume != -1) {
|
||||
+ if (templ->mounts[jmod].volume < mounts[jmod].type->volume*tmpammo) {
|
||||
+ tmpammo =
|
||||
+ (int) floor( .125
|
||||
+ +( (0
|
||||
+ +templ->mounts[jmod].volume)
|
||||
+ /mounts[jmod].type->volume ) );
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
+ if (tmpammo*mounts[jmod].type->volume > mounts[jmod].volume)
|
||||
+ tmpammo = (int) floor( .125+( (0+mounts[jmod].volume)/mounts[jmod].type->volume ) );
|
||||
+ } else {
|
||||
+ std::string ammoname = up->name.get();
|
||||
+ std::size_t ammopos = ammoname.find("_ammo");
|
||||
+ std::string weaponname = ammoname.substr(0, ammopos);
|
||||
+
|
||||
+ /* Do NOT delete this Unit because it will be either fetched
|
||||
+ * from a cache or - if it has to be created - it will
|
||||
+ * be automatically put in a cache.
|
||||
+ * Deletion will corrupt the cache!
|
||||
+ */
|
||||
+ const Unit * weapon = getUnitFromUpgradeName(weaponname);
|
||||
+
|
||||
+ if (weapon == NULL || weapon->name == LOAD_FAILED) {
|
||||
+ // this should not happen
|
||||
+ VSFileSystem::vs_dprintf(1, "UpgradeMount(): FAILED to obtain weapon: %s\n", weaponname.c_str());
|
||||
+ cancompletefully = false;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ int maxammo = weapon->mounts[0].ammo;
|
||||
+
|
||||
+ if (tmpammo > maxammo) {
|
||||
+ tmpammo = maxammo;
|
||||
+ }
|
||||
}
|
||||
- if (tmpammo*mounts[jmod].type->volume > mounts[jmod].volume)
|
||||
- tmpammo = (int) floor( .125+( (0+mounts[jmod].volume)/mounts[jmod].type->volume ) );
|
||||
+
|
||||
if (tmpammo > mounts[jmod].ammo) {
|
||||
cancompletefully = true;
|
||||
if (touchme)
|
||||
diff -ruN ./src/cmd/unit_jump.h ../c/src/cmd/unit_jump.h
|
||||
--- ./src/cmd/unit_jump.h 2012-03-19 09:20:14.000000000 +0100
|
||||
+++ ../c/src/cmd/unit_jump.h 2020-09-03 16:25:55.880086533 +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/cockpit_xml.cpp ../c/src/gfx/cockpit_xml.cpp
|
||||
--- ./src/gfx/cockpit_xml.cpp 2010-12-15 09:53:40.000000000 +0100
|
||||
+++ ../c/src/gfx/cockpit_xml.cpp 2020-09-03 16:30:00.313030701 +0200
|
||||
@@ -315,7 +315,7 @@
|
||||
for (counter = 0; counter < 4; ++counter)
|
||||
if (!replaced[counter]) {
|
||||
delete Pit[counter];
|
||||
- Pit[counter] = false;
|
||||
+ Pit[counter] = NULL;
|
||||
}
|
||||
break;
|
||||
case UnitImages< void >::SHIELD4:
|
||||
diff -ruN ./src/gfx/quadsquare.cpp ../c/src/gfx/quadsquare.cpp
|
||||
--- ./src/gfx/quadsquare.cpp 2010-03-10 06:27:01.000000000 +0100
|
||||
+++ ../c/src/gfx/quadsquare.cpp 2020-09-03 16:25:55.881086521 +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/gui/text_area.cpp ../c/src/gui/text_area.cpp
|
||||
--- ./src/gui/text_area.cpp 2010-02-25 15:26:53.000000000 +0100
|
||||
+++ ../c/src/gui/text_area.cpp 2020-09-03 17:46:51.883378138 +0200
|
||||
@@ -32,6 +32,8 @@
|
||||
* };
|
||||
*/
|
||||
|
||||
+static char EMPTY_STR[] = "";
|
||||
+
|
||||
TextArea::~TextArea() {}
|
||||
|
||||
TextArea::TextArea()
|
||||
@@ -316,7 +318,7 @@
|
||||
{
|
||||
TextAreaItem *search;
|
||||
search = ItemList->FindCount( cur_selected, 0 );
|
||||
- if (search == 0) return '\0';
|
||||
+ if (search == 0) return EMPTY_STR;
|
||||
if (type == 1) return search->name;
|
||||
|
||||
else return search->description;
|
||||
diff -ruN ./src/networking/lowlevel/packetmem.cpp ../c/src/networking/lowlevel/packetmem.cpp
|
||||
--- ./src/networking/lowlevel/packetmem.cpp 2008-03-31 10:20:19.000000000 +0200
|
||||
+++ ../c/src/networking/lowlevel/packetmem.cpp 2020-09-03 16:25:55.881086521 +0200
|
||||
@@ -102,7 +102,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- _buffer.reset( 0 );
|
||||
+ _buffer.reset();
|
||||
_len = 0;
|
||||
}
|
||||
}
|
||||
diff -ruN ./src/pk3.cpp ../c/src/pk3.cpp
|
||||
--- ./src/pk3.cpp 2012-03-19 09:20:14.000000000 +0100
|
||||
+++ ../c/src/pk3.cpp 2020-09-03 16:31:12.819124250 +0200
|
||||
@@ -356,7 +356,7 @@
|
||||
}
|
||||
//if the file isn't in the archive
|
||||
if (index == -1)
|
||||
- return false;
|
||||
+ return NULL;
|
||||
int flength = GetFileLen( index );
|
||||
|
||||
buffer = new char[flength];
|
||||
diff -ruN ./src/vsfilesystem.cpp ../c/src/vsfilesystem.cpp
|
||||
--- ./src/vsfilesystem.cpp 2012-03-19 09:20:14.000000000 +0100
|
||||
+++ ../c/src/vsfilesystem.cpp 2020-09-03 16:25:55.882086508 +0200
|
||||
@@ -460,13 +460,15 @@
|
||||
|
||||
int vs_fprintf( FILE *fp, const char *format, ... )
|
||||
{
|
||||
+ int ret = 0;
|
||||
if (!use_volumes) {
|
||||
va_list ap;
|
||||
va_start( ap, format );
|
||||
|
||||
- return vfprintf( fp, format, ap );
|
||||
- } else {}
|
||||
- return 0;
|
||||
+ ret = vfprintf( fp, format, ap );
|
||||
+ va_end(ap);
|
||||
+ }
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
void vs_dprintf( char level, const char *format, ... )
|
||||
@@ -475,19 +477,22 @@
|
||||
va_list ap;
|
||||
va_start( ap, format );
|
||||
vfprintf( stderr, format, ap );
|
||||
+ va_end(ap);
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
int vs_fscanf( FILE *fp, const char *format, ... )
|
||||
{
|
||||
+ int ret = 0;
|
||||
if (!use_volumes) {
|
||||
va_list arglist;
|
||||
va_start( arglist, format );
|
||||
//return _input(fp,(unsigned char*)format,arglist);
|
||||
- return vfscanf( fp, format, arglist );
|
||||
- } else {}
|
||||
- return 0;
|
||||
+ ret = vfscanf( fp, format, arglist );
|
||||
+ va_end(arglist);
|
||||
+ }
|
||||
+ return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -563,6 +568,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" );
|
||||
@@ -1713,16 +1730,18 @@
|
||||
|
||||
int VSFile::Fprintf( const char *format, ... )
|
||||
{
|
||||
+ int ret = 0;
|
||||
if (!UseVolumes[alt_type] || this->volume_type == VSFSNone) {
|
||||
va_list ap;
|
||||
va_start( ap, format );
|
||||
|
||||
- return vfprintf( this->fp, format, ap );
|
||||
+ ret = vfprintf( this->fp, format, ap );
|
||||
+ va_end(ap);
|
||||
} else {
|
||||
cerr<<"!!! ERROR : Writing is not supported within resource/volume files"<<endl;
|
||||
VSExit( 1 );
|
||||
}
|
||||
- return 0;
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
#if 0
|
||||
@@ -1742,18 +1761,17 @@
|
||||
if (!UseVolumes[alt_type] || this->volume_type == VSFSNone) {
|
||||
//return _input(fp,(unsigned char*)format,arglist);
|
||||
ret = vfscanf( this->fp, newformat, arglist );
|
||||
- va_end( arglist );
|
||||
} else {
|
||||
if (q_volume_format == vfmtVSR) {} else if (q_volume_format == vfmtPK3) {
|
||||
//If the file has not been extracted yet we do now
|
||||
checkExtracted();
|
||||
ret = vsscanf( pk3_extracted_file+offset, newformat, arglist );
|
||||
readbytes = GetReadBytes( newformat, arglist );
|
||||
- va_end( arglist );
|
||||
cerr<<" SSCANF : Read "<<readbytes<<" bytes"<<endl;
|
||||
this->offset += readbytes;
|
||||
}
|
||||
}
|
||||
+ va_end( arglist );
|
||||
delete[] newformat;
|
||||
return ret;
|
||||
}
|
315
games/vegastrike/patches/patch_partsfix-0.5.1.r1_2
Normal file
315
games/vegastrike/patches/patch_partsfix-0.5.1.r1_2
Normal file
File diff suppressed because one or more lines are too long
|
@ -11,9 +11,9 @@ vegastrike:
|
|||
vegastrike: Vegastrike is an Open Source 3D Action-Space-Sim that
|
||||
vegastrike: lets you trade, fight, and explore in a vast universe.
|
||||
vegastrike:
|
||||
vegastrike:
|
||||
vegastrike:
|
||||
vegastrike: Homepage: http://vegastrike.sourceforge.net
|
||||
vegastrike:
|
||||
vegastrike:
|
||||
vegastrike:
|
||||
vegastrike:
|
||||
vegastrike:
|
||||
|
|
|
@ -23,9 +23,6 @@
|
|||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
PRGNAM=vegastrike
|
||||
VERSION=${VERSION:-0.5.1.r1}
|
||||
BUILD=${BUILD:-1}
|
||||
TAG=${TAG:-_SBo}
|
||||
|
||||
PRGSRCSUF=${PRGSRCSUF:-.tar.bz2}
|
||||
PRGSRCNAME=${PRGSRCNAME:-$PRGNAM-src-*}
|
||||
|
@ -47,6 +44,10 @@ PRGSPEECHSUF=${PRGSPEECHSUF%.tar}
|
|||
PRGSPEECHNAME=${PRGSPEECHNAME:-$PRGNAM-speech-*}
|
||||
PRGSPEECHNAME=${PRGSPEECHNAME%$PRGSPEECHSUF}
|
||||
|
||||
VERSION=${VERSION:-0.5.1.r1}
|
||||
BUILD=${BUILD:-2}
|
||||
TAG=${TAG:-_SBo}
|
||||
|
||||
if [ -z "$ARCH" ]; then
|
||||
case "$( uname -m )" in
|
||||
i?86) ARCH=i586 ;;
|
||||
|
@ -84,7 +85,9 @@ tar xvf $CWD/$PRGSRCNAME$PRGSRCSUF
|
|||
|
||||
cd $PRGSRCNAME
|
||||
|
||||
patch -p0 < $CWD/patch-$VERSION
|
||||
declare patchdir="$CWD/patches"
|
||||
|
||||
patch -p0 < "$patchdir/patch-${VERSION}_$BUILD"
|
||||
|
||||
BUILDDIR=build
|
||||
mkdir -p $BUILDDIR
|
||||
|
@ -110,6 +113,7 @@ cmake \
|
|||
-DCMAKE_INSTALL_MANDIR=/usr/man \
|
||||
-DCMAKE_INSTALL_DOCDIR=/usr/doc/$PRGNAM-$VERSION \
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$ARCH \
|
||||
-DDISABLE_SERVER=${DISABLE_SERVER:-ON} \
|
||||
..
|
||||
|
||||
make
|
||||
|
@ -128,16 +132,34 @@ objconvdir=$vsbasedir/objconv
|
|||
|
||||
mkdir -p $vsbasedir $bindir $objconvdir
|
||||
|
||||
for f in ./build/objconv/asteroidgen ./build/objconv/replace ./build/objconv/trisort ./build/vegaserver ./build/vegastrike ./build/setup/vssetup;do
|
||||
for f in ./build/vegaserver ./build/vegastrike ./build/setup/vssetup;do
|
||||
if [[ -e "$f" ]];then
|
||||
chmod +x $f
|
||||
cp $f $bindir
|
||||
fi
|
||||
done
|
||||
|
||||
for f in ./objconv/3ds2xml ./objconv/obj2xml ./objconv/wcp2xml;do
|
||||
chmod -x $f
|
||||
for f in ./build/objconv/asteroidgen ./build/objconv/replace ./build/objconv/trisort ./build/objconv/mesh_tool ;do
|
||||
if [[ -e "$f" ]];then
|
||||
chmod +x $f
|
||||
cp $f $objconvdir
|
||||
fi
|
||||
done
|
||||
|
||||
tar xvf $CWD/$PRGDATANAME$PRGDATASUF
|
||||
|
||||
PARTSFIX=${PARTSFIX:-YES}
|
||||
|
||||
case ${PARTSFIX^^} in
|
||||
Y|YES|T|TRUE|ON|1)
|
||||
cd $PRGDATANAME
|
||||
patch -p0 < "$patchdir/patch_partsfix-${VERSION}_$BUILD"
|
||||
cd -
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
mv $PRGDATANAME $vsdatadir
|
||||
|
||||
tar xvf $CWD/$PRGEXTRANAME$PRGEXTRASUF
|
||||
|
@ -171,3 +193,4 @@ cat $CWD/slack-desc > $PKG/install/slack-desc
|
|||
|
||||
cd $PKG
|
||||
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|
||||
|
||||
|
|
Loading…
Reference in a new issue