--- a/QTfrontend/CocoaInitializer.mm Sun Nov 18 23:10:26 2012 +0400
+++ b/QTfrontend/CocoaInitializer.mm Mon Nov 19 10:38:02 2012 +0400
@@ -33,8 +33,8 @@
CocoaInitializer::CocoaInitializer()
{
c = new CocoaInitializer::Private();
+ c->pool = [[NSAutoreleasePool alloc] init];
NSApplicationLoad();
- c->pool = [[NSAutoreleasePool alloc] init];
}
CocoaInitializer::~CocoaInitializer()
--- a/QTfrontend/M3Panel.h Sun Nov 18 23:10:26 2012 +0400
+++ b/QTfrontend/M3Panel.h Mon Nov 19 10:38:02 2012 +0400
@@ -31,7 +31,7 @@
private:
class Private;
- Private* c;
+ Private* m;
};
#endif
--- a/QTfrontend/M3Panel.mm Sun Nov 18 23:10:26 2012 +0400
+++ b/QTfrontend/M3Panel.mm Mon Nov 19 10:38:02 2012 +0400
@@ -29,19 +29,19 @@
M3Panel::M3Panel(void)
{
- c = new Private;
+ m = new M3Panel::Private();
- c->install = [[M3InstallController alloc] init];
- [c->install retain];
+ m->install = [[M3InstallController alloc] init];
+ [m->install retain];
}
M3Panel::~M3Panel()
{
- [c->install release];
- delete c;
+ [m->install release];
+ delete m;
}
void M3Panel::showInstallController()
{
- [c->install displayInstaller];
+ [m->install displayInstaller];
}
--- a/QTfrontend/SparkleAutoUpdater.mm Sun Nov 18 23:10:26 2012 +0400
+++ b/QTfrontend/SparkleAutoUpdater.mm Mon Nov 19 10:38:02 2012 +0400
@@ -31,7 +31,7 @@
SparkleAutoUpdater::SparkleAutoUpdater()
{
- d = new Private;
+ d = new SparkleAutoUpdater::Private();
d->updater = [SUUpdater sharedUpdater];
[d->updater retain];
--- a/QTfrontend/util/LibavInteraction.cpp Sun Nov 18 23:10:26 2012 +0400
+++ b/QTfrontend/util/LibavInteraction.cpp Mon Nov 19 10:38:02 2012 +0400
@@ -70,7 +70,7 @@
// get list of all codecs
AVCodec* pCodec = NULL;
- while (pCodec = av_codec_next(pCodec))
+ while ((pCodec = av_codec_next(pCodec)))
{
#if LIBAVCODEC_VERSION_MAJOR >= 54
if (!av_codec_is_encoder(pCodec))
@@ -162,7 +162,7 @@
// get list of all formats
AVOutputFormat* pFormat = NULL;
- while (pFormat = av_oformat_next(pFormat))
+ while ((pFormat = av_oformat_next(pFormat)))
{
if (!pFormat->extensions)
continue;
@@ -270,7 +270,7 @@
QByteArray utf8path = filepath.toUtf8();
if (avformat_open_input(&pContext, utf8path.data(), NULL, NULL) < 0)
return "";
-#if LIBAVFORMAT_VERSION_MAJOR < 54
+#if LIBAVFORMAT_VERSION_MAJOR < 53
if (av_find_stream_info(pContext) < 0)
#else
if (avformat_find_stream_info(pContext, NULL) < 0)
@@ -308,7 +308,7 @@
AVDictionaryEntry* pComment = av_dict_get(pContext->metadata, "comment", NULL, 0);
if (pComment)
desc += QString("\n") + pComment->value;
-#if LIBAVFORMAT_VERSION_MAJOR < 54
+#if LIBAVFORMAT_VERSION_MAJOR < 53
av_close_input_file(pContext);
#else
avformat_close_input(&pContext);
--- a/hedgewars/CMakeLists.txt Sun Nov 18 23:10:26 2012 +0400
+++ b/hedgewars/CMakeLists.txt Mon Nov 19 10:38:02 2012 +0400
@@ -100,8 +100,6 @@
endif (APPLE)
endif(BUILD_ENGINE_LIBRARY)
-# doesn't work for some reason (doesn't find symbols)
-#set(pascal_flags "-k${LIBRARY_OUTPUT_PATH}/libphysfs.a" ${pascal_flags})
IF(FPC)
set(fpc_executable ${FPC})
--- a/hedgewars/avwrapper.c Sun Nov 18 23:10:26 2012 +0400
+++ b/hedgewars/avwrapper.c Mon Nov 19 10:38:02 2012 +0400
@@ -22,6 +22,7 @@
#include <string.h>
#include <stdarg.h>
#include "libavformat/avformat.h"
+#include "libavutil/mathematics.h"
#ifndef AVIO_FLAG_WRITE
#define AVIO_FLAG_WRITE AVIO_WRONLY
@@ -47,13 +48,6 @@
static int16_t* g_pSamples;
static int g_NumSamples;
-/*
-Initially I wrote code for latest ffmpeg, but on Linux (Ubuntu)
-only older version is available from repository. That's why you see here
-all of this #if LIBAVCODEC_VERSION_MAJOR < 54.
-Actually, it may be possible to remove code for newer version
-and use only code for older version.
-*/
#if LIBAVCODEC_VERSION_MAJOR < 54
#define OUTBUFFER_SIZE 200000
@@ -65,7 +59,7 @@
static void FatalError(const char* pFmt, ...)
{
- const char Buffer[1024];
+ char Buffer[1024];
va_list VaArgs;
va_start(VaArgs, pFmt);
@@ -83,7 +77,7 @@
// (there is mutex in AddFileLogRaw).
static void LogCallback(void* p, int Level, const char* pFmt, va_list VaArgs)
{
- const char Buffer[1024];
+ char Buffer[1024];
vsnprintf(Buffer, 1024, pFmt, VaArgs);
AddFileLogRaw(Buffer);
@@ -91,7 +85,7 @@
static void Log(const char* pFmt, ...)
{
- const char Buffer[1024];
+ char Buffer[1024];
va_list VaArgs;
va_start(VaArgs, pFmt);
@@ -103,7 +97,7 @@
static void AddAudioStream()
{
-#if LIBAVFORMAT_VERSION_MAJOR >= 54
+#if LIBAVFORMAT_VERSION_MAJOR >= 53
g_pAStream = avformat_new_stream(g_pContainer, g_pACodec);
#else
g_pAStream = av_new_stream(g_pContainer, 1);
@@ -175,7 +169,7 @@
int NumSamples = fread(g_pSamples, 2*g_Channels, g_NumSamples, g_pSoundFile);
-#if LIBAVCODEC_VERSION_MAJOR >= 54
+#if LIBAVCODEC_VERSION_MAJOR >= 53
AVFrame* pFrame = NULL;
if (NumSamples > 0)
{
@@ -215,7 +209,7 @@
// add a video output stream
static void AddVideoStream()
{
-#if LIBAVFORMAT_VERSION_MAJOR >= 54
+#if LIBAVFORMAT_VERSION_MAJOR >= 53
g_pVStream = avformat_new_stream(g_pContainer, g_pVCodec);
#else
g_pVStream = av_new_stream(g_pContainer, 0);
@@ -254,7 +248,7 @@
if (g_pFormat->flags & AVFMT_GLOBALHEADER)
g_pVideo->flags |= CODEC_FLAG_GLOBAL_HEADER;
-#if LIBAVCODEC_VERSION_MAJOR < 54
+#if LIBAVCODEC_VERSION_MAJOR < 53
// for some versions of ffmpeg x264 options must be set explicitly
if (strcmp(g_pVCodec->name, "libx264") == 0)
{
--- a/hedgewars/uPhysFSLayer.pas Sun Nov 18 23:10:26 2012 +0400
+++ b/hedgewars/uPhysFSLayer.pas Mon Nov 19 10:38:02 2012 +0400
@@ -1,7 +1,15 @@
unit uPhysFSLayer;
+{$IFDEF ANDROID}
+ {$linklib physfs}
+ {$linklib physfsrwops}
+{$ELSE}
+ {$LINKLIB ../bin/libphysfs.a}
+ {$LINKLIB ../bin/libphysfsrwops.a}
+{$ENDIF}
-{$LINKLIB ../bin/libphysfs.a}
-{$LINKLIB ../bin/libphysfsrwops.a}
+{$IFDEF DARWIN}
+ {$LINKFRAMEWORK IOKit}
+{$ENDIF}
interface
uses SDLh;
--- a/hedgewars/uScript.pas Sun Nov 18 23:10:26 2012 +0400
+++ b/hedgewars/uScript.pas Mon Nov 19 10:38:02 2012 +0400
@@ -1980,7 +1980,7 @@
// custom script loader via physfs, passed to lua_load
const BUFSIZE = 1024;
-var physfsReaderBuffer: pointer; external;
+var physfsReaderBuffer: pointer; cvar; external;
function physfsReader(L: Plua_State; f: PFSFile; sz: Psize_t) : PChar; cdecl; external;
--- a/misc/Android.mk Sun Nov 18 23:10:26 2012 +0400
+++ b/misc/Android.mk Mon Nov 19 10:38:02 2012 +0400
@@ -4,3 +4,4 @@
include $(MISC_DIR)/libfreetype/Android.mk
include $(MISC_DIR)/liblua/Android.mk
include $(MISC_DIR)/libtremor/Android.mk
+include $(MISC_DIR)/physfs/Android.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/physfs/Android.mk Mon Nov 19 10:38:02 2012 +0400
@@ -0,0 +1,1 @@
+include $(call all-subdir-makefiles)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/physfs/extras/Android.mk Mon Nov 19 10:38:02 2012 +0400
@@ -0,0 +1,17 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := physfsrwops
+
+LOCAL_CFLAGS := -O2 -DPHYSFS_NO_CDROM_SUPPORT
+
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../liblua $(LOCAL_PATH)/../src $(LOCAL_PATH)/../../../project_files/Android-build/SDL-android-project/jni/SDL/include
+
+LOCAL_SRC_FILES := hwpacksmounter.c \
+ physfslualoader.c \
+ physfsrwops.c
+
+LOCAL_SHARED_LIBRARIES := SDL physfs
+
+include $(BUILD_SHARED_LIBRARY)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/physfs/src/Android.mk Mon Nov 19 10:38:02 2012 +0400
@@ -0,0 +1,27 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := physfs
+
+LOCAL_CFLAGS := -O2 -DPHYSFS_NO_CDROM_SUPPORT
+
+LOCAL_C_INCLUDES := $(LOCAL_PATH)
+
+LOCAL_SRC_FILES := physfs.c \
+ physfs_byteorder.c \
+ physfs_unicode.c \
+ platform_posix.c \
+ platform_unix.c \
+ platform_macosx.c \
+ platform_windows.c \
+ archiver_dir.c \
+ archiver_grp.c \
+ archiver_hog.c \
+ archiver_lzma.c \
+ archiver_mvl.c \
+ archiver_qpak.c \
+ archiver_wad.c \
+ archiver_zip.c \
+
+include $(BUILD_SHARED_LIBRARY)
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/PascalExports.java Sun Nov 18 23:10:26 2012 +0400
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/PascalExports.java Mon Nov 19 10:38:02 2012 +0400
@@ -31,6 +31,8 @@
System.loadLibrary("SDL_mixer");
System.loadLibrary("SDL_ttf");
System.loadLibrary("lua5.1");
+ System.loadLibrary("physfs");
+ System.loadLibrary("physfsrwops");
System.loadLibrary("hwengine");
}
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/frontlib/Flib.java Sun Nov 18 23:10:26 2012 +0400
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/frontlib/Flib.java Mon Nov 19 10:38:02 2012 +0400
@@ -28,6 +28,7 @@
public class Flib {
static {
+ System.loadLibrary("SDL");
System.loadLibrary("SDL_net");
System.setProperty("jna.encoding", "UTF8"); // Ugly global setting, but it seems JNA doesn't allow setting this per-library...
}
@@ -58,4 +59,4 @@
INSTANCE.flib_log_setLevel(Frontlib.FLIB_LOGLEVEL_INFO);
INSTANCE.flib_log_setCallback(logCb);
}
-}
\ No newline at end of file
+}
--- a/project_files/frontlib/hwconsts.h Sun Nov 18 23:10:26 2012 +0400
+++ b/project_files/frontlib/hwconsts.h Mon Nov 19 10:38:02 2012 +0400
@@ -44,7 +44,7 @@
// Used for sending scripts to the engine
#define MULTIPLAYER_SCRIPT_PATH "Scripts/Multiplayer/"
-#define WEAPONS_COUNT 55
+#define WEAPONS_COUNT 56
// TODO allow frontend to override these?
/* A merge of mikade/bugq colours w/ a bit of channel feedback */