Parcourir la source

engine: start working on a tickable object, cleaner than entities.

legacy
Sam Hocevar il y a 5 ans
Parent
révision
4ee191fbf4
23 fichiers modifiés avec 267 ajouts et 130 suppressions
  1. +4
    -7
      doc/samples/physics/lolbtphysicsintegration.h
  2. +4
    -1
      src/Makefile.am
  3. +2
    -2
      src/camera.cpp
  4. +2
    -2
      src/debug/record.cpp
  5. +9
    -7
      src/debug/stats.cpp
  6. +3
    -3
      src/engine/entity.cpp
  7. +7
    -54
      src/engine/entity.h
  8. +33
    -0
      src/engine/tickable.cpp
  9. +20
    -20
      src/engine/ticker.cpp
  10. +16
    -12
      src/engine/ticker.h
  11. +1
    -1
      src/font.cpp
  12. +10
    -8
      src/light.cpp
  13. +3
    -0
      src/lol-core.vcxproj
  14. +12
    -0
      src/lol-core.vcxproj.filter
  15. +16
    -0
      src/lol/engine/all.h
  16. +111
    -0
      src/lol/engine/tickable.h
  17. +3
    -2
      src/lol/public.h
  18. +1
    -1
      src/text.cpp
  19. +3
    -3
      src/textureimage.cpp
  20. +3
    -3
      src/ui/controller.cpp
  21. +1
    -1
      src/ui/d3d9-input.cpp
  22. +2
    -2
      src/ui/gui.cpp
  23. +1
    -1
      src/ui/sdl-input.cpp

+ 4
- 7
doc/samples/physics/lolbtphysicsintegration.h Voir le fichier

@@ -1,8 +1,8 @@
//
// Lol Engine
//
// Copyright © 2010—2013 Benjamin “Touky” Huet <huet.benjamin@gmail.com>
// © 2009—2013 Sam Hocevar <sam@hocevar.net>
// Copyright © 2009—2019 Sam Hocevar <sam@hocevar.net>
// © 2010—2013 Benjamin “Touky” Huet <huet.benjamin@gmail.com>
//
// This library is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -24,11 +24,8 @@ namespace lol
// Override Gamegroups names for Physic-usage
// "_ENT_" means that this is a group for Entities that use EasyPhysic primitives.
// "_EZP_" means that this is a group for EasyPhysic primitives.
#define GAMEGROUP_ENT_INPUT GAMEGROUP_INPUT
#define GAMEGROUP_ENT_PLATFORM GAMEGROUP_ENTITY
#define GAMEGROUP_ENT_MAIN GAMEGROUP_OTHER_1
#define GAMEGROUP_EZP_CHAR_CTRLR GAMEGROUP_OTHER_2
#define GAMEGROUP_SIMULATION GAMEGROUP_OTHER_3
#define GAMEGROUP_EZP_CHAR_CTRLR tickable::group::game::other_2
#define GAMEGROUP_SIMULATION tickable::group::game::other_3

#define LOL2BT_UNIT 1.0f
#define BT2LOL_UNIT 1.0f


+ 4
- 1
src/Makefile.am Voir le fichier

@@ -52,6 +52,9 @@ liblol_core_headers = \
lol/audio/all.h \
lol/audio/audio.h lol/audio/sample.h \
\
lol/engine/all.h \
lol/engine/tickable.h \
\
lol/sys/all.h \
lol/sys/init.h lol/sys/file.h lol/sys/getopt.h lol/sys/thread.h \
lol/sys/threadtypes.h lol/sys/timer.h \
@@ -130,7 +133,7 @@ liblol_core_sources = \
image/filter/dilate.cpp image/filter/median.cpp image/filter/yuv.cpp \
image/movie.cpp \
\
engine/ticker.cpp engine/ticker.h \
engine/tickable.cpp engine/ticker.cpp engine/ticker.h \
engine/entity.cpp engine/entity.h \
engine/world.cpp engine/world.h \
engine/worldentity.cpp engine/worldentity.h \


