Environment & IGameDef code refactoring (#4985)
authorNer'zhul <nerzhul@users.noreply.github.com>
Mon, 9 Jan 2017 19:39:22 +0000 (20:39 +0100)
committerGitHub <noreply@github.com>
Mon, 9 Jan 2017 19:39:22 +0000 (20:39 +0100)
commit8e7449e09253e138716d8dbad6a2ab5c6e089e28
treeca6895fb557229445b04639efe7fc57b3e33157b
parent11df7e886a674e280e3ec6f895c11fc1e70eb7b3
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
49 files changed:
build/android/jni/Android.mk
src/camera.cpp
src/camera.h
src/client.cpp
src/client.h
src/clientenvironment.cpp
src/clientenvironment.h
src/clientmap.cpp
src/clientmap.h
src/clientobject.cpp
src/clientobject.h
src/collision.cpp
src/content_cao.cpp
src/content_cao.h
src/content_cso.cpp
src/content_mapblock.cpp
src/content_sao.cpp
src/emerge.cpp
src/emerge.h
src/environment.h
src/game.cpp
src/gamedef.h
src/guiEngine.cpp
src/guiFormSpecMenu.cpp
src/guiFormSpecMenu.h
src/hud.cpp
src/hud.h
src/itemdef.cpp
src/itemdef.h
src/localplayer.cpp
src/localplayer.h
src/mapblock_mesh.cpp
src/mapblock_mesh.h
src/mg_biome.cpp
src/mg_biome.h
src/mg_schematic.cpp
src/mg_schematic.h
src/nodedef.cpp
src/nodedef.h
src/particles.cpp
src/particles.h
src/pathfinder.cpp
src/script/lua_api/l_nodemeta.cpp
src/server.cpp
src/server.h
src/serverenvironment.cpp
src/serverenvironment.h
src/wieldmesh.cpp
src/wieldmesh.h