Skip to content
This repository was archived by the owner on Mar 20, 2022. It is now read-only.

Commit c8366d7

Browse files
committed
quick bench
1 parent 2f4daac commit c8366d7

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# rts
22

33
![](media/2020_12_21_lerp_shadow.gif)
4+
![](media/2020_12_21_cmdMove.gif)
5+
46

57
2D Framework
68
- header-only, (using unity build for testing, 1 x main.cpp)

media/2020_12_21_cmdMove.gif

8.48 MB
Loading

src/app/GameScene.hpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct GameScene
2828

2929
GameScene::GameScene()
3030
{
31-
for(auto i = 0; i < 10; ++i)
31+
for(auto i = 0; i < 1'00; ++i)
3232
{
3333
auto ID = ecs.AddEntity();
3434
auto& mainComponent = ecs.arrays.Add<ecs::MainComponent>(ID);
@@ -69,7 +69,8 @@ void GameScene::Update()
6969
cmd::Command cmd {};
7070
cmd.type = cmd::CmdEnum::Move;
7171
using namespace ecs;
72-
cmd.cmdUnion.cmdMove.entities = { (ID)0, (ID)1, (ID)2, (ID)3, (ID)4, (ID)5, (ID)6, (ID)7, (ID)8, (ID)9 }; //test
72+
for(ecs::ID id = 0; id < 10; ++id)
73+
cmd.cmdUnion.cmdMove.entities.Append(id);
7374
cmd.cmdUnion.cmdMove.pos = app::Inputs::mouse.pos;
7475
cmds.Append(cmd);
7576
timeline.Store(cmds, 0.1, timeline.stepIdx + 2);

src/cmd/Cmds/CmdMove.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ namespace rts::cmd {
1212

1313
struct CmdMove
1414
{
15-
com::POD_Array<ecs::ID, 10> entities;
15+
static constexpr auto MAX_SELECTION = 1'000;
16+
com::POD_Array<ecs::ID, MAX_SELECTION> entities;
1617
com::Vec2i pos;
1718
void Execute(ecs::ECS&);
1819
};

src/mem/MemoryInfo.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct BlockArrayInfo
2424
//constexpr auto s = sizeof(res::Resources);
2525
//constexpr auto s = sizeof(net::Network);
2626
constexpr auto SIZE_RENDERER = 6'000;
27-
constexpr auto SIZE_GAME_SCENE = 2'000'000;
27+
constexpr auto SIZE_GAME_SCENE = 20'000'000;
2828
constexpr auto SIZE_RESOURCES = 80'000;
2929
constexpr auto SIZE_NETWORK = 2'000;
3030

0 commit comments

Comments
 (0)