+ 2
- 2
src/camera.cpp Voir le fichier

@@ -27,8 +27,8 @@ namespace lol

Camera::Camera()
{
m_gamegroup = GAMEGROUP_CAMERA;
m_drawgroup = DRAWGROUP_CAMERA;
m_gamegroup = tickable::group::game::camera;
m_drawgroup = tickable::group::draw::camera;

//Arbitrary values when scene renderer is not ready.
ivec2 screen_size = (Scene::GetCount()) ? (Video::GetSize()) : (ivec2(800, 600));


+ 2
- 2
src/debug/record.cpp Voir le fichier

@@ -1,7 +1,7 @@
//
// Lol Engine
//
// Copyright © 2010—2018 Sam Hocevar <sam@hocevar.net>
// Copyright © 2010—2019 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -56,7 +56,7 @@ DebugRecord::DebugRecord(std::string const &path, float fps)
m_data->m_sequence = nullptr;
#endif

m_drawgroup = DRAWGROUP_CAPTURE;
m_drawgroup = tickable::group::draw::capture;
}

void DebugRecord::tick_game(float seconds)


+ 9
- 7
src/debug/stats.cpp Voir le fichier

@@ -1,11 +1,13 @@
//
// Lol Engine
// Lol Engine
//
// Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See
// http://www.wtfpl.net/ for more details.
// Copyright © 2010—2019 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What the Fuck You Want
// to Public License, Version 2, as published by the WTFPL Task Force.
// See http://www.wtfpl.net/ for more details.
//

#include <lol/engine-internal.h>
@@ -38,7 +40,7 @@ DebugStats::DebugStats(char const *path)
{
data->fp = fopen(path, "w+");

m_gamegroup = GAMEGROUP_STATS;
m_gamegroup = tickable::group::game::stats;
}

void DebugStats::tick_game(float seconds)


+ 3
- 3
src/engine/entity.cpp Voir le fichier

@@ -1,7 +1,7 @@
//
// Lol Engine
//
// Copyright © 2010—2018 Sam Hocevar <sam@hocevar.net>
// Copyright © 2010—2019 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -29,8 +29,8 @@ Entity::Entity() :
#if !LOL_BUILD_RELEASE
m_tickstate = STATE_IDLE;
#endif
m_gamegroup = GAMEGROUP_ENTITY;
m_drawgroup = DRAWGROUP_ENTITY;
m_gamegroup = tickable::group::game::entity;
m_drawgroup = tickable::group::draw::entity;
/* FIXME: is this a problem? because the object can
* be ticked before the constructor is finished! */
Ticker::Register(this);


+ 7
- 54
src/engine/entity.h Voir le fichier

@@ -20,7 +20,9 @@
// Ticker class for the ticking logic and the linked list implementation.
//

#include <stdint.h>
#include <cstdint>

#include <lol/engine/tickable.h>

namespace lol
{
@@ -44,7 +46,7 @@ struct InitState
class Entity
{
friend class Scene;
friend class Ticker;
friend class ticker;
friend class TickerData;
friend class Emcee;

@@ -64,58 +66,6 @@ protected:
virtual void tick_game(float seconds);
virtual void tick_draw(float seconds, class Scene &scene);

enum
{
GAMEGROUP_BEGIN = 0, // must be the first element

GAMEGROUP_INPUT, // input should be polled before everything else
GAMEGROUP_IMGUI, // debug update needs to be called before the rest for init purposes
GAMEGROUP_APP, // main application update
GAMEGROUP_ENTITY, // default entity update
// ----------------- // split entity update:
GAMEGROUP_PLAYER, // player updates before AI to ensure player actions is prevalent
GAMEGROUP_AI, // AI update
GAMEGROUP_OTHER_0, // other misc updates here
GAMEGROUP_OTHER_1, // (same)
GAMEGROUP_OTHER_2, // (same)
GAMEGROUP_OTHER_3, // (same)
// ----------------- // primitives updates
GAMEGROUP_MESH, // update Mesh/Animation to ensure correct sync with PLY/AI
GAMEGROUP_FX, // update FX/other to ensure correct sync with WorldPos and Meshes
GAMEGROUP_LIGHT, // update after FX because it could some
GAMEGROUP_CAMERA, // update camera at the end of the frame, once everything is settled
GAMEGROUP_STATS, // stats update

GAMEGROUP_END // must be the last element
}
m_gamegroup;

enum
{
DRAWGROUP_BEGIN = GAMEGROUP_END,

DRAWGROUP_CAMERA, // update camera first for rendering
DRAWGROUP_TEXTURE, // texture
DRAWGROUP_LIGHT, //
DRAWGROUP_WORLD, // other misc updates here
DRAWGROUP_ENTITY, //
DRAWGROUP_FX, //
DRAWGROUP_OTHER_0, // other misc updates here
DRAWGROUP_OTHER_1, // (same)
DRAWGROUP_OTHER_2, // (same)
DRAWGROUP_OTHER_3, // (same)
DRAWGROUP_APP, // main application Draw
DRAWGROUP_HUD,
DRAWGROUP_IMGUI,
DRAWGROUP_CAPTURE,

DRAWGROUP_END, // must be the next-to-last element
DRAWGROUP_NONE, // this group is for non draw-ticked
}
m_drawgroup;

static int const ALLGROUP_END = DRAWGROUP_END;

/* The initialisation state */
InitState m_initstate;

@@ -131,6 +81,9 @@ protected:
m_tickstate;
#endif

tickable::group::game m_gamegroup;
tickable::group::draw m_drawgroup;

// Emcee begin
private:
void SetState(uint32_t newstate);


+ 33
- 0
src/engine/tickable.cpp Voir le fichier

@@ -0,0 +1,33 @@
//
// Lol Engine
//
// Copyright © 2010—2019 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What the Fuck You Want
// to Public License, Version 2, as published by the WTFPL Task Force.
// See http://www.wtfpl.net/ for more details.
//

#include <lol/engine-internal.h>

#include <cstdlib>
#include <cstdint>
#include <functional>

namespace lol
{

//auto p = tickable::create<tickable>();

tickable::tickable()
{
}

tickable::~tickable()
{
}

} /* namespace lol */


+ 20
- 20
src/engine/ticker.cpp Voir le fichier

@@ -13,7 +13,7 @@
#include <lol/engine-internal.h>

#include <cstdlib>
#include <stdint.h>
#include <cstdint>
#include <functional>

namespace lol
@@ -25,7 +25,7 @@ namespace lol

static class TickerData
{
friend class Ticker;
friend class ticker;

public:
TickerData() :
@@ -57,8 +57,8 @@ public:
private:
/* Entity management */
array<Entity *> m_todolist, m_todolist_delayed, m_autolist;
array<Entity *> m_list[Entity::ALLGROUP_END];
array<int> m_scenes[Entity::ALLGROUP_END];
array<Entity *> m_list[(int)tickable::group::all::end];
array<int> m_scenes[(int)tickable::group::all::end];
int nentities;

/* Fixed framerate management */
@@ -214,10 +214,10 @@ void TickerData::GameThreadTick()

#if 0
msg::debug("-------------------------------------\n");
for (int g = 0; g < Entity::ALLGROUP_END; ++g)
for (int g = 0; g < (int)tickable::group::all::end; ++g)
{
msg::debug("%s Group %d\n",
(g < Entity::GAMEGROUP_END) ? "Game" : "Draw", g);
(g < (int)tickable::group::game::end) ? "Game" : "Draw", g);

for (int i = 0; i < data->m_list[g].count(); ++i)
{
@@ -269,7 +269,7 @@ void TickerData::GameThreadTick()
int n = 0;
data->panic = 2 * (data->panic + 1);

for (int g = 0; g < Entity::ALLGROUP_END && n < data->panic; ++g)
for (int g = 0; g < (int)tickable::group::all::end && n < data->panic; ++g)
for (int i = 0; i < data->m_list[g].count() && n < data->panic; ++i)
{
Entity * e = data->m_list[g][i];
@@ -297,13 +297,13 @@ void TickerData::GameThreadTick()
* in the tick lists can be marked for destruction. */
array<Entity*> destroy_list;
bool do_reserve = true;
for (int g = 0; g < Entity::ALLGROUP_END; ++g)
for (int g = 0; g < (int)tickable::group::all::end; ++g)
{
for (int i = data->m_list[g].count(); i--;)
{
Entity *e = data->m_list[g][i];

if (e->m_destroy && g < Entity::GAMEGROUP_END)
if (e->m_destroy && g < (int)tickable::group::game::end)
{
/* Game tick list:
* If entity is to be destroyed, remove it */
@@ -328,7 +328,7 @@ void TickerData::GameThreadTick()
if (Scene::GetScene(j).IsRelevant(e))
removal_count++;
//Update scene index
data->m_scenes[e->m_drawgroup][j] -= removal_count;
data->m_scenes[(int)e->m_drawgroup][j] -= removal_count;
}
if (do_reserve)
{
@@ -339,7 +339,7 @@ void TickerData::GameThreadTick()
}
else
{
if (e->m_ref <= 0 && g >= Entity::DRAWGROUP_BEGIN)
if (e->m_ref <= 0 && g >= (int)tickable::group::draw::begin)
e->m_destroy = 1;
}
}
@@ -363,11 +363,11 @@ void TickerData::GameThreadTick()
}

data->m_todolist.remove(-1);
data->m_list[e->m_gamegroup].push(e);
if (e->m_drawgroup != Entity::DRAWGROUP_NONE)
data->m_list[(int)e->m_gamegroup].push(e);
if (e->m_drawgroup != tickable::group::draw::none)
{
if (data->m_scenes[e->m_drawgroup].count() < Scene::GetCount())
data->m_scenes[e->m_drawgroup].resize(Scene::GetCount());
if (data->m_scenes[(int)e->m_drawgroup].count() < Scene::GetCount())
data->m_scenes[(int)e->m_drawgroup].resize(Scene::GetCount());

int added_count = 0;
for (int i = 0; i < Scene::GetCount(); i++)
@@ -375,11 +375,11 @@ void TickerData::GameThreadTick()
//If entity is concerned by this scene, add it in the list
if (Scene::GetScene(i).IsRelevant(e))
{
data->m_list[e->m_drawgroup].insert(e, data->m_scenes[e->m_drawgroup][i]);
data->m_list[(int)e->m_drawgroup].insert(e, data->m_scenes[(int)e->m_drawgroup][i]);
added_count++;
}
//Update scene index
data->m_scenes[e->m_drawgroup][i] += added_count;
data->m_scenes[(int)e->m_drawgroup][i] += added_count;
}
}

@@ -391,7 +391,7 @@ void TickerData::GameThreadTick()
data->m_todolist_delayed.clear();

/* Tick objects for the game loop */
for (int g = Entity::GAMEGROUP_BEGIN; g < Entity::GAMEGROUP_END && !data->quit /* Stop as soon as required */; ++g)
for (int g = (int)tickable::group::game::begin; g < (int)tickable::group::game::end && !data->quit /* Stop as soon as required */; ++g)
{
for (int i = 0; i < data->m_list[g].count() && !data->quit /* Stop as soon as required */; ++i)
{
@@ -435,11 +435,11 @@ void TickerData::DrawThreadTick()
scene.pre_render(data->deltatime);

/* Tick objects for the draw loop */
for (int g = Entity::DRAWGROUP_BEGIN; g < Entity::DRAWGROUP_END && !data->quit /* Stop as soon as required */; ++g)
for (int g = (int)tickable::group::draw::begin; g < (int)tickable::group::draw::end && !data->quit /* Stop as soon as required */; ++g)
{
switch (g)
{
case Entity::DRAWGROUP_BEGIN:
case (int)tickable::group::draw::begin:
scene.Reset();
break;
default:


+ 16
- 12
src/engine/ticker.h Voir le fichier

@@ -1,29 +1,31 @@
//
// Lol Engine
// Lol Engine
//
// Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See
// http://www.wtfpl.net/ for more details.
// Copyright © 2010—2019 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What the Fuck You Want
// to Public License, Version 2, as published by the WTFPL Task Force.
// See http://www.wtfpl.net/ for more details.
//

#pragma once

//
// The Ticker class
// ----------------
// The Ticker is a static class that registers entities and ticks them.
// The ticker class
// ————————————————
// The ticker is a static class that registers entities and ticks them.
//

#include <stdint.h>
#include <cstdint>

#include "engine/entity.h"

namespace lol
{

class Ticker
class ticker
{
public:
static void Register(Entity *entity);
@@ -46,8 +48,10 @@ public:
static int Finished();

private:
Ticker() {}
ticker() {}
};

typedef ticker Ticker;

} /* namespace lol */


+ 1
- 1
src/font.cpp Voir le fichier

@@ -60,7 +60,7 @@ Font::Font(std::string const &path)
data->tileset = TileSet::create(path, ivec2::zero, ivec2(16));
data->size = data->tileset->GetTileSize(0);

m_drawgroup = DRAWGROUP_TEXTURE;
m_drawgroup = tickable::group::draw::texture;
}

Font::~Font()


+ 10
- 8
src/light.cpp Voir le fichier

@@ -1,11 +1,13 @@
//
// Lol Engine
// Lol Engine
//
// Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See
// http://www.wtfpl.net/ for more details.
// Copyright © 2010—2019 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What the Fuck You Want
// to Public License, Version 2, as published by the WTFPL Task Force.
// See http://www.wtfpl.net/ for more details.
//

#include <lol/engine-internal.h>
@@ -20,8 +22,8 @@ Light::Light()
: m_color(1.f),
m_type(LightType::Directional)
{
m_gamegroup = GAMEGROUP_LIGHT;
m_drawgroup = DRAWGROUP_LIGHT;
m_gamegroup = tickable::group::game::light;
m_drawgroup = tickable::group::draw::light;

SetPosition(vec3::zero);
}


+ 3
- 0
src/lol-core.vcxproj Voir le fichier

@@ -106,6 +106,7 @@
<ClCompile Include="easymesh\easymeshrender.cpp" />
<ClCompile Include="easymesh\easymeshtransform.cpp" />
<ClCompile Include="engine\entity.cpp" />
<ClCompile Include="engine\tickable.cpp" />
<ClCompile Include="engine\ticker.cpp" />
<ClCompile Include="engine\world.cpp" />
<ClCompile Include="engine\worldentity.cpp" />
@@ -228,6 +229,8 @@
<ClInclude Include="lol\base\tuple.h" />
<ClInclude Include="lol\debug\all.h" />
<ClInclude Include="lol\debug\lines.h" />
<ClInclude Include="lol\engine\all.h" />
<ClInclude Include="lol\engine\tickable.h" />
<ClInclude Include="lol\engine.h" />
<ClInclude Include="lol\engine-internal.h" />
<ClInclude Include="lol\extras.h" />


+ 12
- 0
src/lol-core.vcxproj.filter Voir le fichier

@@ -31,6 +31,9 @@
<Filter Include="lol\algorithm">
<UniqueIdentifier>{39f6f872-186f-48af-8e87-bcceb06b1b21}</UniqueIdentifier>
</Filter>
<Filter Include="lol\engine">
<UniqueIdentifier>{a20b47c1-a0f8-4a02-a7a8-6da2ccd8bb02}</UniqueIdentifier>
</Filter>
<Filter Include="lol\image">
<UniqueIdentifier>{f25b3187-b24c-469a-b038-5a968eaa83f6}</UniqueIdentifier>
</Filter>
@@ -360,6 +363,9 @@
<ClCompile Include="engine\entity.cpp">
<Filter>engine</Filter>
</ClCompile>
<ClCompile Include="engine\tickable.cpp">
<Filter>engine</Filter>
</ClCompile>
<ClCompile Include="engine\ticker.cpp">
<Filter>engine</Filter>
</ClCompile>
@@ -656,6 +662,12 @@
<ClInclude Include="lol\debug\lines.h">
<Filter>lol\debug</Filter>
</ClInclude>
<ClInclude Include="lol\engine\all.h">
<Filter>lol\engine</Filter>
</ClInclude>
<ClInclude Include="lol\engine\tickable.h">
<Filter>lol\engine</Filter>
</ClInclude>
<ClInclude Include="lol\image\image.h">
<Filter>lol\image</Filter>
</ClInclude>


+ 16
- 0
src/lol/engine/all.h Voir le fichier

@@ -0,0 +1,16 @@
//
// Lol Engine
//
// Copyright © 2010—2019 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What the Fuck You Want
// to Public License, Version 2, as published by the WTFPL Task Force.
// See http://www.wtfpl.net/ for more details.
//

#pragma once

#include <lol/engine/tickable.h>


+ 111
- 0
src/lol/engine/tickable.h Voir le fichier

@@ -0,0 +1,111 @@
//
// Lol Engine
//
// Copyright © 2010—2019 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What the Fuck You Want
// to Public License, Version 2, as published by the WTFPL Task Force.
// See http://www.wtfpl.net/ for more details.
//

#pragma once

//
// The tickable class
// ——————————————————
// Tickables are objects that can be ticked by the game loop and/or the render
// loop.
//

#include <cstdint>

namespace lol
{

class game_tickable
{
virtual void tick_game(float seconds) = 0;
};

class draw_tickable
{
virtual void tick_draw(float seconds, class Scene &scene) = 0;
};

class tickable : public std::enable_shared_from_this<tickable>
{
public:
tickable();
virtual ~tickable();

// Auto-registering factory
template<typename T>
static typename std::enable_if<std::is_base_of<tickable, T>::value, std::shared_ptr<T>>::type
create()
{
auto p = std::make_shared<T>();
return p;
}

// Tick groups
struct group
{
enum class game
{
begin = 0, // must be the first element

input, // input should be polled before everything else
gui, // debug update needs to be called before the rest for init purposes
app, // main application update
entity, // default entity update
// ----------------- // split entity update:
player, // player updates before AI to ensure player actions is prevalent
ai, // AI update
other_0, // other misc updates here
other_1, // (same)
other_2, // (same)
other_3, // (same)
// ----------------- // primitives updates
mesh, // update Mesh/Animation to ensure correct sync with PLY/AI
fx, // update FX/other to ensure correct sync with WorldPos and Meshes
light, // update after FX because it could some
camera, // update camera at the end of the frame, once everything is settled
stats, // stats update

end, // must be the last element
};

enum class draw
{
begin = (int)game::end,

camera, // update camera first for rendering
texture, // texture
light, //
world, // other misc updates here
entity, //
fx, //
other_0, // other misc updates here
other_1, // (same)
other_2, // (same)
other_3, // (same)
app, // main application Draw
hud,
gui,
capture,

end, // must be the next-to-last element
none, // this group is for non draw-ticked
};

enum class all
{
end = (int)draw::end,
};
};
};

} /* namespace lol */


+ 3
- 2
src/lol/public.h Voir le fichier

@@ -1,7 +1,7 @@
//
// Lol Engine
//
// Copyright © 2010—2016 Sam Hocevar <sam@hocevar.net>
// Copyright © 2010—2019 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -14,7 +14,7 @@

//
// The main header
// ---------------
// ———————————————
//

#include <lol/base/all.h>
@@ -25,4 +25,5 @@
#include <lol/audio/all.h>
#include <lol/gpu/all.h>
#include <lol/debug/all.h>
#include <lol/engine/all.h>


+ 1
- 1
src/text.cpp Voir le fichier

@@ -50,7 +50,7 @@ Text::Text(std::string const &text, char const *font)
data->m_scale = vec2(1.f);
data->m_spacing = 0.f;

m_drawgroup = DRAWGROUP_HUD;
m_drawgroup = tickable::group::draw::entity;
}

void Text::SetText(std::string const &text)


+ 3
- 3
src/textureimage.cpp Voir le fichier

@@ -1,7 +1,7 @@
//
// Lol Engine
//
// Copyright © 2010—2018 Sam Hocevar <sam@hocevar.net>
// Copyright © 2010—2019 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -12,8 +12,8 @@

#include <lol/engine-internal.h>

#include <cstdlib>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#if defined _WIN32
@@ -84,7 +84,7 @@ void TextureImage::Init(std::string const &path, image* img)
m_data->m_texture_size = ivec2(PotUp(m_data->m_image_size.x),
PotUp(m_data->m_image_size.y));

m_drawgroup = DRAWGROUP_TEXTURE;
m_drawgroup = tickable::group::draw::texture;
}

void TextureImage::tick_draw(float seconds, Scene &scene)


+ 3
- 3
src/ui/controller.cpp Voir le fichier

@@ -1,8 +1,8 @@
//
// Lol Engine
//
// Copyright © 2010—2015 Benjamin Litzelmann
// © 2017—2019 Sam Hocevar <sam@hocevar.net>
// Copyright © 2017—2019 Sam Hocevar <sam@hocevar.net>
// © 2010—2015 Benjamin Litzelmann
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -223,7 +223,7 @@ static uint32_t g_active_layer = ~((uint32_t)0);
//-----------------------------------------------------------------------------
Controller::Controller(std::string const &name)
{
m_gamegroup = GAMEGROUP_INPUT;
m_gamegroup = tickable::group::game::input;
m_name = name;
m_activate_nextframe = true;
m_deactivate_nextframe = false;


+ 1
- 1
src/ui/d3d9-input.cpp Voir le fichier

@@ -103,7 +103,7 @@ D3d9Input::D3d9Input()
}
#endif

m_gamegroup = GAMEGROUP_INPUT;
m_gamegroup = tickable::group::game::input;
}

D3d9Input::~D3d9Input()


+ 2
- 2
src/ui/gui.cpp Voir le fichier

@@ -45,8 +45,8 @@ gui::gui(ImFontAtlas *shared_font_atlas)
{
ImGui::CreateContext(shared_font_atlas);

m_gamegroup = GAMEGROUP_IMGUI;
m_drawgroup = DRAWGROUP_IMGUI;
m_gamegroup = tickable::group::game::gui;
m_drawgroup = tickable::group::draw::gui;

// Build shader code -------------------------------------------------------
ShaderVar out_vertex = ShaderVar::GetShaderOut(ShaderProgram::Vertex);


+ 1
- 1
src/ui/sdl-input.cpp Voir le fichier

@@ -128,7 +128,7 @@ SdlInput::SdlInput(int app_w, int app_h, int screen_w, int screen_h)
}
#endif

m_gamegroup = GAMEGROUP_INPUT;
m_gamegroup = tickable::group::game::input;
}

SdlInput::~SdlInput()


Chargement…
Annuler
Enregistrer