Compare commits

...

22 Commits

Author SHA1 Message Date
dvere 82e3f2ca8d Exclude OpenBSD from XORG_USED to unbreak build. No path check for X11 includes. Breaks more with the correct path so just hit it with a big stick. Appearance of the "l" word at 566/7 may be a hint. 2015-01-06 23:13:49 +00:00
dvere ec0f146fcf Merge remote-tracking branch 'upstream/master' 2015-01-06 22:15:37 +00:00
sapier 0f1d33933d Implement X11 dpi autodetection 2015-01-06 22:41:07 +01:00
sfan5 efdb9da619 Fix buildbot (was broken by 04a1a446cf) 2015-01-06 19:43:21 +01:00
sapier 083d19b3fc Fixes for android
Copy only minetest_game to apk by default
Don't copy .git and .svn folders to apk
Fix bouncing asset copy scrollbar due to long filepaths
Reenable font scaling to fix broken menu on high dpi screens
Implement minetest loglevel to android loglevel mapping
Disable touch digging while moving around
2015-01-06 16:13:39 +01:00
dvere f60090b51f Merge remote-tracking branch 'upstream/master' 2014-12-26 21:19:13 +00:00
dvere 50f10d8033 Merge remote-tracking branch 'upstream/master' 2014-12-14 18:19:46 +00:00
dvere 5fd0e1676a Merge remote-tracking branch 'upstream/master' 2014-12-01 19:17:53 +00:00
dvere f7ce87b7c2 Merge remote-tracking branch 'upstream/master' 2014-11-24 16:33:37 +00:00
dvere 61ee1f66da Fix texture orientation when placing nodes using on_place = minetest.rotate_node on walls or ceilings 2014-11-17 12:18:54 +00:00
dvere 3156ae1e8c Merge remote-tracking branch 'upstream/master' 2014-11-17 12:06:19 +00:00
dvere 5015727149 Merge remote-tracking branch 'upstream/master' 2014-11-09 09:48:55 +00:00
dvere c9838062c7 reorder some ifs 2014-10-12 12:46:09 +01:00
dvere e6aa7f610d and another spurious ")" got in there 2014-10-12 11:56:55 +01:00
dvere 6fe6dca205 another ")" 2014-10-12 11:41:14 +01:00
dvere 37508a8729 put the "(" back where it belonged 2014-10-12 11:34:19 +01:00
dvere 7234e92a63 remove leftover ")" 2014-10-12 11:20:37 +01:00
dvere d275effec1 Additional library checks and adjust compile options for OpenBSD 2014-10-12 11:14:46 +01:00
dvere b53c095743 Merge remote-tracking branch 'upstream/master' 2014-10-12 08:20:13 +01:00
dvere ea846c7e61 Merge remote-tracking branch 'upstream/master'
Conflicts:
	src/porting.h
2014-06-15 09:54:11 +01:00
dvere 48aa1e12c0 Merge remote-tracking branch 'upstream/master' 2014-05-04 05:57:24 +01:00
dvere c657a56481 Include pthread_np.h on OpenBSD & FreeBSD and allow for differing thread function name & location in NetBSD. 2014-05-03 13:54:07 +01:00
10 changed files with 159 additions and 36 deletions

View File

