mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
refacto: Hud: make driver, client, player, inventory, tsrc private & drop unused guienv
also fix c_content.h, on client it includes the src/client/hud.h instead of src/hud.h, which leads to wrong file dependency on the lua stack
This commit is contained in:
parent
a47a00228b
commit
ccdd886e27
4 changed files with 12 additions and 14 deletions
|
@ -45,11 +45,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#define OBJECT_CROSSHAIR_LINE_SIZE 8
|
||||
#define CROSSHAIR_LINE_SIZE 10
|
||||
|
||||
Hud::Hud(gui::IGUIEnvironment *guienv, Client *client, LocalPlayer *player,
|
||||
Hud::Hud(Client *client, LocalPlayer *player,
|
||||
Inventory *inventory)
|
||||
{
|
||||
driver = RenderingEngine::get_video_driver();
|
||||
this->guienv = guienv;
|
||||
this->client = client;
|
||||
this->player = player;
|
||||
this->inventory = inventory;
|
||||
|
@ -315,7 +314,7 @@ bool Hud::calculateScreenPos(const v3s16 &camera_offset, HudElement *e, v2s32 *p
|
|||
{
|
||||
v3f w_pos = e->world_pos * BS;
|
||||
scene::ICameraSceneNode* camera =
|
||||
RenderingEngine::get_scene_manager()->getActiveCamera();
|
||||
client->getSceneManager()->getActiveCamera();
|
||||
w_pos -= intToFloat(camera_offset, BS);
|
||||
core::matrix4 trans = camera->getProjectionMatrix();
|
||||
trans *= camera->getViewMatrix();
|
||||
|
@ -475,7 +474,7 @@ void Hud::drawLuaElements(const v3s16 &camera_offset)
|
|||
|
||||
// Angle according to camera view
|
||||
v3f fore(0.f, 0.f, 1.f);
|
||||
scene::ICameraSceneNode *cam = RenderingEngine::get_scene_manager()->getActiveCamera();
|
||||
scene::ICameraSceneNode *cam = client->getSceneManager()->getActiveCamera();
|
||||
cam->getAbsoluteTransformation().rotateVect(fore);
|
||||
int angle = - fore.getHorizontalAngle().Y;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue