git pushing to find where it changed and why tf TBB is being called
This commit is contained in:
parent
d36dc68f8a
commit
64332cc93e
8 changed files with 118 additions and 36 deletions
|
|
@ -6,6 +6,7 @@ if(WIN32)
|
||||||
else()
|
else()
|
||||||
set(PLATFORM_DIR "linux")
|
set(PLATFORM_DIR "linux")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(engine)
|
add_subdirectory(engine)
|
||||||
add_subdirectory(games/forespend)
|
add_subdirectory(games/forespend)
|
||||||
add_subdirectory(games/endlauncher)
|
add_subdirectory(games/endlauncher)
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ namespace enginend {
|
||||||
int framedelay;
|
int framedelay;
|
||||||
int framecounter;
|
int framecounter;
|
||||||
unsigned int nextframeoffset;
|
unsigned int nextframeoffset;
|
||||||
|
int prevframe;
|
||||||
|
|
||||||
animated() : frames(0), currentframe(0), framedelay(6), framecounter(0), nextframeoffset(0) {
|
animated() : frames(0), currentframe(0), framedelay(6), framecounter(0), nextframeoffset(0) {
|
||||||
animimage.data = nullptr;
|
animimage.data = nullptr;
|
||||||
|
|
@ -60,10 +61,14 @@ namespace enginend {
|
||||||
currentframe++;
|
currentframe++;
|
||||||
if (currentframe >= frames) currentframe = 0;
|
if (currentframe >= frames) currentframe = 0;
|
||||||
nextframeoffset = animimage.width * animimage.height * 4 * currentframe;
|
nextframeoffset = animimage.width * animimage.height * 4 * currentframe;
|
||||||
UpdateTexture(*texture, ((unsigned char*)animimage.data) + nextframeoffset);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void draw() override {
|
void draw() override {
|
||||||
|
|
||||||
|
if (prevframe!=currentframe){
|
||||||
|
prevframe=currentframe;
|
||||||
|
UpdateTexture(*this->texture,((unsigned char*)animimage.data)+nextframeoffset);
|
||||||
|
}
|
||||||
textured::draw();
|
textured::draw();
|
||||||
}
|
}
|
||||||
void exit() override {
|
void exit() override {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#pragma once
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "nodes.h"
|
#include "nodes.h"
|
||||||
|
|
@ -23,6 +22,8 @@ namespace enginend{
|
||||||
Texture2D* texture;
|
Texture2D* texture;
|
||||||
textured(){texture=nullptr;}
|
textured(){texture=nullptr;}
|
||||||
textured(Texture2D* texture,double x,double y,double w,double h):texture(texture),rect(x,y,w,h){}
|
textured(Texture2D* texture,double x,double y,double w,double h):texture(texture),rect(x,y,w,h){}
|
||||||
|
void boot() override{}
|
||||||
|
void tick() override{}
|
||||||
void draw()override{
|
void draw()override{
|
||||||
if(texture==nullptr)return;
|
if(texture==nullptr)return;
|
||||||
float sw=GetScreenWidth();
|
float sw=GetScreenWidth();
|
||||||
|
|
@ -31,11 +32,16 @@ namespace enginend{
|
||||||
float ay=y*sh;
|
float ay=y*sh;
|
||||||
float aw=w*sw;
|
float aw=w*sw;
|
||||||
float ah=h*sh;
|
float ah=h*sh;
|
||||||
|
tiny::echo("og: %f %f %f %f", x,y,w,h);
|
||||||
|
tiny::echo("transformed: %f %f %f %f", ax, ay, aw, ah);
|
||||||
DrawTexturePro(*texture,{0,0,(float)texture->width,(float)texture->height},{ax,ay,aw,ah},{0,0},0,WHITE);
|
DrawTexturePro(*texture,{0,0,(float)texture->width,(float)texture->height},{ax,ay,aw,ah},{0,0},0,WHITE);
|
||||||
}
|
}
|
||||||
void exit()override {
|
void exit()override {
|
||||||
UnloadTexture(*texture);
|
if(texture){
|
||||||
delete texture;
|
UnloadTexture(*texture);
|
||||||
|
delete texture;
|
||||||
|
texture=nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
struct animated :virtual public textured{
|
struct animated :virtual public textured{
|
||||||
|
|
@ -44,14 +50,17 @@ namespace enginend{
|
||||||
int currentframe;
|
int currentframe;
|
||||||
int framedelay;
|
int framedelay;
|
||||||
int framecounter;
|
int framecounter;
|
||||||
|
int prevframe;
|
||||||
unsigned int nextframeoffset;
|
unsigned int nextframeoffset;
|
||||||
animated():frames(0),currentframe(0),framedelay(6),framecounter(0),nextframeoffset(0){
|
animated():frames(0),currentframe(1),framedelay(6),framecounter(0),nextframeoffset(0){
|
||||||
animimage.data=nullptr;
|
animimage.data=nullptr;
|
||||||
|
prevframe=currentframe;
|
||||||
}
|
}
|
||||||
void boot()override{}
|
|
||||||
animated(const char* gifpath,double x,double y,double w,double h,int delay=6):
|
animated(const char* gifpath,double x,double y,double w,double h,int delay=6):
|
||||||
textured(nullptr,x,y,w,h),framedelay(delay),currentframe(0),framecounter(0),frames(0),nextframeoffset(0)
|
textured(nullptr,x,y,w,h),framedelay(delay),currentframe(1),framecounter(0),frames(0),nextframeoffset(0)
|
||||||
{
|
{
|
||||||
|
prevframe=currentframe;
|
||||||
|
this->x=x; this->y=y; this->w=w; this->h=h;
|
||||||
animimage=LoadImageAnim(gifpath,&frames);
|
animimage=LoadImageAnim(gifpath,&frames);
|
||||||
if(frames>0){
|
if(frames>0){
|
||||||
texture=new Texture2D(LoadTextureFromImage(animimage));
|
texture=new Texture2D(LoadTextureFromImage(animimage));
|
||||||
|
|
@ -65,13 +74,18 @@ namespace enginend{
|
||||||
currentframe++;
|
currentframe++;
|
||||||
if(currentframe>=frames)currentframe=0;
|
if(currentframe>=frames)currentframe=0;
|
||||||
nextframeoffset=animimage.width*animimage.height*4*currentframe;
|
nextframeoffset=animimage.width*animimage.height*4*currentframe;
|
||||||
UpdateTexture(*texture,((unsigned char*)animimage.data)+nextframeoffset);
|
tiny::echo("updating node\nframes: %i\n current frame: %i",frames,currentframe);
|
||||||
|
tiny::echo("%i",nextframeoffset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void draw()override {
|
void draw()override {
|
||||||
|
if (prevframe!=currentframe){
|
||||||
|
prevframe=currentframe;
|
||||||
|
UpdateTexture(*this->texture,((unsigned char*)animimage.data)+nextframeoffset);
|
||||||
|
}
|
||||||
textured::draw();
|
textured::draw();
|
||||||
}
|
}
|
||||||
void exit(){
|
void exit()override{
|
||||||
if(animimage.data)UnloadImage(animimage);
|
if(animimage.data)UnloadImage(animimage);
|
||||||
textured::exit();
|
textured::exit();
|
||||||
}
|
}
|
||||||
|
|
@ -80,6 +94,8 @@ namespace enginend{
|
||||||
Color c;
|
Color c;
|
||||||
colored(){}
|
colored(){}
|
||||||
colored(Color color,double x,double y,double w,double h):c(color),rect(x,y,w,h){}
|
colored(Color color,double x,double y,double w,double h):c(color),rect(x,y,w,h){}
|
||||||
|
void boot()override{}
|
||||||
|
void tick()override{}
|
||||||
void draw()override{
|
void draw()override{
|
||||||
float sw=GetScreenWidth();
|
float sw=GetScreenWidth();
|
||||||
float sh=GetScreenHeight();
|
float sh=GetScreenHeight();
|
||||||
|
|
@ -89,15 +105,18 @@ namespace enginend{
|
||||||
float ah=h*sh;
|
float ah=h*sh;
|
||||||
DrawRectangle(ax,ay,aw,ah,c);
|
DrawRectangle(ax,ay,aw,ah,c);
|
||||||
}
|
}
|
||||||
|
void exit()override{}
|
||||||
};
|
};
|
||||||
struct tinted :virtual public colored,virtual public textured{
|
struct tinted :virtual public colored,virtual public textured{
|
||||||
tinted(){}
|
tinted(){}
|
||||||
tinted(Texture2D* texture,Color color,double x,double y,double w,double h):
|
tinted(Texture2D* texture,Color color,double x,double y,double w,double h):
|
||||||
node2d(x,y,w,h),
|
node2d(x,y,w,h),
|
||||||
rect(x,y,w,h),
|
rect(x,y,w,h),
|
||||||
colored(color,x,y,w,h),
|
colored(color,x,y,w,h),
|
||||||
textured(texture,x,y,w,h)
|
textured(texture,x,y,w,h)
|
||||||
{}
|
{}
|
||||||
|
void boot()override{}
|
||||||
|
void tick()override{}
|
||||||
void draw()override{
|
void draw()override{
|
||||||
if(texture==nullptr)return;
|
if(texture==nullptr)return;
|
||||||
float sw=GetScreenWidth();
|
float sw=GetScreenWidth();
|
||||||
|
|
@ -108,6 +127,9 @@ namespace enginend{
|
||||||
float ah=h*sh;
|
float ah=h*sh;
|
||||||
DrawTexturePro(*texture,{0,0,(float)texture->width,(float)texture->height},{ax,ay,aw,ah},{0,0},0,c);
|
DrawTexturePro(*texture,{0,0,(float)texture->width,(float)texture->height},{ax,ay,aw,ah},{0,0},0,c);
|
||||||
}
|
}
|
||||||
|
void exit()override{
|
||||||
|
textured::exit();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
struct text :public tinted {
|
struct text :public tinted {
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -119,8 +141,8 @@ namespace enginend{
|
||||||
std::string content;
|
std::string content;
|
||||||
text(){fs=20;}
|
text(){fs=20;}
|
||||||
text(Texture2D* texture,Color txcol,Color color,double x,double y,double w,double h,Font f,float fsize,std::string txt):
|
text(Texture2D* texture,Color txcol,Color color,double x,double y,double w,double h,Font f,float fsize,std::string txt):
|
||||||
tinted(texture,color,x,y,w,h),
|
tinted(texture,color,x,y,w,h),
|
||||||
font(f),fs(fsize),content(txt),txc(txcol)
|
font(f),fs(fsize),content(txt),txc(txcol)
|
||||||
{
|
{
|
||||||
result=content;
|
result=content;
|
||||||
size_t initp=0;
|
size_t initp=0;
|
||||||
|
|
@ -129,8 +151,8 @@ namespace enginend{
|
||||||
initp+=2;
|
initp+=2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void boot()override{}
|
||||||
void tick()override {
|
void tick()override {
|
||||||
tinted::tick();
|
|
||||||
if(result!=content){
|
if(result!=content){
|
||||||
result=content;
|
result=content;
|
||||||
size_t initp=0;
|
size_t initp=0;
|
||||||
|
|
@ -156,15 +178,18 @@ namespace enginend{
|
||||||
DrawRectangle(ax-charsize.x,ay-charsize.y,minw+p,minh+p,c);
|
DrawRectangle(ax-charsize.x,ay-charsize.y,minw+p,minh+p,c);
|
||||||
DrawTextEx(font,content.c_str(),{ax,ay},fs,1,txc);
|
DrawTextEx(font,content.c_str(),{ax,ay},fs,1,txc);
|
||||||
}
|
}
|
||||||
|
void exit()override{
|
||||||
|
tinted::exit();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
struct button :virtual public tinted{
|
struct button :virtual public tinted{
|
||||||
void(*func)();
|
void(*func)();
|
||||||
bool pressed;
|
bool pressed;
|
||||||
bool hover;
|
bool hover;
|
||||||
button():func(nullptr),pressed(false){}
|
button():func(nullptr),pressed(false),hover(false){}
|
||||||
button(Texture2D* texture,Color color,double x,double y,double w,double h,void(*f)()):func(f),pressed(false),tinted(texture,color,x,y,w,h){}
|
button(Texture2D* texture,Color color,double x,double y,double w,double h,void(*f)()):func(f),pressed(false),hover(false),tinted(texture,color,x,y,w,h){}
|
||||||
|
void boot()override{}
|
||||||
void tick()override{
|
void tick()override{
|
||||||
tinted::tick();
|
|
||||||
Vector2 mouse=GetMousePosition();
|
Vector2 mouse=GetMousePosition();
|
||||||
float sw=GetScreenWidth();
|
float sw=GetScreenWidth();
|
||||||
float sh=GetScreenHeight();
|
float sh=GetScreenHeight();
|
||||||
|
|
@ -178,11 +203,15 @@ namespace enginend{
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
hover=false;
|
hover=false;
|
||||||
|
pressed=false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void draw()override {
|
void draw()override {
|
||||||
tinted::draw();
|
tinted::draw();
|
||||||
}
|
}
|
||||||
|
void exit()override{
|
||||||
|
tinted::exit();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
struct labeledbutton :virtual public button {
|
struct labeledbutton :virtual public button {
|
||||||
std::string label;
|
std::string label;
|
||||||
|
|
@ -190,10 +219,14 @@ namespace enginend{
|
||||||
int fs;
|
int fs;
|
||||||
Color txc;
|
Color txc;
|
||||||
labeledbutton(std::string name,Texture2D* texture,Color color,Color text,
|
labeledbutton(std::string name,Texture2D* texture,Color color,Color text,
|
||||||
double x,double y,double w,double h,void(*f)(),
|
double x,double y,double w,double h,void(*f)(),
|
||||||
Font fnt,int size):font(fnt),fs(size),txc(text),label(name),
|
Font fnt,int size):font(fnt),fs(size),txc(text),label(name),
|
||||||
button(texture,color,x,y,w,h,f)
|
button(texture,color,x,y,w,h,f)
|
||||||
{}
|
{}
|
||||||
|
void boot()override{}
|
||||||
|
void tick()override{
|
||||||
|
button::tick();
|
||||||
|
}
|
||||||
void draw()override{
|
void draw()override{
|
||||||
button::draw();
|
button::draw();
|
||||||
float sw=GetScreenWidth();
|
float sw=GetScreenWidth();
|
||||||
|
|
@ -209,6 +242,9 @@ namespace enginend{
|
||||||
};
|
};
|
||||||
DrawTextEx(font,label.c_str(),tpos,fs,1,txc);
|
DrawTextEx(font,label.c_str(),tpos,fs,1,txc);
|
||||||
}
|
}
|
||||||
|
void exit()override{
|
||||||
|
button::exit();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
struct slider :virtual public tinted{
|
struct slider :virtual public tinted{
|
||||||
float val;
|
float val;
|
||||||
|
|
@ -216,8 +252,8 @@ namespace enginend{
|
||||||
float maxv;
|
float maxv;
|
||||||
slider():val(0),minv(0),maxv(1){}
|
slider():val(0),minv(0),maxv(1){}
|
||||||
slider(Texture2D* texture,Color color,double x,double y,double w,double h,float min,float max,float v):val(v),minv(min),maxv(max),tinted(texture,color,x,y,w,h){}
|
slider(Texture2D* texture,Color color,double x,double y,double w,double h,float min,float max,float v):val(v),minv(min),maxv(max),tinted(texture,color,x,y,w,h){}
|
||||||
|
void boot()override{}
|
||||||
void tick()override{
|
void tick()override{
|
||||||
tinted::tick();
|
|
||||||
Vector2 mouse=GetMousePosition();
|
Vector2 mouse=GetMousePosition();
|
||||||
float sw=GetScreenWidth();
|
float sw=GetScreenWidth();
|
||||||
float sh=GetScreenHeight();
|
float sh=GetScreenHeight();
|
||||||
|
|
@ -240,11 +276,18 @@ namespace enginend{
|
||||||
float t=(val-minv)/(maxv-minv);
|
float t=(val-minv)/(maxv-minv);
|
||||||
DrawRectangle(ax,ay,aw*t,ah,c);
|
DrawRectangle(ax,ay,aw*t,ah,c);
|
||||||
}
|
}
|
||||||
|
void exit()override{
|
||||||
|
tinted::exit();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
struct textfield :public text{
|
struct textfield :public text{
|
||||||
textfield(){}
|
textfield(){}
|
||||||
textfield(Texture2D* texture,Color txcol,Color color,double x,double y,double w,double h,Font f,float fsize,std::string txt):
|
textfield(Texture2D* texture,Color txcol,Color color,double x,double y,double w,double h,Font f,float fsize,std::string txt):
|
||||||
text(texture,txcol,color,x,y,w,h,f,fsize,txt){}
|
text(texture,txcol,color,x,y,w,h,f,fsize,txt){}
|
||||||
|
void boot()override{}
|
||||||
|
void tick()override{
|
||||||
|
text::tick();
|
||||||
|
}
|
||||||
void draw()override{
|
void draw()override{
|
||||||
float sw=GetScreenWidth();
|
float sw=GetScreenWidth();
|
||||||
float sh=GetScreenHeight();
|
float sh=GetScreenHeight();
|
||||||
|
|
@ -260,13 +303,17 @@ namespace enginend{
|
||||||
DrawRectangle(ax-(po/2),ay-(po/2),minw+(po*1.1),minh+(po*1.1),c);
|
DrawRectangle(ax-(po/2),ay-(po/2),minw+(po*1.1),minh+(po*1.1),c);
|
||||||
DrawTextEx(font,content.c_str(),{ax,ay},fs,charsize.x/2,txc);
|
DrawTextEx(font,content.c_str(),{ax,ay},fs,charsize.x/2,txc);
|
||||||
}
|
}
|
||||||
|
void exit()override{
|
||||||
|
text::exit();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
struct textinput :public text{
|
struct textinput :public text{
|
||||||
bool active;
|
bool active;
|
||||||
int cpos;
|
int cpos;
|
||||||
textinput():active(false),cpos(0){}
|
textinput():active(false),cpos(0){}
|
||||||
textinput(Texture2D* texture,Color txcol,Color color,double x,double y,double w,double h,Font f,float fsize):active(false),cpos(0),
|
textinput(Texture2D* texture,Color txcol,Color color,double x,double y,double w,double h,Font f,float fsize):active(false),cpos(0),
|
||||||
text(texture,txcol,color,x,y,w,h,f,fsize,""){}
|
text(texture,txcol,color,x,y,w,h,f,fsize,""){}
|
||||||
|
void boot()override{}
|
||||||
void tick()override{
|
void tick()override{
|
||||||
text::tick();
|
text::tick();
|
||||||
Vector2 mouse=GetMousePosition();
|
Vector2 mouse=GetMousePosition();
|
||||||
|
|
@ -301,13 +348,17 @@ namespace enginend{
|
||||||
DrawRectangle(ax+MeasureTextEx(font,content.c_str(),fs,1).x,ay,2,fs,{0,0,0,127});
|
DrawRectangle(ax+MeasureTextEx(font,content.c_str(),fs,1).x,ay,2,fs,{0,0,0,127});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void exit()override{
|
||||||
|
text::exit();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
struct textinputfield :public textfield{
|
struct textinputfield :public textfield{
|
||||||
bool active;
|
bool active;
|
||||||
int cpos;
|
int cpos;
|
||||||
textinputfield():active(false),cpos(0){}
|
textinputfield():active(false),cpos(0){}
|
||||||
textinputfield(Texture2D* texture,Color txcol,Color color,double x,double y,double w,double h,Font f,float fsize):active(false),cpos(0),
|
textinputfield(Texture2D* texture,Color txcol,Color color,double x,double y,double w,double h,Font f,float fsize):active(false),cpos(0),
|
||||||
textfield(texture,txcol,color,x,y,w,h,f,fsize,""){}
|
textfield(texture,txcol,color,x,y,w,h,f,fsize,""){}
|
||||||
|
void boot()override{}
|
||||||
void tick()override{
|
void tick()override{
|
||||||
textfield::tick();
|
textfield::tick();
|
||||||
Vector2 mouse=GetMousePosition();
|
Vector2 mouse=GetMousePosition();
|
||||||
|
|
@ -357,6 +408,10 @@ namespace enginend{
|
||||||
DrawRectangle(p.x+MeasureTextEx(font,line.c_str(),fs,1).x,p.y,2,fs,BLACK);
|
DrawRectangle(p.x+MeasureTextEx(font,line.c_str(),fs,1).x,p.y,2,fs,BLACK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void exit()override{
|
||||||
|
textfield::exit();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}}
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include <oneapi/tbb/partitioner.h>
|
||||||
|
|
||||||
#include "../gr.h"
|
#include "../gr.h"
|
||||||
#include "../aud.h"
|
#include "../aud.h"
|
||||||
#include "../net.h"
|
#include "../net.h"
|
||||||
|
|
@ -6,13 +8,19 @@
|
||||||
|
|
||||||
namespace enginend {
|
namespace enginend {
|
||||||
namespace nodes {
|
namespace nodes {
|
||||||
struct node{
|
struct node{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void boot()=0;
|
virtual void boot()=0;
|
||||||
virtual void tick()=0;
|
virtual void tick()=0;
|
||||||
virtual void draw()=0;
|
virtual void draw()=0;
|
||||||
virtual void exit()=0;
|
virtual void exit()=0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
struct group : public virtual enginend::nodes::node {
|
||||||
|
std::vector<node*> children;
|
||||||
|
void boot(){for (node* n: children){n->boot();}}
|
||||||
|
void tick(){for (node* n: children){n->tick();}}
|
||||||
|
void draw(){for (node* n: children){n->draw();}}
|
||||||
|
void exit(){for (node* n: children){n->exit();}}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -7,6 +7,7 @@ add_executable(forespend ${FORESPEND_SOURCES})
|
||||||
set_target_properties(forespend PROPERTIES
|
set_target_properties(forespend PROPERTIES
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/built/forespend/${PLATFORM_DIR}/bin"
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/built/forespend/${PLATFORM_DIR}/bin"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_directories(
|
target_link_directories(
|
||||||
forespend PUBLIC
|
forespend PUBLIC
|
||||||
"${CMAKE_SOURCE_DIR}/link")
|
"${CMAKE_SOURCE_DIR}/link")
|
||||||
|
|
|
||||||
|
|
@ -15,12 +15,9 @@ void client::boot() {
|
||||||
target=LoadRenderTexture(380,240);
|
target=LoadRenderTexture(380,240);
|
||||||
}
|
}
|
||||||
void client::draw() {
|
void client::draw() {
|
||||||
BeginTextureMode(target);
|
|
||||||
this->currentscene->draw();
|
|
||||||
EndTextureMode();
|
|
||||||
BeginDrawing();
|
BeginDrawing();
|
||||||
ClearBackground(WHITE);
|
ClearBackground(WHITE);
|
||||||
DrawTexturePro(target.texture, {0, 0, 380,240}, {0, 0, (float)GetScreenWidth(), (float)GetScreenHeight()}, {0, 0}, 0, WHITE);
|
this->currentscene->draw();
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
}
|
}
|
||||||
void client::exit() {
|
void client::exit() {
|
||||||
|
|
|
||||||
6
games/forespend/src/client/scenes/configmenu.h
Normal file
6
games/forespend/src/client/scenes/configmenu.h
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
#pragma once
|
||||||
|
#include <vector>
|
||||||
|
#include <enginend/scenes/node2drelative.h>
|
||||||
|
|
||||||
|
|
||||||
|
std::vector<enginend::nodes::group> config{};
|
||||||
|
|
@ -1,20 +1,29 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <incmgr.h>
|
#include <incmgr.h>
|
||||||
#include <enginend/scenes/node2drelative.h>
|
#include <enginend/scenes/node2drelative.h>
|
||||||
|
#include <enginend/scenes/node2d.h>
|
||||||
|
|
||||||
class mainmenu :public virtual enginend::scene{
|
class mainmenu :public virtual enginend::scene{
|
||||||
|
private:
|
||||||
|
Texture2D bg= LoadTexture(AT("res/images/tilesheet.png"));
|
||||||
public:
|
public:
|
||||||
void boot() override {
|
void boot() override {
|
||||||
|
|
||||||
this->nodes=std::list<enginend::nodes::node*>{
|
this->nodes=std::list<enginend::nodes::node*>{
|
||||||
new enginend::nodes::relative::animated(AT("res/images/sky.gif"),0,0,10,10,5)
|
new enginend::nodes::relative::animated(AT("res/images/sky.gif"),0,0,1,1,2),
|
||||||
};
|
};
|
||||||
enginend::scene::boot();
|
enginend::scene::boot();
|
||||||
}
|
}
|
||||||
void tick() override {
|
void tick() override {
|
||||||
enginend::scene::tick();
|
for (enginend::nodes::node* n : this->nodes) {
|
||||||
|
n->tick();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void draw() override {
|
void draw() override {
|
||||||
enginend::scene::draw();
|
for (enginend::nodes::node* n : this->nodes) {
|
||||||
|
n->draw();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void exit() override {
|
void exit() override {
|
||||||
enginend::scene::exit();
|
enginend::scene::exit();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue