weird bug happened where lots stuf corrupted, better i commit asap
|
|
@ -35,21 +35,23 @@ namespace enginend::nodes::twod {
|
|||
int framecounter;
|
||||
unsigned int nextframeoffset;
|
||||
int prevframe;
|
||||
|
||||
const char*path;
|
||||
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)
|
||||
framedelay(delay), currentframe(0), framecounter(0), frames(0), nextframeoffset(0),path(gifpath)
|
||||
{
|
||||
animimage = LoadImageAnim(gifpath, &frames);
|
||||
animimage = LoadImageAnim(path, &frames);
|
||||
if (frames > 0) {
|
||||
texture = new Texture2D(LoadTextureFromImage(animimage));
|
||||
}
|
||||
}
|
||||
|
||||
void boot() override {
|
||||
|
||||
}
|
||||
void tick() override {
|
||||
textured::tick();
|
||||
if (frames <= 1) return;
|
||||
|
|
@ -162,11 +164,25 @@ namespace enginend::nodes::twod {
|
|||
}
|
||||
void boot()override{this->tinted::boot();}
|
||||
void tick()override{
|
||||
this->tinted::tick();
|
||||
}
|
||||
void draw()override {
|
||||
|
||||
this->tinted::tick();
|
||||
|
||||
Vector2 mouse=GetMousePosition();
|
||||
float wstretch=(float)GetScreenWidth()/(float)GetRenderWidth();
|
||||
float hstretch=(float)GetScreenHeight()/(float)GetRenderHeight();
|
||||
mouse.x/=wstretch;mouse.y/=hstretch;
|
||||
tiny::echo(
|
||||
"render:\nwidth:%i height:%i\n\nscreen:\nwidth:%i height:%i\n\n\n",
|
||||
GetRenderWidth(),GetRenderHeight(),
|
||||
GetScreenWidth(),GetScreenHeight()
|
||||
);
|
||||
|
||||
tiny::echo(
|
||||
"stretch:\nwidth:%f height:%f\n\nmouse:\nwidth:%f height:%f",
|
||||
wstretch,hstretch,
|
||||
mouse.x,mouse.y
|
||||
);
|
||||
if(CheckCollisionPointRec(mouse,{pos.x,pos.y,size.x,size.y})){hover=true;
|
||||
if(IsMouseButtonPressed(MOUSE_LEFT_BUTTON)){
|
||||
pressed=true;
|
||||
|
|
@ -200,7 +216,6 @@ namespace enginend::nodes::twod {
|
|||
};
|
||||
struct labeledbutton :virtual public button {
|
||||
std::string label;
|
||||
Font font;
|
||||
int fs;
|
||||
Color txc;
|
||||
labeledbutton(std::string name,Texture2D* texture,enginend::theme* theme,
|
||||
|
|
@ -229,12 +244,12 @@ namespace enginend::nodes::twod {
|
|||
this->theme->booleantext[3]:this->theme->booleantext[0]:
|
||||
this->theme->buttontext[0];
|
||||
}
|
||||
Vector2 tsize=MeasureTextEx(font,label.c_str(),fs,1);
|
||||
Vector2 tsize=MeasureTextEx(theme->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);
|
||||
DrawTextEx(theme->font,label.c_str(),tpos,fs,1,txc);
|
||||
}
|
||||
void exit()override{this->button::exit();}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ namespace enginend::nodes::twod::relative {
|
|||
void tick() override{}
|
||||
void draw()override{
|
||||
if(texture==nullptr)return;
|
||||
float sw=GetScreenWidth();
|
||||
float sh=GetScreenHeight();
|
||||
float sw=GetRenderWidth();
|
||||
float sh=GetRenderHeight();
|
||||
float ax=x*sw;
|
||||
float ay=y*sh;
|
||||
float aw=w*sw;
|
||||
|
|
@ -95,8 +95,8 @@ namespace enginend::nodes::twod::relative {
|
|||
void boot()override{}
|
||||
void tick()override{}
|
||||
void draw()override{
|
||||
float sw=GetScreenWidth();
|
||||
float sh=GetScreenHeight();
|
||||
float sw=GetRenderWidth();
|
||||
float sh=GetRenderHeight();
|
||||
float ax=x*sw;
|
||||
float ay=y*sh;
|
||||
float aw=w*sw;
|
||||
|
|
@ -120,8 +120,8 @@ namespace enginend::nodes::twod::relative {
|
|||
colored::draw();
|
||||
return;
|
||||
}
|
||||
float sw=GetScreenWidth();
|
||||
float sh=GetScreenHeight();
|
||||
float sw=GetRenderWidth();
|
||||
float sh=GetRenderHeight();
|
||||
float ax=x*sw;
|
||||
float ay=y*sh;
|
||||
float aw=w*sw;
|
||||
|
|
@ -164,8 +164,8 @@ namespace enginend::nodes::twod::relative {
|
|||
}
|
||||
}
|
||||
void draw()override {
|
||||
float sw=GetScreenWidth();
|
||||
float sh=GetScreenHeight();
|
||||
float sw=GetRenderWidth();
|
||||
float sh=GetRenderHeight();
|
||||
float ax=x*sw;
|
||||
float ay=y*sh;
|
||||
|
||||
|
|
@ -206,8 +206,11 @@ namespace enginend::nodes::twod::relative {
|
|||
void draw()override {
|
||||
|
||||
Vector2 mouse=GetMousePosition();
|
||||
float sw=GetScreenWidth();
|
||||
float sh=GetScreenHeight();
|
||||
float wstretch=(float)GetScreenWidth()/(float)GetRenderWidth();
|
||||
float hstretch=(float)GetScreenHeight()/(float)GetRenderHeight();
|
||||
mouse.x/=wstretch;mouse.y/=hstretch;
|
||||
float sw=GetRenderWidth();
|
||||
float sh=GetRenderHeight();
|
||||
Rectangle r={float(x*sw),float(y*sh),float(w*sw),float(h*sh)};
|
||||
if(CheckCollisionPointRec(mouse,r)){hover=true;
|
||||
if(IsMouseButtonPressed(MOUSE_LEFT_BUTTON)){
|
||||
|
|
@ -259,8 +262,8 @@ namespace enginend::nodes::twod::relative {
|
|||
}
|
||||
void draw()override{
|
||||
button::draw();
|
||||
float sw=GetScreenWidth();
|
||||
float sh=GetScreenHeight();
|
||||
float sw=GetRenderWidth();
|
||||
float sh=GetRenderHeight();
|
||||
float ax=x*sw;
|
||||
float ay=y*sh;
|
||||
float aw=w*sw;
|
||||
|
|
@ -307,8 +310,8 @@ namespace enginend::nodes::twod::relative {
|
|||
void boot()override{}
|
||||
void tick()override{
|
||||
Vector2 mouse=GetMousePosition();
|
||||
float sw=GetScreenWidth();
|
||||
float sh=GetScreenHeight();
|
||||
float sw=GetRenderWidth();
|
||||
float sh=GetRenderHeight();
|
||||
Rectangle r={float(x*sw),float(y*sh),float(w*sw),float(h*sh)};
|
||||
if(CheckCollisionPointRec(mouse,r)&&IsMouseButtonDown(MOUSE_LEFT_BUTTON)){
|
||||
float t=(mouse.x-(x*sw))/(w*sw);
|
||||
|
|
@ -318,8 +321,8 @@ namespace enginend::nodes::twod::relative {
|
|||
}
|
||||
}
|
||||
void draw()override{
|
||||
float sw=GetScreenWidth();
|
||||
float sh=GetScreenHeight();
|
||||
float sw=GetRenderWidth();
|
||||
float sh=GetRenderHeight();
|
||||
float ax=x*sw;
|
||||
float ay=y*sh;
|
||||
float aw=w*sw;
|
||||
|
|
@ -341,8 +344,8 @@ namespace enginend::nodes::twod::relative {
|
|||
text::tick();
|
||||
}
|
||||
void draw()override{
|
||||
float sw=GetScreenWidth();
|
||||
float sh=GetScreenHeight();
|
||||
float sw=GetRenderWidth();
|
||||
float sh=GetRenderHeight();
|
||||
float ax=x*sw;
|
||||
float ay=y*sh;
|
||||
float aw=w*sw;
|
||||
|
|
@ -369,8 +372,8 @@ namespace enginend::nodes::twod::relative {
|
|||
void tick()override{
|
||||
text::tick();
|
||||
Vector2 mouse=GetMousePosition();
|
||||
float sw=GetScreenWidth();
|
||||
float sh=GetScreenHeight();
|
||||
float sw=GetRenderWidth();
|
||||
float sh=GetRenderHeight();
|
||||
Rectangle r={float(x*sw),float(y*sh),float(w*sw),float(h*sh)};
|
||||
if(IsMouseButtonPressed(MOUSE_LEFT_BUTTON)){
|
||||
active=CheckCollisionPointRec(mouse,r);
|
||||
|
|
@ -393,8 +396,8 @@ namespace enginend::nodes::twod::relative {
|
|||
void draw()override{
|
||||
text::draw();
|
||||
if(active){
|
||||
float sw=GetScreenWidth();
|
||||
float sh=GetScreenHeight();
|
||||
float sw=GetRenderWidth();
|
||||
float sh=GetRenderHeight();
|
||||
float ax=x*sw;
|
||||
float ay=y*sh;
|
||||
DrawRectangle(ax+MeasureTextEx(this->theme->font,content.c_str(),fs,1).x,ay,2,fs,{0,0,0,127});
|
||||
|
|
@ -414,8 +417,8 @@ namespace enginend::nodes::twod::relative {
|
|||
void tick()override{
|
||||
textfield::tick();
|
||||
Vector2 mouse=GetMousePosition();
|
||||
float sw=GetScreenWidth();
|
||||
float sh=GetScreenHeight();
|
||||
float sw=GetRenderWidth();
|
||||
float sh=GetRenderHeight();
|
||||
Rectangle r={float(x*sw),float(y*sh),float(w*sw),float(h*sh)};
|
||||
if(IsMouseButtonPressed(MOUSE_LEFT_BUTTON)){
|
||||
active=CheckCollisionPointRec(mouse,r);
|
||||
|
|
@ -442,8 +445,8 @@ namespace enginend::nodes::twod::relative {
|
|||
void draw()override{
|
||||
textfield::draw();
|
||||
if(active){
|
||||
float sw=GetScreenWidth();
|
||||
float sh=GetScreenHeight();
|
||||
float sw=GetRenderWidth();
|
||||
float sh=GetRenderHeight();
|
||||
float ax=x*sw;
|
||||
float ay=y*sh;
|
||||
float lh=fs+2;
|
||||
|
|
|
|||
|
|
@ -45,10 +45,21 @@ namespace enginend::nodes::trid {
|
|||
};
|
||||
struct object3d:public physicsagent {
|
||||
Model* model;
|
||||
const char *path;
|
||||
object3d(const char* path):path(path) {
|
||||
}
|
||||
void boot() override {
|
||||
(*model)=LoadModel(path);
|
||||
}
|
||||
void tick() override {
|
||||
|
||||
}
|
||||
void draw() override {
|
||||
DrawModel(*model,pos,1.,tint);
|
||||
}
|
||||
void exit() override {
|
||||
UnloadModel(*model);
|
||||
delete model;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "-std=c++26 -Wno-error -Oz -w -g -mavx2")
|
||||
set(CMAKE_CXX_FLAGS "-std=c++26 -Wno-error -O0 -w -g -mavx2")
|
||||
file(GLOB_RECURSE ANIMSOURCES CONFIGURE_DEPENDS "src/*.cpp")
|
||||
add_executable(animatronical-1 ${ANIMSOURCES})
|
||||
if(NOT DEFINED ${ARCH})
|
||||
|
|
|
|||
BIN
games/animatronical/q1/a1/res/font/eagle.ttf
Executable file
BIN
games/animatronical/q1/a1/res/font/eagle2.ttf
Executable file
BIN
games/animatronical/q1/a1/res/font/mga.ttf
Executable file
BIN
games/animatronical/q1/a1/res/gui/buttonf.png
Executable file
|
After Width: | Height: | Size: 758 B |
BIN
games/animatronical/q1/a1/res/gui/buttonn.png
Executable file
|
After Width: | Height: | Size: 714 B |
BIN
games/animatronical/q1/a1/res/gui/skailevisor.png
Executable file
|
After Width: | Height: | Size: 81 KiB |
BIN
games/animatronical/q1/a1/res/icon.png
Executable file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
games/animatronical/q1/a1/res/loading/out2.gif
Normal file
|
After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 944 B |
|
Before Width: | Height: | Size: 983 B |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 3 KiB |
|
Before Width: | Height: | Size: 2 KiB |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 1 KiB |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 93 KiB |
|
Before Width: | Height: | Size: 137 KiB |
|
Before Width: | Height: | Size: 105 KiB |
|
Before Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 72 KiB |