From 54c3acf0923896ea20b370b11c69648dcb23eb05 Mon Sep 17 00:00:00 2001 From: kin fuyuki Date: Sun, 21 Dec 2025 03:01:29 -0300 Subject: [PATCH] made tons of stuff lol --- CMakeLists.txt | 2 +- engine/CMakeLists.txt | 37 ++- engine/src/engine.h | 3 +- engine/src/gr.h | 2 +- engine/src/graph/window.h | 1 + engine/src/program.cpp | 10 + engine/src/program.h | 30 +- engine/src/scenes/node2d.h | 293 +++++++++++++++--- engine/src/scenes/nodes.h | 18 +- engine/src/scenes/scene.h | 36 ++- engine/test.cpp | 53 ++++ games/forespend/CMakeLists.txt | 2 +- .../forespend/src/client/scenes/mainmenu.cpp | 1 + games/forespend/src/client/scenes/mainmenu.h | 6 + include/tiny/tdf.h | 1 + include/tiny/term.h | 51 +-- 16 files changed, 451 insertions(+), 95 deletions(-) create mode 100644 engine/test.cpp create mode 100644 games/forespend/src/client/scenes/mainmenu.cpp create mode 100644 games/forespend/src/client/scenes/mainmenu.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bcd06e..a89850c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.20) project(games) -SET(CMAKE_CXX_FLAGS "-std=c++23") +set(CMAKE_CXX_FLAGS "-std=c++17 -Wno-error") if(WIN32) set(PLATFORM_DIR "windows") else() diff --git a/engine/CMakeLists.txt b/engine/CMakeLists.txt index aa98808..49f0aed 100644 --- a/engine/CMakeLists.txt +++ b/engine/CMakeLists.txt @@ -1,12 +1,11 @@ cmake_minimum_required(VERSION 3.20) -SET(CMAKE_CXX_FLAGS "-std=c++23 -Werror") -file(GLOB_RECURSE ENGINE_SOURCES "src/*.cpp") -add_library(enginend SHARED ${ENGINE_SOURCES}) -target_include_directories(enginend PUBLIC - ${CMAKE_SOURCE_DIR}/include - +set(CMAKE_CXX_FLAGS "-std=c++17 -Wno-error") +file(GLOB_RECURSE ENGINE_SOURCES "${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") target_link_directories( enginend PUBLIC "${CMAKE_SOURCE_DIR}/link") @@ -32,4 +31,26 @@ foreach(HEADER ${HEADER_FILES}) COMMAND ${CMAKE_COMMAND} -E make_directory "${DEST_DIR}" COMMAND ${CMAKE_COMMAND} -E copy_if_different "${HEADER}" "${DEST}" ) -endforeach() \ No newline at end of file +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" + "${CMAKE_SOURCE_DIR}/link/libdesktopraylib.so" +) +target_include_directories(test PUBLIC + ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/lib/raylib/build/raylib/include +) +target_include_directories(enginend PUBLIC + ${CMAKE_SOURCE_DIR}/lib/raylib/build/raylib/include + +) diff --git a/engine/src/engine.h b/engine/src/engine.h index f1441de..a4888df 100644 --- a/engine/src/engine.h +++ b/engine/src/engine.h @@ -1,4 +1,5 @@ #include "net.h" #include "gr.h" #include "aud.h" -#include "program.h" \ No newline at end of file +#include "program.h" +#include "scenes/scene.h" \ No newline at end of file diff --git a/engine/src/gr.h b/engine/src/gr.h index 30d72f7..8c898e6 100644 --- a/engine/src/gr.h +++ b/engine/src/gr.h @@ -1,2 +1,2 @@ -#include + #include "graph/window.h" \ No newline at end of file diff --git a/engine/src/graph/window.h b/engine/src/graph/window.h index e69de29..ff2092c 100644 --- a/engine/src/graph/window.h +++ b/engine/src/graph/window.h @@ -0,0 +1 @@ +#include \ No newline at end of file diff --git a/engine/src/program.cpp b/engine/src/program.cpp index 80690ef..eba248d 100644 --- a/engine/src/program.cpp +++ b/engine/src/program.cpp @@ -1 +1,11 @@ #include "program.h" + +long long calibrate() { + unsigned long long start = __rdtsc(); + struct timespec ts; + ts.tv_sec = 0; + ts.tv_nsec = 100000000L; // 0.1 seconds + nanosleep(&ts, NULL); + return (__rdtsc() - start) * 10; +} +const long long enginend::CPUCLOCK=calibrate(); diff --git a/engine/src/program.h b/engine/src/program.h index cf0c820..9787e8e 100644 --- a/engine/src/program.h +++ b/engine/src/program.h @@ -1,8 +1,17 @@ #pragma once #define CFG this->CONF() +#include +#include + +namespace enginend{ + extern const long long CPUCLOCK; inline const char* COMMONCONFIG(); class program { + unsigned long long currenttick = __rdtsc(); + unsigned long long currentframe = __rdtsc(); public: + int tickrate; + int framerate; program():client(false){} program(bool isclient):client(isclient){} virtual const char* CONF()=0; @@ -11,4 +20,23 @@ public: virtual void tick()=0; virtual void draw()=0; virtual void exit()=0; -}; \ No newline at end of file + bool shouldtick() { + unsigned long long now = __rdtsc(); + unsigned long long interval = CPUCLOCK / tickrate; + if (now - currenttick >= interval) { + currenttick = now; + return true; + } + return false; + } + + bool shoulddraw() { + unsigned long long now = __rdtsc(); + unsigned long long interval = CPUCLOCK / framerate; + if (now - currentframe >= interval) { + currentframe = now; + return true; + } + return false; + } +};} diff --git a/engine/src/scenes/node2d.h b/engine/src/scenes/node2d.h index aa68816..b022f49 100644 --- a/engine/src/scenes/node2d.h +++ b/engine/src/scenes/node2d.h @@ -1,44 +1,251 @@ -#include "nodes.h" +#pragma once +#include -struct node2d :public node { - vec2 pos; - node2d(){} - node2d(float x,float y):pos(x,y){} -}; -struct rect :virtual public node2d{ - vec2 size; - rect(){} - rect(float x,float y,float w, float h):size(w,h){ - this->pos=vec2(x,y); - } -}; -struct textured :virtual public rect{ - int ID; - textured(){} - textured(int id,float x,float y,float w, float h):ID(id){ - this->pos=vec2(x,y);this->size=vec2(w,h); - } -}; -struct colored :virtual public rect{ - col c; - colored(){} - colored(col color,float x,float y,float w, float h):c(color){ - this->pos=vec2(x,y);this->size=vec2(w,h); - } -}; -struct tinted :virtual public colored, virtual public textured{ - tinted(){} - - tinted(int id,col color,float x,float y,float w, float h): - node2d(x, y), - rect(x, y, w, h), - colored(color, x, y, w, h), - textured(id, x, y, w, h) - { - - } -}; -struct text :virtual tinted { - Font font; - std::string text; -}; \ No newline at end of file +#include "nodes.h" +#include + +namespace enginend { + 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{ + int ID; + textured(){} + textured(int id,float x,float y,float w, float h):ID(id){ + this->pos=Vector2{x,y};this->size=Vector2{w,h}; + } + void boot()override{} + void tick()override{} + void draw()override{DrawTexture(LoadTexture(""),pos.x,pos.y,WHITE);} + void exit()override{} + }; + 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(int id,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(id, 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{DrawTexture(LoadTexture(""),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 fontsize; + Color textcolor; + std::string content; + text(){ fontsize = 20; } + text(int id,Color textcol,Color color,float x,float y,float w,float h,Font f,float fs,std::string txt): + font(f),fontsize(fs),content(txt) + { + this->pos=Vector2{x,y};this->size=Vector2{w,h};this->ID=id;this->c=color;this->textcolor=textcol; + + result=content; + size_t initpos = 0; + while((initpos = result.find("\n", initpos)) != std::string::npos) { + result.replace(initpos, 1, "\\n"); + initpos += 2; + } + } + void boot()override{this->tinted::boot();} + void tick()override { + this->tinted::tick(); + if (result!=content) { + result=content; + size_t initpos = 0; + while((initpos = result.find("\n", initpos)) != std::string::npos) { + result.replace(initpos, 1, "\\n"); + initpos += 2; + } + } + } + void draw()override { + Vector2 minsize=MeasureTextEx(font, content.c_str(), fontsize, 1); + Vector2 charsize=MeasureTextEx(font, " ", fontsize, 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, fontsize, 1, textcolor); + } + void exit()override{this->tinted::exit();} + }; + struct button :virtual public tinted{ + std::function function; + bool pressed; + button():pressed(false){} + button(int id,Color color,float x,float y,float w,float h,std::function func):function(func),pressed(false){ + this->pos=Vector2{x,y};this->size=Vector2{x,y};this->ID=id;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})&&IsMouseButtonPressed(MOUSE_LEFT_BUTTON)){ + if(function)function(); + } + } + void draw()override{DrawRectangle(pos.x,pos.y,size.x,size.y,c);} + void exit()override{this->tinted::exit();} + }; + struct slider :virtual public tinted{ + float value; + float minvalue; + float maxvalue; + slider():value(0),minvalue(0),maxvalue(1){} + slider(int id,Color color,float x,float y,float w,float h,float min,float max,float val):value(val),minvalue(min),maxvalue(max){ + this->pos=Vector2{x,y};this->size=Vector2{x,y};this->ID=id;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; + value=minvalue+t*(maxvalue-minvalue); + if(valuemaxvalue)value=maxvalue; + } + } + void draw()override{ + DrawRectangle(pos.x,pos.y,size.x,size.y,DARKGRAY); + float t=(value-minvalue)/(maxvalue-minvalue); + DrawRectangle(pos.x,pos.y,size.x*t,size.y,c); + } + void exit()override{this->tinted::exit();} + }; + struct textfield :public text{ + textfield(){} + textfield(int id,Color textcol,Color color,float x,float y,float w,float h,Font f,float fs,std::string txt): + text(id,textcol,color,x,y,w,h,f,fs,txt){} + void boot()override{this->text::boot();} + void tick()override{this->text::tick();} + void draw()override{ + Vector2 p=pos; + float lineheight=fontsize+2; + std::string line=""; + Vector2 charsize=MeasureTextEx(font, " ", fontsize, 0); + Vector2 minsize=MeasureTextEx(font, content.c_str(), fontsize, 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,fontsize,charsize.x/2,this->textcolor); + } + void exit()override{this->text::exit();} + }; + struct textinput :public text{ + bool active; + int cursorpos; + textinput():active(false),cursorpos(0){} + textinput(int id,Color textcol,Color color,float x,float y,float w,float h,Font f,float fs):active(false),cursorpos(0){ + this->pos=Vector2{x,y};this->size=Vector2{x,y};this->ID=id;this->c=color;this->font=f;this->content=""; + this->textcolor=textcol;this->fontsize=fs; + } + 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); + cursorpos++; + } + key=GetCharPressed(); + } + if(IsKeyPressed(KEY_BACKSPACE)&&content.length()>0){ + content.pop_back(); + cursorpos--; + } + } + } + void draw()override{ + this->text::draw(); + if(active)DrawRectangle(pos.x+MeasureText(content.c_str(),fontsize),pos.y,2,fontsize,{0,0,0,127}); + } + void exit()override{this->text::exit();} + }; + struct textinputfield :public textfield{ + bool active; + int cursorpos; + textinputfield():active(false),cursorpos(0){} + textinputfield(int id,Color textcol,Color color,float x,float y,float w,float h,Font f,float fs):active(false),cursorpos(0), + textfield(id,textcol,color,x,y,w,h,f,fs,""){} + 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); + cursorpos++; + } + key=GetCharPressed(); + } + if(IsKeyPressed(KEY_BACKSPACE)&&content.length()>0){ + content.pop_back(); + cursorpos--; + } + if(IsKeyPressed(KEY_ENTER)){ + content+='\n'; + cursorpos++; + } + } + } + void draw()override{ + this->textfield::draw(); + if(active){ + Vector2 p=pos; + float lineheight=fontsize+2; + std::string line=""; + for(char ch:content){ + if(ch=='\n'){ + p.y+=lineheight; + line=""; + }else{ + line+=ch; + } + } + DrawRectangle(p.x+MeasureText(line.c_str(),fontsize),p.y,2,fontsize,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 index 9c3e41b..b64be56 100644 --- a/engine/src/scenes/nodes.h +++ b/engine/src/scenes/nodes.h @@ -1,11 +1,15 @@ +#pragma once #include "../gr.h" #include "../aud.h" #include "../net.h" -struct node{ -public: + +namespace enginend { + struct node{ + public: - virtual void init() {} - virtual void render() {} - virtual void update() {} - virtual void close() {} -}; \ No newline at end of file + virtual void boot()=0; + virtual void tick()=0; + virtual void draw()=0; + virtual void exit()=0; + }; +} \ No newline at end of file diff --git a/engine/src/scenes/scene.h b/engine/src/scenes/scene.h index 34df657..e6a205b 100644 --- a/engine/src/scenes/scene.h +++ b/engine/src/scenes/scene.h @@ -1,9 +1,31 @@ #include "nodes.h" #include -struct scene{ - std::list nodes; - virtual void init() {} - virtual void render() {} - virtual void update() {} - virtual void close() {} -}; \ No newline at end of file + + +namespace enginend { + struct scene{ + std::list nodes; + virtual void boot() { + for (enginend::node* n : nodes) { + n->boot(); + } + } + virtual void draw() { + BeginDrawing(); + for (enginend::node* n : nodes) { + n->draw(); + } + EndDrawing(); + } + virtual void tick() { + for (enginend::node* n : nodes) { + n->tick(); + } + } + virtual void exit() { + for (enginend::node* n : nodes) { + n->exit(); + } + } + }; +} \ No newline at end of file diff --git a/engine/test.cpp b/engine/test.cpp new file mode 100644 index 0000000..5296f9b --- /dev/null +++ b/engine/test.cpp @@ -0,0 +1,53 @@ +#include +#include +#include +using namespace enginend; +class test:public program { +public: + + bool vsync = true; + scene s; + const char* CONF() final{return "test.tdf";} + test(){}; + void boot() override { + SetConfigFlags(FLAG_VSYNC_HINT); + InitWindow(500,500,"test"); + SetTargetFPS(GetMonitorRefreshRate(GetCurrentMonitor())); + this->tickrate=GetMonitorRefreshRate(GetCurrentMonitor()); + s.nodes=std::list{ + + new colored(Color{255,255,255,255},0,0,500,500), + new textfield(0,Color{255,127,127,255},Color{127,127,127,255} + ,100,100,220,32,GetFontDefault(),32, + "welcome to enginend!\n" + "hehe" + ) + }; + s.boot(); + + } + void tick() override { + if (shouldtick()) { + s.tick(); + } + } + void draw() override { + s.draw(); + } + void exit() override { + s.exit(); + } +}; + +tiny::ErrorLevel tiny::level{6}; +int main(int argc, char *argv[]) { + tiny::startup((char*)"enginend test",(char*)"1.0"); + test e; + e.boot(); + while (!WindowShouldClose()) { + e.tick(); + e.draw(); + } + e.exit(); + return 0; +} \ No newline at end of file diff --git a/games/forespend/CMakeLists.txt b/games/forespend/CMakeLists.txt index c5f8d94..bf3e4d9 100644 --- a/games/forespend/CMakeLists.txt +++ b/games/forespend/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.20) -SET(CMAKE_CXX_FLAGS "-std=c++23") +set(CMAKE_CXX_FLAGS "-std=c++17 -Wno-error") file(GLOB_RECURSE FORESPEND_SOURCES "src/*.cpp") add_executable(forespend ${FORESPEND_SOURCES}) diff --git a/games/forespend/src/client/scenes/mainmenu.cpp b/games/forespend/src/client/scenes/mainmenu.cpp new file mode 100644 index 0000000..12bdeb0 --- /dev/null +++ b/games/forespend/src/client/scenes/mainmenu.cpp @@ -0,0 +1 @@ +#include "mainmenu.h" \ No newline at end of file diff --git a/games/forespend/src/client/scenes/mainmenu.h b/games/forespend/src/client/scenes/mainmenu.h new file mode 100644 index 0000000..dee6cf5 --- /dev/null +++ b/games/forespend/src/client/scenes/mainmenu.h @@ -0,0 +1,6 @@ +#pragma once +#include + +class mainmenu :public virtual scene{ + +}; diff --git a/include/tiny/tdf.h b/include/tiny/tdf.h index e5bdb44..9d09415 100644 --- a/include/tiny/tdf.h +++ b/include/tiny/tdf.h @@ -7,6 +7,7 @@ #include #include #include +#pragma GCC diagnostic ignored "-Wdelete-incomplete" #ifndef TINYDATAFORMAT_H #define TINYDATAFORMAT_H #define TINYDEFINEHEADER "0000_TDF_HEADER_DEFINE" diff --git a/include/tiny/term.h b/include/tiny/term.h index 95405b9..e3a0f9b 100644 --- a/include/tiny/term.h +++ b/include/tiny/term.h @@ -1,4 +1,5 @@ #pragma once +#pragma GCC diagnostic ignored "-Wvarargs" #ifndef TINYTERM_H #define TINYTERM_H @@ -37,24 +38,24 @@ tiny::ErrorLevel tiny::level={1}; extern tiny::ErrorLevel level; -#define WHITE "\033[0m" /* White */ -#define BLACK "\033[30m" /* Black */ -#define RED "\033[31m" /* Red */ -#define GREEN "\033[32m" /* Green */ -#define YELLOW "\033[33m" /* Yellow */ -#define BLUE "\033[34m" /* Blue */ -#define MAGENTA "\033[35m" /* Magenta */ -#define CYAN "\033[36m" /* Cyan */ -#define WHITE "\033[37m" /* White */ -#define BGRED "\033[41m" /* Red */ -#define BOLDBLACK "\033[1m\033[30m" /* Bold Black */ -#define BOLDRED "\033[1m\033[31m" /* Bold Red */ -#define BOLDGREEN "\033[1m\033[32m" /* Bold Green */ -#define BOLDYELLOW "\033[1m\033[33m" /* Bold Yellow */ -#define BOLDBLUE "\033[1m\033[34m" /* Bold Blue */ -#define BOLDMAGENTA "\033[1m\033[35m" /* Bold Magenta */ -#define BOLDCYAN "\033[1m\033[36m" /* Bold Cyan */ -#define BOLDWHITE "\033[1m\033[37m" /* Bold White */ + + const char* WHITE="\033[0m"; + const char* BLACK="\033[30m"; + const char* RED="\033[31m"; + const char* GREEN="\033[32m"; + const char* YELLOW="\033[33m"; + const char* BLUE="\033[34m"; + const char* MAGENTA="\033[35m"; + const char* CYAN="\033[36m"; + const char* BGRED="\033[41m"; + const char* BOLDBLACK="\033[1m\033[30m"; + const char* BOLDRED="\033[1m\033[31m"; + const char* BOLDGREEN="\033[1m\033[32m"; + const char* BOLDYELLOW="\033[1m\033[33m"; + const char* BOLDBLUE="\033[1m\033[34m"; + const char* BOLDMAGENTA="\033[1m\033[35m"; + const char* BOLDCYAN="\033[1m\033[36m"; + const char* BOLDWHITE="\033[1m\033[37m"; #define ending \ mixer.append(info); mixer.append("\033[0m\n");\ const char * finalinfo=mixer.c_str();\ @@ -62,7 +63,7 @@ extern tiny::ErrorLevel level; vfprintf (stdout, finalinfo, arg);\ va_end (arg); -inline void echo(char * info,...){ +inline void echo(const char * info,...){ if (level.value==4) { va_list arg; @@ -73,36 +74,36 @@ inline void echo(char * info,...){ vfprintf (stdout, finalinfo, arg); va_end (arg);} } -inline void warning( char * info,...){ +inline void warning(const char * info,...){ if (level.value>=1) { va_list arg; std::string mixer=YELLOW;ending } } -inline void fatal( char * info,...){ +inline void fatal(const char * info,...){ va_list arg; std::string mixer=BOLDWHITE+std::string(BGRED);ending } -inline void error( char * info,...){ +inline void error(const char * info,...){ if (level.value>=0) { va_list arg; std::string mixer=BOLDRED;ending }} -inline void success(char * info , ...){ +inline void success(const char * info , ...){ if (level.value>=2) { va_list arg; std::string mixer=GREEN;ending} } -inline void message(char * info , ...){ +inline void message(const char * info , ...){ if (level.value>=3) { va_list arg; std::string mixer=BOLDWHITE;ending} } -inline void startup(char* game,char*version){ +inline void startup(const char* game,const char*version){ int lv=level.value;level.value=6; echo("%s %s",game,version); warning("be warned that");