From 55b9b9d4fa87e111496e27795f609b88927fec43 Mon Sep 17 00:00:00 2001 From: kin-fuyuki Date: Fri, 20 Feb 2026 00:30:40 -0300 Subject: [PATCH] symlinking library headers for better portability --- CMakeLists.txt | 1 + engine/CMakeLists.txt | 56 +++ engine/src/scenes/node2d.h | 342 ++++++++++++++++++ engine/src/scenes/nodes.h | 40 ++ games/endlauncher/CMakeLists.txt | 19 + games/forespend/CMakeLists.txt | 22 ++ games/forespend/src/client/client.cpp | 33 ++ .../src/client/scenes/configmenu.cpp | 40 ++ .../forespend/src/client/scenes/configmenu.h | 11 + games/forespend/src/common/themes.cpp | 4 + games/forespend/src/common/themes.h | 5 + include/enginend/aud.h | 1 + include/enginend/engine.h | 1 + include/enginend/gr.h | 1 + include/enginend/graph/window.h | 1 + include/enginend/net.h | 1 + include/enginend/program.h | 1 + include/enginend/resmgr.h | 1 + include/enginend/scenes/node2d.h | 1 + include/enginend/scenes/node2drelative.h | 1 + include/enginend/scenes/nodes.h | 1 + include/enginend/scenes/scene.h | 1 + include/raylib/raylib.h | 1 + include/raylib/raymath.h | 1 + include/raylib/rcamera.h | 1 + include/raylib/rlgl.h | 1 + lib/raylib | 1 + updatesymlinks.sh | 56 +++ 28 files changed, 645 insertions(+) create mode 100644 engine/CMakeLists.txt create mode 100644 engine/src/scenes/node2d.h create mode 100644 engine/src/scenes/nodes.h create mode 100644 games/endlauncher/CMakeLists.txt create mode 100644 games/forespend/CMakeLists.txt create mode 100644 games/forespend/src/client/client.cpp create mode 100644 games/forespend/src/client/scenes/configmenu.cpp create mode 100644 games/forespend/src/client/scenes/configmenu.h create mode 100644 games/forespend/src/common/themes.cpp create mode 100644 games/forespend/src/common/themes.h create mode 120000 include/enginend/aud.h create mode 120000 include/enginend/engine.h create mode 120000 include/enginend/gr.h create mode 120000 include/enginend/graph/window.h create mode 120000 include/enginend/net.h create mode 120000 include/enginend/program.h create mode 120000 include/enginend/resmgr.h create mode 120000 include/enginend/scenes/node2d.h create mode 120000 include/enginend/scenes/node2drelative.h create mode 120000 include/enginend/scenes/nodes.h create mode 120000 include/enginend/scenes/scene.h create mode 120000 include/raylib/raylib.h create mode 120000 include/raylib/raymath.h create mode 120000 include/raylib/rcamera.h create mode 120000 include/raylib/rlgl.h create mode 160000 lib/raylib create mode 100755 updatesymlinks.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index bbce022..1ebeda6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,7 @@ else() set(PLATFORM_DIR "linux") endif() + add_subdirectory(engine) add_subdirectory(games/forespend) add_subdirectory(games/endlauncher) diff --git a/engine/CMakeLists.txt b/engine/CMakeLists.txt new file mode 100644 index 0000000..59d49da --- /dev/null +++ b/engine/CMakeLists.txt @@ -0,0 +1,56 @@ +cmake_minimum_required(VERSION 3.20) +set(CMAKE_CXX_FLAGS "-std=c++17 -Wno-error") + +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" +) +add_library(enginend SHARED ${ENGINE_SOURCES} "${CMAKE_BINARY_DIR}/force_rebuild" + ../include/json.h) +target_link_directories( + enginend PUBLIC + "${CMAKE_SOURCE_DIR}/link") +set(ENGINE_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src") +set(ENGINE_EXPORT_DIR "${CMAKE_SOURCE_DIR}/include/enginend") +set_target_properties(enginend PROPERTIES + CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/link" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/link" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/link" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/link" +) + +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}") + + set(DEST "${ENGINE_EXPORT_DIR}/${REL_PATH}") + + get_filename_component(DEST_DIR "${DEST}" DIRECTORY) + + add_custom_command( + TARGET enginend PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory "${DEST_DIR}" + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${HEADER}" "${DEST}" + ) +endforeach() + + +add_executable(test test.cpp) + +set_target_properties(test PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/engine/test" +) +target_link_directories( + test PUBLIC + "${CMAKE_SOURCE_DIR}/link") +target_link_libraries(test PRIVATE + "${CMAKE_SOURCE_DIR}/link/libenginend.so" +) +target_include_directories(test PUBLIC + ${CMAKE_SOURCE_DIR}/include +) +target_include_directories(enginend PUBLIC + ${CMAKE_SOURCE_DIR}/include + +) diff --git a/engine/src/scenes/node2d.h b/engine/src/scenes/node2d.h new file mode 100644 index 0000000..c0e12c6 --- /dev/null +++ b/engine/src/scenes/node2d.h @@ -0,0 +1,342 @@ +#pragma once +#include + +#include "nodes.h" + +namespace enginend { + namespace nodes { + struct node2d :public node { + Vector2 pos; + node2d(){} + node2d(float x,float y):pos(Vector2{x,y}){} + }; + struct rect :virtual public node2d{ + Vector2 size; + rect(){} + rect(float x,float y,float w,float h):size(Vector2{w,h}){ + this->pos=Vector2{x,y}; + } + }; + struct textured :virtual public rect{ + Texture2D* texture; + textured(){} + textured(Texture2D* texture,float x,float y,float w,float h):texture(texture){ + this->pos=Vector2{x,y};this->size=Vector2{w,h}; + } + void boot()override{} + void tick()override{} + void draw()override{if(texture!=nullptr)DrawTexture(*texture,pos.x,pos.y,WHITE);} + void exit()override{delete texture;} + }; + struct animated : virtual public textured { + Image animimage; + int frames; + int currentframe; + int framedelay; + int framecounter; + unsigned int nextframeoffset; + int prevframe; + + animated() : frames(0), currentframe(0), framedelay(6), framecounter(0), nextframeoffset(0) { + animimage.data = nullptr; + } + + animated(const char* gifpath, Vector2 position, Vector2 size, int delay = 6) + : textured(nullptr, position.x, position.y, size.x, size.y), + framedelay(delay), currentframe(0), framecounter(0), frames(0), nextframeoffset(0) + { + animimage = LoadImageAnim(gifpath, &frames); + if (frames > 0) { + texture = new Texture2D(LoadTextureFromImage(animimage)); + } + } + + void tick() override { + textured::tick(); + if (frames <= 1) return; + + framecounter++; + if (framecounter >= framedelay) { + framecounter = 0; + currentframe++; + if (currentframe >= frames) currentframe = 0; + nextframeoffset = animimage.width * animimage.height * 4 * currentframe; + } + } + void draw() override { + + if (prevframe!=currentframe){ + prevframe=currentframe; + UpdateTexture(*this->texture,((unsigned char*)animimage.data)+nextframeoffset); + } + textured::draw(); + } + void exit() override { + if (animimage.data) UnloadImage(animimage); + if (texture) { + UnloadTexture(*texture); + delete texture; + texture = nullptr; + } + } + }; + struct colored :virtual public rect{ + Color c; + colored(){} + colored(Color color,float x,float y,float w,float h):c(color){ + this->pos=Vector2{x,y};this->size=Vector2{w,h}; + } + void boot()override{} + void tick()override{} + void draw()override{DrawRectangle(pos.x,pos.y,size.x,size.y,c);} + void exit()override{} + }; + struct tinted :virtual public colored,virtual public textured{ + tinted(){} + tinted(Texture2D* texture,Color color,float x,float y,float w,float h): + node2d(x,y), + rect(x,y,w,h), + colored(color,x,y,w,h), + textured(texture,x,y,w,h) + {} + void boot()override{this->colored::boot();this->textured::boot();} + void tick()override{this->colored::tick();this->textured::tick();} + void draw()override{if(texture!=nullptr)DrawTexture(*texture,pos.x,pos.y,c);} + void exit()override{this->colored::exit();this->textured::exit();} + }; + struct text :public tinted { + protected: + std::string result; + public: + Font font; + float fs; + Color txc; + std::string content; + text(){fs=20;} + text(Texture2D* texture,Color txcol,Color color,float x,float y,float w,float h,Font f,float fsize,std::string txt): + font(f),fs(fsize),content(txt) + { + this->pos=Vector2{x,y};this->size=Vector2{w,h};this->texture=texture;this->c=color;this->txc=txcol; + + result=content; + size_t initp=0; + while((initp=result.find("\n",initp))!=std::string::npos){ + result.replace(initp,1,"\\n"); + initp+=2; + } + } + void boot()override{this->tinted::boot();} + void tick()override { + this->tinted::tick(); + if(result!=content){ + result=content; + size_t initp=0; + while((initp=result.find("\n",initp))!=std::string::npos){ + result.replace(initp,1,"\\n"); + initp+=2; + } + } + } + void draw()override { + 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; + p=p*2; + int minh=(minsize.y>size.y)?minsize.y:size.y; + int minw=(minsize.x>size.x)?minsize.x:size.x; + DrawRectangle(pos.x-charsize.x,pos.y-charsize.y,minw+p,minh+p,c); + DrawTextEx(font,content.c_str(),pos,fs,1,txc); + } + void exit()override{this->tinted::exit();} + }; + struct button :virtual public tinted{ + std::function func; + bool pressed; + bool hover; + final bool isboolean; + button():pressed(false),isboolean(false){} + button(Texture2D* texture,Color color,float x,float y,float w,float h,std::function f):func(f),pressed(false),isboolean(false){ + this->pos=Vector2{x,y};this->size=Vector2{w,h};this->texture=texture;this->c=color; + } + button(Texture2D* texture,Color color,float x,float y,float w,float h,std::function f,bool isboolean):func(f),pressed(false),isboolean(true){ + this->pos=Vector2{x,y};this->size=Vector2{w,h};this->texture=texture;this->c=color; + } + void boot()override{this->tinted::boot();} + void tick()override{ + this->tinted::tick(); + Vector2 mouse=GetMousePosition(); + if(CheckCollisionPointRec(mouse,{pos.x,pos.y,size.x,size.y})){hover=true; + if(IsMouseButtonPressed(MOUSE_LEFT_BUTTON)){ + pressed=true; + if(func)func(); + }else{ + pressed=false; + } + }else{ + hover=false; + } + } + void draw()override { + if(this->texture!=nullptr)DrawTexture(*texture,pos.x,pos.y,c); + else DrawRectangle(pos.x,pos.y,size.x,size.y,c); + } + void exit()override{this->tinted::exit();} + }; + struct labeledbutton :virtual public button { + std::string label; + Font font; + int fs; + Color txc; + labeledbutton(std::string name,Texture2D* texture,Color color,Color text, + float x,float y,float w,float h,std::function f, + Font fnt,int size):font(fnt),fs(size),txc(text){ + this->pos=Vector2{x,y};this->size=Vector2{w,h};this->texture=texture;this->c=color; + this->func=f;this->pressed=false; + this->label=name; + } + void boot()override{this->button::boot();} + void tick()override{this->button::tick();} + void draw()override{ + this->button::draw(); + Vector2 tsize=MeasureTextEx(font,label.c_str(),fs,1); + Vector2 tpos={ + pos.x+(size.x-tsize.x)/2, + pos.y+(size.y-tsize.y)/2 + }; + DrawTextEx(font,label.c_str(),tpos,fs,1,txc); + } + void exit()override{this->button::exit();} + }; + struct slider :virtual public tinted{ + float val; + float minv; + float maxv; + slider():val(0),minv(0),maxv(1){} + slider(Texture2D* texture,Color color,float x,float y,float w,float h,float min,float max,float v):val(v),minv(min),maxv(max){ + this->pos=Vector2{x,y};this->size=Vector2{x,y};this->texture=texture;this->c=color; + } + void boot()override{this->tinted::boot();} + void tick()override{ + this->tinted::tick(); + Vector2 mouse=GetMousePosition(); + if(CheckCollisionPointRec(mouse,{pos.x,pos.y,size.x,size.y})&&IsMouseButtonDown(MOUSE_LEFT_BUTTON)){ + float t=(mouse.x-pos.x)/size.x; + val=minv+t*(maxv-minv); + if(valmaxv)val=maxv; + } + } + void draw()override{ + DrawRectangle(pos.x,pos.y,size.x,size.y,DARKGRAY); + float t=(val-minv)/(maxv-minv); + DrawRectangle(pos.x,pos.y,size.x*t,size.y,c); + } + void exit()override{this->tinted::exit();} + }; + struct textfield :public text{ + textfield(){} + textfield(Texture2D* texture,Color txcol,Color color,float x,float y,float w,float h,Font f,float fsize,std::string txt): + text(texture,txcol,color,x,y,w,h,f,fsize,txt){} + void boot()override{this->text::boot();} + void tick()override{this->text::tick();} + void draw()override{ + Vector2 p=pos; + Vector2 charsize=MeasureTextEx(font," ",fs,0); + Vector2 minsize=MeasureTextEx(font,content.c_str(),fs,charsize.x/2); + float po=charsize.x>charsize.y?charsize.x/charsize.y:charsize.y/charsize.x;po=po*5; + int minh=(minsize.y>size.y)?minsize.y:size.y; + int minw=(minsize.x>size.x)?minsize.x:size.x; + DrawRectangle(pos.x-(po/2),pos.y-(po/2),minw+(po*1.1),minh+(po*1.1),c); + DrawTextEx(font,content.c_str(),p,fs,charsize.x/2,this->txc); + } + void exit()override{this->text::exit();} + }; + struct textinput :public text{ + bool active; + int cpos; + textinput():active(false),cpos(0){} + textinput(Texture2D* texture,Color txcol,Color color,float x,float y,float w,float h,Font f,float fsize):active(false),cpos(0){ + this->pos=Vector2{x,y};this->size=Vector2{x,y};this->texture=texture;this->c=color;this->font=f;this->content=""; + this->txc=txcol;this->fs=fsize; + } + void boot()override{this->text::boot();} + void tick()override{ + this->text::tick(); + Vector2 mouse=GetMousePosition(); + if(IsMouseButtonPressed(MOUSE_LEFT_BUTTON)){ + active=CheckCollisionPointRec(mouse,{pos.x,pos.y,size.x,size.y}); + } + if(active){ + int key=GetCharPressed(); + while(key>0){ + if(key>=32&&key<=125){ + content+=static_cast(key); + cpos++; + } + key=GetCharPressed(); + } + if(IsKeyPressed(KEY_BACKSPACE)&&content.length()>0){ + content.pop_back(); + cpos--; + } + } + } + void draw()override{ + this->text::draw(); + if(active)DrawRectangle(pos.x+MeasureText(content.c_str(),fs),pos.y,2,fs,{0,0,0,127}); + } + void exit()override{this->text::exit();} + }; + struct textinputfield :public textfield{ + bool active; + int cpos; + textinputfield():active(false),cpos(0){} + textinputfield(Texture2D* texture,Color txcol,Color color,float x,float y,float w,float h,Font f,float fsize):active(false),cpos(0), + textfield(texture,txcol,color,x,y,w,h,f,fsize,""){} + void boot()override{this->textfield::boot();} + void tick()override{ + this->textfield::tick(); + Vector2 mouse=GetMousePosition(); + if(IsMouseButtonPressed(MOUSE_LEFT_BUTTON)){ + active=CheckCollisionPointRec(mouse,{pos.x,pos.y,size.x,size.y}); + } + if(active){ + int key=GetCharPressed(); + while(key>0){ + if(key>=32&&key<=125){ + content+=static_cast(key); + cpos++; + } + key=GetCharPressed(); + } + if(IsKeyPressed(KEY_BACKSPACE)&&content.length()>0){ + content.pop_back(); + cpos--; + } + if(IsKeyPressed(KEY_ENTER)){ + content+='\n'; + cpos++; + } + } + } + void draw()override{ + this->textfield::draw(); + if(active){ + Vector2 p=pos; + float lh=fs+2; + std::string line=""; + for(char ch:content){ + if(ch=='\n'){ + p.y+=lh; + line=""; + }else{ + line+=ch; + } + } + DrawRectangle(p.x+MeasureText(line.c_str(),fs),p.y,2,fs,BLACK); + } + } + void exit()override{this->textfield::exit();} + }; + } +} \ No newline at end of file diff --git a/engine/src/scenes/nodes.h b/engine/src/scenes/nodes.h new file mode 100644 index 0000000..9259760 --- /dev/null +++ b/engine/src/scenes/nodes.h @@ -0,0 +1,40 @@ +#pragma once +#include + +#include "../gr.h" +#include "../aud.h" +#include "../net.h" +#include + + namespace enginend { + namespace nodes { + struct node{ + public: + virtual void boot()=0; + virtual void tick()=0; + virtual void draw()=0; + virtual void exit()=0; + }; + } + struct group : public virtual enginend::nodes::node { + std::vector children; + + explicit group(std::vector nodes):children(nodes){}; + + 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();}} + }; + + struct theme { + // in case if its a boolean button, it will use booleanbutton + Color booleanbutton[3],button[3],booleantext[3],buttontext[3],text,buttonborder[3],booleanborder[3],border; + + Font font; + + Image slider,handle, checkbox,checkboxchecked; + + Color tint; + }; + } diff --git a/games/endlauncher/CMakeLists.txt b/games/endlauncher/CMakeLists.txt new file mode 100644 index 0000000..2d18978 --- /dev/null +++ b/games/endlauncher/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.20) + +set(CMAKE_CXX_FLAGS "-std=c++17 -g -Wno-error -O0") +file(GLOB_RECURSE ENDLAUNCHER "src/*.cpp") +add_executable(endlauncher ${ENDLAUNCHER}) + +set_target_properties(endlauncher PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/built/launcher/${PLATFORM_DIR}" +) +target_link_directories( + endlauncher PUBLIC + "${CMAKE_SOURCE_DIR}/link") +target_link_libraries(endlauncher PRIVATE + "${CMAKE_SOURCE_DIR}/link/libenginend.so" + curl zip +) +target_include_directories(endlauncher PUBLIC + ${CMAKE_SOURCE_DIR}/include +) diff --git a/games/forespend/CMakeLists.txt b/games/forespend/CMakeLists.txt new file mode 100644 index 0000000..9510c06 --- /dev/null +++ b/games/forespend/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.20) + +set(CMAKE_CXX_FLAGS "-std=c++17 -Wno-error") +file(GLOB_RECURSE FORESPEND_SOURCES CONFIGURE_DEPENDS "src/*.cpp") +add_executable(forespend ${FORESPEND_SOURCES}) +if(NOT DEFINED ${ARCH}) + set(ARCH "linux-64") +endif(NOT DEFINED ${ARCH}) +set_target_properties(forespend PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/built/forespend/${PLATFORM_DIR}/bin" +) + +target_link_directories( + forespend PUBLIC + "${CMAKE_SOURCE_DIR}/link") +target_link_libraries(forespend PRIVATE + "${CMAKE_SOURCE_DIR}/link/libenginend.so" + "${CMAKE_SOURCE_DIR}/lib/raylib/${ARCH}/raylib/libraylib.a" +) +target_include_directories(forespend PUBLIC + ${CMAKE_SOURCE_DIR}/include +) \ No newline at end of file diff --git a/games/forespend/src/client/client.cpp b/games/forespend/src/client/client.cpp new file mode 100644 index 0000000..d0aa196 --- /dev/null +++ b/games/forespend/src/client/client.cpp @@ -0,0 +1,33 @@ +#include "client.h" + +#include "scenes/mainmenu.h" + +client::client() { + +} +void client::boot() { + this->framerate=60; + this->tickrate=20; +// SetConfigFlags(); + InitWindow(380,240,"forespend - 0.03h"); + initconfigmenu(); + this->currentscene=new mainmenu(); + this->currentscene->boot(); + target=LoadRenderTexture(380,240); +} +void client::draw() { + BeginDrawing(); + ClearBackground(rl::WHITE); + this->currentscene->draw(); + EndDrawing(); +} +void client::exit() { + this->currentscene->exit(); + delete this->currentscene; +} +void client::tick() { + this->currentscene->tick(); +} + + + diff --git a/games/forespend/src/client/scenes/configmenu.cpp b/games/forespend/src/client/scenes/configmenu.cpp new file mode 100644 index 0000000..c43f0c7 --- /dev/null +++ b/games/forespend/src/client/scenes/configmenu.cpp @@ -0,0 +1,40 @@ +#include "configmenu.h" + +#include +Font forefont; +int configmenupage=0; // 0 is before the mainpage is showing. aka pause menu/main menu when start game +enginend::group mainpage= enginend::group( + { + new enginend::nodes::labeledbutton("video",nullptr,{255,127,0,255},{0,0,0,0},100,100,0,0,std::function([]() { + + }),forefont,32), + new enginend::nodes::labeledbutton("sound",nullptr,{255,127,0,255},{0,0,0,0},100,100,0,0,std::function([]() { + + }),forefont,32), + new enginend::nodes::labeledbutton("input",nullptr,{255,127,0,255},{0,0,0,0},100,100,0,0,std::function([]() { + + }),forefont,32), + + } +); + +enginend::group graphics= enginend::group( + { + new enginend::nodes::labeledbutton("fullscreen",nullptr,{255,127,0,255},{0,0,0,0},100,100,0,0,std::function([]() { + + }),forefont,32), + } +); +enginend::group sound= enginend::group( + { + + } +); +enginend::group controls= enginend::group( + { + + } +); +void initconfigmenu() { + forefont=LoadFont(AT("res/fonts/dos.fnt")); +} \ No newline at end of file diff --git a/games/forespend/src/client/scenes/configmenu.h b/games/forespend/src/client/scenes/configmenu.h new file mode 100644 index 0000000..2d35ea4 --- /dev/null +++ b/games/forespend/src/client/scenes/configmenu.h @@ -0,0 +1,11 @@ +#pragma once +#include +#include + +extern Font forefont; +extern enginend::group maincfgpage; +extern enginend::group graphics; +extern enginend::group sound; +extern enginend::group controls; +extern int configmenupage; +void initconfigmenu(); \ No newline at end of file diff --git a/games/forespend/src/common/themes.cpp b/games/forespend/src/common/themes.cpp new file mode 100644 index 0000000..495195f --- /dev/null +++ b/games/forespend/src/common/themes.cpp @@ -0,0 +1,4 @@ +#include "themes.h" + +enginend::theme clienttheme; +enginend::theme servertheme; \ No newline at end of file diff --git a/games/forespend/src/common/themes.h b/games/forespend/src/common/themes.h new file mode 100644 index 0000000..0e70df9 --- /dev/null +++ b/games/forespend/src/common/themes.h @@ -0,0 +1,5 @@ +#pragma once +#include + +extern enginend::theme clienttheme; +extern enginend::theme servertheme; \ No newline at end of file diff --git a/include/enginend/aud.h b/include/enginend/aud.h new file mode 120000 index 0000000..2552629 --- /dev/null +++ b/include/enginend/aud.h @@ -0,0 +1 @@ +../../engine/src/aud.h \ No newline at end of file diff --git a/include/enginend/engine.h b/include/enginend/engine.h new file mode 120000 index 0000000..da5b02b --- /dev/null +++ b/include/enginend/engine.h @@ -0,0 +1 @@ +../../engine/src/engine.h \ No newline at end of file diff --git a/include/enginend/gr.h b/include/enginend/gr.h new file mode 120000 index 0000000..2138b8f --- /dev/null +++ b/include/enginend/gr.h @@ -0,0 +1 @@ +../../engine/src/gr.h \ No newline at end of file diff --git a/include/enginend/graph/window.h b/include/enginend/graph/window.h new file mode 120000 index 0000000..d86b560 --- /dev/null +++ b/include/enginend/graph/window.h @@ -0,0 +1 @@ +../../../engine/src/graph/window.h \ No newline at end of file diff --git a/include/enginend/net.h b/include/enginend/net.h new file mode 120000 index 0000000..183f4b3 --- /dev/null +++ b/include/enginend/net.h @@ -0,0 +1 @@ +../../engine/src/net.h \ No newline at end of file diff --git a/include/enginend/program.h b/include/enginend/program.h new file mode 120000 index 0000000..3012887 --- /dev/null +++ b/include/enginend/program.h @@ -0,0 +1 @@ +../../engine/src/program.h \ No newline at end of file diff --git a/include/enginend/resmgr.h b/include/enginend/resmgr.h new file mode 120000 index 0000000..4a56f39 --- /dev/null +++ b/include/enginend/resmgr.h @@ -0,0 +1 @@ +../../engine/src/resmgr.h \ No newline at end of file diff --git a/include/enginend/scenes/node2d.h b/include/enginend/scenes/node2d.h new file mode 120000 index 0000000..1b8dc3e --- /dev/null +++ b/include/enginend/scenes/node2d.h @@ -0,0 +1 @@ +../../../engine/src/scenes/node2d.h \ No newline at end of file diff --git a/include/enginend/scenes/node2drelative.h b/include/enginend/scenes/node2drelative.h new file mode 120000 index 0000000..8a0a870 --- /dev/null +++ b/include/enginend/scenes/node2drelative.h @@ -0,0 +1 @@ +../../../engine/src/scenes/node2drelative.h \ No newline at end of file diff --git a/include/enginend/scenes/nodes.h b/include/enginend/scenes/nodes.h new file mode 120000 index 0000000..7fc83f8 --- /dev/null +++ b/include/enginend/scenes/nodes.h @@ -0,0 +1 @@ +../../../engine/src/scenes/nodes.h \ No newline at end of file diff --git a/include/enginend/scenes/scene.h b/include/enginend/scenes/scene.h new file mode 120000 index 0000000..32bf8a7 --- /dev/null +++ b/include/enginend/scenes/scene.h @@ -0,0 +1 @@ +../../../engine/src/scenes/scene.h \ No newline at end of file diff --git a/include/raylib/raylib.h b/include/raylib/raylib.h new file mode 120000 index 0000000..47e5dbd --- /dev/null +++ b/include/raylib/raylib.h @@ -0,0 +1 @@ +../../lib/raylib/include/raylib.h \ No newline at end of file diff --git a/include/raylib/raymath.h b/include/raylib/raymath.h new file mode 120000 index 0000000..24d6244 --- /dev/null +++ b/include/raylib/raymath.h @@ -0,0 +1 @@ +../../lib/raylib/include/raymath.h \ No newline at end of file diff --git a/include/raylib/rcamera.h b/include/raylib/rcamera.h new file mode 120000 index 0000000..9346aa9 --- /dev/null +++ b/include/raylib/rcamera.h @@ -0,0 +1 @@ +../../lib/raylib/include/rcamera.h \ No newline at end of file diff --git a/include/raylib/rlgl.h b/include/raylib/rlgl.h new file mode 120000 index 0000000..b7c64d2 --- /dev/null +++ b/include/raylib/rlgl.h @@ -0,0 +1 @@ +../../lib/raylib/include/rlgl.h \ No newline at end of file diff --git a/lib/raylib b/lib/raylib new file mode 160000 index 0000000..c8cc2ba --- /dev/null +++ b/lib/raylib @@ -0,0 +1 @@ +Subproject commit c8cc2ba6e94f82ec12d12f4764a07231269409f1 diff --git a/updatesymlinks.sh b/updatesymlinks.sh new file mode 100755 index 0000000..93eae53 --- /dev/null +++ b/updatesymlinks.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +folders=("engine/src" "lib/raylib/include") +names=("enginend" "raylib") +outdir="include" +types=("h" "hpp") + +mkdir -p "$outdir" + + +create_symlinks() { + local src="$1" + local outnam="$2" + local currout="$outdir/$outnam" + + mkdir -p "$currout" + + find "$src" -mindepth 1 -print0 | while IFS= read -r -d '' item; do + rl="${item#$src/}" + outpath="$currout/$rl" + mkdir -p "$(dirname "$outpath")" + + if [ -f "$item" ]; then + nam=$(basename "$item") + ftype="${nam##*.}" + + skip=true + for type in "${types[@]}"; do + if [ "$ftype" = "$type" ]; then + skip=false + break + fi + done + + if [ "$skip" = false ]; then + ln -sf "$(realpath --relative-to="$(dirname "$outpath")" "$item")" "$outpath" + fi + elif [ -d "$item" ]; then + mkdir -p "$outpath" + fi + done +} + +for i in "${!folders[@]}"; do + if [ $i -lt ${#names[@]} ]; then + src="${folders[$i]}" + outnam="${names[$i]}" + + if [ -d "$src" ]; then + create_symlinks "$src" "$outnam" + echo + else + echo "'$src' not exist" + fi + fi +done