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)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
set(CMAKE_CXX_FLAGS "-std=c++17 -Wno-error")
|
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"
|
add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/force_rebuild"
|
||||||
COMMAND rm -f "${CMAKE_SOURCE_DIR}/link/libenginend.so"
|
COMMAND rm -f "${CMAKE_SOURCE_DIR}/link/libenginend.so"
|
||||||
COMMAND rm -rf "${CMAKE_SOURCE_DIR}/include/enginend"
|
COMMAND rm -rf "${CMAKE_SOURCE_DIR}/include/enginend"
|
||||||
|
|
@ -18,7 +19,7 @@ set_target_properties(enginend PROPERTIES
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/link"
|
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})
|
foreach(HEADER ${HEADER_FILES})
|
||||||
file(RELATIVE_PATH REL_PATH "${ENGINE_SRC_DIR}" "${HEADER}")
|
file(RELATIVE_PATH REL_PATH "${ENGINE_SRC_DIR}" "${HEADER}")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -141,9 +141,11 @@ 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)
|
||||||
{
|
{
|
||||||
|
this->x=x;this->y=y;this->w=w;this->h=h;
|
||||||
|
this->texture=texture;this->c=color;
|
||||||
result=content;
|
result=content;
|
||||||
size_t initp=0;
|
size_t initp=0;
|
||||||
while((initp=result.find("\n",initp))!=std::string::npos){
|
while((initp=result.find("\n",initp))!=std::string::npos){
|
||||||
|
|
@ -167,8 +169,12 @@ namespace enginend{
|
||||||
float sh=GetScreenHeight();
|
float sh=GetScreenHeight();
|
||||||
float ax=x*sw;
|
float ax=x*sw;
|
||||||
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("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 minsize=MeasureTextEx(font,content.c_str(),fs,1);
|
||||||
Vector2 charsize=MeasureTextEx(font," ",fs,1);
|
Vector2 charsize=MeasureTextEx(font," ",fs,1);
|
||||||
float p=charsize.x>charsize.y?charsize.x/minsize.x:charsize.y/minsize.y;
|
float p=charsize.x>charsize.y?charsize.x/minsize.x:charsize.y/minsize.y;
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ namespace nodes {
|
||||||
}
|
}
|
||||||
struct group : public virtual enginend::nodes::node {
|
struct group : public virtual enginend::nodes::node {
|
||||||
std::vector<node*> children;
|
std::vector<node*> children;
|
||||||
|
group(std::vector<node*>& children) : children(std::move(children)) {}
|
||||||
void boot(){for (node* n: children){n->boot();}}
|
void boot(){for (node* n: children){n->boot();}}
|
||||||
void tick(){for (node* n: children){n->tick();}}
|
void tick(){for (node* n: children){n->tick();}}
|
||||||
void draw(){for (node* n: children){n->draw();}}
|
void draw(){for (node* n: children){n->draw();}}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
cmake_minimum_required(VERSION 3.20)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "-std=c++17 -Wno-error")
|
set(CMAKE_CXX_FLAGS "-std=c++17 -Wno-error")
|
||||||
file(GLOB_RECURSE FORESPEND_SOURCES "src/*.cpp")
|
file(GLOB_RECURSE FORESPEND_SOURCES CONFIGURE_DEPENDS "src/*.cpp")
|
||||||
add_executable(forespend ${FORESPEND_SOURCES})
|
add_executable(forespend ${FORESPEND_SOURCES})
|
||||||
|
|
||||||
set_target_properties(forespend PROPERTIES
|
set_target_properties(forespend PROPERTIES
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,9 @@ client::client() {
|
||||||
void client::boot() {
|
void client::boot() {
|
||||||
this->framerate=60;
|
this->framerate=60;
|
||||||
this->tickrate=20;
|
this->tickrate=20;
|
||||||
InitWindow(380,240,"forespend - 0.03h");
|
|
||||||
// SetConfigFlags();
|
// SetConfigFlags();
|
||||||
|
InitWindow(380,240,"forespend - 0.03h");
|
||||||
|
initconfigmenu();
|
||||||
this->currentscene=new mainmenu();
|
this->currentscene=new mainmenu();
|
||||||
this->currentscene->boot();
|
this->currentscene->boot();
|
||||||
target=LoadRenderTexture(380,240);
|
target=LoadRenderTexture(380,240);
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,31 @@
|
||||||
//
|
#include "configmenu.h"
|
||||||
// Created by komi on 12/25/25.
|
|
||||||
//
|
#include <enginend/scenes/node2d.h>
|
||||||
|
Font forefont;
|
||||||
|
|
||||||
|
enginend::group mainpage= enginend::group(
|
||||||
|
{
|
||||||
|
new enginend::nodes::labeledbutton("graphics",nullptr,{255,127,0,255},{0,0,0,0},100,100,0,0,std::function<void()>([]() {
|
||||||
|
|
||||||
|
}),forefont,32),
|
||||||
|
|
||||||
|
}
|
||||||
|
);
|
||||||
|
enginend::group graphics= enginend::group(
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
);
|
||||||
|
enginend::group sound= enginend::group(
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
);
|
||||||
|
enginend::group controls= enginend::group(
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
);
|
||||||
|
void initconfigmenu() {
|
||||||
|
forefont=LoadFont(AT("res/fonts/dos.fnt"));
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,11 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <enginend/scenes/node2drelative.h>
|
#include <incmgr.h>
|
||||||
|
|
||||||
|
extern Font forefont;
|
||||||
|
extern enginend::group maincfgpage;
|
||||||
|
extern enginend::group graphics;
|
||||||
|
extern enginend::group sound;
|
||||||
|
extern enginend::group controls;
|
||||||
|
|
||||||
std::vector<enginend::nodes::group> config{};
|
void initconfigmenu();
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <incmgr.h>
|
#include <incmgr.h>
|
||||||
#include <enginend/scenes/node2drelative.h>
|
#include <enginend/scenes/node2drelative.h>
|
||||||
|
#include "configmenu.h"
|
||||||
#include <enginend/scenes/node2d.h>
|
#include <enginend/scenes/node2d.h>
|
||||||
|
|
||||||
class mainmenu :public virtual enginend::scene{
|
class mainmenu :public virtual enginend::scene{
|
||||||
|
|
@ -11,6 +12,7 @@ public:
|
||||||
|
|
||||||
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,1,1,2),
|
new enginend::nodes::relative::animated(AT("res/images/sky.gif"),0,0,1,1,2),
|
||||||
|
new enginend::nodes::relative::text(nullptr,{255,127,0,255},{0,0,0,0},0.25,0.05,0.8,0.1,forefont,32,"FORESPEND"),
|
||||||
};
|
};
|
||||||
enginend::scene::boot();
|
enginend::scene::boot();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
PLATFORM platform=LINUX;
|
PLATFORM platform=LINUX;
|
||||||
std::string androidpackage="kn.kinfuyuki.forespend";
|
std::string androidpackage="kn.kinfuyuki.forespend";
|
||||||
inline const char* COMMONCONFIG(){return "common.tdf";}
|
inline const char* COMMONCONFIG(){return "common.tdf";}
|
||||||
tiny::ErrorLevel tiny::level{6};
|
tiny::ErrorLevel tiny::level{4};
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
enginend::program* game;
|
enginend::program* game;
|
||||||
tiny::startup("forespend","0.03g-rewrite");
|
tiny::startup("forespend","0.03g-rewrite");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue