the-powder-toy: update to 94.1

This commit is contained in:
Leonid Pliushch 2019-05-19 20:52:39 +03:00 committed by Yaksh Bariya
parent f873412d05
commit 9194e56c12
No known key found for this signature in database
GPG Key ID: F7486BA7D3D27581
13 changed files with 195 additions and 181 deletions

View File

@ -1,7 +1,7 @@
diff -uNr The-Powder-Toy-93.3/SConscript The-Powder-Toy-93.3.mod/SConscript
--- The-Powder-Toy-93.3/SConscript 2018-06-15 13:35:44.616286939 +0300
+++ The-Powder-Toy-93.3.mod/SConscript 2018-06-15 13:55:39.922920452 +0300
@@ -137,7 +137,7 @@
diff -uNr The-Powder-Toy-94.1/SConscript The-Powder-Toy-94.1.mod/SConscript
--- The-Powder-Toy-94.1/SConscript 2019-02-21 07:23:45.000000000 +0200
+++ The-Powder-Toy-94.1.mod/SConscript 2019-05-19 18:34:00.558771379 +0300
@@ -138,7 +138,7 @@
for var in ["CC","CXX","LD","LIBPATH","STRIP"]:
if var in os.environ:
env[var] = os.environ[var]
@ -10,7 +10,7 @@ diff -uNr The-Powder-Toy-93.3/SConscript The-Powder-Toy-93.3.mod/SConscript
# variables containing several space separated things
for var in ["CFLAGS","CCFLAGS","CXXFLAGS","LINKFLAGS","CPPDEFINES","CPPPATH"]:
if var in os.environ:
@@ -145,7 +145,7 @@
@@ -146,7 +146,7 @@
env[var] += SCons.Util.CLVar(os.environ[var])
else:
env[var] = SCons.Util.CLVar(os.environ[var])
@ -19,7 +19,7 @@ diff -uNr The-Powder-Toy-93.3/SConscript The-Powder-Toy-93.3.mod/SConscript
#Used for intro text / executable name, actual bit flags are only set if the --64bit/--32bit command line args are given
def add32bitflags(env):
@@ -158,12 +158,8 @@
@@ -159,12 +159,8 @@
env["BIT"] = 64
#add 32/64 bit defines before configuration
if GetOption('64bit'):
@ -33,26 +33,26 @@ diff -uNr The-Powder-Toy-93.3/SConscript The-Powder-Toy-93.3.mod/SConscript
if GetOption('universal'):
@@ -246,16 +242,14 @@
runSdlConfig = platform == "Linux" or compilePlatform == "Linux" or platform == "FreeBSD"
if platform == "Darwin" and conf.CheckFramework("SDL"):
runSdlConfig = False
- elif not conf.CheckLib("SDL"):
- FatalError("SDL development library not found or not installed")
runSdlConfig = platform == "Linux" or compilePlatform == "Linux" or platform == "FreeBSD"
#if platform == "Darwin" and conf.CheckFramework("SDL"):
# runSdlConfig = False
- if not conf.CheckLib("SDL2"):
- FatalError("SDL2 development library not found or not installed")
if runSdlConfig:
try:
- env.ParseConfig('sdl-config --cflags')
+ env.ParseConfig('bash /data/data/com.termux/files/usr/bin/sdl-config --cflags')
if GetOption('static'):
- env.ParseConfig('sdl-config --static-libs')
+ env.ParseConfig('bash /data/data/com.termux/files/usr/bin/sdl-config --static-libs')
else:
- env.ParseConfig('sdl-config --libs')
+ env.ParseConfig('bash /data/data/com.termux/files/usr/bin/sdl-config --libs')
except:
pass
if runSdlConfig:
try:
- env.ParseConfig('sdl2-config --cflags')
+ env.ParseConfig('bash @TERMUX_PREFIX@/bin/sdl2-config --cflags')
if GetOption('static'):
- env.ParseConfig('sdl2-config --static-libs')
+ env.ParseConfig('bash @TERMUX_PREFIX@/bin/sdl2-config --static-libs')
else:
- env.ParseConfig('sdl2-config --libs')
+ env.ParseConfig('bash @TERMUX_PREFIX@/bin/sdl2-config --libs')
except:
pass
@@ -333,10 +327,6 @@
@@ -332,10 +326,6 @@
if not conf.CheckLib(['z', 'zlib']):
FatalError("libz not found or not installed")
@ -63,7 +63,7 @@ diff -uNr The-Powder-Toy-93.3/SConscript The-Powder-Toy-93.3.mod/SConscript
if msvc:
if not conf.CheckHeader('dirent.h') or not conf.CheckHeader('fftw3.h') or not conf.CheckHeader('pthread.h') or not conf.CheckHeader('zlib.h'):
FatalError("Required headers not found")
@@ -367,9 +357,6 @@
@@ -366,9 +356,6 @@
if platform == "Linux" or platform == "FreeBSD":
if not conf.CheckLib('X11'):
FatalError("X11 development library not found or not installed")
@ -73,7 +73,7 @@ diff -uNr The-Powder-Toy-93.3/SConscript The-Powder-Toy-93.3.mod/SConscript
elif platform == "Windows":
#These need to go last
if not conf.CheckLib('gdi32') or not conf.CheckLib('winmm') or (not msvc and not conf.CheckLib('dxguid')):
@@ -429,8 +416,6 @@
@@ -428,8 +415,6 @@
#Add architecture flags and defines
@ -82,7 +82,7 @@ diff -uNr The-Powder-Toy-93.3/SConscript The-Powder-Toy-93.3.mod/SConscript
if not GetOption('no-sse'):
if GetOption('sse'):
if msvc:
@@ -475,7 +460,7 @@
@@ -474,7 +459,7 @@
else:
env.Append(CCFLAGS=['/MD'])
else:

View File

@ -0,0 +1,14 @@
diff -uNr The-Powder-Toy-94.1/src/gui/game/GameView.cpp The-Powder-Toy-94.1.mod/src/gui/game/GameView.cpp
--- The-Powder-Toy-94.1/src/gui/game/GameView.cpp 2019-02-21 07:23:45.000000000 +0200
+++ The-Powder-Toy-94.1.mod/src/gui/game/GameView.cpp 2019-05-19 20:37:48.967690493 +0300
@@ -1628,9 +1628,7 @@
c->AdjustBrushSize(-1, !alt, shiftBehaviour, ctrlBehaviour);
break;
case SDL_SCANCODE_I:
- if(ctrl)
- c->Install();
- else
+ if(!ctrl)
c->InvertAirSim();
break;
case SDL_SCANCODE_SEMICOLON:

View File

@ -0,0 +1,151 @@
diff -uNr The-Powder-Toy-94.1/src/client/Client.cpp The-Powder-Toy-94.1.mod/src/client/Client.cpp
--- The-Powder-Toy-94.1/src/client/Client.cpp 2019-02-21 07:23:45.000000000 +0200
+++ The-Powder-Toy-94.1.mod/src/client/Client.cpp 2019-05-19 20:47:52.166319755 +0300
@@ -71,7 +71,8 @@
{
//Read config
std::ifstream configFile;
- configFile.open("powder.pref", std::ios::binary);
+ MakeDirectory("@TERMUX_HOME@/.powdertoy");
+ configFile.open("@TERMUX_HOME@/.powdertoy/powder.pref", std::ios::binary);
if (configFile)
{
try
@@ -909,7 +910,8 @@
void Client::WritePrefs()
{
std::ofstream configFile;
- configFile.open("powder.pref", std::ios::trunc);
+ MakeDirectory("@TERMUX_HOME@/.powdertoy");
+ configFile.open("@TERMUX_HOME@/.powdertoy/powder.pref", std::ios::trunc);
if (configFile)
{
@@ -1102,6 +1104,7 @@
ByteString saveID = ByteString::Build(Format::Hex(Format::Width(lastStampTime, 8)), Format::Hex(Format::Width(lastStampName, 2)));
ByteString filename = STAMPS_DIR PATH_SEP + saveID + ".stm";
+ MakeDirectory("@TERMUX_HOME@/.powdertoy");
MakeDirectory(STAMPS_DIR);
Json::Value stampInfo;
@@ -1137,6 +1140,7 @@
void Client::updateStamps()
{
+ MakeDirectory("@TERMUX_HOME@/.powdertoy");
MakeDirectory(STAMPS_DIR);
std::ofstream stampsStream;
@@ -1527,7 +1531,7 @@
if(authUser.UserID)
{
ByteString userID = ByteString::Build(authUser.UserID);
-
+
data = http_auth_get(url.c_str(), userID.c_str(), NULL, authUser.SessionID.c_str(), &dataStatus, &dataLength);
}
else
@@ -1549,7 +1553,7 @@
if (authUser.UserID)
{
ByteString userID = ByteString::Build(authUser.UserID);
-
+
const char *const postNames[] = { "ActionPublish", NULL };
const char *const postDatas[] = { "" };
size_t postLengths[] = { 1 };
@@ -1578,7 +1582,7 @@
if(authUser.UserID)
{
ByteString userID = ByteString::Build(authUser.UserID);
-
+
data = http_auth_get(urlStream.Build().c_str(), userID.c_str(), NULL, authUser.SessionID.c_str(), &dataStatus, &dataLength);
}
else
diff -uNr The-Powder-Toy-94.1/src/Config.h The-Powder-Toy-94.1.mod/src/Config.h
--- The-Powder-Toy-94.1/src/Config.h 2019-02-21 07:23:45.000000000 +0200
+++ The-Powder-Toy-94.1.mod/src/Config.h 2019-05-19 20:40:10.040532978 +0300
@@ -61,11 +61,7 @@
#define IDENT_PLATFORM "WIN32"
#endif
#elif defined(LIN)
-#if defined(_64BIT)
-#define IDENT_PLATFORM "LIN64"
-#else
-#define IDENT_PLATFORM "LIN32"
-#endif
+#define IDENT_PLATFORM "TERMUX"
#elif defined(MACOSX)
#define IDENT_PLATFORM "MACOSX"
#else
@@ -88,11 +84,11 @@
#define SERVER "powdertoy.co.uk"
#define STATICSERVER "static.powdertoy.co.uk"
-#define LOCAL_SAVE_DIR "Saves"
+#define LOCAL_SAVE_DIR "@TERMUX_HOME@/.powdertoy/saves"
-#define STAMPS_DIR "stamps"
+#define STAMPS_DIR "@TERMUX_HOME@/.powdertoy/stamps"
-#define BRUSH_DIR "Brushes"
+#define BRUSH_DIR "@TERMUX_HOME@/.powdertoy/brushes"
//Number of unique thumbnails to have in cache at one time
#define THUMB_CACHE_SIZE 256
diff -uNr The-Powder-Toy-94.1/src/gui/game/GameController.cpp The-Powder-Toy-94.1.mod/src/gui/game/GameController.cpp
--- The-Powder-Toy-94.1/src/gui/game/GameController.cpp 2019-02-21 07:23:45.000000000 +0200
+++ The-Powder-Toy-94.1.mod/src/gui/game/GameController.cpp 2019-05-19 20:40:39.801711358 +0300
@@ -850,7 +850,7 @@
#if !defined(MACOSX) && !defined(NO_INSTALL_CHECK)
if (Client::Ref().IsFirstRun())
{
- Install();
+ //Install();
}
#endif
firstTick = false;
@@ -1265,6 +1265,7 @@
gameSave->authors = localSaveInfo;
gameModel->SetSaveFile(&tempSave);
+ Client::Ref().MakeDirectory("@TERMUX_HOME@/.powdertoy");
Client::Ref().MakeDirectory(LOCAL_SAVE_DIR);
std::vector<char> saveData = gameSave->Serialise();
if (saveData.size() == 0)
diff -uNr The-Powder-Toy-94.1/src/gui/game/GameModel.cpp The-Powder-Toy-94.1.mod/src/gui/game/GameModel.cpp
--- The-Powder-Toy-94.1/src/gui/game/GameModel.cpp 2019-02-21 07:23:45.000000000 +0200
+++ The-Powder-Toy-94.1.mod/src/gui/game/GameModel.cpp 2019-05-19 20:49:54.675892548 +0300
@@ -105,6 +105,7 @@
brushList.push_back(new TriangleBrush(ui::Point(4, 4)));
//Load more from brushes folder
+ Client::Ref().MakeDirectory("@TERMUX_HOME@/.powdertoy");
std::vector<ByteString> brushFiles = Client::Ref().DirectorySearch(BRUSH_DIR, "", ".ptb");
for (size_t i = 0; i < brushFiles.size(); i++)
{
diff -uNr The-Powder-Toy-94.1/src/gui/options/OptionsView.cpp The-Powder-Toy-94.1.mod/src/gui/options/OptionsView.cpp
--- The-Powder-Toy-94.1/src/gui/options/OptionsView.cpp 2019-02-21 07:23:45.000000000 +0200
+++ The-Powder-Toy-94.1.mod/src/gui/options/OptionsView.cpp 2019-05-19 20:41:09.689890689 +0300
@@ -292,7 +292,7 @@
const char* openCommand = "xdg-open ";
#endif
char* workingDirectory = new char[FILENAME_MAX+strlen(openCommand)];
- sprintf(workingDirectory, "%s\"%s\"", openCommand, getcwd(NULL, 0));
+ sprintf(workingDirectory, "%s\"%s\"", openCommand, "@TERMUX_HOME@/.powdertoy");
system(workingDirectory);
delete[] workingDirectory;
}
diff -uNr The-Powder-Toy-94.1/src/gui/save/LocalSaveActivity.cpp The-Powder-Toy-94.1.mod/src/gui/save/LocalSaveActivity.cpp
--- The-Powder-Toy-94.1/src/gui/save/LocalSaveActivity.cpp 2019-02-21 07:23:45.000000000 +0200
+++ The-Powder-Toy-94.1.mod/src/gui/save/LocalSaveActivity.cpp 2019-05-19 20:41:28.202001848 +0300
@@ -116,6 +116,7 @@
void LocalSaveActivity::saveWrite(ByteString finalFilename)
{
+ Client::Ref().MakeDirectory("@TERMUX_HOME@/.powdertoy");
Client::Ref().MakeDirectory(LOCAL_SAVE_DIR);
GameSave *gameSave = save.GetGameSave();
Json::Value localSaveInfo;

View File

@ -1,12 +0,0 @@
diff -uNr The-Powder-Toy-93.3/data/IntroText.h The-Powder-Toy-93.3.mod/data/IntroText.h
--- The-Powder-Toy-93.3/data/IntroText.h 2018-04-02 00:19:03.000000000 +0300
+++ The-Powder-Toy-93.3.mod/data/IntroText.h 2018-06-15 13:55:36.196253889 +0300
@@ -28,6 +28,8 @@
"\brThis is a BETA, you cannot save things publicly. If you are planning on publishing any saves, use the release version\n"
#endif
"\n"
+ "\brWarning: this is an experimental build and it may contain bugs.\n"
+ "\n"
"\bt" MTOS(SAVE_VERSION) "." MTOS(MINOR_VERSION) "." MTOS(BUILD_NUM) " " IDENT_PLATFORM " "
#ifdef SNAPSHOT
"SNAPSHOT " MTOS(SNAPSHOT_ID) " "

View File

@ -1,31 +0,0 @@
diff -uNr The-Powder-Toy-93.3/src/Config.h The-Powder-Toy-93.3.mod/src/Config.h
--- The-Powder-Toy-93.3/src/Config.h 2018-04-02 00:19:03.000000000 +0300
+++ The-Powder-Toy-93.3.mod/src/Config.h 2018-06-15 13:55:36.206253889 +0300
@@ -61,11 +61,7 @@
#define IDENT_PLATFORM "WIN32"
#endif
#elif defined(LIN)
-#if defined(_64BIT)
-#define IDENT_PLATFORM "LIN64"
-#else
-#define IDENT_PLATFORM "LIN32"
-#endif
+#define IDENT_PLATFORM "TERMUX"
#elif defined(MACOSX)
#define IDENT_PLATFORM "MACOSX"
#else
@@ -88,11 +84,11 @@
#define SERVER "powdertoy.co.uk"
#define STATICSERVER "static.powdertoy.co.uk"
-#define LOCAL_SAVE_DIR "Saves"
+#define LOCAL_SAVE_DIR "/data/data/com.termux/files/home/.powdertoy/saves"
-#define STAMPS_DIR "stamps"
+#define STAMPS_DIR "/data/data/com.termux/files/home/.powdertoy/stamps"
-#define BRUSH_DIR "Brushes"
+#define BRUSH_DIR "/data/data/com.termux/files/home/.powdertoy/brushes"
//Number of unique thumbnails to have in cache at one time
#define THUMB_CACHE_SIZE 256

View File

@ -1,39 +0,0 @@
diff -uNr The-Powder-Toy-93.3/src/client/Client.cpp The-Powder-Toy-93.3.mod/src/client/Client.cpp
--- The-Powder-Toy-93.3/src/client/Client.cpp 2018-04-02 00:19:03.000000000 +0300
+++ The-Powder-Toy-93.3.mod/src/client/Client.cpp 2018-06-15 13:55:36.199587222 +0300
@@ -84,7 +84,8 @@
//Read config
std::ifstream configFile;
- configFile.open("powder.pref", std::ios::binary);
+ MakeDirectory("/data/data/com.termux/files/home/.powdertoy");
+ configFile.open("/data/data/com.termux/files/home/.powdertoy/powder.pref", std::ios::binary);
if (configFile)
{
try
@@ -941,7 +942,8 @@
void Client::WritePrefs()
{
std::ofstream configFile;
- configFile.open("powder.pref", std::ios::trunc);
+ MakeDirectory("/data/data/com.termux/files/home/.powdertoy");
+ configFile.open("/data/data/com.termux/files/home/.powdertoy/powder.pref", std::ios::trunc);
if (configFile)
{
@@ -1144,6 +1146,7 @@
<< std::setw(2) << std::setfill('0') << std::hex << lastStampName;
std::string filename = std::string(STAMPS_DIR PATH_SEP + saveID.str()+".stm").c_str();
+ MakeDirectory("/data/data/com.termux/files/home/.powdertoy");
MakeDirectory(STAMPS_DIR);
Json::Value stampInfo;
@@ -1179,6 +1182,7 @@
void Client::updateStamps()
{
+ MakeDirectory("/data/data/com.termux/files/home/.powdertoy");
MakeDirectory(STAMPS_DIR);
std::ofstream stampsStream;

View File

@ -1,20 +0,0 @@
diff -uNr The-Powder-Toy-93.3/src/gui/game/GameController.cpp The-Powder-Toy-93.3.mod/src/gui/game/GameController.cpp
--- The-Powder-Toy-93.3/src/gui/game/GameController.cpp 2018-04-02 00:19:03.000000000 +0300
+++ The-Powder-Toy-93.3.mod/src/gui/game/GameController.cpp 2018-06-15 13:55:36.206253889 +0300
@@ -843,7 +843,7 @@
#if !defined(MACOSX) && !defined(NO_INSTALL_CHECK)
if (Client::Ref().IsFirstRun())
{
- Install();
+ //Install();
}
#endif
firstTick = false;
@@ -1253,6 +1253,7 @@
gameSave->authors = localSaveInfo;
gameModel->SetSaveFile(&tempSave);
+ Client::Ref().MakeDirectory("/data/data/com.termux/files/home/.powdertoy");
Client::Ref().MakeDirectory(LOCAL_SAVE_DIR);
std::vector<char> saveData = gameSave->Serialise();
if (saveData.size() == 0)

View File

@ -1,11 +0,0 @@
diff -uNr The-Powder-Toy-93.3/src/gui/game/GameModel.cpp The-Powder-Toy-93.3.mod/src/gui/game/GameModel.cpp
--- The-Powder-Toy-93.3/src/gui/game/GameModel.cpp 2018-04-02 00:19:03.000000000 +0300
+++ The-Powder-Toy-93.3.mod/src/gui/game/GameModel.cpp 2018-06-15 13:55:36.209587222 +0300
@@ -105,6 +105,7 @@
brushList.push_back(new TriangleBrush(ui::Point(4, 4)));
//Load more from brushes folder
+ Client::Ref().MakeDirectory("/data/data/com.termux/files/home/.powdertoy");
std::vector<string> brushFiles = Client::Ref().DirectorySearch(BRUSH_DIR, "", ".ptb");
for (size_t i = 0; i < brushFiles.size(); i++)
{

View File

@ -1,14 +0,0 @@
diff -uNr The-Powder-Toy-93.3/src/gui/game/GameView.cpp The-Powder-Toy-93.3.mod/src/gui/game/GameView.cpp
--- The-Powder-Toy-93.3/src/gui/game/GameView.cpp 2018-04-02 00:19:03.000000000 +0300
+++ The-Powder-Toy-93.3.mod/src/gui/game/GameView.cpp 2018-06-15 13:55:36.212920556 +0300
@@ -1636,9 +1636,7 @@
c->AdjustBrushSize(-1, !alt, shiftBehaviour, ctrlBehaviour);
break;
case 'i':
- if(ctrl)
- c->Install();
- else
+ if(!ctrl)
c->InvertAirSim();
break;
case ';':

View File

@ -1,12 +0,0 @@
diff -uNr The-Powder-Toy-93.3/src/gui/options/OptionsView.cpp The-Powder-Toy-93.3.mod/src/gui/options/OptionsView.cpp
--- The-Powder-Toy-93.3/src/gui/options/OptionsView.cpp 2018-04-02 00:19:03.000000000 +0300
+++ The-Powder-Toy-93.3.mod/src/gui/options/OptionsView.cpp 2018-06-15 13:55:36.216253888 +0300
@@ -260,7 +260,7 @@
const char* openCommand = "xdg-open ";
#endif
char* workingDirectory = new char[FILENAME_MAX+strlen(openCommand)];
- sprintf(workingDirectory, "%s\"%s\"", openCommand, getcwd(NULL, 0));
+ sprintf(workingDirectory, "%s\"%s\"", openCommand, "/data/data/com.termux/files/home/.powdertoy");
system(workingDirectory);
delete[] workingDirectory;
}

View File

@ -1,11 +0,0 @@
diff -uNr The-Powder-Toy-93.3/src/gui/save/LocalSaveActivity.cpp The-Powder-Toy-93.3.mod/src/gui/save/LocalSaveActivity.cpp
--- The-Powder-Toy-93.3/src/gui/save/LocalSaveActivity.cpp 2018-04-02 00:19:03.000000000 +0300
+++ The-Powder-Toy-93.3.mod/src/gui/save/LocalSaveActivity.cpp 2018-06-15 13:55:36.216253888 +0300
@@ -109,6 +109,7 @@
void LocalSaveActivity::saveWrite(std::string finalFilename)
{
+ Client::Ref().MakeDirectory("/data/data/com.termux/files/home/.powdertoy");
Client::Ref().MakeDirectory(LOCAL_SAVE_DIR);
GameSave *gameSave = save.GetGameSave();
Json::Value localSaveInfo;

View File

@ -2,11 +2,10 @@ TERMUX_PKG_HOMEPAGE=https://powdertoy.co.uk/
TERMUX_PKG_DESCRIPTION="The Powder Toy is a free physics sandbox game"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com>"
TERMUX_PKG_VERSION=93.3
TERMUX_PKG_REVISION=8
TERMUX_PKG_VERSION=94.1
TERMUX_PKG_SRCURL=https://github.com/ThePowderToy/The-Powder-Toy/archive/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=6c5f5914e4ae0ac8500c7203ec69517a2fd4380dece6b33247ed719aa12e074e
TERMUX_PKG_DEPENDS="fftw, libbz2, libc++, liblua52, sdl, libx11, zlib"
TERMUX_PKG_SHA256=9770c0732c97e4e89a1e53330c969e9675595f78e6673c519c3724d6df591e72
TERMUX_PKG_DEPENDS="fftw, libbz2, libc++, liblua52, sdl2, libx11, zlib"
TERMUX_PKG_FOLDERNAME=The-Powder-Toy-${TERMUX_PKG_VERSION}
TERMUX_PKG_BUILD_IN_SRC=true