Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/client/attachableobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ AttachedEffectPtr AttachableObject::getAttachedEffectById(uint16_t id)
return *it;
}

void AttachableObject::drawAttachedEffect(const Point& dest, const LightViewPtr& lightView, const bool isOnTop)
void AttachableObject::drawAttachedEffect(const Point& dest, LightView* lightView, const bool isOnTop)
{
if (!hasAttachedEffects()) return;
for (const auto& effect : m_data->attachedEffects) {
Expand All @@ -162,7 +162,7 @@ void AttachableObject::drawAttachedEffect(const Point& dest, const LightViewPtr&
}
}

void AttachableObject::drawAttachedLightEffect(const Point& dest, const LightViewPtr& lightView) {
void AttachableObject::drawAttachedLightEffect(const Point& dest, LightView* lightView) {
if (!hasAttachedEffects()) return;
for (const auto& effect : m_data->attachedEffects)
effect->drawLight(dest, lightView);
Expand Down
5 changes: 3 additions & 2 deletions src/client/attachableobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "declarations.h"
#include "framework/graphics/declarations.h"
#include "framework/luaengine/luaobject.h"
#include "framework/ui/declarations.h"

static const std::vector<UIWidgetPtr> EMPTY_ATTACHED_WIDGETS;
static const std::vector<AttachedEffectPtr> EMPTY_ATTACHED_EFFECTS;
Expand Down Expand Up @@ -79,8 +80,8 @@ class AttachableObject : public LuaObject
std::vector<UIWidgetPtr> attachedWidgets;
};

void drawAttachedEffect(const Point& dest, const LightViewPtr& lightView, bool isOnTop);
void drawAttachedLightEffect(const Point& dest, const LightViewPtr& lightView);
void drawAttachedEffect(const Point& dest, LightView* lightView, bool isOnTop);
void drawAttachedLightEffect(const Point& dest, LightView* lightView);

void onDetachEffect(const AttachedEffectPtr& effect, bool callEvent = true);
void drawAttachedParticlesEffect(const Point& dest);
Expand Down
4 changes: 2 additions & 2 deletions src/client/attachedeffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ int getBounce(const AttachedEffect::Bounce bounce, const ticks_t ticks) {
return minHeight + (height - std::abs(height - static_cast<int>(ticks / (bounce.speed / 100.f)) % static_cast<int>(height * 2)));
}

void AttachedEffect::draw(const Point& dest, const bool isOnTop, const LightViewPtr& lightView, const bool drawThing) {
void AttachedEffect::draw(const Point& dest, const bool isOnTop, LightView* lightView, const bool drawThing) {
if (m_transform)
return;

Expand Down Expand Up @@ -154,7 +154,7 @@ void AttachedEffect::draw(const Point& dest, const bool isOnTop, const LightView
}
}

void AttachedEffect::drawLight(const Point& dest, const LightViewPtr& lightView) {
void AttachedEffect::drawLight(const Point& dest, LightView* lightView) {
if (!lightView) return;

const auto& dirControl = m_offsetDirections[m_direction];
Expand Down
4 changes: 2 additions & 2 deletions src/client/attachedeffect.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class AttachedEffect final : public LuaObject
public:
static AttachedEffectPtr create(uint16_t thingId, ThingCategory category);

void draw(const Point& /*dest*/, bool /*isOnTop*/, const LightViewPtr & = nullptr, bool drawThing = true);
void drawLight(const Point& /*dest*/, const LightViewPtr&);
void draw(const Point& /*dest*/, bool /*isOnTop*/, LightView* = nullptr, bool drawThing = true);
void drawLight(const Point& /*dest*/, LightView*);

uint16_t getId() { return m_id; }

Expand Down
4 changes: 2 additions & 2 deletions src/client/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void Creature::onCreate() {
callLuaField("onCreate");
}

void Creature::draw(const Point& dest, const bool drawThings, const LightViewPtr& /*lightView*/)
void Creature::draw(const Point& dest, const bool drawThings, LightView* /*lightView*/)
{
if (!canBeSeen() || !canDraw() || isDead())
return;
Expand Down Expand Up @@ -100,7 +100,7 @@ void Creature::draw(const Point& dest, const bool drawThings, const LightViewPtr
// drawLight(dest, lightView);
}

void Creature::drawLight(const Point& dest, const LightViewPtr& lightView) {
void Creature::drawLight(const Point& dest, LightView* lightView) {
if (!lightView) return;

auto light = getLight();
Expand Down
4 changes: 2 additions & 2 deletions src/client/creature.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ class Creature : public Thing
void onAppear() override;
void onDisappear() override;

void draw(const Point& dest, bool drawThings = true, const LightViewPtr& lightView = nullptr) override;
void draw(const Point& dest, bool drawThings = true, LightView* lightView = nullptr) override;
void draw(const Rect& destRect, uint8_t size, bool center = false);
void drawLight(const Point& dest, const LightViewPtr& lightView) override;
void drawLight(const Point& dest, LightView* lightView) override;

void internalDraw(Point dest, const Color& color = Color::white);
void drawInformation(const MapPosInfo& mapRect, const Point& dest, int drawFlags);
Expand Down
2 changes: 0 additions & 2 deletions src/client/declarations.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
#pragma once

#include "global.h"
#include <framework/net/declarations.h>
#include <framework/ui/declarations.h>

enum FrameGroupType : uint8_t;
enum ThingCategory : uint8_t;
Expand Down
2 changes: 1 addition & 1 deletion src/client/effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "framework/graphics/drawpoolmanager.h"
#include "framework/graphics/shadermanager.h"

void Effect::draw(const Point& dest, const bool drawThings, const LightViewPtr& lightView)
void Effect::draw(const Point& dest, const bool drawThings, LightView* lightView)
{
if (!canDraw() || isHided())
return;
Expand Down
2 changes: 1 addition & 1 deletion src/client/effect.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class Effect final : public Thing
{
public:
void draw(const Point& /*dest*/, bool drawThings = true, const LightViewPtr & = nullptr) override;
void draw(const Point& /*dest*/, bool drawThings = true, LightView* = nullptr) override;
void setId(uint32_t id) override;
void setPosition(const Position& position, uint8_t stackPos = 0) override;

Expand Down
4 changes: 4 additions & 0 deletions src/client/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,15 @@
#include "map.h"
#include "protocolgame.h"
#include "protocolcodes.h"
#include "thingtype.h"
#include "thingtypemanager.h"
#include "tile.h"
#include "framework/core/eventdispatcher.h"
#include "framework/core/graphicalapplication.h"
#include "framework/luaengine/luainterface.h"
#include "framework/net/packet_player.h"
#include "framework/net/packet_recorder.h"
#include "luavaluecasts_client.h"

Game g_game;

Expand Down
6 changes: 3 additions & 3 deletions src/client/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ItemPtr Item::create(const int id)
return item;
}

void Item::draw(const Point& dest, const bool drawThings, const LightViewPtr& lightView)
void Item::draw(const Point& dest, const bool drawThings, LightView* lightView)
{
if (!canDraw(m_color) || isHided())
return;
Expand All @@ -63,7 +63,7 @@ void Item::draw(const Point& dest, const bool drawThings, const LightViewPtr& li
internalDraw(animationPhase, dest, getHighlightColor(), drawThings, true);
}

void Item::internalDraw(const int animationPhase, const Point& dest, const Color& color, const bool drawThings, const bool replaceColorShader, const LightViewPtr& lightView)
void Item::internalDraw(const int animationPhase, const Point& dest, const Color& color, const bool drawThings, const bool replaceColorShader, LightView* lightView)
{
if (replaceColorShader)
g_drawPool.setShaderProgram(g_painter->getReplaceColorShader(), true);
Expand All @@ -88,7 +88,7 @@ void Item::internalDraw(const int animationPhase, const Point& dest, const Color
}
}

void Item::drawLight(const Point& dest, const LightViewPtr& lightView) {
void Item::drawLight(const Point& dest, LightView* lightView) {
if (!lightView) return;
getThingType()->draw(dest, 0, m_numPatternX, m_numPatternY, m_numPatternZ, 0, Color::white, false, lightView);
drawAttachedLightEffect(dest, lightView);
Expand Down
6 changes: 3 additions & 3 deletions src/client/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ class Item final : public Thing
public:
static ItemPtr create(int id);

void draw(const Point& dest, bool drawThings = true, const LightViewPtr& lightView = nullptr) override;
void drawLight(const Point& dest, const LightViewPtr& lightView) override;
void draw(const Point& dest, bool drawThings = true, LightView* lightView = nullptr) override;
void drawLight(const Point& dest, LightView* lightView) override;

void setId(uint32_t id) override;

Expand Down Expand Up @@ -163,7 +163,7 @@ class Item final : public Thing
private:
ThingType* getThingType() const override;

void internalDraw(int animationPhase, const Point& dest, const Color& color, bool drawThings, bool replaceColorShader, const LightViewPtr& lightView = nullptr);
void internalDraw(int animationPhase, const Point& dest, const Color& color, bool drawThings, bool replaceColorShader, LightView* lightView = nullptr);

uint16_t m_countOrSubType{ 0 };
uint32_t m_durationTime{ 0 };
Expand Down
1 change: 1 addition & 0 deletions src/client/localplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "game.h"
#include "item.h"
#include "map.h"
#include "tile.h"
#include "framework/core/clock.h"
#include "framework/core/eventdispatcher.h"

Expand Down
2 changes: 1 addition & 1 deletion src/client/luafunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#include "uieffect.h"
#include "uiitem.h"
#include "uimissile.h"

#include <framework/graphics/paintershaderprogram.h>
#include "attachableobject.h"
#include "thingtype.h"
#include "uigraph.h"
Expand Down
1 change: 1 addition & 0 deletions src/client/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "localplayer.h"
#include "mapview.h"
#include "minimap.h"
#include "missile.h"
#include "thing.h"
#include "tile.h"
#include "framework/core/asyncdispatcher.h"
Expand Down
1 change: 1 addition & 0 deletions src/client/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "declarations.h"
#include "staticdata.h"
#include "framework/core/inputevent.h"
#include "framework/ui/declarations.h"

class TileBlock
{
Expand Down
4 changes: 2 additions & 2 deletions src/client/mapview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ void MapView::drawLights() {
}

for (const auto& tile : map.tiles)
tile->drawLight(transformPositionTo2D(tile->getPosition()), m_lightView);
tile->drawLight(transformPositionTo2D(tile->getPosition()), m_lightView.get());

for (const auto& missile : g_map.getFloorMissiles(z))
missile->draw(transformPositionTo2D(missile->getPosition()), false, m_lightView);
missile->draw(transformPositionTo2D(missile->getPosition()), false, m_lightView.get());
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/client/mapview.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
*/

#pragma once

#include "declarations.h"
#include <framework/graphics/declarations.h>
#include <framework/luaengine/luaobject.h>

#include "framework/core/timer.h"
#include "staticdata.h"
#include "framework/core/inputevent.h"

// @bindclass
class MapView final : public LuaObject
Expand Down
2 changes: 1 addition & 1 deletion src/client/missile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "framework/graphics/drawpoolmanager.h"
#include "framework/graphics/shadermanager.h"

void Missile::draw(const Point& dest, const bool drawThings, const LightViewPtr& lightView)
void Missile::draw(const Point& dest, const bool drawThings, LightView* lightView)
{
if (!canDraw() || isHided())
return;
Expand Down
2 changes: 1 addition & 1 deletion src/client/missile.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class Missile final : public Thing
{
public:
void draw(const Point& dest, bool drawThings = true, const LightViewPtr& lightView = nullptr) override;
void draw(const Point& dest, bool drawThings = true, LightView* lightView = nullptr) override;

void setId(uint32_t id) override;
void setPath(const Position& fromPosition, const Position& toPosition);
Expand Down
2 changes: 2 additions & 0 deletions src/client/position.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

#pragma once

#include "const.h"

class Position
{
public:
Expand Down
1 change: 1 addition & 0 deletions src/client/protocolgamesend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "protocolgame.h"
#include "framework/net/outputmessage.h"
#include "protocolcodes.h"
#include "thingtypemanager.h"
#include "framework/util/crypt.h"

void ProtocolGame::onSend() {}
Expand Down
2 changes: 2 additions & 0 deletions src/client/statictext.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

#include <framework/graphics/cachedtext.h>

#include "declarations.h"
#include "framework/core/declarations.h"
#include "framework/luaengine/luaobject.h"

// @bindclass
Expand Down
4 changes: 2 additions & 2 deletions src/client/thing.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
class Thing : public AttachableObject
{
public:
virtual void draw(const Point& /*dest*/, bool /*drawThings*/ = true, const LightViewPtr & = nullptr) {}
virtual void drawLight(const Point& /*dest*/, const LightViewPtr&) {}
virtual void draw(const Point& /*dest*/, bool /*drawThings*/ = true, LightView* = nullptr) {}
virtual void drawLight(const Point& /*dest*/, LightView*) {}

LuaObjectPtr attachedObjectToLuaObject() override { return asLuaObject(); }
bool isThing() override { return true; }
Expand Down
2 changes: 1 addition & 1 deletion src/client/thingtype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ void ThingType::drawWithFrameBuffer(const TexturePtr& texture, const Rect& scree
g_drawPool.resetShaderProgram();
}

void ThingType::draw(const Point& dest, const int layer, const int xPattern, const int yPattern, const int zPattern, const int animationPhase, const Color& color, const bool drawThings, const LightViewPtr& lightView)
void ThingType::draw(const Point& dest, const int layer, const int xPattern, const int yPattern, const int zPattern, const int animationPhase, const Color& color, const bool drawThings, LightView* lightView)
{
if (m_null)
return;
Expand Down
2 changes: 1 addition & 1 deletion src/client/thingtype.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ThingType final : public LuaObject
void exportImage(const std::string& fileName);
#endif

void draw(const Point& dest, int layer, int xPattern, int yPattern, int zPattern, int animationPhase, const Color& color, bool drawThings = true, const LightViewPtr& lightView = nullptr);
void draw(const Point& dest, int layer, int xPattern, int yPattern, int zPattern, int animationPhase, const Color& color, bool drawThings = true, LightView* lightView = nullptr);

void drawWithFrameBuffer(const TexturePtr& texture, const Rect& screenRect, const Rect& textureRect, const Color& color);

Expand Down
8 changes: 4 additions & 4 deletions src/client/tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void updateElevation(const ThingPtr& thing, uint8_t& drawElevation) {
drawElevation = std::min<uint8_t>(drawElevation + thing->getElevation(), g_gameConfig.getTileMaxElevation());
}

void drawThing(const ThingPtr& thing, const Point& dest, const int flags, uint8_t& drawElevation, const LightViewPtr& lightView = nullptr)
void drawThing(const ThingPtr& thing, const Point& dest, const int flags, uint8_t& drawElevation, LightView* lightView = nullptr)
{
const auto& newDest = dest - drawElevation * g_drawPool.getScaleFactor();

Expand All @@ -66,7 +66,7 @@ void drawThing(const ThingPtr& thing, const Point& dest, const int flags, uint8_
}
}

void Tile::draw(const Point& dest, const int flags, const LightViewPtr& lightView)
void Tile::draw(const Point& dest, const int flags, LightView* lightView)
{
m_lastDrawDest = dest;

Expand Down Expand Up @@ -107,7 +107,7 @@ void Tile::draw(const Point& dest, const int flags, const LightViewPtr& lightVie
drawAttachedParticlesEffect(dest);
}

void Tile::drawLight(const Point& dest, const LightViewPtr& lightView) {
void Tile::drawLight(const Point& dest, LightView* lightView) {
uint8_t drawElevation = 0;

for (const auto& thing : m_things) {
Expand All @@ -127,7 +127,7 @@ void Tile::drawLight(const Point& dest, const LightViewPtr& lightView) {
drawAttachedLightEffect(dest, lightView);
}

void Tile::drawCreature(const Point& dest, const int flags, const bool forceDraw, uint8_t drawElevation, const LightViewPtr& lightView)
void Tile::drawCreature(const Point& dest, const int flags, const bool forceDraw, uint8_t drawElevation, LightView* lightView)
{
if (!forceDraw && !m_drawTopAndCreature)
return;
Expand Down
6 changes: 3 additions & 3 deletions src/client/tile.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class Tile final : public AttachableObject
bool isTile() override { return true; }

void onAddInMapView();
void draw(const Point& dest, int flags, const LightViewPtr& lightView = nullptr);
void drawLight(const Point& dest, const LightViewPtr& lightView);
void draw(const Point& dest, int flags, LightView* lightView = nullptr);
void drawLight(const Point& dest, LightView* lightView);

void clean();

Expand Down Expand Up @@ -158,7 +158,7 @@ class Tile final : public AttachableObject
private:
void updateThingStackPos();
void drawTop(const Point& dest, int flags, bool forceDraw, uint8_t drawElevation);
void drawCreature(const Point& dest, int flags, bool forceDraw, uint8_t drawElevation, const LightViewPtr& lightView = nullptr);
void drawCreature(const Point& dest, int flags, bool forceDraw, uint8_t drawElevation, LightView* lightView = nullptr);

void setThingFlag(const ThingPtr& thing);

Expand Down
2 changes: 2 additions & 0 deletions src/client/uimapanchorlayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#pragma once
#include <framework/ui/uianchorlayout.h>

#include "position.h"

class UIPositionAnchor final : public UIAnchor
{
public:
Expand Down
Loading
Loading