Merged in nearly everything from minetest++
parent
c25b231c31
commit
2f53cdb085
|
@ -131,17 +131,17 @@ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "An InfiniMiner/Minecraft inspired game")
|
||||||
set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
|
set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
|
||||||
set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
|
set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
|
||||||
set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
|
set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
|
||||||
set(CPACK_PACKAGE_VENDOR "celeron55")
|
set(CPACK_PACKAGE_VENDOR "TANK")
|
||||||
set(CPACK_PACKAGE_CONTACT "Perttu Ahola <celeron55@gmail.com>")
|
set(CPACK_PACKAGE_CONTACT "Jordan Craige <jordan4ibanez@gmail.com>")
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
# For some reason these aren't copied otherwise
|
# For some reason these aren't copied otherwise
|
||||||
# NOTE: For some reason now it seems to work without these
|
# NOTE: For some reason now it seems to work without these
|
||||||
#if(BUILD_CLIENT)
|
#if(BUILD_CLIENT)
|
||||||
# install(FILES bin/minetest.exe DESTINATION bin)
|
# install(FILES bin/blockplanet.exe DESTINATION bin)
|
||||||
#endif()
|
#endif()
|
||||||
#if(BUILD_SERVER)
|
#if(BUILD_SERVER)
|
||||||
# install(FILES bin/minetestserver.exe DESTINATION bin)
|
# install(FILES bin/blockplanetserver.exe DESTINATION bin)
|
||||||
#endif()
|
#endif()
|
||||||
|
|
||||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-win32")
|
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-win32")
|
||||||
|
@ -149,7 +149,7 @@ if(WIN32)
|
||||||
set(CPACK_GENERATOR ZIP)
|
set(CPACK_GENERATOR ZIP)
|
||||||
|
|
||||||
# This might be needed for some installer
|
# This might be needed for some installer
|
||||||
#set(CPACK_PACKAGE_EXECUTABLES bin/minetest.exe "Minetest" bin/minetestserver.exe "Minetest Server")
|
#set(CPACK_PACKAGE_EXECUTABLES bin/blockplanet.exe "BlockPlanet" bin/blockplanetserver.exe "BlockPlanet Server")
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
# TODO
|
# TODO
|
||||||
# see http://cmake.org/Wiki/CMake:CPackPackageGenerators#Bundle_.28OSX_only.29
|
# see http://cmake.org/Wiki/CMake:CPackPackageGenerators#Bundle_.28OSX_only.29
|
||||||
|
|
|
@ -4,7 +4,7 @@ Minetest++
|
||||||
A game built off of the best free and open source Minecraft clone, Minetest-C55.
|
A game built off of the best free and open source Minecraft clone, Minetest-C55.
|
||||||
|
|
||||||
Copyright (c) 2010-2012 Perttu Ahola <celeron55@gmail.com>
|
Copyright (c) 2010-2012 Perttu Ahola <celeron55@gmail.com>
|
||||||
and ther contributors (see source file comments and the version control log)
|
and their contributors (see source file comments and the version control log)
|
||||||
|
|
||||||
This contains 2 different game modes, Minetest and Minimal.
|
This contains 2 different game modes, Minetest and Minimal.
|
||||||
Game mode Minimal is just a test and will be taken out soon. Game mode Minetest has all the cool features.
|
Game mode Minimal is just a test and will be taken out soon. Game mode Minetest has all the cool features.
|
||||||
|
|
|
@ -30,6 +30,7 @@ minetest.register_entity("__builtin:item", {
|
||||||
gravity = true,
|
gravity = true,
|
||||||
whocaresaboutnodes = false,
|
whocaresaboutnodes = false,
|
||||||
lastplayer = false,
|
lastplayer = false,
|
||||||
|
timer = 0,
|
||||||
|
|
||||||
set_item = function(self, itemstring)
|
set_item = function(self, itemstring)
|
||||||
self.itemstring = itemstring
|
self.itemstring = itemstring
|
||||||
|
@ -69,6 +70,10 @@ minetest.register_entity("__builtin:item", {
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_step = function(self, dtime)
|
on_step = function(self, dtime)
|
||||||
|
self.timer = self.timer + dtime
|
||||||
|
if (self.timer > 300) then
|
||||||
|
self.object:remove()
|
||||||
|
end
|
||||||
local p = self.object:getpos()
|
local p = self.object:getpos()
|
||||||
p.y = p.y - 0.3
|
p.y = p.y - 0.3
|
||||||
local nn = minetest.env:get_node(p).name
|
local nn = minetest.env:get_node(p).name
|
||||||
|
|
|
@ -1,32 +1,48 @@
|
||||||
# - Find CURL
|
# - Find CURL
|
||||||
# Find the native CURL includes and libraries
|
# Find the native CURL includes and libraries
|
||||||
#
|
#
|
||||||
# CURL_INCLUDE_DIR - where to find vorbis.h, etc.
|
# CURL_INCLUDE_DIR - where to find vorbis.h, etc.
|
||||||
# CURL_LIBRARIES - List of libraries when using vorbis(file).
|
# CURL_LIBRARIES - List of libraries when using vorbis(file).
|
||||||
# CURL_FOUND - True if vorbis found.
|
# CURL_FOUND - True if vorbis found.
|
||||||
|
if( UNIX )
|
||||||
|
FIND_PATH(CURL_INCLUDE_DIR NAMES curl.h
|
||||||
|
PATHS
|
||||||
|
/usr/local/include/curl
|
||||||
|
/usr/include/curl
|
||||||
|
)
|
||||||
|
|
||||||
if(NOT GP2XWIZ)
|
FIND_LIBRARY(CURL_LIBRARY NAMES libcurl.a curl
|
||||||
if(CURL_INCLUDE_DIR)
|
PATHS
|
||||||
# Already in cache, be silent
|
/usr/local/lib
|
||||||
set(CURL_FIND_QUIETLY TRUE)
|
/usr/lib
|
||||||
endif(CURL_INCLUDE_DIR)
|
)
|
||||||
find_library(CURL_LIBRARY NAMES curl)
|
else( UNIX )
|
||||||
# Handle the QUIETLY and REQUIRED arguments and set VORBIS_FOUND
|
if(NOT GP2XWIZ)
|
||||||
# to TRUE if all listed variables are TRUE.
|
if(CURL_INCLUDE_DIR)
|
||||||
include(FindPackageHandleStandardArgs)
|
# Already in cache, be silent
|
||||||
find_package_handle_standard_args(CURL DEFAULT_MSG CURL_INCLUDE_DIR CURL_LIBRARY)
|
set(CURL_FIND_QUIETLY TRUE)
|
||||||
else(NOT GP2XWIZ)
|
endif(CURL_INCLUDE_DIR)
|
||||||
find_package_handle_standard_args(VORBIS DEFAULT_MSG
|
find_library(CURL_LIBRARY NAMES curl)
|
||||||
CURL_INCLUDE_DIR CURL_LIBRARY)
|
# Handle the QUIETLY and REQUIRED arguments and set VORBIS_FOUND
|
||||||
endif(NOT GP2XWIZ)
|
# to TRUE if all listed variables are TRUE.
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(CURL DEFAULT_MSG CURL_INCLUDE_DIR CURL_LIBRARY)
|
||||||
|
else(NOT GP2XWIZ)
|
||||||
|
find_package_handle_standard_args(VORBIS DEFAULT_MSG
|
||||||
|
CURL_INCLUDE_DIR CURL_LIBRARY)
|
||||||
|
endif(NOT GP2XWIZ)
|
||||||
|
|
||||||
if(CURL_FOUND)
|
if(CURL_FOUND)
|
||||||
if(NOT GP2XWIZ)
|
if(NOT GP2XWIZ)
|
||||||
set(CURL_LIBRARY ${CURL_LIBRARY})
|
set(CURL_LIBRARY ${CURL_LIBRARY})
|
||||||
else(NOT GP2XWIZ)
|
else(NOT GP2XWIZ)
|
||||||
set(CURL_LIBRARY ${CURL_LIBRARY})
|
set(CURL_LIBRARY ${CURL_LIBRARY})
|
||||||
endif(NOT GP2XWIZ)
|
endif(NOT GP2XWIZ)
|
||||||
else(CURL_FOUND)
|
else(CURL_FOUND)
|
||||||
set(CURL_LIBRARY)
|
set(CURL_LIBRARY)
|
||||||
endif(CURL_FOUND)
|
endif(CURL_FOUND)
|
||||||
|
endif( UNIX )
|
||||||
|
|
||||||
|
MESSAGE(STATUS "CURL_SOURCE_DIR = ${CURL_SOURCE_DIR}")
|
||||||
|
MESSAGE(STATUS "CURL_INCLUDE_DIR = ${CURL_INCLUDE_DIR}")
|
||||||
|
MESSAGE(STATUS "CURL_LIBRARY = ${CURL_LIBRARY}")
|
||||||
|
|
|
@ -1292,7 +1292,7 @@ minetest.register_node("default:apple", {
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {fleshy=3,dig_immediate=3,flammable=2},
|
groups = {fleshy=3,dig_immediate=3,flammable=2,leafdecay=2},
|
||||||
on_use = minetest.item_eat(4, 2),
|
on_use = minetest.item_eat(4, 2),
|
||||||
sounds = default.node_sound_defaults(),
|
sounds = default.node_sound_defaults(),
|
||||||
})
|
})
|
||||||
|
|
|
@ -75,7 +75,7 @@ minetest.register_abm({
|
||||||
-- Drop stuff other than the node itself
|
-- Drop stuff other than the node itself
|
||||||
itemstacks = minetest.get_node_drops(n0.name)
|
itemstacks = minetest.get_node_drops(n0.name)
|
||||||
for _, itemname in ipairs(itemstacks) do
|
for _, itemname in ipairs(itemstacks) do
|
||||||
if itemname ~= n0.name then
|
if itemname ~= n0.name or minetest.get_item_group(itemname, "leafdecay") == 2 then
|
||||||
local p_drop = {
|
local p_drop = {
|
||||||
x = p0.x - 0.5 + math.random(),
|
x = p0.x - 0.5 + math.random(),
|
||||||
y = p0.y - 0.5 + math.random(),
|
y = p0.y - 0.5 + math.random(),
|
||||||
|
|
|
@ -1,4 +1,12 @@
|
||||||
/*
|
/*
|
||||||
|
BlockPlanet
|
||||||
|
Copyright (C) 2012 MiJyn, Joel Leclerc <mijyn@mail.com>
|
||||||
|
Contributors:
|
||||||
|
Jeija
|
||||||
|
Licensed under GPLv3
|
||||||
|
|
||||||
|
|
||||||
|
Based on:
|
||||||
Minetest-c55
|
Minetest-c55
|
||||||
Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
|
Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||||
|
|
||||||
|
@ -218,11 +226,25 @@ void Camera::update(LocalPlayer* player, f32 frametime, v2u32 screensize,
|
||||||
m_playernode->updateAbsolutePosition();
|
m_playernode->updateAbsolutePosition();
|
||||||
|
|
||||||
//Get camera tilt timer (hurt animation)
|
//Get camera tilt timer (hurt animation)
|
||||||
float cameratilt = fabs(fabs(-(player->hurt_tilt_timer_max/2)+player->hurt_tilt_timer)-player->hurt_tilt_timer_max/2);
|
float cameratilt = fabs(fabs(-(player->hurt_tilt_timer_max/2)+player->hurt_tilt_timer)-player->hurt_tilt_timer_max/2)/5;
|
||||||
|
|
||||||
|
v3f campos(player->getEyeOffset());
|
||||||
|
v3f camrot(player->getPitch(), 0, 0);
|
||||||
|
|
||||||
|
m_headnode->updateAbsolutePosition();
|
||||||
|
if (cameratilt > 0)
|
||||||
|
{
|
||||||
|
campos += v3f(0, cameratilt * -13, 0);
|
||||||
|
camrot += v3f(0, 0, cameratilt * 13 * BS);
|
||||||
|
}
|
||||||
|
if(player->is_sprinting)
|
||||||
|
{
|
||||||
|
campos += v3f(0, 0, 0.3 * BS);
|
||||||
|
}
|
||||||
|
|
||||||
// Set head node transformation
|
// Set head node transformation
|
||||||
m_headnode->setPosition(player->getEyeOffset()+v3f(0,cameratilt*-13,0));
|
m_headnode->setPosition(campos);
|
||||||
m_headnode->setRotation(v3f(player->getPitch(), 0, cameratilt*13));
|
m_headnode->setRotation(camrot);
|
||||||
m_headnode->updateAbsolutePosition();
|
m_headnode->updateAbsolutePosition();
|
||||||
|
|
||||||
// Compute relative camera position and target
|
// Compute relative camera position and target
|
||||||
|
@ -297,6 +319,11 @@ void Camera::update(LocalPlayer* player, f32 frametime, v2u32 screensize,
|
||||||
m_fov_y *= MYMAX(1.0, MYMIN(1.4, sqrt(16./10. / m_aspect)));
|
m_fov_y *= MYMAX(1.0, MYMIN(1.4, sqrt(16./10. / m_aspect)));
|
||||||
// WTF is this? It can't be right
|
// WTF is this? It can't be right
|
||||||
m_fov_x = 2 * atan(0.5 * m_aspect * tan(m_fov_y));
|
m_fov_x = 2 * atan(0.5 * m_aspect * tan(m_fov_y));
|
||||||
|
if(player->is_sprinting)
|
||||||
|
{
|
||||||
|
m_fov_x += 0.3;
|
||||||
|
m_fov_y += 0.3;
|
||||||
|
}
|
||||||
m_cameranode->setAspectRatio(m_aspect);
|
m_cameranode->setAspectRatio(m_aspect);
|
||||||
m_cameranode->setFOV(m_fov_y);
|
m_cameranode->setFOV(m_fov_y);
|
||||||
|
|
||||||
|
|
68
src/game.cpp
68
src/game.cpp
|
@ -1402,8 +1402,8 @@ void the_game(
|
||||||
u32 lasttime = device->getTimer()->getTime();
|
u32 lasttime = device->getTimer()->getTime();
|
||||||
|
|
||||||
LocalPlayer* player = client.getEnv().getLocalPlayer();
|
LocalPlayer* player = client.getEnv().getLocalPlayer();
|
||||||
player->hurt_tilt_timer=0;
|
/*player->hurt_tilt_timer=0;
|
||||||
player->hurt_tilt_timer_max=0;
|
player->hurt_tilt_timer_max=0;*/
|
||||||
|
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
|
@ -1632,6 +1632,25 @@ void the_game(
|
||||||
/*
|
/*
|
||||||
Launch menus and trigger stuff according to keys
|
Launch menus and trigger stuff according to keys
|
||||||
*/
|
*/
|
||||||
|
if(input->isKeyDown(getKeySetting("keymap_forward")))
|
||||||
|
{
|
||||||
|
if(player->enable_sprinting_timer > 0)
|
||||||
|
{
|
||||||
|
player->is_sprinting = true;
|
||||||
|
}
|
||||||
|
player->enable_sprinting_timer = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (player->is_sprinting)
|
||||||
|
{
|
||||||
|
player->is_sprinting = false;
|
||||||
|
}
|
||||||
|
if (player->enable_sprinting_timer == -1)
|
||||||
|
{
|
||||||
|
player->enable_sprinting_timer = 0.2;
|
||||||
|
}
|
||||||
|
}
|
||||||
if(input->wasKeyDown(getKeySetting("keymap_drop")))
|
if(input->wasKeyDown(getKeySetting("keymap_drop")))
|
||||||
{
|
{
|
||||||
// drop selected item
|
// drop selected item
|
||||||
|
@ -1642,7 +1661,7 @@ void the_game(
|
||||||
a->from_i = client.getPlayerItem();
|
a->from_i = client.getPlayerItem();
|
||||||
client.inventoryAction(a);
|
client.inventoryAction(a);
|
||||||
}
|
}
|
||||||
else if(input->wasKeyDown(getKeySetting("keymap_inventory")))
|
if(input->wasKeyDown(getKeySetting("keymap_inventory")))
|
||||||
{
|
{
|
||||||
infostream<<"the_game: "
|
infostream<<"the_game: "
|
||||||
<<"Launching inventory"<<std::endl;
|
<<"Launching inventory"<<std::endl;
|
||||||
|
@ -1670,7 +1689,7 @@ void the_game(
|
||||||
|
|
||||||
menu->drop();
|
menu->drop();
|
||||||
}
|
}
|
||||||
else if(input->wasKeyDown(EscapeKey))
|
if(input->wasKeyDown(EscapeKey))
|
||||||
{
|
{
|
||||||
infostream<<"the_game: "
|
infostream<<"the_game: "
|
||||||
<<"Launching pause menu"<<std::endl;
|
<<"Launching pause menu"<<std::endl;
|
||||||
|
@ -1684,7 +1703,7 @@ void the_game(
|
||||||
else
|
else
|
||||||
input->setMousePos(displaycenter.X, displaycenter.Y+25);
|
input->setMousePos(displaycenter.X, displaycenter.Y+25);
|
||||||
}
|
}
|
||||||
else if(input->wasKeyDown(getKeySetting("keymap_chat")))
|
if(input->wasKeyDown(getKeySetting("keymap_chat")))
|
||||||
{
|
{
|
||||||
TextDest *dest = new TextDestChat(&client);
|
TextDest *dest = new TextDestChat(&client);
|
||||||
|
|
||||||
|
@ -1692,7 +1711,7 @@ void the_game(
|
||||||
&g_menumgr, dest,
|
&g_menumgr, dest,
|
||||||
L""))->drop();
|
L""))->drop();
|
||||||
}
|
}
|
||||||
else if(input->wasKeyDown(getKeySetting("keymap_cmd")))
|
if(input->wasKeyDown(getKeySetting("keymap_cmd")))
|
||||||
{
|
{
|
||||||
TextDest *dest = new TextDestChat(&client);
|
TextDest *dest = new TextDestChat(&client);
|
||||||
|
|
||||||
|
@ -1700,7 +1719,7 @@ void the_game(
|
||||||
&g_menumgr, dest,
|
&g_menumgr, dest,
|
||||||
L"/"))->drop();
|
L"/"))->drop();
|
||||||
}
|
}
|
||||||
else if(input->wasKeyDown(getKeySetting("keymap_console")))
|
if(input->wasKeyDown(getKeySetting("keymap_console")))
|
||||||
{
|
{
|
||||||
if (!gui_chat_console->isOpenInhibited())
|
if (!gui_chat_console->isOpenInhibited())
|
||||||
{
|
{
|
||||||
|
@ -1709,7 +1728,7 @@ void the_game(
|
||||||
guienv->setFocus(gui_chat_console);
|
guienv->setFocus(gui_chat_console);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(input->wasKeyDown(getKeySetting("keymap_freemove")))
|
if(input->wasKeyDown(getKeySetting("keymap_freemove")))
|
||||||
{
|
{
|
||||||
if(g_settings->getBool("free_move"))
|
if(g_settings->getBool("free_move"))
|
||||||
{
|
{
|
||||||
|
@ -1726,7 +1745,7 @@ void the_game(
|
||||||
statustext += L" (note: no 'fly' privilege)";
|
statustext += L" (note: no 'fly' privilege)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(input->wasKeyDown(getKeySetting("keymap_fastmove")))
|
if(input->wasKeyDown(getKeySetting("keymap_fastmove")))
|
||||||
{
|
{
|
||||||
if(g_settings->getBool("fast_move"))
|
if(g_settings->getBool("fast_move"))
|
||||||
{
|
{
|
||||||
|
@ -1743,7 +1762,7 @@ void the_game(
|
||||||
statustext += L" (note: no 'fast' privilege)";
|
statustext += L" (note: no 'fast' privilege)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(input->wasKeyDown(getKeySetting("keymap_screenshot")))
|
if(input->wasKeyDown(getKeySetting("keymap_screenshot")))
|
||||||
{
|
{
|
||||||
irr::video::IImage* const image = driver->createScreenShot();
|
irr::video::IImage* const image = driver->createScreenShot();
|
||||||
if (image) {
|
if (image) {
|
||||||
|
@ -1763,7 +1782,7 @@ void the_game(
|
||||||
image->drop();
|
image->drop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(input->wasKeyDown(getKeySetting("keymap_toggle_hud")))
|
if(input->wasKeyDown(getKeySetting("keymap_toggle_hud")))
|
||||||
{
|
{
|
||||||
show_hud = !show_hud;
|
show_hud = !show_hud;
|
||||||
if(show_hud)
|
if(show_hud)
|
||||||
|
@ -1772,7 +1791,7 @@ void the_game(
|
||||||
statustext = L"HUD hidden";
|
statustext = L"HUD hidden";
|
||||||
statustext_time = 0;
|
statustext_time = 0;
|
||||||
}
|
}
|
||||||
else if(input->wasKeyDown(getKeySetting("keymap_toggle_chat")))
|
if(input->wasKeyDown(getKeySetting("keymap_toggle_chat")))
|
||||||
{
|
{
|
||||||
show_chat = !show_chat;
|
show_chat = !show_chat;
|
||||||
if(show_chat)
|
if(show_chat)
|
||||||
|
@ -1781,7 +1800,7 @@ void the_game(
|
||||||
statustext = L"Chat hidden";
|
statustext = L"Chat hidden";
|
||||||
statustext_time = 0;
|
statustext_time = 0;
|
||||||
}
|
}
|
||||||
else if(input->wasKeyDown(getKeySetting("keymap_toggle_force_fog_off")))
|
if(input->wasKeyDown(getKeySetting("keymap_toggle_force_fog_off")))
|
||||||
{
|
{
|
||||||
force_fog_off = !force_fog_off;
|
force_fog_off = !force_fog_off;
|
||||||
if(force_fog_off)
|
if(force_fog_off)
|
||||||
|
@ -1790,7 +1809,7 @@ void the_game(
|
||||||
statustext = L"Fog enabled";
|
statustext = L"Fog enabled";
|
||||||
statustext_time = 0;
|
statustext_time = 0;
|
||||||
}
|
}
|
||||||
else if(input->wasKeyDown(getKeySetting("keymap_toggle_update_camera")))
|
if(input->wasKeyDown(getKeySetting("keymap_toggle_update_camera")))
|
||||||
{
|
{
|
||||||
disable_camera_update = !disable_camera_update;
|
disable_camera_update = !disable_camera_update;
|
||||||
if(disable_camera_update)
|
if(disable_camera_update)
|
||||||
|
@ -1799,7 +1818,7 @@ void the_game(
|
||||||
statustext = L"Camera update enabled";
|
statustext = L"Camera update enabled";
|
||||||
statustext_time = 0;
|
statustext_time = 0;
|
||||||
}
|
}
|
||||||
else if(input->wasKeyDown(getKeySetting("keymap_toggle_debug")))
|
if(input->wasKeyDown(getKeySetting("keymap_toggle_debug")))
|
||||||
{
|
{
|
||||||
// Initial / 3x toggle: Chat only
|
// Initial / 3x toggle: Chat only
|
||||||
// 1x toggle: Debug text with chat
|
// 1x toggle: Debug text with chat
|
||||||
|
@ -1825,7 +1844,7 @@ void the_game(
|
||||||
statustext_time = 0;
|
statustext_time = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(input->wasKeyDown(getKeySetting("keymap_toggle_profiler")))
|
if(input->wasKeyDown(getKeySetting("keymap_toggle_profiler")))
|
||||||
{
|
{
|
||||||
show_profiler = (show_profiler + 1) % (show_profiler_max + 1);
|
show_profiler = (show_profiler + 1) % (show_profiler_max + 1);
|
||||||
|
|
||||||
|
@ -1847,7 +1866,7 @@ void the_game(
|
||||||
statustext_time = 0;
|
statustext_time = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(input->wasKeyDown(getKeySetting("keymap_increase_viewing_range_min")))
|
if(input->wasKeyDown(getKeySetting("keymap_increase_viewing_range_min")))
|
||||||
{
|
{
|
||||||
s16 range = g_settings->getS16("viewing_range_nodes_min");
|
s16 range = g_settings->getS16("viewing_range_nodes_min");
|
||||||
s16 range_new = range + 10;
|
s16 range_new = range + 10;
|
||||||
|
@ -1857,7 +1876,7 @@ void the_game(
|
||||||
+ itos(range_new));
|
+ itos(range_new));
|
||||||
statustext_time = 0;
|
statustext_time = 0;
|
||||||
}
|
}
|
||||||
else if(input->wasKeyDown(getKeySetting("keymap_decrease_viewing_range_min")))
|
if(input->wasKeyDown(getKeySetting("keymap_decrease_viewing_range_min")))
|
||||||
{
|
{
|
||||||
s16 range = g_settings->getS16("viewing_range_nodes_min");
|
s16 range = g_settings->getS16("viewing_range_nodes_min");
|
||||||
s16 range_new = range - 10;
|
s16 range_new = range - 10;
|
||||||
|
@ -2106,7 +2125,7 @@ void the_game(
|
||||||
chat_backend.addMessage(L"", L"You died.");
|
chat_backend.addMessage(L"", L"You died.");
|
||||||
|
|
||||||
/* Handle visualization */
|
/* Handle visualization */
|
||||||
LocalPlayer* player = client.getEnv().getLocalPlayer();
|
//LocalPlayer* player = client.getEnv().getLocalPlayer();
|
||||||
player->hurt_tilt_timer = 0;
|
player->hurt_tilt_timer = 0;
|
||||||
player->hurt_tilt_timer_max = 0;
|
player->hurt_tilt_timer_max = 0;
|
||||||
|
|
||||||
|
@ -2937,7 +2956,18 @@ void the_game(
|
||||||
{
|
{
|
||||||
player->hurt_tilt_timer -= dtime*5;
|
player->hurt_tilt_timer -= dtime*5;
|
||||||
if(player->hurt_tilt_timer < 0.0)
|
if(player->hurt_tilt_timer < 0.0)
|
||||||
|
{
|
||||||
player->hurt_tilt_timer_max = 0;
|
player->hurt_tilt_timer_max = 0;
|
||||||
|
player->hurt_tilt_timer = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Time that has to pass between key_forward presses to enable sprinting
|
||||||
|
*/
|
||||||
|
if(player->enable_sprinting_timer > 0.0)
|
||||||
|
{
|
||||||
|
player->enable_sprinting_timer -= dtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,15 @@
|
||||||
/*
|
/*
|
||||||
|
BlockPlanet
|
||||||
|
Copyright (C) 2012 MiJyn, Joel Leclerc <mijyn@mail.com>
|
||||||
|
Contributors:
|
||||||
|
Sfan5
|
||||||
|
Jeija
|
||||||
|
Licensed under GPLv3
|
||||||
|
|
||||||
|
|
||||||
|
Based on:
|
||||||
Minetest-c55
|
Minetest-c55
|
||||||
Copyright (C) 2010-12 celeron55, Perttu Ahola <celeron55@gmail.com>
|
Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -608,10 +617,13 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
|
||||||
"\n"
|
"\n"
|
||||||
"By:\n"
|
"By:\n"
|
||||||
"Perttu Ahola <celeron55@gmail.com>\n"
|
"Perttu Ahola <celeron55@gmail.com>\n"
|
||||||
"Joel Leclerc <lkjoel@ubuntu.com>\n"
|
"Joel Leclerc (MiJyn) <mijyn@mail.com>\n"
|
||||||
"Jordan Craige <jordan4girl3@gmail.com>\n"
|
"Jordan Craige <jordan4girl3@gmail.com>\n"
|
||||||
|
"sfan5 <sfan5@live.de>\n"
|
||||||
|
"Jeija <norrepli@gmail.com>\n"
|
||||||
|
"\n"
|
||||||
"For a full list of contributors go here:\n"
|
"For a full list of contributors go here:\n"
|
||||||
"http://minetestpp.tk/contributors/"
|
"http://www.blockpla.net/contributors/"
|
||||||
).c_str(), rect, false, true, this, -1);
|
).c_str(), rect, false, true, this, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
/*
|
/*
|
||||||
|
BlockPlanet
|
||||||
|
Copyright (C) 2012 MiJyn, Joel Leclerc <mijyn@mail.com>
|
||||||
|
Contributors:
|
||||||
|
Jeija
|
||||||
|
Licensed under GPLv3
|
||||||
|
|
||||||
|
|
||||||
|
Based on:
|
||||||
Minetest-c55
|
Minetest-c55
|
||||||
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
|
Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -66,8 +74,8 @@ void LocalPlayer::move(f32 dtime, Map &map, f32 pos_max_d,
|
||||||
// Skip collision detection if a special movement mode is used
|
// Skip collision detection if a special movement mode is used
|
||||||
bool fly_allowed = m_gamedef->checkLocalPrivilege("fly");
|
bool fly_allowed = m_gamedef->checkLocalPrivilege("fly");
|
||||||
bool free_move = fly_allowed && g_settings->getBool("free_move");
|
bool free_move = fly_allowed && g_settings->getBool("free_move");
|
||||||
bool fast_allowed = m_gamedef->checkLocalPrivilege("fast");
|
//bool fast_allowed = m_gamedef->checkLocalPrivilege("fast");
|
||||||
bool fast_move = fast_allowed && g_settings->getBool("fast_move");
|
//bool fast_move = fast_allowed && g_settings->getBool("fast_move");
|
||||||
//if(free_move)
|
//if(free_move)
|
||||||
//{
|
//{
|
||||||
// setPosition(position);
|
// setPosition(position);
|
||||||
|
@ -131,7 +139,7 @@ void LocalPlayer::move(f32 dtime, Map &map, f32 pos_max_d,
|
||||||
}
|
}
|
||||||
|
|
||||||
is_flying = free_move;
|
is_flying = free_move;
|
||||||
is_sprinting = fast_move;
|
//is_sprinting = fast_move;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Collision uncertainty radius
|
Collision uncertainty radius
|
||||||
|
@ -503,7 +511,7 @@ void LocalPlayer::applyControl(float dtime)
|
||||||
bool fast_move = fast_allowed && g_settings->getBool("fast_move");
|
bool fast_move = fast_allowed && g_settings->getBool("fast_move");
|
||||||
bool continuous_forward = g_settings->getBool("continuous_forward");
|
bool continuous_forward = g_settings->getBool("continuous_forward");
|
||||||
|
|
||||||
if (!in_water)
|
if (!in_water || free_move)
|
||||||
{
|
{
|
||||||
speed.X=speed.X*0.85;
|
speed.X=speed.X*0.85;
|
||||||
speed.Z=speed.Z*0.85;
|
speed.Z=speed.Z*0.85;
|
||||||
|
@ -528,6 +536,10 @@ void LocalPlayer::applyControl(float dtime)
|
||||||
if(control.up)
|
if(control.up)
|
||||||
{
|
{
|
||||||
speed += move_direction;
|
speed += move_direction;
|
||||||
|
if (is_sprinting)
|
||||||
|
{
|
||||||
|
speed += move_direction*0.5;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(control.down)
|
if(control.down)
|
||||||
{
|
{
|
||||||
|
@ -602,13 +614,16 @@ void LocalPlayer::applyControl(float dtime)
|
||||||
speed.Z=speed.Z*1.1;
|
speed.Z=speed.Z*1.1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(in_water_stable || in_water)
|
if((in_water_stable || in_water) && !free_move)
|
||||||
{
|
{
|
||||||
speed.Y=speed.Y*0.95-0.1*BS;
|
speed.Y=speed.Y*0.95-0.1*BS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(control.sneak)
|
if(control.sneak)
|
||||||
speed = speed / 1.5;
|
{
|
||||||
|
speed.X = speed.X / 1.5;
|
||||||
|
speed.Z = speed.Z / 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(abs(speed.X)>maxspeed) {speed.X=maxspeed*(abs(speed.X)/speed.X);}
|
if(abs(speed.X)>maxspeed) {speed.X=maxspeed*(abs(speed.X)/speed.X);}
|
||||||
|
|
10
src/map.cpp
10
src/map.cpp
|
@ -1,4 +1,12 @@
|
||||||
/*
|
/*
|
||||||
|
BlockPlanet
|
||||||
|
Copyright (C) 2012 MiJyn, Joel Leclerc <mijyn@mail.com>
|
||||||
|
Contributors:
|
||||||
|
Jeija
|
||||||
|
Licensed under GPLv3
|
||||||
|
|
||||||
|
|
||||||
|
Based on:
|
||||||
Minetest-c55
|
Minetest-c55
|
||||||
Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
|
Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||||
|
|
||||||
|
@ -2274,7 +2282,7 @@ MapBlock* ServerMap::finishBlockMake(mapgen::BlockMakeData *data,
|
||||||
y<=blockpos_max.Y+extra_borders.Y; y++)
|
y<=blockpos_max.Y+extra_borders.Y; y++)
|
||||||
{
|
{
|
||||||
v3s16 p(x, y, z);
|
v3s16 p(x, y, z);
|
||||||
getBlockNoCreateNoEx(p)->setLightingExpired(true);
|
getBlockNoCreateNoEx(p)->setLightingExpired(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
|
@ -1,4 +1,12 @@
|
||||||
/*
|
/*
|
||||||
|
BlockPlanet
|
||||||
|
Copyright (C) 2012 MiJyn, Joel Leclerc <mijyn@mail.com>
|
||||||
|
Contributors:
|
||||||
|
Jeija
|
||||||
|
Licensed under GPLv3
|
||||||
|
|
||||||
|
|
||||||
|
Based on:
|
||||||
Minetest-c55
|
Minetest-c55
|
||||||
Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
|
Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||||
|
|
||||||
|
@ -1968,7 +1976,7 @@ void make_block(BlockMakeData *data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 1
|
#if 0
|
||||||
{
|
{
|
||||||
// 340ms @cs=8
|
// 340ms @cs=8
|
||||||
TimeTaker timer1("flow mud");
|
TimeTaker timer1("flow mud");
|
||||||
|
|
|
@ -1,4 +1,12 @@
|
||||||
/*
|
/*
|
||||||
|
BlockPlanet
|
||||||
|
Copyright (C) 2012 MiJyn, Joel Leclerc <mijyn@mail.com>
|
||||||
|
Contributors:
|
||||||
|
Jeija
|
||||||
|
Licensed under GPLv3
|
||||||
|
|
||||||
|
|
||||||
|
Based on:
|
||||||
Minetest-c55
|
Minetest-c55
|
||||||
Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
|
Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||||
|
|
||||||
|
@ -36,6 +44,9 @@ Player::Player(IGameDef *gamedef):
|
||||||
camera_barely_in_ceiling(false),
|
camera_barely_in_ceiling(false),
|
||||||
inventory(gamedef->idef()),
|
inventory(gamedef->idef()),
|
||||||
hp(PLAYER_MAX_HP),
|
hp(PLAYER_MAX_HP),
|
||||||
|
hurt_tilt_timer(0),
|
||||||
|
hurt_tilt_timer_max(0),
|
||||||
|
enable_sprinting_timer(0),
|
||||||
hunger(PLAYER_MAX_HUNGER),
|
hunger(PLAYER_MAX_HUNGER),
|
||||||
hunger_timer(0.0),
|
hunger_timer(0.0),
|
||||||
hunger_hurt_heal_timer(0.0),
|
hunger_hurt_heal_timer(0.0),
|
||||||
|
|
10
src/player.h
10
src/player.h
|
@ -1,4 +1,12 @@
|
||||||
/*
|
/*
|
||||||
|
BlockPlanet
|
||||||
|
Copyright (C) 2012 MiJyn, Joel Leclerc <mijyn@mail.com>
|
||||||
|
Contributors:
|
||||||
|
Jeija
|
||||||
|
Licensed under GPLv3
|
||||||
|
|
||||||
|
|
||||||
|
Based on:
|
||||||
Minetest-c55
|
Minetest-c55
|
||||||
Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
|
Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||||
|
|
||||||
|
@ -157,6 +165,8 @@ public:
|
||||||
|
|
||||||
float hurt_tilt_timer_max;
|
float hurt_tilt_timer_max;
|
||||||
|
|
||||||
|
float enable_sprinting_timer;
|
||||||
|
|
||||||
u16 hunger;
|
u16 hunger;
|
||||||
|
|
||||||
f32 hunger_timer;
|
f32 hunger_timer;
|
||||||
|
|
|
@ -16,6 +16,7 @@ mingwm10_dll_file=$dir/mingwm10.dll
|
||||||
irrlicht_version=1.7.2
|
irrlicht_version=1.7.2
|
||||||
ogg_version=1.2.1
|
ogg_version=1.2.1
|
||||||
vorbis_version=1.3.2
|
vorbis_version=1.3.2
|
||||||
|
curl_verison=7.25.0
|
||||||
|
|
||||||
# unzip -l $openal_stripped_file:
|
# unzip -l $openal_stripped_file:
|
||||||
# 0 2012-04-03 00:25 openal_stripped/
|
# 0 2012-04-03 00:25 openal_stripped/
|
||||||
|
@ -47,18 +48,17 @@ wget http://switch.dl.sourceforge.net/project/winlibs/libvorbis/libvorbis-$vorbi
|
||||||
-c -O $packagedir/libvorbis-$vorbis_version-dev.7z || exit 1
|
-c -O $packagedir/libvorbis-$vorbis_version-dev.7z || exit 1
|
||||||
wget http://switch.dl.sourceforge.net/project/winlibs/libvorbis/libvorbis-$vorbis_version-dll.7z \
|
wget http://switch.dl.sourceforge.net/project/winlibs/libvorbis/libvorbis-$vorbis_version-dll.7z \
|
||||||
-c -O $packagedir/libvorbis-$vorbis_version-dll.7z || exit 1
|
-c -O $packagedir/libvorbis-$vorbis_version-dll.7z || exit 1
|
||||||
|
wget http://curl.haxx.se/gknw.net/win32/curl-$curl_version-devel-mingw32.zip \
|
||||||
|
-c -O $packagedir/curl-$curl_version-devel-mingw32.zip || exit 1
|
||||||
wget http://github.com/celeron55/minetest/zipball/master \
|
wget http://github.com/celeron55/minetest/zipball/master \
|
||||||
-c -O $packagedir/minetest.zip || exit 1
|
-c -O $packagedir/minetest.zip || exit 1
|
||||||
cp $openal_stripped_file $packagedir/openal_stripped.zip || exit 1
|
cp $openal_stripped_file $packagedir/openal_stripped.zip || exit 1
|
||||||
cp $mingwm10_dll_file $packagedir/mingwm10.dll || exit 1
|
cp $mingwm10_dll_file $packagedir/mingwm10.dll || exit 1
|
||||||
wget http://github.com/celeron55/minetest_game/zipball/master \
|
|
||||||
-c -O $packagedir/minetest_game.zip || exit 1
|
|
||||||
|
|
||||||
# Figure out some path names from the packages
|
# Figure out some path names from the packages
|
||||||
minetestdirname=`unzip -l $packagedir/minetest.zip | head -n 7 | tail -n 1 | sed -e 's/^[^c]*//' -e 's/\/.*$//'`
|
minetestdirname=`unzip -l $packagedir/minetest.zip | head -n 7 | tail -n 1 | sed -e 's/^[^j]*//' -e 's/\/.*$//'`
|
||||||
minetestdir=$builddir/$minetestdirname || exit 1
|
minetestdir=$builddir/$minetestdirname || exit 1
|
||||||
git_hash=`echo $minetestdirname | sed -e 's/celeron55-minetest-//'`
|
git_hash=`echo $minetestdirname | sed -e 's/jordan4ibanez-minetest-//'`
|
||||||
minetest_gamedirname=`unzip -l $packagedir/minetest_game.zip | head -n 7 | tail -n 1 | sed -e 's/^[^c]*//' -e 's/\/.*$//'`
|
|
||||||
|
|
||||||
# Extract stuff
|
# Extract stuff
|
||||||
cd $libdir || exit 1
|
cd $libdir || exit 1
|
||||||
|
@ -70,6 +70,7 @@ unzip -o $packagedir/zlib125dll.zip -d zlib125dll || exit 1
|
||||||
7z x -y -olibvorbis $packagedir/libvorbis-$vorbis_version-dev.7z || exit 1
|
7z x -y -olibvorbis $packagedir/libvorbis-$vorbis_version-dev.7z || exit 1
|
||||||
7z x -y -olibvorbis $packagedir/libvorbis-$vorbis_version-dll.7z || exit 1
|
7z x -y -olibvorbis $packagedir/libvorbis-$vorbis_version-dll.7z || exit 1
|
||||||
unzip -o $packagedir/openal_stripped.zip || exit 1
|
unzip -o $packagedir/openal_stripped.zip || exit 1
|
||||||
|
unzip -o $packagedir/curl-$curl_version-devel-mingw32.zip || exit 1
|
||||||
cd $builddir || exit 1
|
cd $builddir || exit 1
|
||||||
unzip -o $packagedir/minetest.zip || exit 1
|
unzip -o $packagedir/minetest.zip || exit 1
|
||||||
|
|
||||||
|
@ -77,13 +78,6 @@ unzip -o $packagedir/minetest.zip || exit 1
|
||||||
rm -rf $builddir/minetest
|
rm -rf $builddir/minetest
|
||||||
ln -s $minetestdir $builddir/minetest
|
ln -s $minetestdir $builddir/minetest
|
||||||
|
|
||||||
# Extract minetest_game
|
|
||||||
cd $minetestdir/games || exit 1
|
|
||||||
rm -rf minetest_game || exit 1
|
|
||||||
unzip -o $packagedir/minetest_game.zip || exit 1
|
|
||||||
minetest_gamedir=$minetestdir/games/$minetest_gamedirname || exit 1
|
|
||||||
mv $minetest_gamedir $minetestdir/games/minetest_game || exit 1
|
|
||||||
|
|
||||||
# Build the thing
|
# Build the thing
|
||||||
cd $minetestdir || exit 1
|
cd $minetestdir || exit 1
|
||||||
mkdir -p build || exit 1
|
mkdir -p build || exit 1
|
||||||
|
@ -106,6 +100,9 @@ cmake $minetestdir -DCMAKE_TOOLCHAIN_FILE=$toolchain_file -DENABLE_SOUND=1 \
|
||||||
-DOPENAL_INCLUDE_DIR=$libdir/openal_stripped/include \
|
-DOPENAL_INCLUDE_DIR=$libdir/openal_stripped/include \
|
||||||
-DOPENAL_LIBRARY=$libdir/openal_stripped/lib/OpenAL32.lib \
|
-DOPENAL_LIBRARY=$libdir/openal_stripped/lib/OpenAL32.lib \
|
||||||
-DOPENAL_DLL=$libdir/openal_stripped/bin/OpenAL32.dll \
|
-DOPENAL_DLL=$libdir/openal_stripped/bin/OpenAL32.dll \
|
||||||
|
-DCURL_INCLUDE_DIR=$libdir/curl-$curl_version-devel-mingw32/include \
|
||||||
|
-DCURL_LIBRARY=$libdir/curl-$curl_version-devel-mingw32/lib/libcurl.a \
|
||||||
|
-DCURL_DLL=$libdir/curl-$curl_version-devel-mingw32/bin/libcurl.dll \
|
||||||
-DMINGWM10_DLL=$packagedir/mingwm10.dll \
|
-DMINGWM10_DLL=$packagedir/mingwm10.dll \
|
||||||
-DCMAKE_INSTALL_PREFIX=/tmp \
|
-DCMAKE_INSTALL_PREFIX=/tmp \
|
||||||
-DVERSION_EXTRA=$git_hash \
|
-DVERSION_EXTRA=$git_hash \
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# name of the target operating system
|
# name of the target operating system
|
||||||
SET(CMAKE_SYSTEM_NAME Windows)
|
SET(CMAKE_SYSTEM_NAME Windows)
|
||||||
|
|
||||||
# which compilers to use for C and C++
|
# which compilers to use for C and C++
|
||||||
SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
|
SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
|
||||||
|
|
Loading…
Reference in New Issue