summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorNascher2015-07-29 14:22:53 +0000
committerNascher2015-07-29 14:22:53 +0000
commit84f4da09cc0443e11220dadd2e0e0c8ba43ed70e (patch)
tree996dc4a1a4789a98567d99475b4389715da5e6e6
parent3218ee01c472bfba743f47284f9c1ec6552e570a (diff)
downloadaur-84f4da09cc0443e11220dadd2e0e0c8ba43ed70e.tar.gz
Update to 1507 with some patches
-rwxr-xr-x.AURINFO4
-rwxr-xr-x.SRCINFO6
-rw-r--r--.directory6
-rwxr-xr-xPKGBUILD19
-rw-r--r--cmakepatch.patch28
-rw-r--r--utilitypatch.patch230
6 files changed, 281 insertions, 12 deletions
diff --git a/.AURINFO b/.AURINFO
index 11233e2d2112..a5f1c9434217 100755
--- a/.AURINFO
+++ b/.AURINFO
@@ -1,6 +1,6 @@
pkgbase = voxelands
pkgdesc = A fork of Minetest, an Infiniminer/Minecraft inspired game
- pkgver = 1506.00
+ pkgver = 1507.00
pkgrel = 1
url = http://voxelands.com
install = voxelands.install
@@ -25,7 +25,7 @@ pkgbase = voxelands
conflicts = voxelands-next-git
replaces = minetest-classic
source =
-http://voxelands.com/downloads/voxelands-1506.00-src.tar.bz2
+http://voxelands.com/downloads/voxelands-1507.00-src.tar.bz2
pkgname = voxelands
diff --git a/.SRCINFO b/.SRCINFO
index 1d672b4d7c26..4d47a08f6da7 100755
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = voxelands
pkgdesc = A fork of Minetest, an Infiniminer/Minecraft inspired game
- pkgver = 1506.00
+ pkgver = 1507.00
pkgrel = 1
url = http://voxelands.com
install = voxelands.install
@@ -25,7 +25,11 @@ pkgbase = voxelands
conflicts = voxelands-next-git
replaces = minetest-classic
source = http://voxelands.com/downloads/voxelands-1507.00-src.tar.bz2
+ source = cmakepatch.patch
+ source = utilitypatch.patch
sha256sums = de0052401bb98f41b41bd4b8a0f3ea71e2469d3de2175edde93f8bdd5bfc0249
+ sha256sums = 323b095473c8893ce3e30fe2c275d6e2946cc510a8b137e46dd4c717bf3cbf62
+ sha256sums = f73e79928718a2ca3136d8b6b0305202774763069c8600b211755b3608453c71
pkgname = voxelands
diff --git a/.directory b/.directory
deleted file mode 100644
index ff1352c63529..000000000000
--- a/.directory
+++ /dev/null
@@ -1,6 +0,0 @@
-[Dolphin]
-Timestamp=2015,6,8,21,52,12
-Version=3
-
-[Settings]
-HiddenFilesShown=true
diff --git a/PKGBUILD b/PKGBUILD
index 595463a3a515..b3c6ad278d3b 100755
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
# Contributor: Menche <menche_mt at yahoo dot com>
pkgname=voxelands
-pkgver=1506.00
+pkgver=1507.00
pkgrel=1
pkgdesc="A fork of Minetest, an Infiniminer/Minecraft inspired game"
url="http://voxelands.com"
@@ -15,9 +15,22 @@ provides=('minetest-classic' 'voxelands')
conflicts=('minetest-classic' 'minetest-classic-next-git' 'voxelands-next-git')
install="${pkgname}.install"
-source=("http://voxelands.com/downloads/${pkgname}-${pkgver}-src.tar.bz2")
+source=("http://voxelands.com/downloads/${pkgname}-${pkgver}-src.tar.bz2"
+ cmakepatch.patch
+ utilitypatch.patch
+ )
-sha256sums=('de0052401bb98f41b41bd4b8a0f3ea71e2469d3de2175edde93f8bdd5bfc0249')
+sha256sums=('f73e79928718a2ca3136d8b6b0305202774763069c8600b211755b3608453c71'
+ '5e91cb07b6ea049f4fdf03c2c0f4f225dd578c5b0a748e120a91c7be33cae3ad'
+ '323b095473c8893ce3e30fe2c275d6e2946cc510a8b137e46dd4c717bf3cbf62')
+
+prepare() {
+ cd "${srcdir}/${pkgname}"
+
+ echo "Patching Voxelands ..."
+ patch -p1 -i $srcdir/cmakepatch.patch
+ patch -p1 -i $srcdir/utilitypatch.patch
+}
build() {
cd "${srcdir}/${pkgname}"
diff --git a/cmakepatch.patch b/cmakepatch.patch
new file mode 100644
index 000000000000..fda9ad7eedca
--- /dev/null
+++ b/cmakepatch.patch
@@ -0,0 +1,28 @@
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 0adff9e..a674581 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -382,8 +382,8 @@ else()
+ set(OPT_FLAGS "-O2 -fomit-frame-pointer")
+ endif()
+
+- set(CMAKE_CXX_FLAGS_RELEASE "${OPT_FLAGS} ${SAFETY_FLAGS} -Wall -std=c++11 -DNDEBUG -pipe")
+- set(CMAKE_CXX_FLAGS_DEBUG "${SAFETY_FLAGS} -Wall -std=c++11 -O0 -g2 -ggdb")
++ set(CMAKE_CXX_FLAGS_RELEASE "${OPT_FLAGS} ${SAFETY_FLAGS} -Wall -DNDEBUG -pipe")
++ set(CMAKE_CXX_FLAGS_DEBUG "${SAFETY_FLAGS} -Wall -O0 -g2 -ggdb")
+ set(CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
+ set(CMAKE_C_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
+
+diff --git a/src/cmake_config.h.in b/src/cmake_config.h.in
+index 2a74e59..b0fd7fb 100644
+--- a/src/cmake_config.h.in
++++ b/src/cmake_config.h.in
+@@ -14,7 +14,7 @@
+ #else
+ #define BUILD_TYPE "Debug"
+ #endif
+-#define BUILD_INFO "VER=" VERSION_STRING " RUN_IN_PLACE=@RUN_IN_PLACE@ USE_GETTEXT=@USE_GETTEXT@ INSTALL_PREFIX=@CMAKE_INSTALL_PREFIX@ BUILD_TYPE=" BUILD_TYPE
++#define BUILD_INFO "VER="VERSION_STRING" RUN_IN_PLACE=@RUN_IN_PLACE@ USE_GETTEXT=@USE_GETTEXT@ INSTALL_PREFIX=@CMAKE_INSTALL_PREFIX@ BUILD_TYPE="BUILD_TYPE
+
+ #endif
+
diff --git a/utilitypatch.patch b/utilitypatch.patch
new file mode 100644
index 000000000000..e06b02f2de9b
--- /dev/null
+++ b/utilitypatch.patch
@@ -0,0 +1,230 @@
+diff --git a/src/tile.cpp b/src/tile.cpp
+index 4de2d00..010519c 100644
+--- a/src/tile.cpp
++++ b/src/tile.cpp
+@@ -73,17 +73,23 @@ void TextureSource::processQueue()
+ /*
+ Fetch textures
+ */
+- std::lock_guard<std::mutex> guard(m_get_texture_queue_mutex);
+- while (!m_get_texture_queue.empty())
++ if(m_get_texture_queue.size() > 0)
+ {
+- std::string name = m_get_texture_queue.front().first;
++ GetRequest<std::string, u32, u8, u8>
++ request = m_get_texture_queue.pop();
++
+ infostream<<"TextureSource::processQueue(): "
+ <<"got texture request with "
+- <<"name=\""<< name <<"\""
++ <<"name=\""<<request.key<<"\""
+ <<std::endl;
+
+- m_get_texture_queue.front().second.set_value(getTextureIdDirect(name));
+- m_get_texture_queue.pop();
++ GetResult<std::string, u32, u8, u8>
++ result;
++ result.key = request.key;
++ result.callers = request.callers;
++ result.item = getTextureIdDirect(request.key);
++
++ request.dest->push_back(result);
+ }
+ }
+
+@@ -110,21 +116,29 @@ u32 TextureSource::getTextureId(const std::string &name)
+ }else{
+ infostream<<"getTextureId(): Queued: name=\""<<name<<"\""<<std::endl;
+
+- std::future<u32> future;
+- {
+- std::lock_guard<std::mutex> guard(m_get_texture_queue_mutex);
+- // We're gonna ask the result to be put into here
+- std::promise<u32> promise;
+- future = promise.get_future();
++ // We're gonna ask the result to be put into here
++ ResultQueue<std::string, u32, u8, u8> result_queue;
+
+- // Throw a request in
+- m_get_texture_queue.push(std::make_pair(name, std::move(promise)));
+- }
++ // Throw a request in
++ m_get_texture_queue.add(name, 0, 0, &result_queue);
+
+ infostream<<"Waiting for texture from main thread, name=\""
+ <<name<<"\""<<std::endl;
+
+- return future.get();
++ try{
++ // Wait result for a second
++ GetResult<std::string, u32, u8, u8>
++ result = result_queue.pop_front(1000);
++
++ // Check that at least something worked OK
++ if (result.key != name)
++ return 0;
++
++ return result.item;
++ }catch(ItemNotFoundException &e) {
++ infostream<<"Waiting for texture timed out."<<std::endl;
++ return 0;
++ }
+ }
+
+ infostream<<"getTextureId(): Failed"<<std::endl;
+diff --git a/src/tile.h b/src/tile.h
+index 3251474..d8daaab 100644
+--- a/src/tile.h
++++ b/src/tile.h
+@@ -30,9 +30,6 @@
+ #include "threads.h"
+ #include "utility.h"
+ #include <string>
+-#include <future>
+-#include <mutex>
+-#include <queue>
+
+ using namespace jthread;
+
+@@ -261,8 +258,7 @@ private:
+ JMutex m_atlaspointer_cache_mutex;
+
+ // Queued texture fetches (to be processed by the main thread)
+- std::queue<std::pair<std::string, std::promise<u32>>> m_get_texture_queue;
+- std::mutex m_get_texture_queue_mutex;
++ RequestQueue<std::string, u32, u8, u8> m_get_texture_queue;
+ };
+
+ enum MaterialType{
+diff --git a/src/utility.h b/src/utility.h
+index f4190ec..d0cbdf6 100644
+--- a/src/utility.h
++++ b/src/utility.h
+@@ -1128,6 +1128,127 @@ protected:
+ };
+
+ /*
++ A single worker thread - multiple client threads queue framework.
++*/
++
++template<typename Caller, typename Data>
++class CallerInfo
++{
++public:
++ Caller caller;
++ Data data;
++};
++
++template<typename Key, typename T, typename Caller, typename CallerData>
++class GetResult
++{
++public:
++ Key key;
++ T item;
++ core::list<CallerInfo<Caller, CallerData> > callers;
++};
++
++template<typename Key, typename T, typename Caller, typename CallerData>
++class ResultQueue: public MutexedQueue< GetResult<Key, T, Caller, CallerData> >
++{
++};
++
++template<typename Key, typename T, typename Caller, typename CallerData>
++class GetRequest
++{
++public:
++ GetRequest()
++ {
++ dest = NULL;
++ }
++ GetRequest(ResultQueue<Key,T, Caller, CallerData> *a_dest)
++ {
++ dest = a_dest;
++ }
++ GetRequest(ResultQueue<Key,T, Caller, CallerData> *a_dest,
++ Key a_key)
++ {
++ dest = a_dest;
++ key = a_key;
++ }
++ ~GetRequest()
++ {
++ }
++
++ Key key;
++ ResultQueue<Key, T, Caller, CallerData> *dest;
++ core::list<CallerInfo<Caller, CallerData> > callers;
++};
++
++template<typename Key, typename T, typename Caller, typename CallerData>
++class RequestQueue
++{
++public:
++ u32 size()
++ {
++ return m_queue.size();
++ }
++
++ void add(Key key, Caller caller, CallerData callerdata,
++ ResultQueue<Key, T, Caller, CallerData> *dest)
++ {
++ JMutexAutoLock lock(m_queue.getMutex());
++
++ /*
++ If the caller is already on the list, only update CallerData
++ */
++ for(typename core::list< GetRequest<Key, T, Caller, CallerData> >::Iterator
++ i = m_queue.getList().begin();
++ i != m_queue.getList().end(); i++)
++ {
++ GetRequest<Key, T, Caller, CallerData> &request = *i;
++
++ if(request.key == key)
++ {
++ for(typename core::list< CallerInfo<Caller, CallerData> >::Iterator
++ i = request.callers.begin();
++ i != request.callers.end(); i++)
++ {
++ CallerInfo<Caller, CallerData> &ca = *i;
++ if(ca.caller == caller)
++ {
++ ca.data = callerdata;
++ return;
++ }
++ }
++ CallerInfo<Caller, CallerData> ca;
++ ca.caller = caller;
++ ca.data = callerdata;
++ request.callers.push_back(ca);
++ return;
++ }
++ }
++
++ /*
++ Else add a new request to the queue
++ */
++
++ GetRequest<Key, T, Caller, CallerData> request;
++ request.key = key;
++ CallerInfo<Caller, CallerData> ca;
++ ca.caller = caller;
++ ca.data = callerdata;
++ request.callers.push_back(ca);
++ request.dest = dest;
++
++ m_queue.getList().push_back(request);
++ }
++
++ GetRequest<Key, T, Caller, CallerData> pop(bool wait_if_empty=false)
++ {
++ return m_queue.pop_front(wait_if_empty);
++ }
++
++private:
++ MutexedQueue< GetRequest<Key, T, Caller, CallerData> > m_queue;
++};
++
++/*
+ Pseudo-random (VC++ rand() sucks)
+ */
+ int myrand(void);