; charset=UTF-8 Last-Modified: Thu, 03 Dec 2026 02:19:54 GMT Expires: Sun, 30 Nov 2036 02:19:54 GMT minetest.git - modified minetest for gpcfs purposes
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client.h3
-rw-r--r--src/connection.cpp18
-rw-r--r--src/guiEngine.cpp3
-rw-r--r--src/localplayer.cpp3
-rw-r--r--src/main.cpp6
-rw-r--r--src/porting.cpp30
generated by cgit v1.2.3 (git 2.39.1) at 2026-12-03 02:19:54 +0000 RUE, (UInt8 *)path, PATH_MAX))
+ // Code based on
+ // http://stackoverflow.com/questions/516200/relative-paths-not-working-in-xcode-c
+ CFBundleRef main_bundle = CFBundleGetMainBundle();
+ CFURLRef resources_url = CFBundleCopyResourcesDirectoryURL(main_bundle);
+ char path[PATH_MAX];
+ if(CFURLGetFileSystemRepresentation(resources_url, TRUE, (UInt8 *)path, PATH_MAX))
{
dstream<<"Bundle resource path: "<<path<<std::endl;
//chdir(path);
- path_share = std::string(path) + "/share";
+ path_share = std::string(path) + DIR_DELIM + "share";
}
else
- {
- // error!
+ {
+ // error!
dstream<<"WARNING: Could not determine bundle resource path"<<std::endl;
- }
- CFRelease(resources_url);
+ }
+ CFRelease(resources_url);
path_user = std::string(getenv("HOME")) + "/Library/Application Support/" + PROJECT_NAME;
#else // FreeBSD, and probably many other POSIX-like systems.
path_share = STATIC_SHAREDIR;
- path_user = std::string(getenv("HOME")) + "/." + PROJECT_NAME;
+ path_user = std::string(getenv("HOME")) + DIR_DELIM + "." + PROJECT_NAME;
#endif
diff --git a/src/settings.h b/src/settings.h
index 53e8d8ef5..13c8e1e65 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -37,6 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <map>
#include <set>
#include "filesys.h"
+#include <cctype>
enum ValueType
{
@@ -575,7 +576,7 @@ public:
u32 getFlagStr(std::string name, FlagDesc *flagdesc, u32 *flagmask)
{
std::string val = get(name);
- return (isdigit(val[0])) ? stoi(val) :
+ return (std::isdigit(val[0])) ? stoi(val) :
readFlagString(val, flagdesc, flagmask);
}
diff --git a/src/tile.cpp b/src/tile.cpp
index b8080c708..78aa4d946 100644
--- a/src/tile.cpp
+++ b/src/tile.cpp
@@ -730,9 +730,6 @@ u32 TextureSource::getTextureIdDirect(const std::string &name)
m_textureinfo_cache.push_back(ti);
m_name_to_id[name] = id;
- /*infostream<<"getTextureIdDirect(): "
- <<"Returning id="<<id<<" for name \""<<name<<"\""<<std::endl;*/
-
return id;
}
@@ -962,6 +959,20 @@ bool TextureSource::generateImage(std::string part_of_name, video::IImage *& bas
{
video::IImage *image = m_sourcecache.getOrLoad(part_of_name, m_device);
+ if (image != NULL) {
+ if (!driver->queryFeature(irr::video::EVDF_TEXTURE_NPOT)) {
+ core::dimension2d<u32> dim = image->getDimension();
+
+
+ if ((dim.Height %2 != 0) ||
+ (dim.Width %2 != 0)) {
+ errorstream << "TextureSource::generateImage "
+ << part_of_name << " size npot2 x=" << dim.Width
+ << " y=" << dim.Height << std::endl;
+ }
+ }
+ }
+
if(image == NULL)
{
if(part_of_name != ""){
diff --git a/src/util/pointer.h b/src/util/pointer.h
index ba43b7844..7922a9b39 100644
--- a/src/util/pointer.h
+++ b/src/util/pointer.h
@@ -258,7 +258,7 @@ public:
}
T & operator[](unsigned int i) const
{
- //assert(i < m_size)
+ assert(i < m_size);
return data[i];
}
T * operator*() const