automatic update by autodist [release 44-1mamba;Sun Jun 06 2021]

This commit is contained in:
Automatic Build System 2024-01-05 17:40:27 +01:00
parent dbf012e7be
commit edc2002c2f
16 changed files with 966 additions and 0 deletions

View File

@ -1,2 +1,5 @@
# scorched3d # scorched3d
Scorched 3D is a game based loosely (or actually quite heavily now) on the classic DOS game Scorched Earth.
Scorched 3D adds amongst other new features a 3D island environment and LAN and internet play.

4
openal-config Normal file
View File

@ -0,0 +1,4 @@
#!/bin/bash
pkg-config "$@" openal
exit $?

View File

@ -0,0 +1,49 @@
Index: scorched3d-41.3dfsg/src/common/main.h
===================================================================
--- scorched3d-41.3dfsg.orig/src/common/main.h 2008-01-26 20:41:37.000000000 +0100
+++ scorched3d-41.3dfsg/src/common/main.h 2008-01-26 20:45:15.000000000 +0100
@@ -21,6 +21,8 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
+#include <cstdlib>
+#include <vector>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
Index: scorched3d-41.3dfsg/src/common/sha2.h
===================================================================
--- scorched3d-41.3dfsg.orig/src/common/sha2.h 2008-01-26 20:41:37.000000000 +0100
+++ scorched3d-41.3dfsg/src/common/sha2.h 2008-01-26 20:45:15.000000000 +0100
@@ -46,6 +46,7 @@
#include <string>
#include <stdexcept>
+#include <cstring>
// NOTE: You may need to define things by hand for your system:
typedef unsigned char sha_byte; // Exactly 1 byte
Index: scorched3d-41.3dfsg/src/common/DefinesFile.cpp
===================================================================
--- scorched3d-41.3dfsg.orig/src/common/DefinesFile.cpp 2008-01-26 20:41:37.000000000 +0100
+++ scorched3d-41.3dfsg/src/common/DefinesFile.cpp 2008-01-26 20:45:15.000000000 +0100
@@ -21,6 +21,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string>
+#include <cstring>
#include <common/DefinesFile.h>
#include <sys/types.h>
#include <sys/stat.h>
Index: scorched3d-41.3dfsg/src/common/LoggerI.cpp
===================================================================
--- scorched3d-41.3dfsg.orig/src/common/LoggerI.cpp 2008-01-26 20:45:33.000000000 +0100
+++ scorched3d-41.3dfsg/src/common/LoggerI.cpp 2008-01-26 20:46:03.000000000 +0100
@@ -20,6 +20,7 @@
#include <common/LoggerI.h>
#include <time.h>
+#include <cstring>
LoggerInfo::LoggerInfo(
const char *message,

View File

@ -0,0 +1,21 @@
Fix build failure against gcc-4.7 (missing <unistd.h> for close())
../client/SecureID.cpp: In member function 'std::string SecureID::GetPrivateKey()':
../client/SecureID.cpp:92:13: error: 'close' was not declared in this scope
../client/SecureID.cpp:102:14: error: 'close' was not declared in this scope
../client/SecureID.cpp:115:13: error: 'close' was not declared in this scope
../client/SecureID.cpp:124:12: error: 'close' was not declared in this scope
make[3]: *** [SecureID.o] Error 1
diff --git a/src/client/client/SecureID.cpp b/src/client/client/SecureID.cpp
index bc276c4..5eb2f13 100644
--- a/src/client/client/SecureID.cpp
+++ b/src/client/client/SecureID.cpp
@@ -75,6 +75,7 @@ std::string SecureID::GetPrivateKey(void)
#include <sys/ioctl.h>
#include <net/if.h>
+#include <unistd.h>
std::string SecureID::GetPrivateKey(void)
{

View File

@ -0,0 +1,74 @@
--- ./src/common/image/ImagePngFactory.cpp.old
+++ ./src/common/image/ImagePngFactory.cpp
@@ -104,7 +104,7 @@
static void user_png_error(png_structp png_ptr, png_const_charp msg)
{
- longjmp(png_ptr->jmpbuf,1);
+ longjmp(png_jmpbuf(png_ptr),1);
}
static void user_png_warning(png_structp png_ptr, png_const_charp msg)
--- ./src/client/client/LoadPNG.cpp.old
+++ ./src/client/client/LoadPNG.cpp
@@ -28,6 +28,8 @@
int row, i;
volatile int ckey = -1;
png_color_16 *transv;
+ png_colorp png_palette;
+ int num_palette;
if ( !src ) {
/* The error message has been set in SDL_RWFromFile */
@@ -58,7 +60,7 @@
* the normal method of doing things with libpng). REQUIRED unless you
* set up your own error handlers in png_create_read_struct() earlier.
*/
- if ( setjmp(png_ptr->jmpbuf) ) {
+ if ( setjmp(png_jmpbuf(png_ptr)) ) {
error = "Error reading the PNG file.";
goto done;
}
@@ -127,9 +129,9 @@
Rmask = 0x000000FF;
Gmask = 0x0000FF00;
Bmask = 0x00FF0000;
- Amask = (info_ptr->channels == 4) ? 0xFF000000 : 0;
+ Amask = (png_get_channels(png_ptr, info_ptr) == 4) ? 0xFF000000 : 0;
} else {
- int s = (info_ptr->channels == 4) ? 0 : 8;
+ int s = (png_get_channels(png_ptr, info_ptr) == 4) ? 0 : 8;
Rmask = 0xFF000000 >> s;
Gmask = 0x00FF0000 >> s;
Bmask = 0x0000FF00 >> s;
@@ -137,7 +139,7 @@
}
}
surface = SDL_AllocSurface(SDL_SWSURFACE, width, height,
- bit_depth*info_ptr->channels, Rmask,Gmask,Bmask,Amask);
+ bit_depth*png_get_channels(png_ptr, info_ptr), Rmask,Gmask,Bmask,Amask);
if ( surface == NULL ) {
error = "Out of memory";
goto done;
@@ -185,12 +187,15 @@
palette->colors[i].g = i;
palette->colors[i].b = i;
}
- } else if (info_ptr->num_palette > 0 ) {
- palette->ncolors = info_ptr->num_palette;
- for( i=0; i<info_ptr->num_palette; ++i ) {
- palette->colors[i].b = info_ptr->palette[i].blue;
- palette->colors[i].g = info_ptr->palette[i].green;
- palette->colors[i].r = info_ptr->palette[i].red;
+ } else {
+ png_get_PLTE(png_ptr, info_ptr, &png_palette, &num_palette);
+ if (num_palette > 0 ) {
+ palette->ncolors = num_palette;
+ for( i=0; i<num_palette; ++i ) {
+ palette->colors[i].b = png_palette[i].blue;
+ palette->colors[i].g = png_palette[i].green;
+ palette->colors[i].r = png_palette[i].red;
+ }
}
}
}

