mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Environment & IGameDef code refactoring (#4985)
* Environment code refactoring * Cleanup includes & class declarations in client & server environment to improve build speed * ServerEnvironment::m_gamedef is now a pointer to Server instead of IGameDef, permitting to cleanup many casts. * Cleanup IGameDef * Move ITextureSource* IGameDef::getTextureSource() to Client only. * Also move ITextureSource *IGameDef::tsrc() helper * drop getShaderSource, getSceneManager, getSoundManager & getCamera abstract call * drop unused emerge() call * cleanup server unused functions (mentionned before) * Drop one unused parameter from ContentFeatures::updateTextures * move checkLocalPrivilege to Client * Remove some unnecessary casts * create_formspec_menu: remove IWritableTextureSource pointer, as client already knows it * Fix some comments * Change required IGameDef to Server/Client pointers * Previous change that game.cpp sometimes calls functions with Client + InventoryManager + IGameDef in same functions but it's the same objects * Remove duplicate Client pointer in GUIFormSpecMenu::GUIFormSpecMenu * drop ClientMap::sectorWasDrawn which is unused
This commit is contained in:
parent
11df7e886a
commit
8e7449e092
49 changed files with 301 additions and 409 deletions
|
@ -35,13 +35,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
ClientMap::ClientMap(
|
||||
Client *client,
|
||||
IGameDef *gamedef,
|
||||
MapDrawControl &control,
|
||||
scene::ISceneNode* parent,
|
||||
scene::ISceneManager* mgr,
|
||||
s32 id
|
||||
):
|
||||
Map(dout_client, gamedef),
|
||||
Map(dout_client, client),
|
||||
scene::ISceneNode(parent, mgr, id),
|
||||
m_client(client),
|
||||
m_control(control),
|
||||
|
@ -140,7 +139,7 @@ static bool isOccluded(Map *map, v3s16 p0, v3s16 p1, float step, float stepfac,
|
|||
return false;
|
||||
}
|
||||
|
||||
void ClientMap::getBlocksInViewRange(v3s16 cam_pos_nodes,
|
||||
void ClientMap::getBlocksInViewRange(v3s16 cam_pos_nodes,
|
||||
v3s16 *p_blocks_min, v3s16 *p_blocks_max)
|
||||
{
|
||||
v3s16 box_nodes_d = m_control.wanted_range * v3s16(1, 1, 1);
|
||||
|
@ -766,7 +765,7 @@ void ClientMap::renderPostFx(CameraMode cam_mode)
|
|||
const ContentFeatures& features = m_nodedef->get(n);
|
||||
video::SColor post_effect_color = features.post_effect_color;
|
||||
if(features.solidness == 2 && !(g_settings->getBool("noclip") &&
|
||||
m_gamedef->checkLocalPrivilege("noclip")) &&
|
||||
m_client->checkLocalPrivilege("noclip")) &&
|
||||
cam_mode == CAMERA_MODE_FIRST)
|
||||
{
|
||||
post_effect_color = video::SColor(255, 0, 0, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue