#CXXFLAGS = -O1 -ffast-math -Wall -g\r
#CXXFLAGS = -Wall -g -O0\r
\r
-#FAST_CXXFLAGS = -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops -mtune=i686\r
-\r
-#Default target\r
-\r
-all: all_linux\r
+all: fast_linux\r
\r
ifeq ($(HOSTTYPE), x86_64)\r
LIBSELECT=64\r
endif\r
\r
-# Target specific settings\r
-\r
all_linux fast_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L$(IRRLICHTPATH)/lib/Linux -L$(JTHREADPATH)/src/.libs -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -ljthread -lz\r
all_linux fast_linux: CPPFLAGS = -I$(IRRLICHTPATH)/include -I/usr/X11R6/include -I$(JTHREADPATH)/src\r
fast_linux server_linux: CXXFLAGS = -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops -mtune=i686\r
server_linux: CPPFLAGS = -I$(IRRLICHTPATH)/include -I/usr/X11R6/include -I$(JTHREADPATH)/src -DSERVER\r
all_linux fast_linux clean_linux: SYSTEM=Linux\r
\r
-# These are out of date\r
-all_win32: LDFLAGS = -L$(IRRLICHTPATH)/lib/Win32-gcc -L$(JTHREADPATH)/Debug -lIrrlicht -lopengl32 -lm -ljthread\r
-all_win32 clean_win32: SYSTEM=Win32-gcc\r
-all_win32 clean_win32: SUF=.exe\r
-\r
-# Name of the binary - only valid for targets which set SYSTEM\r
-\r
-DESTPATH = bin/$(TARGET)$(SUF)\r
-FAST_DESTPATH = bin/$(FAST_TARGET)$(SUF)\r
-SERVER_DESTPATH = bin/$(SERVER_TARGET)$(SUF)\r
+DESTPATH = bin/$(TARGET)\r
+FAST_DESTPATH = bin/$(FAST_TARGET)\r
+SERVER_DESTPATH = bin/$(SERVER_TARGET)\r
\r
# Build commands\r
\r
-all_linux all_win32: $(BUILD_DIR) $(DESTPATH)\r
+all_linux: $(BUILD_DIR) $(DESTPATH)\r
fast_linux: $(FAST_BUILD_DIR) $(FAST_DESTPATH)\r
server_linux: $(SERVER_BUILD_DIR) $(SERVER_DESTPATH)\r
\r
$(SERVER_BUILD_DIR)/%.o: src/%.cpp\r
$(CXX) -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS)\r
\r
-clean: clean_linux clean_win32 clean_fast_linux clean_server_linux\r
+clean: clean_linux clean_fast_linux clean_server_linux\r
\r
-clean_linux clean_win32:\r
+clean_linux:\r
@$(RM) $(OBJECTS) $(DESTPATH)\r
\r
clean_fast_linux:\r
- @$(RM) $(OBJECTS) $(FAST_DESTPATH)\r
+ @$(RM) $(FAST_OBJECTS) $(FAST_DESTPATH)\r
\r
clean_server_linux:\r
@$(RM) $(SERVER_OBJECTS) $(SERVER_DESTPATH)\r
\r
SUGG: Signs could be done in the same way as torches. For this, blocks\r
need an additional metadata field for the texts\r
+ - This is also needed for item container chests\r
\r
SUGG: Precalculate lighting translation table at runtime (at startup)\r
\r
- This can then be used to make sure the most recent version of\r
a block has been sent to client\r
\r
+SUGG: Make the amount of blocks sending to client and the total\r
+ amount of blocks dynamically limited. Transferring blocks is the\r
+ main network eater of this system, so it is the one that has\r
+ to be throttled so that RTTs stay low.\r
+\r
+TODO: Untie client network operations from framerate\r
+ - Needs some input queues or something\r
+ - Not really necessary?\r
+\r
TODO: Combine MapBlock's face caches to so big pieces that VBO\r
gets used\r
- That is >500 vertices\r
TODO: Better dungeons\r
TODO: Cliffs, arcs\r
\r
-TODO: Menus\r
-\r
-TODO: Moving players more smoothly. Calculate moving animation\r
- in a way that doesn't make the player jump to the right place\r
- immediately when the server sends a new position\r
+TODO: Startup and configuration menu\r
\r
TODO: There are some lighting-related todos and fixmes in\r
ServerMap::emergeBlock\r
is not in the middle of an ocean (some land to stand on at\r
least) and save it in map config.\r
\r
-TODO: Make the amount of blocks sending to client and the total\r
- amount of blocks dynamically limited. Transferring blocks is the\r
- main network eater of this system, so it is the one that has\r
- to be throttled so that RTTs stay low.\r
-\r
-TODO: Server to load starting inventory from disk\r
-\r
TODO: Players to only be hidden when the client quits.\r
TODO: - Players to be saved on disk, with inventory\r
TODO: Players to be saved as text in map/players/<name>\r
+TODO: Player inventory to be saved on disk\r
\r
TODO: Make fetching sector's blocks more efficient when rendering\r
sectors that have very large amounts of blocks (on client)\r
TODO: Copy the text of the last picked sign to inventory in creative\r
mode\r
\r
-TODO: Untie client network operations from framerate\r
- - Needs some input queues or something\r
-\r
TODO: Get rid of GotSplitPacketException\r
\r
TODO: Check what goes wrong with caching map to disk (Kray)\r
- Make other players utilize the same framework\r
\r
TODO: Draw big amounts of torches better (that is, throw them in the\r
- same meshbuffer (can the meshcombiner class be used?))\r
+ same meshbuffer (can the meshcollector class be used?))\r
\r
Doing now:\r
======================================================================\r
m_mesh_expired = false;
mesh_mutex.Init();
mesh = NULL;
+ m_temp_mods_mutex.Init();
#endif
}
NOTE: This is the slowest part of this method.
*/
+
+ {
+ // Lock this, as m_temp_mods will be used directly
+ JMutexAutoLock lock(m_temp_mods_mutex);
- /*
- Go through every y,z and get top faces in rows of x+
- */
- for(s16 y=0; y<MAP_BLOCKSIZE; y++){
- for(s16 z=0; z<MAP_BLOCKSIZE; z++){
- updateFastFaceRow(daynight_ratio, posRelative_f,
- v3s16(0,y,z), MAP_BLOCKSIZE,
- v3s16(1,0,0), //dir
- v3f (1,0,0),
- v3s16(0,1,0), //face dir
- v3f (0,1,0),
- fastfaces_new);
- }
- }
- /*
- Go through every x,y and get right faces in rows of z+
- */
- for(s16 x=0; x<MAP_BLOCKSIZE; x++){
+ /*
+ Go through every y,z and get top faces in rows of x+
+ */
for(s16 y=0; y<MAP_BLOCKSIZE; y++){
- updateFastFaceRow(daynight_ratio, posRelative_f,
- v3s16(x,y,0), MAP_BLOCKSIZE,
- v3s16(0,0,1),
- v3f (0,0,1),
- v3s16(1,0,0),
- v3f (1,0,0),
- fastfaces_new);
+ for(s16 z=0; z<MAP_BLOCKSIZE; z++){
+ updateFastFaceRow(daynight_ratio, posRelative_f,
+ v3s16(0,y,z), MAP_BLOCKSIZE,
+ v3s16(1,0,0), //dir
+ v3f (1,0,0),
+ v3s16(0,1,0), //face dir
+ v3f (0,1,0),
+ fastfaces_new);
+ }
}
- }
- /*
- Go through every y,z and get back faces in rows of x+
- */
- for(s16 z=0; z<MAP_BLOCKSIZE; z++){
- for(s16 y=0; y<MAP_BLOCKSIZE; y++){
- updateFastFaceRow(daynight_ratio, posRelative_f,
- v3s16(0,y,z), MAP_BLOCKSIZE,
- v3s16(1,0,0),
- v3f (1,0,0),
- v3s16(0,0,1),
- v3f (0,0,1),
- fastfaces_new);
+ /*
+ Go through every x,y and get right faces in rows of z+
+ */
+ for(s16 x=0; x<MAP_BLOCKSIZE; x++){
+ for(s16 y=0; y<MAP_BLOCKSIZE; y++){
+ updateFastFaceRow(daynight_ratio, posRelative_f,
+ v3s16(x,y,0), MAP_BLOCKSIZE,
+ v3s16(0,0,1),
+ v3f (0,0,1),
+ v3s16(1,0,0),
+ v3f (1,0,0),
+ fastfaces_new);
+ }
+ }
+ /*
+ Go through every y,z and get back faces in rows of x+
+ */
+ for(s16 z=0; z<MAP_BLOCKSIZE; z++){
+ for(s16 y=0; y<MAP_BLOCKSIZE; y++){
+ updateFastFaceRow(daynight_ratio, posRelative_f,
+ v3s16(0,y,z), MAP_BLOCKSIZE,
+ v3s16(1,0,0),
+ v3f (1,0,0),
+ v3s16(0,0,1),
+ v3f (0,0,1),
+ fastfaces_new);
+ }
}
}
<<", mod.type="<<mod.type
<<", mod.param="<<mod.param
<<std::endl;*/
+ JMutexAutoLock lock(m_temp_mods_mutex);
m_temp_mods[p] = mod;
}
+ // Returns true if there was one
+ bool getTempMod(v3s16 p, struct NodeMod *mod)
+ {
+ JMutexAutoLock lock(m_temp_mods_mutex);
+ core::map<v3s16, NodeMod>::Node *n;
+ n = m_temp_mods.find(p);
+ if(n == NULL)
+ return false;
+ if(mod)
+ *mod = n->getValue();
+ return true;
+ }
void clearTempMod(v3s16 p)
{
+ JMutexAutoLock lock(m_temp_mods_mutex);
if(m_temp_mods.find(p))
m_temp_mods.remove(p);
}
void clearTempMods()
{
+ JMutexAutoLock lock(m_temp_mods_mutex);
m_temp_mods.clear();
}
#endif
// Temporary modifications to nodes
// These are only used when drawing
core::map<v3s16, NodeMod> m_temp_mods;
+ JMutex m_temp_mods_mutex;
#endif
};