just adding more missing stuf
This commit is contained in:
parent
8fe442807a
commit
fd099c84ca
9 changed files with 59 additions and 15 deletions
|
|
@ -1,6 +1,7 @@
|
|||
cmake_minimum_required(VERSION 3.20)
|
||||
set(CMAKE_CXX_FLAGS "-std=c++17 -Wno-error")
|
||||
file(GLOB_RECURSE ENGINE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
|
||||
|
||||
file(GLOB_RECURSE ENGINE_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
|
||||
add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/force_rebuild"
|
||||
COMMAND rm -f "${CMAKE_SOURCE_DIR}/link/libenginend.so"
|
||||
COMMAND rm -rf "${CMAKE_SOURCE_DIR}/include/enginend"
|
||||
|
|
@ -18,7 +19,7 @@ set_target_properties(enginend PROPERTIES
|
|||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/link"
|
||||
)
|
||||
|
||||
file(GLOB_RECURSE HEADER_FILES "${ENGINE_SRC_DIR}/*.h" "${ENGINE_SRC_DIR}/*.hpp")
|
||||
file(GLOB_RECURSE HEADER_FILES CONFIGURE_DEPENDS "${ENGINE_SRC_DIR}/*.h" "${ENGINE_SRC_DIR}/*.hpp")
|
||||
foreach(HEADER ${HEADER_FILES})
|
||||
file(RELATIVE_PATH REL_PATH "${ENGINE_SRC_DIR}" "${HEADER}")
|
||||
|
||||
|
|
|
|||
|
|
@ -141,9 +141,11 @@ namespace enginend{
|
|||
std::string content;
|
||||
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):
|
||||
tinted(texture,color,x,y,w,h),
|
||||
//tinted(texture,color,x,y,w,h),
|
||||
font(f),fs(fsize),content(txt),txc(txcol)
|
||||
{
|
||||
this->x=x;this->y=y;this->w=w;this->h=h;
|
||||
this->texture=texture;this->c=color;
|
||||
result=content;
|
||||
size_t initp=0;
|
||||
while((initp=result.find("\n",initp))!=std::string::npos){
|
||||
|
|
@ -167,8 +169,12 @@ namespace enginend{
|
|||
float sh=GetScreenHeight();
|
||||
float ax=x*sw;
|
||||
float ay=y*sh;
|
||||
|
||||
float aw=w*sw;
|
||||
float ah=h*sh;
|
||||
tiny::echo("og: %f %f %f %f", x,y,w,h);
|
||||
tiny::echo("drawing text: %s", content.c_str());
|
||||
tiny::echo("transformed: %f %f %f %f", ax, ay, aw, ah);
|
||||
Vector2 minsize=MeasureTextEx(font,content.c_str(),fs,1);
|
||||
Vector2 charsize=MeasureTextEx(font," ",fs,1);
|
||||
float p=charsize.x>charsize.y?charsize.x/minsize.x:charsize.y/minsize.y;
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@
|
|||
#include "../net.h"
|
||||
#include<tiny/term.h>
|
||||
|
||||
namespace enginend {
|
||||
namespace nodes {
|
||||
struct node{
|
||||
namespace enginend {
|
||||
namespace nodes {
|
||||
struct node{
|
||||
public:
|
||||
virtual void boot()=0;
|
||||
virtual void tick()=0;
|
||||
|
|
@ -18,6 +18,7 @@ namespace nodes {
|
|||
}
|
||||
struct group : public virtual enginend::nodes::node {
|
||||
std::vector<node*> children;
|
||||
group(std::vector<node*>& children) : children(std::move(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();}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue