Back sqlite3 for WIN, fix Sky

This commit is contained in:
MoNTE48 2019-05-03 21:16:45 +02:00
parent c3b2eeca49
commit a13e033c89
12 changed files with 62 additions and 30 deletions

View File

@ -182,7 +182,7 @@ if(UNIX AND NOT APPLE)
install(FILES "misc/MultiCraft.svg" DESTINATION "${ICONDIR}/hicolor/scalable/apps") install(FILES "misc/MultiCraft.svg" DESTINATION "${ICONDIR}/hicolor/scalable/apps")
install(FILES "misc/MultiCraft-xorg-icon-128.png" install(FILES "misc/MultiCraft-xorg-icon-128.png"
DESTINATION "${ICONDIR}/hicolor/128x128/apps" DESTINATION "${ICONDIR}/hicolor/128x128/apps"
RENAME "minetest.png") RENAME "MultiCraft.png")
endif() endif()
if(APPLE) if(APPLE)

View File

@ -1,22 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application"> <component type="desktop-application">
<id>net.minetest.minetest.desktop</id> <id>com.MultiCraft.game.desktop</id>
<metadata_license>CC0-1.0</metadata_license> <metadata_license>CC0-1.0</metadata_license>
<project_license>LGPL-2.1+ and CC-BY-SA-3.0 and MIT and Apache-2.0</project_license> <project_license>LGPL-3.0+ and CC-BY-SA-3.0 and MIT and Apache-2.0</project_license>
<name>Minetest</name> <name>MultiCraft</name>
<summary>Multiplayer infinite-world block sandbox game</summary> <summary>Multiplayer infinite-world block sandbox game</summary>
<description> <description>
<p> <p>
Minetest is an infinite-world block sandbox game and game engine. MultiCraft is an infinite-world block sandbox game and game engine.
</p><p> </p><p>
Players can create and destroy various types of blocks in a Players can create and destroy various types of blocks in a
three-dimensional open world. This allows forming structures in three-dimensional open world. This allows forming structures in
every possible creation, on multiplayer servers or in singleplayer. every possible creation, on multiplayer servers or in singleplayer.
</p><p> </p><p>
Minetest is designed to be simple, stable, and portable. MultiCraft is designed to be simple, stable, and portable.
It is lightweight enough to run on fairly old hardware. It is lightweight enough to run on fairly old hardware.
</p><p> </p><p>
Minetest has many features, including: MultiCraft has many features, including:
</p> </p>
<ul> <ul>
<li>Ability to walk around, dig, and build in a near-infinite voxel world</li> <li>Ability to walk around, dig, and build in a near-infinite voxel world</li>
@ -51,8 +51,8 @@
<url type="faq">http://wiki.minetest.net/FAQ</url> <url type="faq">http://wiki.minetest.net/FAQ</url>
<url type="help">http://wiki.minetest.net</url> <url type="help">http://wiki.minetest.net</url>
<provides> <provides>
<binary>minetest</binary> <binary>multicraft</binary>
</provides> </provides>
<translation type="gettext">minetest</translation> <translation type="gettext">multicraft</translation>
<update_contact>sfan5@live.de</update_contact> <update_contact>sfan5@live.de</update_contact>
</component> </component>

View File

@ -1,6 +1,6 @@
[Desktop Entry] [Desktop Entry]
Name=Minetest Name=MultiCraft
GenericName=Minetest GenericName=MultiCraft
Comment=Multiplayer infinite-world block sandbox Comment=Multiplayer infinite-world block sandbox
Comment[de]=Mehrspieler-Sandkastenspiel mit unendlichen Blockwelten Comment[de]=Mehrspieler-Sandkastenspiel mit unendlichen Blockwelten
Comment[es]=Juego sandbox multijugador con mundos infinitos Comment[es]=Juego sandbox multijugador con mundos infinitos
@ -8,8 +8,8 @@ Comment[fr]=Jeu multijoueurs de type bac à sable avec des mondes infinis
Comment[ja]=マルチプレイに対応した、無限の世界のブロック型サンドボックスゲームです Comment[ja]=マルチプレイに対応した、無限の世界のブロック型サンドボックスゲームです
Comment[ru]=Игра-песочница с безграничным миром, состоящим из блоков Comment[ru]=Игра-песочница с безграничным миром, состоящим из блоков
Comment[tr]=Tek-Çok oyuncuyla küplerden sonsuz dünyalar inşa et Comment[tr]=Tek-Çok oyuncuyla küplerden sonsuz dünyalar inşa et
Exec=minetest Exec=multicraft
Icon=minetest Icon=multicraft
Terminal=false Terminal=false
Type=Application Type=Application
Categories=Game;Simulation; Categories=Game;Simulation;

View File

@ -232,8 +232,6 @@ if(ENABLE_REDIS)
endif(ENABLE_REDIS) endif(ENABLE_REDIS)
#find_package(SQLite3 REQUIRED)
OPTION(ENABLE_SPATIAL "Enable SpatialIndex AreaStore backend" TRUE) OPTION(ENABLE_SPATIAL "Enable SpatialIndex AreaStore backend" TRUE)
set(USE_SPATIAL FALSE) set(USE_SPATIAL FALSE)
@ -259,6 +257,8 @@ add_definitions(-DUSE_CMAKE_CONFIG_H)
if(WIN32) if(WIN32)
# Windows # Windows
# Add SQLITE3
find_package(SQLite3 REQUIRED)
if(MSVC) # MSVC Specifics if(MSVC) # MSVC Specifics
set(PLATFORM_LIBS dbghelp.lib ${PLATFORM_LIBS}) set(PLATFORM_LIBS dbghelp.lib ${PLATFORM_LIBS})
# Surpress some useless warnings # Surpress some useless warnings
@ -383,6 +383,7 @@ set(common_SRCS
database-leveldb.cpp database-leveldb.cpp
database-postgresql.cpp database-postgresql.cpp
database-redis.cpp database-redis.cpp
database-sqlite3.cpp
database.cpp database.cpp
debug.cpp debug.cpp
defaultsettings.cpp defaultsettings.cpp
@ -460,7 +461,6 @@ set(common_SRCS
${UNITTEST_SRCS} ${UNITTEST_SRCS}
) )
# This gives us the icon and file version information # This gives us the icon and file version information
if(WIN32) if(WIN32)
set(WINRESOURCE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../misc/winresource.rc") set(WINRESOURCE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../misc/winresource.rc")
@ -558,6 +558,9 @@ include_directories(
${PROJECT_SOURCE_DIR}/script ${PROJECT_SOURCE_DIR}/script
) )
if(WIN32)
include_directories(${SQLITE3_INCLUDE_DIR})
endif()
if(USE_FREETYPE) if(USE_FREETYPE)
include_directories(${FREETYPE_INCLUDE_DIRS} ${CGUITTFONT_INCLUDE_DIR}) include_directories(${FREETYPE_INCLUDE_DIRS} ${CGUITTFONT_INCLUDE_DIR})
@ -592,6 +595,12 @@ if(BUILD_CLIENT)
${PLATFORM_LIBS} ${PLATFORM_LIBS}
${CLIENT_PLATFORM_LIBS} ${CLIENT_PLATFORM_LIBS}
) )
if(WIN32)
target_link_libraries(
${client_LIBS}
${SQLITE3_LIBRARY}
)
endif()
if(APPLE) if(APPLE)
target_link_libraries( target_link_libraries(
${client_LIBS} ${client_LIBS}
@ -800,9 +809,15 @@ if(WIN32)
if(FREETYPE_DLL) if(FREETYPE_DLL)
install(FILES ${FREETYPE_DLL} DESTINATION ${BINDIR}) install(FILES ${FREETYPE_DLL} DESTINATION ${BINDIR})
endif() endif()
if(SQLITE3_DLL)
install(FILES ${SQLITE3_DLL} DESTINATION ${BINDIR})
endif()
if(LEVELDB_DLL) if(LEVELDB_DLL)
install(FILES ${LEVELDB_DLL} DESTINATION ${BINDIR}) install(FILES ${LEVELDB_DLL} DESTINATION ${BINDIR})
endif() endif()
if(LUA_DLL)
install(FILES ${LUA_DLL} DESTINATION ${BINDIR})
endif()
endif() endif()
if(BUILD_CLIENT) if(BUILD_CLIENT)

View File

@ -43,6 +43,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "version.h" #include "version.h"
#include "drawscene.h" #include "drawscene.h"
#include "database.h" #include "database.h"
#ifdef _WIN32
#include "database-sqlite3.h"
#endif
#include "serialization.h" #include "serialization.h"
#include "guiscalingfilter.h" #include "guiscalingfilter.h"
#include "script/scripting_client.h" #include "script/scripting_client.h"
@ -769,7 +772,7 @@ void Client::initLocalMapSaving(const Address &address,
return; return;
} }
/*const std::string world_path = porting::path_user const std::string world_path = porting::path_user
+ DIR_DELIM + "worlds" + DIR_DELIM + "worlds"
+ DIR_DELIM + "server_" + DIR_DELIM + "server_"
+ hostname + "_" + std::to_string(address.getPort()); + hostname + "_" + std::to_string(address.getPort());
@ -778,7 +781,7 @@ void Client::initLocalMapSaving(const Address &address,
m_localdb = new MapDatabaseSQLite3(world_path); m_localdb = new MapDatabaseSQLite3(world_path);
m_localdb->beginSave(); m_localdb->beginSave();
actionstream << "Local map saving started, map will be saved at '" << world_path << "'" << std::endl;*/ actionstream << "Local map saving started, map will be saved at '" << world_path << "'" << std::endl;
} }
void Client::ReceiveAll() void Client::ReceiveAll()

View File

@ -43,6 +43,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "server.h" #include "server.h"
#include "database.h" #include "database.h"
#include "database-dummy.h" #include "database-dummy.h"
#ifdef _WIN32
#include "database-sqlite3.h"
#endif
#include "script/scripting_server.h" #include "script/scripting_server.h"
#include <deque> #include <deque>
#include <queue> #include <queue>
@ -2287,6 +2290,8 @@ MapDatabase *ServerMap::createDatabase(
const std::string &savedir, const std::string &savedir,
Settings &conf) Settings &conf)
{ {
if (name == "sqlite3")
return new MapDatabaseSQLite3(savedir);
if (name == "dummy") if (name == "dummy")
return new Database_Dummy(); return new Database_Dummy();
#if USE_LEVELDB #if USE_LEVELDB

View File

@ -621,9 +621,9 @@ bool setWindowIcon(IrrlichtDevice *device)
HWND hWnd; // Window handle HWND hWnd; // Window handle
switch (device->getVideoDriver()->getDriverType()) { switch (device->getVideoDriver()->getDriverType()) {
case video::EDT_DIRECT3D8: /* case video::EDT_DIRECT3D8:
hWnd = reinterpret_cast<HWND>(exposedData.D3D8.HWnd); hWnd = reinterpret_cast<HWND>(exposedData.D3D8.HWnd);
break; break;*/
case video::EDT_DIRECT3D9: case video::EDT_DIRECT3D9:
hWnd = reinterpret_cast<HWND>(exposedData.D3D9.HWnd); hWnd = reinterpret_cast<HWND>(exposedData.D3D9.HWnd);
break; break;

View File

@ -39,6 +39,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "gameparams.h" #include "gameparams.h"
#include "database-dummy.h" #include "database-dummy.h"
#include "database-files.h" #include "database-files.h"
#ifdef _WIN32
#include "database-sqlite3.h"
#endif
#if USE_POSTGRESQL #if USE_POSTGRESQL
#include "database-postgresql.h" #include "database-postgresql.h"
#endif #endif
@ -2168,7 +2171,9 @@ PlayerDatabase *ServerEnvironment::openPlayerDatabase(const std::string &name,
const std::string &savedir, const Settings &conf) const std::string &savedir, const Settings &conf)
{ {
if (name == "dummy") if (name == "sqlite3")
return new PlayerDatabaseSQLite3(savedir);
else if (name == "dummy")
return new Database_Dummy(); return new Database_Dummy();
#if USE_POSTGRESQL #if USE_POSTGRESQL
else if (name == "postgresql") { else if (name == "postgresql") {

View File

@ -191,7 +191,7 @@ void Sky::render()
video::SColor cloudyfogcolor = m_bgcolor; video::SColor cloudyfogcolor = m_bgcolor;
// Draw far cloudy fog thing blended with skycolor // Draw far cloudy fog thing blended with skycolor
for (u32 j = 0; j < 4; j++) { /* for (u32 j = 0; j < 4; j++) {
video::SColor c = cloudyfogcolor.getInterpolated(m_skycolor, 0.45); video::SColor c = cloudyfogcolor.getInterpolated(m_skycolor, 0.45);
vertices[0] = video::S3DVertex(-1, 0.08, -1, 0, 0, 1, c, t, t); vertices[0] = video::S3DVertex(-1, 0.08, -1, 0, 0, 1, c, t, t);
vertices[1] = video::S3DVertex( 1, 0.08, -1, 0, 0, 1, c, o, t); vertices[1] = video::S3DVertex( 1, 0.08, -1, 0, 0, 1, c, o, t);
@ -212,10 +212,10 @@ void Sky::render()
vertices[i].Pos.rotateXZBy(-180); vertices[i].Pos.rotateXZBy(-180);
} }
driver->drawIndexedTriangleFan(&vertices[0], 4, indices, 2); driver->drawIndexedTriangleFan(&vertices[0], 4, indices, 2);
} }*/
// Draw far cloudy fog thing // Draw far cloudy fog thing
for (u32 j = 0; j < 4; j++) { /* for (u32 j = 0; j < 4; j++) {
video::SColor c = cloudyfogcolor; video::SColor c = cloudyfogcolor;
vertices[0] = video::S3DVertex(-1, -1.0, -1, 0, 0, 1, c, t, t); vertices[0] = video::S3DVertex(-1, -1.0, -1, 0, 0, 1, c, t, t);
vertices[1] = video::S3DVertex( 1, -1.0, -1, 0, 0, 1, c, o, t); vertices[1] = video::S3DVertex( 1, -1.0, -1, 0, 0, 1, c, o, t);
@ -236,7 +236,7 @@ void Sky::render()
vertices[i].Pos.rotateXZBy(-180); vertices[i].Pos.rotateXZBy(-180);
} }
driver->drawIndexedTriangleFan(&vertices[0], 4, indices, 2); driver->drawIndexedTriangleFan(&vertices[0], 4, indices, 2);
} }*/
// Draw bottom far cloudy fog thing // Draw bottom far cloudy fog thing
video::SColor c = cloudyfogcolor; video::SColor c = cloudyfogcolor;
@ -502,7 +502,7 @@ void Sky::render()
// Draw far cloudy fog thing below east and west horizons // Draw far cloudy fog thing below east and west horizons
for (u32 j = 0; j < 2; j++) { for (u32 j = 0; j < 2; j++) {
video::SColor c = cloudyfogcolor; video::SColor c = m_skycolor;
vertices[0] = video::S3DVertex(-1, -1.0, -1, 0, 0, 1, c, t, t); vertices[0] = video::S3DVertex(-1, -1.0, -1, 0, 0, 1, c, t, t);
vertices[1] = video::S3DVertex( 1, -1.0, -1, 0, 0, 1, c, o, t); vertices[1] = video::S3DVertex( 1, -1.0, -1, 0, 0, 1, c, o, t);
vertices[2] = video::S3DVertex( 1, -0.02, -1, 0, 0, 1, c, o, o); vertices[2] = video::S3DVertex( 1, -0.02, -1, 0, 0, 1, c, o, o);
@ -560,12 +560,12 @@ void Sky::update(float time_of_day, float time_brightness,
video::SColorf cloudcolor_bright_dawn_f(1.0, 0.7, 0.5); video::SColorf cloudcolor_bright_dawn_f(1.0, 0.7, 0.5);
*/ */
video::SColorf bgcolor_bright_normal_f = video::SColor(255, 155, 193, 240); video::SColorf bgcolor_bright_normal_f = video::SColor(255, 2, 145, 255);
video::SColorf bgcolor_bright_indoor_f = video::SColor(255, 100, 100, 100); video::SColorf bgcolor_bright_indoor_f = video::SColor(255, 100, 100, 100);
video::SColorf bgcolor_bright_dawn_f = video::SColor(255, 186, 193, 240); video::SColorf bgcolor_bright_dawn_f = video::SColor(255, 180, 186, 255);
video::SColorf bgcolor_bright_night_f = video::SColor(255, 64, 144, 255); video::SColorf bgcolor_bright_night_f = video::SColor(255, 64, 144, 255);
video::SColorf skycolor_bright_normal_f = video::SColor(255, 2, 138, 255); video::SColorf skycolor_bright_normal_f = video::SColor(255, 2, 145, 255);
video::SColorf skycolor_bright_dawn_f = video::SColor(255, 180, 186, 255); video::SColorf skycolor_bright_dawn_f = video::SColor(255, 180, 186, 255);
video::SColorf skycolor_bright_night_f = video::SColor(255, 0, 107, 255); video::SColorf skycolor_bright_night_f = video::SColor(255, 0, 107, 255);

View File

@ -293,7 +293,11 @@ bool loadGameConfAndInitWorld(const std::string &path, const SubgameSpec &gamesp
if (!fs::PathExists(worldmt_path)) { if (!fs::PathExists(worldmt_path)) {
std::ostringstream ss(std::ios_base::binary); std::ostringstream ss(std::ios_base::binary);
ss << "gameid = " << gamespec.id ss << "gameid = " << gamespec.id
<< "\nbackend = leveldb" #ifdef _WIN32
<< "\nbackend = sqlite3"
#else
<< "\nbackend = leveldb"
#endif
<< "\ncreative_mode = " << g_settings->get("creative_mode") << "\ncreative_mode = " << g_settings->get("creative_mode")
<< "\nenable_damage = " << g_settings->get("enable_damage") << "\nenable_damage = " << g_settings->get("enable_damage")
<< "\n"; << "\n";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 B

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB