Add Editor instance.
This commit is contained in:
parent
725853c0b2
commit
b0d0f1e564
@ -0,0 +1,11 @@
|
||||
|
||||
#include "pixelGameEngine.h"
|
||||
#include "main.h"
|
||||
#include "Editor.h"
|
||||
using namespace olc;
|
||||
|
||||
extern FaceBall* game;
|
||||
|
||||
void Editor::Update(float fElapsedTime){
|
||||
game->DrawStringDecal({ 0,0 }, "HEllo World!", WHITE, { 4,4 });
|
||||
}
|
@ -5,7 +5,7 @@ using namespace olc;
|
||||
class Editor {
|
||||
std::string filename;
|
||||
vi2d MAP_SIZE;
|
||||
void Update(float fElapsedTime) {
|
||||
|
||||
}
|
||||
public:
|
||||
Editor() {}
|
||||
void Update(float fElapsedTime);
|
||||
};
|
@ -6,6 +6,7 @@
|
||||
|
||||
using namespace olc;
|
||||
|
||||
FaceBall* game;
|
||||
|
||||
vec3d
|
||||
FaceBall::Matrix_MultiplyVector(mat4x4& m, vec3d& i)
|
||||
@ -705,9 +706,12 @@ bool FaceBall::OnUserUpdate(float fElapsedTime)
|
||||
RenderWorld();
|
||||
}break;
|
||||
case EDITOR: {
|
||||
|
||||
editor.Update(fElapsedTime);
|
||||
}break;
|
||||
}
|
||||
if (GetKey(olc::F5).bPressed) {
|
||||
mode = (GAMEMODE)!(mode&1);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "pixelGameEngine.h"
|
||||
#include "Editor.h"
|
||||
using namespace olc;
|
||||
|
||||
const float PI = 3.14159f;
|
||||
@ -143,7 +144,7 @@ class FaceBall : public PixelGameEngine
|
||||
std::vector<std::vector<MapSquare>>map;
|
||||
std::vector<Object>objects;
|
||||
GAMEMODE mode=GAMEMODE::GAME;
|
||||
|
||||
Editor editor;
|
||||
|
||||
mat4x4 matProj;
|
||||
|
||||
@ -182,4 +183,3 @@ class FaceBall : public PixelGameEngine
|
||||
bool OnUserCreate() override;
|
||||
bool OnUserUpdate(float fElapsedTime) override;
|
||||
};
|
||||
FaceBall* game;
|
Loading…
x
Reference in New Issue
Block a user