View File

@ -0,0 +1,53 @@
diff -up scorched/src/common/coms/ComsLoadLevelMessage.cpp~ scorched/src/common/coms/ComsLoadLevelMessage.cpp
--- scorched/src/common/coms/ComsLoadLevelMessage.cpp~ 2014-08-01 18:47:31.000000000 +0200
+++ scorched/src/common/coms/ComsLoadLevelMessage.cpp 2020-08-13 21:33:59.895250469 +0200
@@ -108,6 +108,49 @@ bool ComsLoadLevelMessage::loadState(Sco
bool ComsLoadLevelMessage::loadTanks(ScorchedContext &context)
{
+ /*
+ * There is a timing bug which shows on really fast machines
+ * where the client starts talking to the server before the
+ * server initial setup is done.
+ * In sofar as I have managed to debug this, the following
+ * happens on slower machines, aka the GOOD case:
+ *
+ * Server TankAddSimAction::invokeAction() new Tank "(Bot) Fred"
+ * Server TankAddSimAction::invokeAction() new Tank "(Bot) Ted"
+ * Server TankAddSimAction::invokeAction() new Tank "Player 1"
+ * Server TankAddSimAction::invokeAction() new Tank "Spectator"
+ * Client TankAddSimAction::invokeAction() new Tank "(Bot) Fred"
+ * Client TankAddSimAction::invokeAction() new Tank "(Bot) Ted"
+ * Client TankAddSimAction::invokeAction() new Tank "Player 1"
+ * Client TankAddSimAction::invokeAction() new Tank "Spectator"
+ *
+ * Note the server internally creates all tanks before the
+ * client does and thus before the client starts sending
+ * messages related to these tanks to the server.
+ *
+ * On a fast enough system (i7-10610U) the following order
+ * has been observed instead:
+ *
+ * Server TankAddSimAction::invokeAction() new Tank "(Bot) Fred"
+ * Server TankAddSimAction::invokeAction() new Tank "(Bot) Ted"
+ * Client TankAddSimAction::invokeAction() new Tank "(Bot) Fred"
+ * Client TankAddSimAction::invokeAction() new Tank "(Bot) Ted"
+ * Client TankAddSimAction::invokeAction() new Tank "Player 1"
+ * Client TankAddSimAction::invokeAction() new Tank "Spectator"
+ * Server TankAddSimAction::invokeAction() new Tank "Player 1"
+ * Server TankAddSimAction::invokeAction() new Tank "Spectator"
+ *
+ * Note the server creates the "Player 1" and "Spectator"
+ * tanks after the client, this causes the server to ignore
+ * some initial messages from the client related to these
+ * tanks, after which things get stuck, breaking non-networked
+ * games on fast machines.
+ *
+ * The sleep below is an ugly but effective workaround for this
+ * issue.
+ */
+ SDL_Delay(100);
+
NetBufferReader reader(tanksBuffer_);
// Add any new tanks

View File

@ -0,0 +1,36 @@
diff -up scorched/src/launcher/wxdialogs/TrueTypeFont.h~ scorched/src/launcher/wxdialogs/TrueTypeFont.h
--- scorched/src/launcher/wxdialogs/TrueTypeFont.h~ 2014-08-01 18:47:32.000000000 +0200
+++ scorched/src/launcher/wxdialogs/TrueTypeFont.h 2014-08-29 14:04:55.726042013 +0200
@@ -25,10 +25,10 @@
#include <wx/image.h>
#include <ft2build.h>
#include <string>
-#include <freetype/freetype.h>
-#include <freetype/ftglyph.h>
-#include <freetype/ftoutln.h>
-#include <freetype/fttrigon.h>
+#include FT_FREETYPE_H
+#include FT_GLYPH_H
+#include FT_OUTLINE_H
+#include FT_TRIGONOMETRY_H
class TrueTypeFont
{
diff -up scorched/src/client/GLEXT/GLFont2dFreeType.h~ scorched/src/client/GLEXT/GLFont2dFreeType.h
--- scorched/src/client/GLEXT/GLFont2dFreeType.h~ 2014-08-01 18:47:31.000000000 +0200
+++ scorched/src/client/GLEXT/GLFont2dFreeType.h 2014-08-29 14:08:10.327083878 +0200
@@ -23,10 +23,10 @@
#include <GLEXT/GLFont2dStorage.h>
#include <ft2build.h>
-#include <freetype/freetype.h>
-#include <freetype/ftglyph.h>
-#include <freetype/ftoutln.h>
-#include <freetype/fttrigon.h>
+#include FT_FREETYPE_H
+#include FT_GLYPH_H
+#include FT_OUTLINE_H
+#include FT_TRIGONOMETRY_H
#include <string>
class GLFont2dFreeType

12
scorched3d-44-help.patch Normal file
View File

@ -0,0 +1,12 @@
diff -up scorched/src/common/common/DefinesScorched.cpp.orig scorched/src/common/common/DefinesScorched.cpp
--- scorched/src/common/common/DefinesScorched.cpp.orig 2009-02-15 15:11:18.000000000 +0100
+++ scorched/src/common/common/DefinesScorched.cpp 2009-02-16 14:28:53.000000000 +0100
@@ -58,7 +58,7 @@ void S3D::showURL(const std::string &url
std::string buffer = S3D::formatStringBuffer("open %s", url.c_str());
system(buffer.c_str());
#else
- std::string buffer = S3D::formatStringBuffer("firefox %s", url.c_str());
+ std::string buffer = S3D::formatStringBuffer("xdg-open %s", url.c_str());
system(buffer.c_str());
#endif // __DARWIN__
#endif // _WIN32

36
scorched3d-44-lua54.patch Normal file
View File

@ -0,0 +1,36 @@
diff -up scorched3d-44/scorched/src/common/lua/LUAS3DLib.cpp~ scorched3d-44/scorched/src/common/lua/LUAS3DLib.cpp
--- a/src/common/lua/LUAS3DLib.cpp~ 2020-08-11 15:07:12.000000000 +0200
+++ b/src/common/lua/LUAS3DLib.cpp 2020-08-11 15:22:07.159970299 +0200
@@ -349,7 +349,14 @@ static const luaL_Reg s3dlib[] = {
};
LUALIB_API int luaopen_s3d (lua_State *L) {
+#if LUA_VERSION_NUM > 501
+ lua_newtable(L);
+ luaL_setfuncs(L, s3dlib, 0);
+ lua_pushvalue(L, -1);
+ lua_setglobal(L, LUA_S3DLIBNAME);
+#else
luaL_register(L, LUA_S3DLIBNAME, s3dlib);
+#endif
return 1;
}
diff -up scorched3d-44/scorched/src/common/lua/LUAS3DWeaponLib.cpp~ scorched3d-44/scorched/src/common/lua/LUAS3DWeaponLib.cpp
--- a/src/common/lua/LUAS3DWeaponLib.cpp~ 2020-08-11 15:32:25.000000000 +0200
+++ b/src/common/lua/LUAS3DWeaponLib.cpp 2020-08-11 15:35:49.886946546 +0200
@@ -156,7 +156,14 @@ static const luaL_Reg s3dweaponlib[] = {
};
LUALIB_API int luaopen_s3dweapon (lua_State *L) {
+#if LUA_VERSION_NUM > 501
+ lua_newtable(L);
+ luaL_setfuncs(L, s3dweaponlib, 0);
+ lua_pushvalue(L, -1);
+ lua_setglobal(L, LUA_S3DWEAPONLIBNAME);
+#else
luaL_register(L, LUA_S3DWEAPONLIBNAME, s3dweaponlib);
+#endif
return 1;
}

View File

@ -0,0 +1,11 @@
--- src/common/weapons/AccessoryStore.cpp.orig 2016-02-13 22:16:08.997822186 -0600
+++ src/common/weapons/AccessoryStore.cpp 2016-02-13 22:16:47.949819533 -0600
@@ -156,7 +156,7 @@
Accessory *parent, XMLNode *currentNode)
{
XMLNode *typeNode = 0;
- if (!currentNode->getNamedParameter("type", typeNode)) return false;
+ if (!currentNode->getNamedParameter("type", typeNode)) return 0;
AccessoryPart *accessoryPart =
AccessoryMetaRegistration::getNewAccessory(typeNode->getContent(), this);

295
scorched3d-44-sys-lua.patch Normal file
View File

@ -0,0 +1,295 @@
diff -up scorched/src/client/scorchedc/Makefile.am~ scorched/src/client/scorchedc/Makefile.am
--- scorched/src/client/scorchedc/Makefile.am~ 2014-08-29 14:20:29.000000000 +0200
+++ scorched/src/client/scorchedc/Makefile.am 2014-08-30 08:52:17.803527748 +0200
@@ -178,42 +178,12 @@ scorched3dc_SOURCES = \
../../common/landscapemap/MovementMap.cpp \
../../common/landscapemap/NapalmMap.cpp \
../../common/landscapemap/RoofMaps.cpp \
- ../../common/lua/lapi.cpp \
- ../../common/lua/lauxlib.cpp \
- ../../common/lua/lbaselib.cpp \
- ../../common/lua/lcode.cpp \
- ../../common/lua/ldblib.cpp \
- ../../common/lua/ldebug.cpp \
- ../../common/lua/ldo.cpp \
- ../../common/lua/ldump.cpp \
- ../../common/lua/lfixed.cpp \
- ../../common/lua/lfunc.cpp \
- ../../common/lua/lgc.cpp \
- ../../common/lua/linit.cpp \
- ../../common/lua/liolib.cpp \
- ../../common/lua/llex.cpp \
- ../../common/lua/lmathlib.cpp \
- ../../common/lua/lmem.cpp \
- ../../common/lua/loadlib.cpp \
- ../../common/lua/lobject.cpp \
- ../../common/lua/lopcodes.cpp \
- ../../common/lua/loslib.cpp \
- ../../common/lua/lparser.cpp \
- ../../common/lua/lstate.cpp \
- ../../common/lua/lstring.cpp \
- ../../common/lua/lstrlib.cpp \
- ../../common/lua/ltable.cpp \
- ../../common/lua/ltablib.cpp \
- ../../common/lua/ltm.cpp \
../../common/lua/LUAS3DLib.cpp \
../../common/lua/LUAS3DWeaponLib.cpp \
../../common/lua/LUAScript.cpp \
../../common/lua/LUAScriptFactory.cpp \
../../common/lua/LUAScriptHook.cpp \
../../common/lua/LUAUtil.cpp \
- ../../common/lua/lundump.cpp \
- ../../common/lua/lvm.cpp \
- ../../common/lua/lzio.cpp \
../../common/movement/Boid2.cpp \
../../common/movement/TargetMovement.cpp \
../../common/movement/TargetMovementEntry.cpp \
@@ -933,35 +903,12 @@ scorched3dc_SOURCES = \
../../common/landscapemap/MovementMap.h \
../../common/landscapemap/NapalmMap.h \
../../common/landscapemap/RoofMaps.h \
- ../../common/lua/lapi.h \
- ../../common/lua/lauxlib.h \
- ../../common/lua/lcode.h \
- ../../common/lua/ldebug.h \
- ../../common/lua/ldo.h \
- ../../common/lua/lfixed.h \
- ../../common/lua/lfunc.h \
- ../../common/lua/lgc.h \
- ../../common/lua/llex.h \
- ../../common/lua/llimits.h \
- ../../common/lua/lmem.h \
- ../../common/lua/lobject.h \
- ../../common/lua/lopcodes.h \
- ../../common/lua/lparser.h \
- ../../common/lua/lstate.h \
- ../../common/lua/lstring.h \
- ../../common/lua/ltable.h \
- ../../common/lua/ltm.h \
- ../../common/lua/luaconf.h \
- ../../common/lua/lualib.h \
../../common/lua/LUAS3DLib.h \
../../common/lua/LUAS3DWeaponLib.h \
../../common/lua/LUAScript.h \
../../common/lua/LUAScriptFactory.h \
../../common/lua/LUAScriptHook.h \
../../common/lua/LUAUtil.h \
- ../../common/lua/lundump.h \
- ../../common/lua/lvm.h \
- ../../common/lua/lzio.h \
../../common/movement/Boid2.h \
../../common/movement/TargetMovement.h \
../../common/movement/TargetMovementEntry.h \
@@ -1450,5 +1450,5 @@ scorched3dc_SOURCES = \
../../common/simactions/TankTeamBallanceSimAction.h
AM_CPPFLAGS = -I../../common/porting -I../../common -I../../client -I../../server @FFTW_CFLAGS@ @AL_CFLAGS@ @FT2_CFLAGS@ @OGG_CFLAGS@ @SDL_CFLAGS@
-LDADD = @FFTW_LIBS@ @AL_LIBS@ @FT2_LIBS@ @GL_LIBS@ @OGG_LIBS@ @SDL_LIBS@
+LDADD = @FFTW_LIBS@ @AL_LIBS@ @FT2_LIBS@ @GL_LIBS@ @OGG_LIBS@ @SDL_LIBS@ -llua
diff -up scorched/src/server/scorcheds/Makefile.am~ scorched/src/server/scorcheds/Makefile.am
--- scorched/src/server/scorcheds/Makefile.am~ 2014-08-29 14:20:29.000000000 +0200
+++ scorched/src/server/scorcheds/Makefile.am 2014-08-30 08:51:55.790113979 +0200
@@ -361,42 +361,12 @@ scorched3ds_SOURCES = \
../../common/landscapemap/MovementMap.cpp \
../../common/landscapemap/NapalmMap.cpp \
../../common/landscapemap/RoofMaps.cpp \
- ../../common/lua/lapi.cpp \
- ../../common/lua/lauxlib.cpp \
- ../../common/lua/lbaselib.cpp \
- ../../common/lua/lcode.cpp \
- ../../common/lua/ldblib.cpp \
- ../../common/lua/ldebug.cpp \
- ../../common/lua/ldo.cpp \
- ../../common/lua/ldump.cpp \
- ../../common/lua/lfixed.cpp \
- ../../common/lua/lfunc.cpp \
- ../../common/lua/lgc.cpp \
- ../../common/lua/linit.cpp \
- ../../common/lua/liolib.cpp \
- ../../common/lua/llex.cpp \
- ../../common/lua/lmathlib.cpp \
- ../../common/lua/lmem.cpp \
- ../../common/lua/loadlib.cpp \
- ../../common/lua/lobject.cpp \
- ../../common/lua/lopcodes.cpp \
- ../../common/lua/loslib.cpp \
- ../../common/lua/lparser.cpp \
- ../../common/lua/lstate.cpp \
- ../../common/lua/lstring.cpp \
- ../../common/lua/lstrlib.cpp \
- ../../common/lua/ltable.cpp \
- ../../common/lua/ltablib.cpp \
- ../../common/lua/ltm.cpp \
../../common/lua/LUAS3DLib.cpp \
../../common/lua/LUAS3DWeaponLib.cpp \
../../common/lua/LUAScript.cpp \
../../common/lua/LUAScriptFactory.cpp \
../../common/lua/LUAScriptHook.cpp \
../../common/lua/LUAUtil.cpp \
- ../../common/lua/lundump.cpp \
- ../../common/lua/lvm.cpp \
- ../../common/lua/lzio.cpp \
../../common/movement/Boid2.cpp \
../../common/movement/TargetMovement.cpp \
../../common/movement/TargetMovementEntry.cpp \
@@ -840,35 +810,12 @@ scorched3ds_SOURCES = \
../../common/landscapemap/MovementMap.h \
../../common/landscapemap/NapalmMap.h \
../../common/landscapemap/RoofMaps.h \
- ../../common/lua/lapi.h \
- ../../common/lua/lauxlib.h \
- ../../common/lua/lcode.h \
- ../../common/lua/ldebug.h \
- ../../common/lua/ldo.h \
- ../../common/lua/lfixed.h \
- ../../common/lua/lfunc.h \
- ../../common/lua/lgc.h \
- ../../common/lua/llex.h \
- ../../common/lua/llimits.h \
- ../../common/lua/lmem.h \
- ../../common/lua/lobject.h \
- ../../common/lua/lopcodes.h \
- ../../common/lua/lparser.h \
- ../../common/lua/lstate.h \
- ../../common/lua/lstring.h \
- ../../common/lua/ltable.h \
- ../../common/lua/ltm.h \
- ../../common/lua/luaconf.h \
- ../../common/lua/lualib.h \
../../common/lua/LUAS3DLib.h \
../../common/lua/LUAS3DWeaponLib.h \
../../common/lua/LUAScript.h \
../../common/lua/LUAScriptFactory.h \
../../common/lua/LUAScriptHook.h \
../../common/lua/LUAUtil.h \
- ../../common/lua/lundump.h \
- ../../common/lua/lvm.h \
- ../../common/lua/lzio.h \
../../common/movement/Boid2.h \
../../common/movement/TargetMovement.h \
../../common/movement/TargetMovementEntry.h \
@@ -896,5 +896,5 @@ scorched3ds_SOURCES = \
../../common/simactions/TankTeamBallanceSimAction.h
AM_CPPFLAGS = -I../../common/porting -I../../common -I../../server -DS3D_SERVER=1 @SDL_CFLAGS@ @MYSQL_CFLAGS@
-LDADD = @SDL_LIBS@ @MYSQL_LIBS@
+LDADD = @SDL_LIBS@ @MYSQL_LIBS@ -llua
diff -up scorched/src/common/lua/LUAS3DLib.cpp~ scorched/src/common/lua/LUAS3DLib.cpp
--- scorched/src/common/lua/LUAS3DLib.cpp~ 2014-08-01 18:47:31.000000000 +0200
+++ scorched/src/common/lua/LUAS3DLib.cpp 2014-08-30 09:33:00.096184004 +0200
@@ -34,6 +34,8 @@
#include <target/TargetLife.h>
#include <landscapemap/LandscapeMaps.h>
+extern "C" {
+
#define LUA_LIB
#include "lua.h"
@@ -350,3 +352,5 @@ LUALIB_API int luaopen_s3d (lua_State *L
luaL_register(L, LUA_S3DLIBNAME, s3dlib);
return 1;
}
+
+} /* end of extern "C" */
diff -up scorched/src/common/lua/LUAS3DLib.h~ scorched/src/common/lua/LUAS3DLib.h
--- scorched/src/common/lua/LUAS3DLib.h~ 2014-08-01 18:47:31.000000000 +0200
+++ scorched/src/common/lua/LUAS3DLib.h 2014-08-30 09:34:59.244191281 +0200
@@ -21,9 +21,13 @@
#if !defined(__INCLUDE_LUAS3DLib_INCLUDE__)
#define __INCLUDE_LUAS3DLib_INCLUDE__
+extern "C" {
+
#include "lua.h"
#define LUA_S3DLIBNAME "s3d"
LUALIB_API int (luaopen_s3d) (lua_State *L);
+}
+
#endif // __INCLUDE_LUAS3DLib_INCLUDE__
diff -up scorched/src/common/lua/LUAS3DWeaponLib.cpp~ scorched/src/common/lua/LUAS3DWeaponLib.cpp
--- scorched/src/common/lua/LUAS3DWeaponLib.cpp~ 2014-08-01 18:47:31.000000000 +0200
+++ scorched/src/common/lua/LUAS3DWeaponLib.cpp 2014-08-30 09:32:55.503299589 +0200
@@ -30,6 +30,8 @@
#include <engine/Simulator.h>
#include <common/Logger.h>
+extern "C" {
+
#define LUA_LIB
#include "lua.h"
@@ -157,3 +159,5 @@ LUALIB_API int luaopen_s3dweapon (lua_St
luaL_register(L, LUA_S3DWEAPONLIBNAME, s3dweaponlib);
return 1;
}
+
+} /* end of extern "C" */
diff -up scorched/src/common/lua/LUAS3DWeaponLib.h~ scorched/src/common/lua/LUAS3DWeaponLib.h
--- scorched/src/common/lua/LUAS3DWeaponLib.h~ 2014-08-01 18:47:31.000000000 +0200
+++ scorched/src/common/lua/LUAS3DWeaponLib.h 2014-08-30 09:35:00.875150821 +0200
@@ -21,9 +21,13 @@
#if !defined(__INCLUDE_LUAWeaponFns_INCLUDE__)
#define __INCLUDE_LUAWeaponFns_INCLUDE__
+extern "C" {
+
#include "lua.h"
#define LUA_S3DWEAPONLIBNAME "s3dweapon"
LUALIB_API int (luaopen_s3dweapon) (lua_State *L);
+}
+
#endif // __INCLUDE_LUAWeaponFns_INCLUDE__
diff -up scorched/src/common/lua/LUAScript.cpp~ scorched/src/common/lua/LUAScript.cpp
--- scorched/src/common/lua/LUAScript.cpp~ 2014-08-30 09:28:33.000000000 +0200
+++ scorched/src/common/lua/LUAScript.cpp 2014-08-30 09:30:41.267677817 +0200
@@ -24,15 +24,14 @@
#include <lua/LUAS3DWeaponLib.h>
#include <common/Logger.h>
-#include "lauxlib.h"
-#include "lualib.h"
+#include "lua.hpp"
LUAScript::LUAScript(ScorchedContext *context) :
context_(context),
L_(0),
weapon_(0)
{
- L_ = lua_open();
+ L_ = luaL_newstate();
// Load the available libraries
luaopen_base(L_);
diff -up scorched/src/common/lua/LUAScript.h~ scorched/src/common/lua/LUAScript.h
--- scorched/src/common/lua/LUAScript.h~ 2014-08-01 18:47:31.000000000 +0200
+++ scorched/src/common/lua/LUAScript.h 2014-08-30 09:33:56.397767096 +0200
@@ -24,7 +24,7 @@
#include <string>
#include <common/FixedVector.h>
-#include "lua.h"
+#include "lua.hpp"
class Weapon;
class ScorchedContext;
diff -up scorched/src/common/lua/LUAUtil.h~ scorched/src/common/lua/LUAUtil.h
--- scorched/src/common/lua/LUAUtil.h~ 2014-08-01 18:47:31.000000000 +0200
+++ scorched/src/common/lua/LUAUtil.h 2014-08-30 09:34:14.652307697 +0200
@@ -24,9 +24,7 @@
#include <string>
#include <common/FixedVector.h>
-#include "lua.h"
-#include "lauxlib.h"
-#include "lualib.h"
+#include "lua.hpp"
class LUAUtil
{

View File

@ -0,0 +1,33 @@
diff -up scorched/src/client/scorchedc/Makefile.am~ scorched/src/client/scorchedc/Makefile.am
--- scorched/src/client/scorchedc/Makefile.am~ 2014-08-01 18:47:59.000000000 +0200
+++ scorched/src/client/scorchedc/Makefile.am 2014-08-29 13:46:18.225526804 +0200
@@ -41,7 +41,6 @@ scorched3dc_SOURCES = \
../../common/common/RandomGenerator.cpp \
../../common/common/RollingAverage.cpp \
../../common/common/sha2.cpp \
- ../../common/common/snprintf.c \
../../common/common/SplineCurve.cpp \
../../common/common/SplinePath.cpp \
../../common/common/ToolTip.cpp \
diff -up scorched/src/launcher/scorched/Makefile.am~ scorched/src/launcher/scorched/Makefile.am
--- scorched/src/launcher/scorched/Makefile.am~ 2014-08-01 18:47:59.000000000 +0200
+++ scorched/src/launcher/scorched/Makefile.am 2014-08-29 13:46:14.017634121 +0200
@@ -36,7 +36,6 @@ scorched3d_SOURCES = \
../../common/common/OptionsGame.cpp \
../../common/common/OptionsParameters.cpp \
../../common/common/ProgressCounter.cpp \
- ../../common/common/snprintf.c \
../../common/common/Vector.cpp \
../../common/common/Vector4.cpp \
../../common/common/VectorLib.cpp \
diff -up scorched/src/server/scorcheds/Makefile.am~ scorched/src/server/scorcheds/Makefile.am
--- scorched/src/server/scorcheds/Makefile.am~ 2014-08-01 18:47:59.000000000 +0200
+++ scorched/src/server/scorcheds/Makefile.am 2014-08-29 13:46:36.993048162 +0200
@@ -105,7 +105,6 @@ scorched3ds_SOURCES = \
../../common/common/RandomGenerator.cpp \
../../common/common/RollingAverage.cpp \
../../common/common/sha2.cpp \
- ../../common/common/snprintf.c \
../../common/common/SplineCurve.cpp \
../../common/common/SplinePath.cpp \
../../common/common/ToolTip.cpp \

170
scorched3d-44-wx3.0.patch Normal file
View File

@ -0,0 +1,170 @@
From: Markus Koschany <apo@debian.org>
Date: Fri, 15 Jul 2016 18:01:36 +0200
Subject: wx3.0 compat
Make Scorched3D compatible with wxWidgets 3.0
Thanks to Olly Betts for the patch.
---
src/launcher/wxdialogs/Display.cpp | 10 +++++-----
src/launcher/wxdialogs/DisplayDialog.cpp | 10 +++++-----
src/launcher/wxdialogs/SettingsDialog.cpp | 14 +++++++-------
3 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/src/launcher/wxdialogs/Display.cpp b/src/launcher/wxdialogs/Display.cpp
index e0a423a..22169e0 100644
--- a/src/launcher/wxdialogs/Display.cpp
+++ b/src/launcher/wxdialogs/Display.cpp
@@ -26,7 +26,7 @@ static void createMainControls(wxWindow *parent, wxSizer *sizer)
// Display settings
wxStaticBox *displayBox = new wxStaticBox(parent, -1, wxT("&Display"));
wxStaticBoxSizer *displaySizer = new wxStaticBoxSizer(displayBox, wxVERTICAL);
- wxFlexGridSizer *displaySizer2 = new wxFlexGridSizer(2, 3, 5, 5);
+ wxFlexGridSizer *displaySizer2 = new wxFlexGridSizer(0, 3, 5, 5);
wxStaticText *resText = new wxStaticText(parent, -1, wxT("&Resolution :"));
IDC_DISPLAY_CTRL =
new wxComboBox(parent, -1,
@@ -88,7 +88,7 @@ static void createMainControls(wxWindow *parent, wxSizer *sizer)
// Sound settings
wxStaticBox *soundBox = new wxStaticBox(parent, -1, wxT("&Sound"));
wxStaticBoxSizer *soundSizerMain = new wxStaticBoxSizer(soundBox, wxVERTICAL);
- wxFlexGridSizer *soundSizer1 = new wxFlexGridSizer(4, 2);
+ wxFlexGridSizer *soundSizer1 = new wxFlexGridSizer(0, 4, 2, 0);
wxStaticText *volumeText = new wxStaticText(parent, -1, wxT("Sound Volume :"));
wxStaticText *musicVolumeText = new wxStaticText(parent, -1, wxT("Music Volume :"));
wxStaticText *ambientVolumeText = new wxStaticText(parent, -1, wxT("Ambient Volume :"));
@@ -137,7 +137,7 @@ static void createMainControls(wxWindow *parent, wxSizer *sizer)
wxT("Game Detail Options"));
wxStaticBoxSizer *speedSizer = new wxStaticBoxSizer(speedBox, wxHORIZONTAL);
- wxGridSizer *loadSizer = new wxFlexGridSizer(2, 2);
+ wxGridSizer *loadSizer = new wxFlexGridSizer(0, 2, 2, 0);
IDC_LOADULTRA_CTRL = new wxButton(parent, ID_LOADULTRA, wxT("&Ultra Detail"), wxDefaultPosition, wxSize(120,-1));
IDC_LOADDEFAULTS_CTRL = new wxButton(parent, ID_LOADDEFAULTS, wxT("&Normal Detail"), wxDefaultPosition, wxSize(120,-1));
IDC_LOADMEDIUM_CTRL = new wxButton(parent, ID_LOADMEDIUM, wxT("Faster Detail"), wxDefaultPosition, wxSize(120,-1));
@@ -256,7 +256,7 @@ static void createSpeedControls(wxWindow *parent, wxSizer *sizer)
wxStaticBox *waterDetailBox = new wxStaticBox(parent, -1,
wxT("Graphics Detail"));
wxStaticBoxSizer *waterDetailSizer = new wxStaticBoxSizer(waterDetailBox, wxHORIZONTAL);
- wxGridSizer *waterDetailSizer2 = new wxGridSizer(3, 1, 10, 10);
+ wxGridSizer *waterDetailSizer2 = new wxGridSizer(0, 1, 10, 10);
IDC_NOWATERREF_CTRL =
new wxCheckBox(parent, -1, wxT("Don't draw water reflections - Large Framerate Improvement"));
@@ -471,7 +471,7 @@ static void createKeysControls(wxWindow *parent, wxSizer *topsizer)
{
wxScrolledWindow *scrolledWindow = new wxScrolledWindow(parent, -1,
wxDefaultPosition, wxSize(480, 250));
- wxSizer *sizer = new wxFlexGridSizer(5, 1);
+ wxSizer *sizer = new wxFlexGridSizer(0, 5, 1, 0);
keyboardKeyList.clear();
if (!Keyboard::instance()->loadKeyFile())
diff --git a/src/launcher/wxdialogs/DisplayDialog.cpp b/src/launcher/wxdialogs/DisplayDialog.cpp
index c34c9dc..0cdc620 100644
--- a/src/launcher/wxdialogs/DisplayDialog.cpp
+++ b/src/launcher/wxdialogs/DisplayDialog.cpp
@@ -449,15 +449,15 @@ void DisplayFrame::refreshScreen()
IDC_SLIDER1_CTRL->SetValue(OptionsDisplay::instance()->getBrightness());
IDC_SLIDER1_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getBrightnessEntry().getDescription(), wxConvUTF8));
IDC_VOLUME_CTRL->SetRange(0, 128);
- IDC_VOLUME_CTRL->SetTickFreq(4, 0);
+ IDC_VOLUME_CTRL->SetTickFreq(4);
IDC_VOLUME_CTRL->SetValue(OptionsDisplay::instance()->getSoundVolume());
IDC_VOLUME_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getSoundVolumeEntry().getDescription(), wxConvUTF8));
IDC_MUSICVOLUME_CTRL->SetRange(0, 128);
- IDC_MUSICVOLUME_CTRL->SetTickFreq(4, 0);
+ IDC_MUSICVOLUME_CTRL->SetTickFreq(4);
IDC_MUSICVOLUME_CTRL->SetValue(OptionsDisplay::instance()->getMusicVolume());
IDC_MUSICVOLUME_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getMusicVolumeEntry().getDescription(), wxConvUTF8));
IDC_AMBIENTVOLUME_CTRL->SetRange(0, 128);
- IDC_AMBIENTVOLUME_CTRL->SetTickFreq(4, 0);
+ IDC_AMBIENTVOLUME_CTRL->SetTickFreq(4);
IDC_AMBIENTVOLUME_CTRL->SetValue(OptionsDisplay::instance()->getAmbientSoundVolume());
IDC_AMBIENTVOLUME_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getAmbientSoundVolumeEntry().getDescription(), wxConvUTF8));
IDC_USERNAME_CTRL->SetValue(wxString(OptionsDisplay::instance()->getOnlineUserName(), wxConvUTF8));
@@ -736,7 +736,7 @@ void DisplayFrame::onExportMod(wxCommandEvent &event)
#if wxCHECK_VERSION(2, 8, 0)
wxFD_SAVE);
#else
- wxSAVE);
+ wxFD_SAVE);
#endif
if (file.empty()) return;
ModFiles files;
@@ -764,7 +764,7 @@ void DisplayFrame::onImportMod(wxCommandEvent &event)
#if wxCHECK_VERSION(2, 8, 0)
wxFD_OPEN | wxFD_FILE_MUST_EXIST);
#else
- wxOPEN | wxFILE_MUST_EXIST);
+ wxFD_OPEN | wxFD_FILE_MUST_EXIST);
#endif
if (file.empty()) return;
ModFiles files;
diff --git a/src/launcher/wxdialogs/SettingsDialog.cpp b/src/launcher/wxdialogs/SettingsDialog.cpp
index b312085..03ba629 100644
--- a/src/launcher/wxdialogs/SettingsDialog.cpp
+++ b/src/launcher/wxdialogs/SettingsDialog.cpp
@@ -105,7 +105,7 @@ void SettingsFrame::createMainPanel(bool server)
mainPanel_ = new wxPanel(book_, -1);
book_->AddPage(mainPanel_, wxT("Main"));
wxSizer *mainPanelSizer = new wxBoxSizer(wxVERTICAL);
- wxSizer *sizer = new wxFlexGridSizer(2, 2);
+ wxSizer *sizer = new wxFlexGridSizer(0, 2, 2, 0);
mainPanelSizer->Add(sizer, 0, wxALL | wxALIGN_CENTER, 10);
setters_.push_back(
@@ -166,7 +166,7 @@ void SettingsFrame::createMoneyPanel()
{
moneyPanel_ = new wxPanel(book_, -1);
wxSizer *ecoPanelSizer = new wxBoxSizer(wxVERTICAL);
- wxSizer *sizer = new wxFlexGridSizer(2, 2);
+ wxSizer *sizer = new wxFlexGridSizer(0, 2, 2, 0);
ecoPanelSizer->Add(sizer, 0, wxALL | wxALIGN_CENTER, 10);
setters_.push_back(
@@ -215,7 +215,7 @@ void SettingsFrame::createScorePanel()
{
scorePanel_ = new wxPanel(book_, -1);
wxSizer *ecoPanelSizer = new wxBoxSizer(wxVERTICAL);
- wxSizer *sizer = new wxFlexGridSizer(2, 2);
+ wxSizer *sizer = new wxFlexGridSizer(0, 2, 2, 0);
ecoPanelSizer->Add(sizer, 0, wxALL | wxALIGN_CENTER, 10);
setters_.push_back(
@@ -249,7 +249,7 @@ void SettingsFrame::createWeaponsPanel()
{
weaponsPanel_ = new wxPanel(book_, -1);
wxSizer *ecoPanelSizer = new wxBoxSizer(wxVERTICAL);
- wxSizer *sizer = new wxFlexGridSizer(2, 2);
+ wxSizer *sizer = new wxFlexGridSizer(0, 2, 2, 0);
ecoPanelSizer->Add(sizer, 0, wxALL | wxALIGN_CENTER, 10);
setters_.push_back(
@@ -286,7 +286,7 @@ void SettingsFrame::createEnvPanel()
{
envPanel_ = new wxPanel(book_, -1);
wxSizer *envPanelSizer = new wxBoxSizer(wxVERTICAL);
- wxSizer *sizer = new wxFlexGridSizer(2, 2);
+ wxSizer *sizer = new wxFlexGridSizer(0, 2, 2, 0);
envPanelSizer->Add(sizer, 0, wxALL | wxALIGN_CENTER, 10);
setters_.push_back(
@@ -337,7 +337,7 @@ void SettingsFrame::createLandPanel()
wxScrolledWindow *scrolledWindow = new wxScrolledWindow(landPanel_, -1,
wxDefaultPosition, wxSize(225, 200));
- wxSizer *sizer = new wxFlexGridSizer(3, 3);
+ wxSizer *sizer = new wxFlexGridSizer(0, 3, 3, 0);
int i = 0;
std::list<LandscapeDefinitionsEntry> &defns =
landscapeDefinitions.getAllLandscapes();
@@ -438,7 +438,7 @@ void SettingsFrame::createPlayersPanel()
wxT("Players are persistent for game"));
playersPanelSizer->Add(IDC_SERVER_RESIDUAL_CTRL, 0, wxALIGN_CENTER | wxTOP, 10);
- wxSizer *sizer = new wxGridSizer(3, 3);
+ wxSizer *sizer = new wxGridSizer(0, 3, 3, 0);
playersPanelSizer->Add(sizer, 0, wxALL | wxALIGN_CENTER, 10);
for (int i=0; i<24; i++)

24
scorched3d-appdata.xml Normal file
View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2014 Ryan Lerch <rlerch@redhat.com> -->
<!--
BugReportURL: http://www.scorched3d.co.uk/mantisbt/view.php?id=209
SentUpstream: 2014-09-25
-->
<application>
<id type="desktop">scorched3d.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<summary>Turn based 3D artillery game</summary>
<description>
<p>
Scorched 3D is a turn-based 3D artillery game where you take control of a
tank and attack your opponents in a 3D landscape with a range of weapons.
It also features some real-time elements allowing you to counter opponents
attacks, and also features online multiplayer modes.
</p>
</description>
<screenshots>
<screenshot type="default">http://www.scorched3d.co.uk/phpBB3/gallery/image.php?album_id=8&amp;image_id=61&amp;view=no_count</screenshot>
<screenshot>http://www.scorched3d.co.uk/phpBB3/gallery/image.php?album_id=3&amp;image_id=4&amp;view=no_count</screenshot>
</screenshots>
<url type="homepage">http://www.scorched3d.co.uk/</url>
</application>

8
scorched3d.desktop Normal file
View File

@ -0,0 +1,8 @@
[Desktop Entry]
Name=Scorched 3D
Comment=Un remake 3D di Scorched Earth
Exec=scorched3d
Icon=/usr/share/pixmaps/scorched3d.png
Terminal=false
Type=Application
Categories=Application;Game;ArcadeGame;

137
scorched3d.spec Normal file
View File

@ -0,0 +1,137 @@
%define scordir %{_datadir}/scorched3d
Name: scorched3d
Version: 44
Release: 1mamba
Summary: A 3D version of the classic DOS game Scorched Earth
Group: Applications/Games
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.scorched3d.co.uk/
Source0: http://downloads.sourceforge.net/project/scorched3d/scorched3d/Version%20%{version}/Scorched3D-%{version}-src.tar.gz
Source1: %{name}.desktop
Source2: openal-config
Source3: scorched3d-appdata.xml
Patch0: %{name}-41.3-gcc43.patch
Patch1: scorched3d-43.3d-libpng-1.5.patch
Patch2: scorched3d-43.3d-gcc-4.7.patch
Patch3: scorched3d-44-syslibs.patch
Patch4: scorched3d-44-help.patch
Patch5: scorched3d-44-freetype-2.10.4-buildfix.patch
Patch6: scorched3d-44-sys-lua.patch
Patch7: scorched3d-44-returntype.patch
Patch8: scorched3d-44-wx3.0.patch
Patch9: scorched3d-44-lua54.patch
Patch10: scorched3d-44-fix-hang-on-fast-machines.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libGLU-devel
BuildRequires: libSDL-devel
BuildRequires: libSDL_net-devel
BuildRequires: libexpat-devel
BuildRequires: libfftw-devel
BuildRequires: libfreealut-devel
BuildRequires: libfreetype-devel
BuildRequires: libgcc
BuildRequires: libglew-devel
BuildRequires: libglvnd-devel
BuildRequires: libjpeg-devel
BuildRequires: liblua-devel
BuildRequires: libogg-devel
BuildRequires: libopenal-devel
BuildRequires: libpng-devel
BuildRequires: libstdc++6-devel
BuildRequires: libvorbis-devel
BuildRequires: libwx_baseu30-devel
BuildRequires: libwx_gtk3u30-devel
BuildRequires: libz-devel
## AUTOBUILDREQ-END
%description
Scorched 3D is a game based loosely (or actually quite heavily now) on the classic DOS game Scorched Earth.
Scorched 3D adds amongst other new features a 3D island environment and LAN and internet play.
%debug_package
%prep
%setup -q -c
#-D -T
#:<< _EOF
cd scorched
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p0
%patch8 -p1
%patch9 -p1
%patch10 -p1
#sh ./autogen.sh
touch compile NEWS AUTHORS ChangeLog
autoreconf -ivf
install -m 755 %{SOURCE2} .
mkdir apoc
cp -a data/globalmods/apoc/*.txt apoc
# ensure we use the system versions of these
rm src/common/common/snprintf.c
rm src/common/lua/l*.{cpp,h}
rm src/common/lua/print.cpp
%build
#:<< _EOF
cd scorched
export OPENAL_CONFIG=$PWD/openal-config
%configure \
--datadir=%{scordir} \
--program-prefix=%{?_program_prefix} \
CXXFLAGS="%{optflags} `pkg-config --cflags lua`"
%make
# install scorched3d icon
convert -geometry 48x48 data/images/tank2.ico %{name}-48.png
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall -C scorched
install -D -m 644 scorched/%{name}-48-0.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
install -D -m 644 %{S:1} \
%{buildroot}%{_datadir}/applications/%{name}.desktop
install -D -m 644 %{S:2} \
%{buildroot}%{_datadir}/appdata/%{name}.appdata.xml
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files
%defattr(-,root,root)
%{_bindir}/scorched3d
%{_bindir}/scorched3dc
%{_bindir}/scorched3ds
%{_datadir}/applications/%{name}.desktop
%{_datadir}/appdata/%{name}.appdata.xml
%{_datadir}/pixmaps/scorched3d.png
%dir %{scordir}
%dir %{scordir}/data
%{scordir}/data/*
%doc %{scordir}/documentation/*.txt
%doc scorched/COPYING scorched/AUTHORS
%changelog
* Sun Jun 06 2021 Automatic Build System <autodist@mambasoft.it> 44-1mamba
- automatic update by autodist
* Mon May 13 2013 Automatic Build System <autodist@mambasoft.it> 43.3d-1mamba
- update to 43.3d
* Mon Jul 13 2009 Automatic Build System <autodist@mambasoft.it> 42.1-1mamba
- automatic update by autodist
* Mon Apr 20 2009 Automatic Build System <autodist@mambasoft.it> 41.3-2mamba
- automatic rebuild by autodist
* Sun May 18 2008 gil <puntogil@libero.it> src-1mamba
- package created by autospec