@ -20,6 +20,8 @@ PATHCFGFILE = path.cfg
ROOT = $(shell pwd)
GAMES_TO_COPY = minetest_game
################################################################################
# Android Version code
# Increase for each build!
@ -631,15 +633,23 @@ assets : $(ASSETS_TIMESTAMP)
cp -r ${ROOT}/../../client ${ROOT}/assets/Minetest; \
cp -r ${ROOT}/../../doc ${ROOT}/assets/Minetest; \
cp -r ${ROOT}/../../fonts ${ROOT}/assets/Minetest; \
cp -r ${ROOT}/../../games ${ROOT}/assets/Minetest; \
mkdir ${ROOT}/assets/Minetest/games; \
for game in ${GAMES_TO_COPY}; \
do \
cp -r ${ROOT}/../../games/$$game ${ROOT}/assets/Minetest/games/; \
done; \
cp -r ${ROOT}/../../mods ${ROOT}/assets/Minetest; \
cp -r ${ROOT}/../../po ${ROOT}/assets/Minetest; \
cp -r ${ROOT}/../../textures ${ROOT}/assets/Minetest; \
mkdir -p ${ROOT}/assets/Minetest/media; \
cp -r ${IRRLICHT_DIR}/media/Shaders ${ROOT}/assets/Minetest/media; \
cd ${ROOT}/assets; \
cd ${ROOT}/assets || exit 1; \
find . -name "timestamp" -exec rm {} \; ; \
find . -name "*.blend" -exec rm {} \; ; \
find . -name "*~" -exec rm {} \; ; \
find . -type d -path "*.git" -exec rm -rf {} \; ; \
find . -type d -path "*.svn" -exec rm -rf {} \; ; \
find . -type f -path "*.gitignore" -exec rm -rf {} \; ; \
ls -R | grep ":$$" | sed -e 's/:$$//' -e 's/\.//' -e 's/^\///' > "index.txt"; \
find Minetest >"filelist.txt"; \
cp ${ROOT}/${ASSETS_TIMESTAMP} ${ROOT}/${ASSETS_TIMESTAMP}.old; \

View File

@ -9,6 +9,7 @@ import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.Vector;
import java.util.Iterator;
import java.lang.Object;
import android.app.Activity;
import android.content.res.AssetFileDescriptor;
@ -20,6 +21,9 @@ import android.util.Log;
import android.view.Display;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.graphics.Rect;
import android.graphics.Paint;
import android.text.TextPaint;
public class MinetestAssetCopy extends Activity
{
@ -244,14 +248,62 @@ public class MinetestAssetCopy extends Activity
*/
protected void onProgressUpdate(Integer... progress)
{
if (m_copy_started)
{
boolean shortened = false;
String todisplay = m_tocopy.get(progress[0]);
m_ProgressBar.setProgress(progress[0]);
m_Filename.setText(m_tocopy.get(progress[0]));
// make sure our text doesn't exceed our layout width
Rect bounds = new Rect();
Paint textPaint = m_Filename.getPaint();
textPaint.getTextBounds(todisplay, 0, todisplay.length(), bounds);
while (bounds.width() > getResources().getDisplayMetrics().widthPixels * 0.7) {
Log.e("MinetestAssetCopy", todisplay + ": " +
bounds.width() + " > " + (getResources().getDisplayMetrics().widthPixels * 0.7));
if (todisplay.length() < 2) {
break;
}
todisplay = todisplay.substring(1);
textPaint.getTextBounds(todisplay, 0, todisplay.length(), bounds);
shortened = true;
}
if (! shortened) {
m_Filename.setText(todisplay);
}
else {
m_Filename.setText(".." + todisplay);
}
}
else
{
m_Filename.setText("scanning " + m_Foldername + " ...");
boolean shortened = false;
String todisplay = m_Foldername;
String full_text = "scanning " + todisplay + " ...";
// make sure our text doesn't exceed our layout width
Rect bounds = new Rect();
Paint textPaint = m_Filename.getPaint();
textPaint.getTextBounds(full_text, 0, full_text.length(), bounds);
while (bounds.width() > getResources().getDisplayMetrics().widthPixels * 0.7) {
if (todisplay.length() < 2) {
break;
}
todisplay = todisplay.substring(1);
full_text = "scanning " + todisplay + " ...";
textPaint.getTextBounds(full_text, 0, full_text.length(), bounds);
shortened = true;
}
if (! shortened) {
m_Filename.setText(full_text);
}
else {
m_Filename.setText("scanning .." + todisplay + " ...");
}
}
}

View File

@ -224,7 +224,7 @@
#directional_colored_fog = true
# Delay showing tooltips, stated in milliseconds
#tooltip_show_delay = 400
# Adjust dpi configuration to your screen (Desktop only) e.g. for 4k screens
# Adjust dpi configuration to your screen (non X11/Android only) e.g. for 4k screens
#screen_dpi = 72
# Default timeout for cURL, stated in milliseconds.
# Only has an effect if compiled with cURL.

View File

@ -32,6 +32,12 @@ set(USE_GETTEXT 0)
if(ENABLE_GETTEXT)
find_package(GettextLib)
if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
find_package(Iconv)
find_package(Libintl)
endif(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
else()
MARK_AS_ADVANCED(GETTEXT_ICONV_DLL GETTEXT_INCLUDE_DIR GETTEXT_LIBRARY GETTEXT_MSGFMT)
endif()
@ -165,7 +171,11 @@ else()
if(APPLE)
set(PLATFORM_LIBS "-framework CoreFoundation" ${PLATFORM_LIBS})
else()
set(PLATFORM_LIBS -lrt ${PLATFORM_LIBS})
# librt is not guaranteed
check_library_exists(rt clock_gettime "" HAVE_LIBRT)
if(HAVE_LIBRT)
set(PLATFORM_LIBS -lrt ${PLATFORM_LIBS})
endif()
endif(APPLE)
#set(CLIENT_PLATFORM_LIBS -lXxf86vm)
# This way Xxf86vm is found on OpenBSD too
@ -527,7 +537,6 @@ if(BUILD_CLIENT)
${BZIP2_LIBRARIES}
${PNG_LIBRARIES}
${X11_LIBRARIES}
${GETTEXT_LIBRARY}
${SOUND_LIBRARIES}
${SQLITE3_LIBRARY}
${LUA_LIBRARY}
@ -542,9 +551,18 @@ if(BUILD_CLIENT)
${ICONV_LIBRARY}
)
else()
target_link_libraries(
${minetest_LIBS}
)
if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
target_link_libraries(
${minetest_LIBS}
${ICONV_LIBRARIES}
${LIBINTL_LIBRARIES}
)
else()
target_link_libraries(
${minetest_LIBS}
${GETTEXT_LIBRARY}
)
endif(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
endif()
if(USE_CURL)
target_link_libraries(
@ -581,10 +599,21 @@ if(BUILD_SERVER)
${ZLIB_LIBRARIES}
${SQLITE3_LIBRARY}
${JSON_LIBRARY}
${GETTEXT_LIBRARY}
${LUA_LIBRARY}
${PLATFORM_LIBS}
)
if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
target_link_libraries(
${minetest_LIBS}
${ICONV_LIBRARIES}
${LIBINTL_LIBRARIES}
)
else()
target_link_libraries(
${minetest_LIBS}
${GETTEXT_LIBRARY}
)
endif(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
if (USE_LEVELDB)
target_link_libraries(${PROJECT_NAME}server ${LEVELDB_LIBRARY})
endif(USE_LEVELDB)
@ -658,7 +687,11 @@ else()
if(APPLE)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os")
else()
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -fomit-frame-pointer")
if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${RELEASE_WARNING_FLAGS} ${WARNING_FLAGS} ${OTHER_FLAGS}")
else()
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -fomit-frame-pointer")
endif(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
endif(APPLE)
set(CMAKE_CXX_FLAGS_DEBUG "-g -O1 -Wall ${WARNING_FLAGS} ${OTHER_FLAGS}")

View File

@ -76,21 +76,6 @@ static unsigned int font_line_height(gui::IGUIFont *font)
static gui::IGUIFont *select_font_by_line_height(double target_line_height)
{
return g_fontengine->getFont();
/* I have no idea what this is trying to achieve, but scaling the font according
* to the size of a formspec/dialog does not seem to be a standard (G)UI
* design and AFAIK no existing nor proposed GUI does this. Besides that it:
* a) breaks most (current) formspec layouts
* b) font sizes change depending on the size of the formspec/dialog (see above)
* meaning that there is no UI consistency
* c) the chosen fonts are, in general, probably too large
*
* Disabling for now.
*
* FIXME
*/
#if 0
// We don't get to directly select a font according to its
// baseline-to-baseline height. Rather, we select by em size.
// The ratio between these varies between fonts. The font
@ -120,7 +105,6 @@ static gui::IGUIFont *select_font_by_line_height(double target_line_height)
}
}
return g_fontengine->getFont(target_line_height - lohgt < hihgt - target_line_height ? loreq : hireq);
#endif
}
GUIFormSpecMenu::GUIFormSpecMenu(irr::IrrlichtDevice* dev,

View File

@ -29,6 +29,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "porting.h"
#include "config.h"
#ifdef __ANDROID__
unsigned int android_log_level_mapping[] {
/* LMT_ERROR */ ANDROID_LOG_ERROR,
/* LMT_ACTION */ ANDROID_LOG_WARN,
/* LMT_INFO */ ANDROID_LOG_INFO,
/* LMT_VERBOSE */ ANDROID_LOG_VERBOSE
};
#endif
std::list<ILogOutput*> log_outputs[LMT_NUM_VALUES];
std::map<threadid_t, std::string> log_threadnames;
JMutex log_threadnamemutex;
@ -160,7 +169,7 @@ public:
{
log_printline(m_lev, m_buf);
#ifdef __ANDROID__
__android_log_print(ANDROID_LOG_ERROR, PROJECT_NAME, "%s", m_buf.c_str());
__android_log_print(android_log_level_mapping[m_lev], PROJECT_NAME, "%s", m_buf.c_str());
#endif
}

View File

@ -37,7 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#endif
#if !defined(_WIN32) && !defined(__APPLE__) && \
!defined(__ANDROID__) && !defined(SERVER)
!defined(__ANDROID__) && !defined(__OpenBSD__) && !defined(SERVER)
#define XORG_USED
#endif
@ -570,17 +570,48 @@ void setXorgClassHint(const video::SExposedVideoData &video_data,
}
#ifndef SERVER
v2u32 getWindowSize() {
v2u32 getWindowSize()
{
return device->getVideoDriver()->getScreenSize();
}
#ifndef __ANDROID__
#ifdef XORG_USED
float getDisplayDensity()
{
const char* current_display = getenv("DISPLAY");
float getDisplayDensity() {
if (current_display != NULL) {
Display * x11display = XOpenDisplay(current_display);
if (x11display != NULL) {
/* try x direct */
float dpi_height =
floor(DisplayHeight(x11display, 0) /
(DisplayHeightMM(x11display, 0) * 0.039370) + 0.5);
float dpi_width =
floor(DisplayWidth(x11display, 0) /
(DisplayWidthMM(x11display, 0) * 0.039370) +0.5);
XCloseDisplay(x11display);
return (std::max(dpi_height,dpi_width) / 96.0);
}
}
/* return manually specified dpi */
return g_settings->getFloat("screen_dpi")/96.0;
}
v2u32 getDisplaySize() {
#else
float getDisplayDensity()
{
return g_settings->getFloat("screen_dpi")/96.0;
}
#endif
#ifndef __ANDROID__
v2u32 getDisplaySize()
{
IrrlichtDevice *nulldevice = createDevice(video::EDT_NULL);
core::dimension2d<u32> deskres = nulldevice->getVideoModeList()->getDesktopResolution();

View File

@ -683,6 +683,10 @@ void TouchScreenGUI::step(float dtime)
if (btn->ids.size() > 0) {
btn->repeatcounter += dtime;
/* in case we're moving around digging does not happen */
if (m_move_id != -1)
m_move_has_really_moved = true;
if (btn->repeatcounter < 0.2) continue;
btn->repeatcounter = 0;

View File

@ -71,7 +71,7 @@ cd $libdir
# Get minetest
cd $builddir
if [ -d $EXISTING_MINETEST_DIR ]; then
if [ ! "x$EXISTING_MINETEST_DIR" = "x" ]; then
ln -s $EXISTING_MINETEST_DIR minetest
else
[ -d minetest ] && (cd minetest && git pull) || (git clone https://github.com/minetest/minetest)

View File

@ -66,7 +66,7 @@ cd $libdir
# Get minetest
cd $builddir
if [ -d $EXISTING_MINETEST_DIR ]; then
if [ ! "x$EXISTING_MINETEST_DIR" = "x" ]; then
ln -s $EXISTING_MINETEST_DIR minetest
else
[ -d minetest ] && (cd minetest && git pull) || (git clone https://github.com/minetest/minetest)