summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-01-28 01:38:16 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-01-28 01:38:16 +0200
commit64b59757322e29c331c0a75262baec4382673e6f (patch)
treeb1404f42db92b92202655bdd4f13a6c4c7fdd39d /src/main.cpp
parentbd100c5483eb77a27eeac4e476c81a1bf6afc710 (diff)
downloadminetest-64b59757322e29c331c0a75262baec4382673e6f.tar.gz
minetest-64b59757322e29c331c0a75262baec4382673e6f.tar.bz2
minetest-64b59757322e29c331c0a75262baec4382673e6f.zip
Now texture handling is fast. Also now players are saved on disk.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp61
1 files changed, 34 insertions, 27 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 388ab8089..0dc822474 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -104,8 +104,11 @@ SUGG: Meshes of blocks could be split into 6 meshes facing into
Gaming ideas:
-------------
-- Aim for something like controlling a single dwarf in Dwarf Fortress.
+- Aim for something like controlling a single dwarf in Dwarf Fortress
+- The player could go faster by a crafting a boat, or riding an animal
+
+- Random NPC traders. what else?
Documentation:
--------------
@@ -165,6 +168,20 @@ TODO: Make fetching sector's blocks more efficient when rendering
TODO: Flowing water animation
+FIXME: The new texture stuff is slow on wine
+ - A basic grassy ground block takes 20-40ms
+ - A bit more complicated block can take 270ms
+ - On linux, a similar one doesn't take long at all (14ms)
+ - It is NOT a bad std::string implementation of MSVC.
+ - Can take up to 200ms? Is it when loading textures or always?
+ - Updating excess amount of meshes when making footprints is too
+ slow. It has to be fixed.
+ -> implement Map::updateNodeMeshes()
+ The fix:
+ * Optimize TileSpec to only contain a reference number that
+ is fast to compare, which refers to a cached string, or
+ * Make TextureSpec for using instead of strings
+
Configuration:
--------------
@@ -281,18 +298,6 @@ TODO: Flowing water to actually contain flow direction information
TODO: Remove duplicate lighting implementation from Map (leave
VoxelManipulator, which is faster)
-FIXME: The new texture stuff is slow on wine
- - A basic grassy ground block takes 20-40ms
- - A bit more complicated block can take 270ms
- - On linux, a similar one doesn't take long at all (14ms)
- - Is it a bad std::string implementation of MSVC?
- - Can take up to 200ms? Is it when loading textures or always?
- - Updating excess amount of meshes when making footprints is too
- slow. It has to be fixed.
- -> implement Map::updateNodeMeshes()
- TODO: Optimize TileSpec to only contain a reference number that
- is fast to compare, which refers to a cached string
-
Doing now:
----------
@@ -360,6 +365,7 @@ Doing now:
#include "filesys.h"
#include "config.h"
#include "guiMainMenu.h"
+#include "mineral.h"
IrrlichtWrapper *g_irrlicht;
@@ -1445,7 +1451,6 @@ int main(int argc, char *argv[])
// C-style stuff initialization
initializeMaterialProperties();
- init_mapnode();
// Debug handler
BEGIN_DEBUG_EXCEPTION_HANDLER
@@ -1683,7 +1688,8 @@ int main(int argc, char *argv[])
*/
init_content_inventory_texture_paths();
- //init_tile_textures();
+ init_mapnode(g_irrlicht);
+ init_mineral(g_irrlicht);
/*
GUI stuff
@@ -2378,7 +2384,7 @@ int main(int argc, char *argv[])
bool nodefound = false;
v3s16 nodepos;
v3s16 neighbourpos;
- core::aabbox3d<f32> nodefacebox;
+ core::aabbox3d<f32> nodehilightbox;
f32 mindistance = BS * 1001;
v3s16 pos_i = floatToInt(player_position);
@@ -2470,7 +2476,7 @@ int main(int argc, char *argv[])
nodepos = np;
neighbourpos = np;
mindistance = distance;
- nodefacebox = box;
+ nodehilightbox = box;
}
}
}
@@ -2513,7 +2519,16 @@ int main(int argc, char *argv[])
nodepos = np;
neighbourpos = np + dirs[i];
mindistance = distance;
- nodefacebox = facebox;
+
+ //nodehilightbox = facebox;
+
+ const float d = 0.502;
+ core::aabbox3d<f32> nodebox
+ (-BS*d, -BS*d, -BS*d, BS*d, BS*d, BS*d);
+ v3f nodepos_f = intToFloat(nodepos);
+ nodebox.MinEdge += nodepos_f;
+ nodebox.MaxEdge += nodepos_f;
+ nodehilightbox = nodebox;
}
} // if distance < mindistance
} // for dirs
@@ -2531,15 +2546,7 @@ int main(int argc, char *argv[])
// Visualize selection
- const float d = 0.502;
- core::aabbox3d<f32> nodebox(-BS*d, -BS*d, -BS*d, BS*d, BS*d, BS*d);
- v3f nodepos_f = intToFloat(nodepos);
- //v3f nodepos_f(nodepos.X*BS, nodepos.Y*BS, nodepos.Z*BS);
- nodebox.MinEdge += nodepos_f;
- nodebox.MaxEdge += nodepos_f;
- hilightboxes.push_back(nodebox);
-
- //hilightboxes.push_back(nodefacebox);
+ hilightboxes.push_back(nodehilightbox);
// Handle digging