copied draft of updateNodeMeshes from backup
parent
e4f7f97e6c
commit
06eb0ad4d0
14
src/main.cpp
14
src/main.cpp
|
@ -183,8 +183,6 @@ TODO: Remove IrrlichtWrapper
|
||||||
Server:
|
Server:
|
||||||
-------
|
-------
|
||||||
|
|
||||||
TODO: When player dies, throw items on map
|
|
||||||
|
|
||||||
SUGG: Make an option to the server to disable building and digging near
|
SUGG: Make an option to the server to disable building and digging near
|
||||||
the starting position
|
the starting position
|
||||||
|
|
||||||
|
@ -202,6 +200,8 @@ FIXME: Server sometimes goes into some infinite PeerNotFoundException loop
|
||||||
* Make a small history check to transformLiquids to detect and log
|
* Make a small history check to transformLiquids to detect and log
|
||||||
continuous oscillations, in such detail that they can be fixed.
|
continuous oscillations, in such detail that they can be fixed.
|
||||||
|
|
||||||
|
TODO: When player dies, throw items on map
|
||||||
|
|
||||||
Objects:
|
Objects:
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@ -215,11 +215,11 @@ Block object server side:
|
||||||
- A "near blocks" buffer, in which some nearby blocks are stored.
|
- A "near blocks" buffer, in which some nearby blocks are stored.
|
||||||
- For all blocks in the buffer, objects are stepped(). This
|
- For all blocks in the buffer, objects are stepped(). This
|
||||||
means they are active.
|
means they are active.
|
||||||
- TODO: A global active buffer is needed for the server
|
- A global active buffer is needed for the server
|
||||||
- TODO: A timestamp to blocks
|
- A timestamp to blocks
|
||||||
- TODO: All blocks going in and out of the buffer are recorded.
|
- All blocks going in and out of the buffer are recorded.
|
||||||
- TODO: For outgoing blocks, timestamp is written.
|
- For outgoing blocks, timestamp is written.
|
||||||
- TODO: For incoming blocks, time difference is calculated and
|
- For incoming blocks, time difference is calculated and
|
||||||
objects are stepped according to it.
|
objects are stepped according to it.
|
||||||
|
|
||||||
- When an active object goes far from a player, either delete
|
- When an active object goes far from a player, either delete
|
||||||
|
|
56
src/map.cpp
56
src/map.cpp
|
@ -5692,27 +5692,45 @@ void ClientMap::updateMeshes(v3s16 blockpos, u32 daynight_ratio)
|
||||||
b->updateMesh(daynight_ratio);
|
b->updateMesh(daynight_ratio);
|
||||||
}
|
}
|
||||||
catch(InvalidPositionException &e){}
|
catch(InvalidPositionException &e){}
|
||||||
/*// Trailing edge
|
|
||||||
try{
|
|
||||||
v3s16 p = blockpos + v3s16(1,0,0);
|
|
||||||
MapBlock *b = getBlockNoCreate(p);
|
|
||||||
b->updateMesh(daynight_ratio);
|
|
||||||
}
|
|
||||||
catch(InvalidPositionException &e){}
|
|
||||||
try{
|
|
||||||
v3s16 p = blockpos + v3s16(0,1,0);
|
|
||||||
MapBlock *b = getBlockNoCreate(p);
|
|
||||||
b->updateMesh(daynight_ratio);
|
|
||||||
}
|
|
||||||
catch(InvalidPositionException &e){}
|
|
||||||
try{
|
|
||||||
v3s16 p = blockpos + v3s16(0,0,1);
|
|
||||||
MapBlock *b = getBlockNoCreate(p);
|
|
||||||
b->updateMesh(daynight_ratio);
|
|
||||||
}
|
|
||||||
catch(InvalidPositionException &e){}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/*
|
||||||
|
Update mesh of block in which the node is, and if the node is at the
|
||||||
|
leading edge, update the appropriate leading blocks too.
|
||||||
|
*/
|
||||||
|
void ClientMap::updateNodeMeshes(v3s16 nodepos, u32 daynight_ratio)
|
||||||
|
{
|
||||||
|
v3s16 dirs[4] = {
|
||||||
|
v3s16(0,0,0),
|
||||||
|
v3s16(-1,0,0),
|
||||||
|
v3s16(0,-1,0),
|
||||||
|
v3s16(0,0,-1),
|
||||||
|
};
|
||||||
|
v3s16 blockposes[4];
|
||||||
|
for(u32 i=0; i<4; i++)
|
||||||
|
{
|
||||||
|
v3s16 np = nodepos + dirs[i];
|
||||||
|
blockposes[i] = getNodeBlockPos(np);
|
||||||
|
// Don't update mesh of block if it has been done already
|
||||||
|
bool already_updated = false;
|
||||||
|
for(u32 j=0; j<i; j++)
|
||||||
|
{
|
||||||
|
if(blockposes[j] == blockposes[i])
|
||||||
|
{
|
||||||
|
already_updated = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(already_updated)
|
||||||
|
continue;
|
||||||
|
// Update mesh
|
||||||
|
MapBlock *b = getBlockNoCreate(blockposes[i]);
|
||||||
|
b->updateMesh(daynight_ratio);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void ClientMap::PrintInfo(std::ostream &out)
|
void ClientMap::PrintInfo(std::ostream &out)
|
||||||
{
|
{
|
||||||
out<<"ClientMap: ";
|
out<<"ClientMap: ";
|
||||||
|
|
Loading…
Reference in New Issue