Browse Source

another secret project

vlod 6 months ago
parent
commit
ab818f85e1

+ 39 - 36
Pika/gameplay/containers.h

@@ -21,32 +21,34 @@ Container *getContainer(const char* name, pika::memory::MemoryArena *memoryArena
 #include "pluggins/pikatextEditor.h"
 #include "pluggins/sushiViewer/sushiViewer.h"
 
-#include "containers/mario/mario.h"
-#include "containers/mario/marioEditor.h"
-#include "containers/mario/marioNeuralVizualizer.h"
-#include "containers/mario/marioNeuralTrainer.h"
-#include "containers/minecraftDungeons/mcDungeonsEditor.h"
-#include "containers/minecraftDungeons/mcDungeonsgameplay.h"
-#include "containers/minecraftDungeons/mcDungeonsMenu.h"
-#include "containers/hollowknight/hollowknight.h"
-
-#include "containers/marioKart/marioKartEditor.h"
-#include "containers/marioKart/marioKart.h"
+//#include "containers/mario/mario.h"
+//#include "containers/mario/marioEditor.h"
+//#include "containers/mario/marioNeuralVizualizer.h"
+//#include "containers/mario/marioNeuralTrainer.h"
+//#include "containers/minecraftDungeons/mcDungeonsEditor.h"
+//#include "containers/minecraftDungeons/mcDungeonsgameplay.h"
+//#include "containers/minecraftDungeons/mcDungeonsMenu.h"
+//#include "containers/hollowknight/hollowknight.h"
+
+//#include "containers/marioKart/marioKartEditor.h"
+//#include "containers/marioKart/marioKart.h"
 
 #include "containers/threeDGameExample/threeDGameExample.h"
 #include "containers/threeDGameExample/threeDGameMenu.h"
 
 
-#include "containers/isometricGame/isometricGameEditor.h"
-#include "containers/isometricGame/isometricGame.h"
+//#include "containers/isometricGame/isometricGameEditor.h"
+//#include "containers/isometricGame/isometricGame.h"
 
-#include "containers/bezie/bezie.h"
+//#include "containers/bezie/bezie.h"
 
-#include "containers/physicsTest/physicsTest.h"
-#include "containers/physicsTest/logo.h"
+//#include "containers/physicsTest/physicsTest.h"
+//#include "containers/physicsTest/logo.h"
 
-#include "containers/angryBirds/angryBirds.h"
-#include "containers/milk/milk.h"
+//#include "containers/angryBirds/angryBirds.h"
+//#include "containers/milk/milk.h"
+
+#include "containers/silksong/silkSong.h"
 
 #if PIKA_PRODUCTION == 1
 
@@ -59,28 +61,29 @@ Container *getContainer(const char* name, pika::memory::MemoryArena *memoryArena
 
 #define PIKA_ALL_CONTAINERS() \
 	PIKA_DECLARE_CONTAINER(Gameplay) \
-	PIKA_DECLARE_CONTAINER(AngryBirds) \
+	PIKA_DECLARE_CONTAINER(SilkSong) \
 	PIKA_DECLARE_CONTAINER(SushiViewer) \
 	PIKA_DECLARE_CONTAINER(ImmageViewer) \
 	PIKA_DECLARE_CONTAINER(ThreeDTest) \
 	PIKA_DECLARE_CONTAINER(ThreeDEditor) \
-	PIKA_DECLARE_CONTAINER(PikaTextEditor) \
-	PIKA_DECLARE_CONTAINER(ThreeDGameExample) \
-	PIKA_DECLARE_CONTAINER(ThreeDGameMenu) \
-	PIKA_DECLARE_CONTAINER(MarioKartEditor) \
-	PIKA_DECLARE_CONTAINER(MarioKart) \
-	PIKA_DECLARE_CONTAINER(IsometricGameEditor) \
-	PIKA_DECLARE_CONTAINER(Mario) \
-	PIKA_DECLARE_CONTAINER(Holloknight)\
-	PIKA_DECLARE_CONTAINER(Bezie)\
-	PIKA_DECLARE_CONTAINER(PhysicsTest)\
-	PIKA_DECLARE_CONTAINER(Logo)\
-	PIKA_DECLARE_CONTAINER(IsometricGame) \
-	PIKA_DECLARE_CONTAINER(MarioEditor) \
-	PIKA_DECLARE_CONTAINER(MarioNeuralTrainer) \
-	PIKA_DECLARE_CONTAINER(McDungeonsGameplay) \
-	PIKA_DECLARE_CONTAINER(Milk) \
-	PIKA_DECLARE_CONTAINER(MarioNeuralVizualizer) 
+	PIKA_DECLARE_CONTAINER(PikaTextEditor)
+	//PIKA_DECLARE_CONTAINER(ThreeDGameExample) \
+	//PIKA_DECLARE_CONTAINER(ThreeDGameMenu) \
+	//PIKA_DECLARE_CONTAINER(MarioKartEditor) \
+	//PIKA_DECLARE_CONTAINER(MarioKart) \
+	//PIKA_DECLARE_CONTAINER(IsometricGameEditor) \
+	//PIKA_DECLARE_CONTAINER(Mario) \
+	//PIKA_DECLARE_CONTAINER(Holloknight)\
+	//PIKA_DECLARE_CONTAINER(Bezie)\
+	//PIKA_DECLARE_CONTAINER(PhysicsTest)\
+	//PIKA_DECLARE_CONTAINER(Logo)\
+	//PIKA_DECLARE_CONTAINER(IsometricGame) \
+	//PIKA_DECLARE_CONTAINER(MarioEditor) \
+	//PIKA_DECLARE_CONTAINER(MarioNeuralTrainer) \
+	//PIKA_DECLARE_CONTAINER(McDungeonsGameplay) \
+	//PIKA_DECLARE_CONTAINER(AngryBirds) \
+	//PIKA_DECLARE_CONTAINER(Milk) \
+	//PIKA_DECLARE_CONTAINER(MarioNeuralVizualizer) 
 	//PIKA_DECLARE_CONTAINER(McDungeonsEditor)
 	//PIKA_DECLARE_CONTAINER(McDungeonsMenu)
 

+ 0 - 0
Pika/gameplay/containers/silksong/silkSong.cpp


+ 837 - 0
Pika/gameplay/containers/silksong/silkSong.h

@@ -0,0 +1,837 @@
+#pragma once
+
+#include <gl2d/gl2d.h>
+#include <imgui.h>
+#include <baseContainer.h>
+#include <shortcutApi/shortcutApi.h>
+#include <pikaSizes.h>
+#include <imgui_spinner.h>
+#include <box2d/box2d.h>
+#include <engineLibraresSupport/engineGL2DSupport.h>
+#include <pikaImgui/pikaImgui.h>
+#include <safeSave/safeSave.h>
+#include <engineLibraresSupport/engineSafeSaveSupport.h>
+#include "imguiComboSearch.h"
+
+
+struct SilkSong: public Container
+{
+
+	gl2d::Renderer2D renderer;
+	gl2d::Texture sprites;
+	gl2d::TextureAtlasPadding atlas;
+
+	b2World world{{0, 10}};
+
+	constexpr static int ASSETS_COUNT = 18;
+
+	std::vector<const char*> assetsNames=
+	{
+		"bush.png",
+		"grass.png",
+		"mushroom1.png",
+		"mushroom2.png",
+		"mushroom3.png",
+		"mushroom4.png",
+		"mushroom5.png",
+		"mushroom6.png",
+		"vines1.png",
+		"vines2.png",
+		"vines3.png",
+		"background.jpg",
+		"grass2.png",
+		"grass3.png",
+		"block1.png",
+		"block2.png",
+		"block3.png",
+		"block4.png",
+	};
+
+	gl2d::Texture assets[ASSETS_COUNT];
+
+	static ContainerStaticInfo containerInfo()
+	{
+		ContainerStaticInfo info = {};
+		info.defaultHeapMemorySize = pika::MB(100);
+
+		info.requestImguiFbo = true; 
+		info.pushAnImguiIdForMe = true;
+
+
+		return info;
+	}
+
+	struct Block 
+	{
+
+		b2Body *dynamicBody = 0;
+		glm::vec2 getPosCenter() 
+		{
+			auto pos = dynamicBody->GetPosition();
+			return {pos.x,pos.y};
+		};
+
+		glm::vec2 getSize()
+		{
+			auto f = dynamicBody->GetFixtureList(); if (!f) return {};
+			auto s = f->GetShape(); if (!s) return {};
+
+			if (s->GetType() == b2Shape::Type::e_polygon)
+			{
+				b2PolygonShape *poligon = dynamic_cast<b2PolygonShape *>(s);
+
+				if (poligon)
+				{
+					glm::vec2 min{999999,999999};
+					glm::vec2 max{-999999,-999999};
+
+					for (int i = 0; i < poligon->m_count; i++)
+					{
+						glm::vec2 p1 = {poligon->m_vertices[i].x,poligon->m_vertices[i].y};
+						
+						if (p1.x > max.x) { max.x = p1.x; }
+						if (p1.y > max.y) { max.y = p1.y; }
+
+						if (p1.x < min.x) { min.x = p1.x; }
+						if (p1.y < min.y) { min.y = p1.y; }
+					}
+
+					glm::vec2 size = max - min;
+
+					return size;
+				}
+
+			}
+
+			return {};
+		}
+
+		glm::vec2 getPosTopLeft()
+		{
+			auto pos = dynamicBody->GetPosition();
+			return glm::vec2(pos.x,pos.y) - getSize()/2.f;
+		};
+
+		float getRotation()
+		{
+			return dynamicBody->GetAngle();
+		}
+
+		void create(b2World &world, glm::vec4 dimensions, float rotation, int type)
+		{
+			b2BodyDef myBodyDef;
+			myBodyDef.type = (b2BodyType)type; //this will be a dynamic body
+
+			dimensions.x += dimensions.z / 2.f;
+			dimensions.y += dimensions.w / 2.f;
+
+			myBodyDef.position.Set(dimensions.x, dimensions.y); //set the starting position
+			myBodyDef.angle = rotation; //set the starting angle
+
+			dynamicBody = world.CreateBody(&myBodyDef);
+
+			b2PolygonShape boxShape;
+			boxShape.SetAsBox(dimensions.z / 2, dimensions.w / 2);
+
+			b2FixtureDef boxFixtureDef;
+			boxFixtureDef.shape = &boxShape;
+			boxFixtureDef.density = 1;
+			dynamicBody->CreateFixture(&boxFixtureDef);
+		}
+
+		b2Fixture *addSensor(glm::vec4 dimensionsRelativeToCenter)
+		{
+			b2PolygonShape boxShape;
+
+			b2Vec2 pos(dimensionsRelativeToCenter.x, dimensionsRelativeToCenter.y);
+
+			b2Vec2 topLeft(-dimensionsRelativeToCenter.z / 2, dimensionsRelativeToCenter.w / 2);
+			b2Vec2 bottomLeft(-dimensionsRelativeToCenter.z / 2, -dimensionsRelativeToCenter.w / 2);
+			b2Vec2 bottomRight(dimensionsRelativeToCenter.z / 2, -dimensionsRelativeToCenter.w / 2);
+			b2Vec2 topRight(dimensionsRelativeToCenter.z / 2, dimensionsRelativeToCenter.w / 2);
+
+			b2Vec2 points[4] =
+			{
+				topLeft + pos,
+				bottomLeft + pos,
+				bottomRight + pos,
+				topRight + pos
+			};
+
+			boxShape.Set(points, 4);
+
+			b2FixtureDef boxFixtureDef;
+			boxFixtureDef.shape = &boxShape;
+			boxFixtureDef.density = 0;
+			boxFixtureDef.isSensor = true;
+
+			b2Fixture * f = dynamicBody->CreateFixture(&boxFixtureDef);
+			return f;
+		}
+
+		void render(gl2d::Renderer2D &renderer, glm::vec4 color) 
+		{
+			glm::vec4 dimensions(getPosCenter(), getSize());
+			renderer.renderRectangle({dimensions.x - dimensions.z / 2,dimensions.y - dimensions.w / 2,
+				dimensions.z,dimensions.w}, color, {}, -glm::degrees(getRotation()));
+		}
+	};
+
+	struct SavedBlock
+	{
+		glm::vec4 dimensions = {};
+		float rotation = 0;
+		int type = 0;
+	};
+
+	struct Entity
+	{
+		Block physicalBody;
+		
+		glm::vec4 spriteDimensions = {};
+
+		glm::vec4 getRenderPos() 
+		{
+			glm::vec4 centerPos = glm::vec4(physicalBody.getPosCenter() + glm::vec2(spriteDimensions),
+				glm::vec2(spriteDimensions.z, spriteDimensions.w));
+
+			centerPos.x -= centerPos.z / 2.f;
+			centerPos.y -= centerPos.w / 2.f;
+
+			return centerPos;
+		}
+	};
+
+	Block blocks[10];
+	b2Body *currentBodySelected = 0;
+	int currentSelectedSprite = 0;
+
+	Entity character;
+	b2Fixture *characterJumpSensor;
+
+	glm::vec2 draggedStart = {};
+
+	bool followPlayer = false;
+	bool dragGeometry = false;
+	bool renderGeometry = true;
+	int selectType = 0;
+
+	struct InputMetrict
+	{
+		float speed = 20;
+		float jump = 8;
+		float stopSpeed = 7;
+		float jumpTimer = 1;
+		float initialJumpImpulse = 4;
+	} inputMetrics = {};
+
+	struct GameSprite
+	{
+		glm::vec2 pos = {};
+		float scale = 1;
+		int type = 0;
+		float rotation = 0;
+		bool flip = 0;
+		int layer = 0; //0 is background than 1 is objects than 2 is decoration than player than 3
+	};
+
+	std::vector<GameSprite> gameSprites;
+
+	bool create(RequestedContainerInfo &requestedInfo, pika::StaticString<256> commandLineArgument)
+	{
+		
+		renderer.create(requestedInfo.requestedFBO.fbo);
+		renderer.currentCamera.zoom = 80.f;
+		renderer.currentCamera.position.x = -440;
+		renderer.currentCamera.position.y = -500;
+		renderer.currentCamera3D.position.z = 2;
+
+		if (!requestedInfo.readEntireFileBinary(PIKA_RESOURCES_PATH "hollowknight/inputMetrics.bin",
+			&inputMetrics, sizeof(inputMetrics)))
+		{
+			inputMetrics = {};
+		}
+
+		for (int i = 0; i < ASSETS_COUNT; i++)
+		{
+			assets[i]
+				= pika::gl2d::loadTexture
+				((std::string(PIKA_RESOURCES_PATH "hollowknight/") + std::string(assetsNames[i])).c_str()
+				, requestedInfo);
+		}
+
+
+
+		sprites = pika::gl2d::loadTextureWithPixelPadding(PIKA_RESOURCES_PATH "hollowknight/sprites.png", requestedInfo, 80);
+		atlas = gl2d::TextureAtlasPadding(12, 12, sprites.GetSize().x, sprites.GetSize().y);
+
+		world.SetAllowSleeping(true);
+		world.SetContinuousPhysics(true);
+
+		{
+			sfs::SafeSafeKeyValueData data;
+
+			pika::sfs::safeLoad(data, PIKA_RESOURCES_PATH "hollowknight/map", false);
+
+			void *geometry = 0;
+			size_t s = 0;
+			if (data.getRawDataPointer("geometry", geometry, s) == sfs::noError)
+			{
+				SavedBlock *b = (SavedBlock*)geometry;
+
+				for (int i = 0; i < s / sizeof(SavedBlock); i++)
+				{
+					blocks[i].create(world, b[i].dimensions, b[i].rotation, b[i].type);
+				}
+			}
+			else
+			{
+				requestedInfo.log("Error reading map file", pika::logError);
+			}
+
+			void *loadedSprites = 0;
+			s = 0;
+			if (data.getRawDataPointer("sprites", loadedSprites, s) == sfs::noError)
+			{
+				GameSprite *loagedGameSprites = (GameSprite *)loadedSprites;
+
+				for (int i = 0; i < s / sizeof(SavedBlock); i++)
+				{
+					gameSprites.push_back(loagedGameSprites[i]);
+				}
+			}
+
+		}
+
+	
+		character.physicalBody.create(world, {10, 2, 0.6f,1}, 0, b2BodyType::b2_dynamicBody);
+		character.spriteDimensions = glm::vec4{0,0,1,1};
+		character.physicalBody.dynamicBody->SetFixedRotation(true);
+		characterJumpSensor = character.physicalBody.addSensor({0, 0.5, 0.55f, 0.1f});
+
+		return true;
+	}
+
+	bool movingLeft = 0;
+
+	bool update(pika::Input input, pika::WindowState windowState,
+		RequestedContainerInfo &requestedInfo)
+	{
+	#pragma region clear stuff
+		glClear(GL_COLOR_BUFFER_BIT);
+		renderer.updateWindowMetrics(windowState.windowW, windowState.windowH);
+	#pragma endregion
+
+	#pragma region input
+
+		//::pika::gl2d::cameraController(renderer.currentCamera, input, 60 * (!followPlayer), 4);
+
+		{
+			auto &c = renderer.currentCamera3D;
+			c.use = true;
+			float speed = 1;
+			glm::vec3 position = {};
+			if (input.buttons[pika::Button::W].held())
+			{
+				position.z -= speed * input.deltaTime;
+			}
+			if (input.buttons[pika::Button::S].held())
+			{
+				position.z += speed * input.deltaTime;
+			}
+			if (input.buttons[pika::Button::A].held())
+			{
+				position.x -= speed * input.deltaTime;
+			}
+			if (input.buttons[pika::Button::D].held())
+			{
+				position.x += speed * input.deltaTime;
+			}	
+			if (input.buttons[pika::Button::E].held())
+			{
+				position.y += speed * input.deltaTime;
+			}
+			if (input.buttons[pika::Button::Q].held())
+			{
+				position.y -= speed * input.deltaTime;
+			}
+			c.moveFPS(position);
+
+			float rotateSpeed = 0.002;
+			if (!input.rMouse.held()) { rotateSpeed = 0; }
+			c.rotateFPS({input.mouseX, input.mouseY}, rotateSpeed);
+
+
+		}
+
+		int direction = 0;
+		
+
+		if (input.buttons[pika::Button::Left].held() 
+			|| input.anyController.buttons[pika::Controller::Left].held() 
+			|| input.anyController.LStick.left()
+			) { direction--; movingLeft = true; }
+
+		if (input.buttons[pika::Button::Right].held() 
+			|| input.anyController.buttons[pika::Controller::Right].held()
+			|| input.anyController.LStick.right()
+			) { direction++; movingLeft = false; }
+
+		{
+			b2Vec2 vel = character.physicalBody.dynamicBody->GetLinearVelocity();
+			float force = 0;
+
+
+			if (direction < 0)
+			{
+				if (vel.x > -5) force = -inputMetrics.speed;
+			}
+			else if (direction == 0)
+			{
+				force = vel.x * -inputMetrics.stopSpeed;
+			}
+			else
+			{
+				if (vel.x < 5) force = inputMetrics.speed;
+			}
+		
+			character.physicalBody.dynamicBody->ApplyForce(b2Vec2(force, 0), 
+				character.physicalBody.dynamicBody->GetWorldCenter(), true);
+		}
+
+		bool hitsGround = 0;
+		#pragma region jump
+		{
+			
+			auto b = character.physicalBody.dynamicBody;
+
+			for (b2ContactEdge *ce = b->GetContactList(); ce; ce = ce->next)
+			{
+				if (ce->contact->IsTouching())
+				{
+					if (
+						ce->contact->GetFixtureA() == characterJumpSensor ||
+						ce->contact->GetFixtureB() == characterJumpSensor
+						)
+					{
+						hitsGround = true;
+					}
+				}
+			}
+
+			static bool duringJump = 0;
+			static float jumpTimer = 0;
+			
+			if ((input.buttons[pika::Button::Space].pressed() ||
+				input.anyController.buttons[pika::Controller::A].pressed())
+				&& hitsGround
+				)
+			{
+				duringJump = true;
+				jumpTimer = inputMetrics.jumpTimer;
+
+				float impulse = character.physicalBody.dynamicBody->GetMass() * inputMetrics.initialJumpImpulse;
+				character.physicalBody.dynamicBody->ApplyLinearImpulse(b2Vec2(0, -impulse),
+					character.physicalBody.dynamicBody->GetWorldCenter(), true);
+			}
+
+			if ((input.buttons[pika::Button::Space].held() ||
+				input.anyController.buttons[pika::Controller::A].held()
+				) 
+					&& duringJump
+				)
+			{
+				jumpTimer -= input.deltaTime;
+
+				if (jumpTimer < 0) { jumpTimer = 0; duringJump = false; }
+				else
+				{
+					auto b = character.physicalBody.dynamicBody;
+
+					b->ApplyForce(b2Vec2(0, b->GetMass() * -inputMetrics.jump), b->GetWorldCenter(), true);
+				}
+
+				
+			}
+			else { duringJump = false; }
+	
+		}
+		#pragma endregion
+
+
+	#pragma endregion
+
+		int32 velocityIterations = 8;
+		int32 positionIterations = 3;
+		world.Step(input.deltaTime, velocityIterations, positionIterations);
+
+	#pragma region follow player
+		if (followPlayer)
+		{
+			renderer.currentCamera.follow(character.physicalBody.getPosCenter(), 2 * input.deltaTime, 0.f, 0.f,
+				windowState.frameBufferW, windowState.frameBufferH);
+		}
+	#pragma endregion
+
+	#pragma region render
+
+		for (int i = 0; i < 4; i++)
+		{
+			//player
+			if (i == 3)
+			{
+				renderer.renderRectangle(character.getRenderPos(), sprites, Colors_White, {}, 0, 
+					atlas.get(0, 0, movingLeft));
+			}
+
+			int index = 0;
+			for (auto &s : gameSprites)
+			{
+				if (s.layer == i)
+				{
+
+					if (currentSelectedSprite == index && selectType == 2)
+					{
+						renderer.renderRectangle({glm::vec2(s.pos), glm::vec2(assets[s.type].GetSize()) * s.scale * (1.f / 400.f)},
+							assets[s.type], {1,0.5,0.5,1.0}, {}, s.rotation, s.flip ? glm::vec4(1, 1, 0, 0) : glm::vec4(0, 1, 1, 0), index * 0.1);
+					}
+					else
+					{
+						renderer.renderRectangle({glm::vec2(s.pos), glm::vec2(assets[s.type].GetSize()) * s.scale * (1.f / 400.f)},
+							assets[s.type], Colors_White, {}, s.rotation, s.flip ? glm::vec4(1, 1, 0, 0) : glm::vec4(0, 1, 1, 0), index * 0.1);
+					}
+				}
+
+				index++;
+			}
+		}
+
+
+	#pragma endregion
+
+
+		glm::vec2 mouseWorldpos(input.mouseX, input.mouseY);
+		{
+			auto viewRect = renderer.getViewRect();
+
+			glm::vec2 mousePosNormalized = mouseWorldpos / glm::vec2(windowState.frameBufferW, windowState.frameBufferH);
+			
+			mouseWorldpos = glm::vec2(viewRect) + mousePosNormalized * glm::vec2(viewRect.z, viewRect.w);
+		}
+
+	#pragma region body render
+
+		if(renderGeometry)
+		for (b2Body *b = world.GetBodyList(); b; b = b->GetNext())
+		{
+
+			glm::vec4 color = Colors_Red;
+			float thickness = 0.01;
+
+			if (currentBodySelected == b && selectType == 1)
+			{
+				color = Colors_Blue;
+				thickness = 0.02;
+			}
+
+			auto centerOfMass = b->GetWorldCenter();
+			auto angleDegrees = glm::degrees(b->GetAngle());
+			auto shapePos = b->GetTransform();
+
+			renderer.renderRectangle({centerOfMass.x - thickness,centerOfMass.y - thickness,2* thickness,2* thickness}, 
+				color, {}, angleDegrees);
+
+			for (b2Fixture *f = b->GetFixtureList(); f; f = f->GetNext()) 
+			{
+				auto shape = f->GetShape();
+
+				if (shape->TestPoint(shapePos, {mouseWorldpos.x,mouseWorldpos.y}) && input.lMouse.held()
+					&& selectType == 1
+					)
+				{
+					currentBodySelected = b;
+				}
+
+				//the shape doesn't know anything about position so we have to move it from 0 0 
+				if (shape->GetType() == b2Shape::Type::e_polygon) 
+				{
+					b2PolygonShape *poligon = dynamic_cast<b2PolygonShape*>(shape);
+				
+					if (poligon)
+					{
+						for (int i = 0; i < poligon->m_count; i++)
+						{
+							int j = (i + 1) % poligon->m_count;
+
+							glm::vec2 p1 = {poligon->m_vertices[i].x,poligon->m_vertices[i].y};
+							glm::vec2 p2 = {poligon->m_vertices[j].x,poligon->m_vertices[j].y};
+
+							p1 += glm::vec2{centerOfMass.x, centerOfMass.y};
+							p2 += glm::vec2{centerOfMass.x, centerOfMass.y};
+
+							p1 = gl2d::rotateAroundPoint(p1, {centerOfMass.x,-centerOfMass.y}, angleDegrees);
+							p2 = gl2d::rotateAroundPoint(p2, {centerOfMass.x,-centerOfMass.y}, angleDegrees);
+
+							if (f->IsSensor())
+							{
+								renderer.renderLine(p1, p2, Colors_Green, thickness * 2);
+							}
+							else
+							{
+								renderer.renderLine(p1, p2, color, thickness * 2);
+							}
+						}
+
+					}
+
+				}
+			
+			}
+
+		}
+
+	#pragma endregion
+
+	#pragma region drag
+
+		if(dragGeometry)
+		{
+
+			if (input.rMouse.pressed())
+			{
+				draggedStart = glm::vec2(input.mouseX, input.mouseY);
+			}
+
+			if (input.rMouse.released())
+			{
+				glm::vec2 dragEnd(input.mouseX, input.mouseY);
+
+				glm::vec2 movement = dragEnd - draggedStart;
+
+				movement *= 0.01;
+
+				if (currentBodySelected)
+				{
+					currentBodySelected->SetLinearVelocity({movement.x,movement.y});
+				}
+			}
+			
+		}
+
+	#pragma endregion
+
+
+		renderer.flush();
+
+	#pragma region imgui
+		{
+			ImGui::Begin("Game Editor");
+
+			if (ImGui::Button("Spawn"))
+			{
+				for (int i = 0; i < 10; i++)
+				{
+					blocks[i].create(world, {1 + sin(i) * 5, -1.5 * i, 1,1}, 0, b2BodyType::b2_dynamicBody);
+				}
+			}
+
+			ImGui::DragFloat2("Camera pos", &renderer.currentCamera.position[0], 0.001);
+			ImGui::DragFloat("Camera zoom", &renderer.currentCamera.zoom, 0.5, 10, 1000);
+		
+			ImGui::Checkbox("Follow player", &followPlayer);
+			ImGui::Checkbox("Drag geometry", &dragGeometry);
+			ImGui::Checkbox("Render geometry", &renderGeometry);
+
+			ImGui::Combo("Editor type: ", &selectType, "none\0geometry\0sprites\0");
+
+			ImGui::Separator();
+
+			ImGui::InputFloat("Speed", &inputMetrics.speed);
+			ImGui::InputFloat("Jump", &inputMetrics.jump);
+			ImGui::InputFloat("Stop speed", &inputMetrics.stopSpeed);
+			ImGui::InputFloat("Jump timer", &inputMetrics.jumpTimer);
+			ImGui::InputFloat("Initial jump", &inputMetrics.initialJumpImpulse);
+
+			ImGui::Separator();
+
+			if (hitsGround)
+			{
+				ImGui::PushStyleColor(ImGuiCol_Text, {0,1,0,1});
+				ImGui::Text("Hits ground: Yes");
+			}
+			else
+			{
+				ImGui::PushStyleColor(ImGuiCol_Text, {1,0,0,1});
+				ImGui::Text("Hits ground: No");
+			}
+
+			ImGui::PopStyleColor();
+
+			if(selectType == 1)
+			if (currentBodySelected)
+			{
+				ImGui::NewLine();
+				ImGui::Separator();
+				ImGui::Text("Geometry editor");
+				ImGui::NewLine();
+
+
+				int item = currentBodySelected->GetType();
+				ImGui::Combo("Body type: ", &item, "static\0kinematic\0dynamic\0");
+
+				currentBodySelected->SetType((b2BodyType)item);
+
+				auto pos = currentBodySelected->GetPosition();
+
+				auto angle = currentBodySelected->GetAngle();
+
+				{
+					auto f = currentBodySelected->GetFixtureList();
+					
+					if (f)
+					{
+						auto s = f->GetShape();
+
+						if (s->GetType() == b2Shape::Type::e_polygon)
+						{
+							b2PolygonShape *poligon = dynamic_cast<b2PolygonShape *>(s);
+
+							glm::vec2 size = {};
+
+							if (poligon)
+							{
+								glm::vec2 min{999999,999999};
+								glm::vec2 max{-999999,-999999};
+
+								for (int i = 0; i < poligon->m_count; i++)
+								{
+									glm::vec2 p1 = {poligon->m_vertices[i].x,poligon->m_vertices[i].y};
+
+									if (p1.x > max.x) { max.x = p1.x; }
+									if (p1.y > max.y) { max.y = p1.y; }
+
+									if (p1.x < min.x) { min.x = p1.x; }
+									if (p1.y < min.y) { min.y = p1.y; }
+								}
+
+								size = max - min;
+							}
+
+							auto newSize = size;
+
+							ImGui::DragFloat2("Size: ", &newSize.x, 0.1);
+
+							if (newSize != size)
+							{
+								currentBodySelected->DestroyFixture(f);
+
+								b2PolygonShape boxShape;
+								boxShape.SetAsBox(newSize.x / 2, newSize.y / 2);
+
+								b2FixtureDef boxFixtureDef;
+								boxFixtureDef.shape = &boxShape;
+								boxFixtureDef.density = 1;
+								currentBodySelected->CreateFixture(&boxFixtureDef);
+							}
+
+						}
+					}
+				
+				}
+
+				ImGui::DragFloat2("Pos: ", &pos.x, 0.1);
+				ImGui::SliderAngle("Angle", &angle);
+
+				currentBodySelected->SetTransform(pos, angle);
+
+			}
+
+			if (selectType == 2)
+			{
+				ImGui::NewLine();
+				ImGui::Separator();
+				ImGui::Text("Sprites editor");
+				ImGui::NewLine();
+
+				if (ImGui::Button("Add sprite"))
+				{
+					gameSprites.push_back({});
+					currentSelectedSprite = gameSprites.size() - 1;
+				}
+				
+				ImGui::InputInt("Sprite", &currentSelectedSprite);
+
+				currentSelectedSprite = glm::clamp(currentSelectedSprite, 0, (int)gameSprites.size() - 1);
+
+				if (gameSprites.size())
+				{
+
+					auto &s = gameSprites[currentSelectedSprite];
+
+					ImGui::ComboWithFilter("Type", &s.type, assetsNames);
+					s.type = glm::clamp(s.type, 0, ASSETS_COUNT);
+
+					ImGui::Combo("Layer: ", &s.layer, "background\0geometry\0geometry2\0on top of player\0");
+
+					ImGui::DragFloat3("Pos", &s.pos[0], 0.01);
+
+					ImGui::Checkbox("Flip", &s.flip);
+
+					ImGui::SliderAngle("Angle", &s.rotation);
+
+					ImGui::DragFloat("Scale", &s.scale, 0.01, 0.001, 100);
+
+
+				}
+
+			}
+
+
+			ImGui::NewLine();
+			ImGui::Separator();
+
+			if (ImGui::Button("Save map"))
+			{
+				SavedBlock b[10];
+
+				for (int i = 0; i < 10; i++)
+				{
+					b[i].dimensions = glm::vec4(blocks[i].getPosTopLeft(), blocks[i].getSize());
+					b[i].rotation = blocks[i].getRotation();
+					b[i].type = blocks[i].dynamicBody->GetType();
+				}
+
+				sfs::SafeSafeKeyValueData data;
+
+				data.setRawData("geometry", b, sizeof(b));
+
+				data.setRawData("sprites", gameSprites.data(), sizeof(GameSprite) *gameSprites.size());
+
+
+				pika::memory::pushCustomAllocatorsToStandard();
+				sfs::safeSave(data, PIKA_RESOURCES_PATH "hollowknight/map", false);
+				pika::memory::popCustomAllocatorsToStandard();
+
+			}
+
+
+			ImGui::End();
+		}
+
+		requestedInfo.writeEntireFileBinary(PIKA_RESOURCES_PATH "hollowknight/inputMetrics.bin",
+			&inputMetrics, sizeof(inputMetrics));
+
+	#pragma endregion
+
+
+		
+		return true;
+	}
+
+	//optional
+	void destruct(RequestedContainerInfo &requestedInfo)
+	{
+	}
+
+};
+

+ 2 - 44
Pika/resources/logs.txt

@@ -1,44 +1,2 @@
-#2025-05-26 23:48:52[warning]: Couldn't reloaded dll
-#2025-05-26 23:48:54: Reloaded dll
-#2025-05-26 23:49:21[warning]: Couldn't reloaded dll
-#2025-05-26 23:49:23: Reloaded dll
-#2025-05-26 23:49:26: Created container: Milk
-#2025-05-26 23:50:01[warning]: Couldn't reloaded dll
-#2025-05-26 23:50:02: Reloaded dll
-#2025-05-26 23:50:51[warning]: Couldn't reloaded dll
-#2025-05-26 23:50:54: Reloaded dll
-#2025-05-26 23:52:03[warning]: Couldn't reloaded dll
-#2025-05-26 23:52:05: Reloaded dll
-#2025-05-26 23:52:48[warning]: Couldn't reloaded dll
-#2025-05-26 23:52:50: Reloaded dll
-#2025-05-26 23:53:14[warning]: Couldn't reloaded dll
-#2025-05-26 23:53:16[warning]: Couldn't reloaded dll
-#2025-05-26 23:53:17: Reloaded dll
-#2025-05-26 23:54:01[warning]: Couldn't reloaded dll
-#2025-05-26 23:54:03[warning]: Couldn't reloaded dll
-#2025-05-26 23:54:03: Reloaded dll
-#2025-05-26 23:55:12[warning]: Couldn't reloaded dll
-#2025-05-26 23:55:14[warning]: Couldn't reloaded dll
-#2025-05-26 23:55:14: Reloaded dll
-#2025-05-26 23:56:33[warning]: Couldn't reloaded dll
-#2025-05-26 23:56:35[warning]: Couldn't reloaded dll
-#2025-05-26 23:56:35: Reloaded dll
-#2025-05-26 23:59:17: Destroyed continer: Milk #1
-#2025-05-27 00:01:48[warning]: Couldn't reloaded dll
-#2025-05-27 00:01:50: Reloaded dll
-#2025-05-27 00:01:52: Created container: Milk
-#2025-05-27 00:02:20[warning]: Couldn't reloaded dll
-#2025-05-27 00:02:23: Reloaded dll
-#2025-05-27 00:03:27[warning]: Couldn't reloaded dll
-#2025-05-27 00:03:29[warning]: Couldn't reloaded dll
-#2025-05-27 00:03:30: Reloaded dll
-#2025-05-27 00:04:06[warning]: Couldn't reloaded dll
-#2025-05-27 00:04:08: Reloaded dll
-#2025-05-27 00:05:04[warning]: Couldn't reloaded dll
-#2025-05-27 00:05:06: Reloaded dll
-#2025-05-27 00:05:30[warning]: Couldn't reloaded dll
-#2025-05-27 00:05:32: Reloaded dll
-#2025-05-27 00:06:34[warning]: Couldn't reloaded dll
-#2025-05-27 00:06:36[warning]: Couldn't reloaded dll
-#2025-05-27 00:06:37: Reloaded dll
-#2025-05-27 00:10:01: Destroyed continer: Milk #2
+#2025-06-06 12:36:09: Created container: SilkSong
+#2025-06-06 12:36:26: Destroyed continer: SilkSong #1

+ 103 - 37
Pika/thirdparty/gl2d/include/gl2d/gl2d.h

@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////
-//gl2d.h				1.6.1
-//Copyright(c) 2020 - 2024 Luta Vlad
+//gl2d.h				1.6.3
+//Copyright(c) 2020 - 2025 Luta Vlad
 //https://github.com/meemknight/gl2d
 //
 //	dependences: glew(or any loader you want to use), glm, stb_image, stb_trueType
@@ -92,7 +92,8 @@ namespace gl2d
 	struct ShaderProgram
 	{
 		GLuint id = 0;
-		int u_sampler = 0;
+		int u_sampler = -1;
+		int u_viewProjection = -1;
 
 		void bind() { glUseProgram(id); };
 
@@ -285,12 +286,14 @@ namespace gl2d
 		stbtt_packedchar *packedCharsBuffer = 0;
 		int               packedCharsBufferSize = 0;
 		float             max_height = 0.f;
+		float			  spaceSize = 0.f; //you can manually change this variable if you want!
+		bool			  monospaced = false;
 
 		Font() {}
-		explicit Font(const char *file) { createFromFile(file); }
+		explicit Font(const char *file, bool monospaced = false) { createFromFile(file, monospaced); }
 
-		void createFromTTF(const unsigned char *ttf_data, const size_t ttf_data_size);
-		void createFromFile(const char *file);
+		void createFromTTF(const unsigned char *ttf_data, const size_t ttf_data_size, bool monospaced = false);
+		void createFromFile(const char *file, bool monospaced = false);
 
 		void cleanup();
 	};
@@ -331,6 +334,62 @@ namespace gl2d
 		void follow(glm::vec2 pos, float speed, float min, float max, float w, float h);
 	};
 
+	struct Camera3D
+	{
+		Camera3D() = default;
+		Camera3D(float aspectRatio, float fovRadians)
+			:aspectRatio(aspectRatio),
+			fovRadians(fovRadians)
+		{
+		}
+
+		glm::vec3 up = {0.f,1.f,0.f};
+
+		float aspectRatio = 1;
+		float fovRadians = glm::radians(70.f);
+
+		float closePlane = 0.01f;
+		float farPlane = 800.f;
+
+
+		glm::vec3 position = {};
+		glm::vec3 viewDirection = {0,0,-1};
+
+		glm::mat4x4 getProjectionMatrix();
+		glm::mat4x4 getViewMatrix();
+		glm::mat4x4 getViewProjectionMatrix();
+
+
+		void rotateCamera(const glm::vec2 delta);
+		float yaw = 0.f;
+		float pitch = 0.f;
+
+		void moveFPS(glm::vec3 direction);
+		void rotateFPS(glm::ivec2 mousePos, float speed);
+		glm::ivec2 lastMousePos = {};
+
+		bool use = false;
+
+		bool operator==(const Camera3D &other)
+		{
+			return
+				(up == other.up)
+				&& (aspectRatio == other.aspectRatio)
+				&& (fovRadians == other.fovRadians)
+				&& (closePlane == other.closePlane)
+				&& (farPlane == other.farPlane)
+				&& (position == other.position)
+				&& (viewDirection == other.viewDirection)
+				;
+		};
+
+		bool operator!=(const Camera3D &other)
+		{
+			return !(*this == other);
+		};
+
+	};
+
 
 #pragma endregion
 
@@ -347,13 +406,17 @@ namespace gl2d
 	struct FrameBuffer
 	{
 		FrameBuffer() {};
-		explicit FrameBuffer(unsigned int w, unsigned int h) { create(w, h); };
+		explicit FrameBuffer(int w, int h) { create(w, h); };
 
 		unsigned int fbo = 0;
 		Texture texture = {};
+		Texture depthTexture = {};
+
+		int w = 0;
+		int h = 0;
 
-		void create(unsigned int w, unsigned int h);
-		void resize(unsigned int w, unsigned int h);
+		void create(int w, int h, bool hasDepth = 0, bool nearestFilter = 0);
+		void resize(int w, int h);
 
 		//clears resources
 		void cleanup();
@@ -389,6 +452,7 @@ namespace gl2d
 		//If the capacity is exceded it will be extended but this will cost performance.
 		void create(GLuint fbo = 0, size_t quadCount = 1'000);
 
+
 		//Clears the object alocated resources but
 		//does not clear resources allocated by user like textures, fonts and fbos!
 		void cleanup();
@@ -399,7 +463,7 @@ namespace gl2d
 		GLuint vao = {};
 
 		//4 elements each component
-		std::vector<glm::vec2>spritePositions;
+		std::vector<glm::vec4>spritePositions;
 		std::vector<glm::vec4>spriteColors;
 		std::vector<glm::vec2>texturePositions;
 		std::vector<Texture>spriteTextures;
@@ -420,10 +484,15 @@ namespace gl2d
 		void popShader();
 
 		Camera currentCamera = {};
+		Camera3D currentCamera3D = {};
 		std::vector<Camera> cameraPushPop;
 		void pushCamera(Camera c = {});
 		void popCamera();
 
+		std::vector<Camera3D> camera3DPushPop;
+		void pushCamera3D(Camera3D c = {});
+		void popCamera3D();
+
 		glm::vec4 getViewRect(); //returns the view coordonates and size of this camera. Doesn't take rotation into account!
 
 
@@ -449,15 +518,15 @@ namespace gl2d
 			//texturePositionsCount = 0;
 		}
 
-		glm::vec2 getTextSize(const char *text, const Font font, const float size = 1.5f,
+		glm::vec2 getTextSize(const char *text, const Font font, const float sizePixels = 64.f,
 			const float spacing = 4, const float line_space = 3);
 
 		// The origin will be the bottom left corner since it represents the line for the text to be drawn
 		//Pacing and lineSpace are influenced by size
 		//todo the function should returns the size of the text drawn also refactor
-		void renderText(glm::vec2 position, const char *text, const Font font, const Color4f color, const float size = 1.5f,
-			const float spacing = 4, const float line_space = 3, bool showInCenter = 1, const Color4f ShadowColor = {0.1,0.1,0.1,1}
-		, const Color4f LightColor = {});
+		void renderText(glm::vec2 position, const char *text, const Font font, const Color4f color, const float sizePixels = 64.f,
+			const float spacing = 4, const float line_spacePixels = 3, bool showInCenter = 1, const Color4f ShadowColor = {0.1,0.1,0.1,1}
+		, const Color4f LightColor = {}, float positionZ = 0);
 
 		//determines the text size so that it fits in the given box,
 		//the x and y components of the transform are ignored
@@ -479,60 +548,60 @@ namespace gl2d
 		//todo the function should returns the size of the text drawn also refactor
 		void renderTextWrapped(const std::string &text,
 			gl2d::Font f, glm::vec4 textPos, glm::vec4 color, float baseSize,
-			float spacing = 4, float lineSpacing = 3,
+			float spacing = 4, float lineSpacing = 0,
 			bool showInCenter = true, glm::vec4 shadowColor = {0.1,0.1,0.1,1}, glm::vec4 lightColor = {});
 
 		glm::vec2 getTextSizeWrapped(const std::string &text,
-			gl2d::Font f, float maxTextLenght, float baseSize, float spacing = 4, float lineSpacing = 3);
+			gl2d::Font f, float maxTextLenght, float baseSize, float spacing = 4, float lineSpacing = 0);
 
 		//determines the text size so that it fits in the given box,
 		//the x and y components of the transform are ignored
 		float determineTextRescaleFitBigger(const std::string &str,
 			gl2d::Font &f, glm::vec4 transform, float minSize);
 
-		void renderRectangle(const Rect transforms, const Texture texture, const Color4f colors[4], const glm::vec2 origin = {}, const float rotationDegrees = 0.f, const glm::vec4 textureCoords = GL2D_DefaultTextureCoords);
-		inline void renderRectangle(const Rect transforms, const Texture texture, const Color4f colors = {1,1,1,1}, const glm::vec2 origin = {}, const float rotationDegrees = 0, const glm::vec4 textureCoords = GL2D_DefaultTextureCoords)
+		void renderRectangle(const Rect transforms, const Texture texture, const Color4f colors[4], const glm::vec2 origin = {}, const float rotationDegrees = 0.f, const glm::vec4 textureCoords = GL2D_DefaultTextureCoords, float positionZ = 0);
+		inline void renderRectangle(const Rect transforms, const Texture texture, const Color4f colors = {1,1,1,1}, const glm::vec2 origin = {}, const float rotationDegrees = 0, const glm::vec4 textureCoords = GL2D_DefaultTextureCoords, float positionZ = 0)
 		{
 			Color4f c[4] = {colors,colors,colors,colors};
-			renderRectangle(transforms, texture, c, origin, rotationDegrees, textureCoords);
+			renderRectangle(transforms, texture, c, origin, rotationDegrees, textureCoords, positionZ);
 		}
 
 		//abs rotation means that the rotaion is relative to the screen rather than object
-		void renderRectangleAbsRotation(const Rect transforms, const Texture texture, const Color4f colors[4], const glm::vec2 origin = {}, const float rotationDegrees = 0.f, const glm::vec4 textureCoords = GL2D_DefaultTextureCoords);
-		inline void renderRectangleAbsRotation(const Rect transforms, const Texture texture, const Color4f colors = {1,1,1,1}, const glm::vec2 origin = {}, const float rotationDegrees = 0.f, const glm::vec4 textureCoords = GL2D_DefaultTextureCoords)
+		void renderRectangleAbsRotation(const Rect transforms, const Texture texture, const Color4f colors[4], const glm::vec2 origin = {}, const float rotationDegrees = 0.f, const glm::vec4 textureCoords = GL2D_DefaultTextureCoords, float positionZ = 0);
+		inline void renderRectangleAbsRotation(const Rect transforms, const Texture texture, const Color4f colors = {1,1,1,1}, const glm::vec2 origin = {}, const float rotationDegrees = 0.f, const glm::vec4 textureCoords = GL2D_DefaultTextureCoords, float positionZ = 0)
 		{
 			Color4f c[4] = {colors,colors,colors,colors};
-			renderRectangleAbsRotation(transforms, texture, c, origin, rotationDegrees, textureCoords);
+			renderRectangleAbsRotation(transforms, texture, c, origin, rotationDegrees, textureCoords, positionZ);
 		}
 
-		void renderRectangle(const Rect transforms, const Color4f colors[4], const glm::vec2 origin = {0,0}, const float rotationDegrees = 0);
-		inline void renderRectangle(const Rect transforms, const Color4f colors = {1,1,1,1}, const glm::vec2 origin = {0,0}, const float rotationDegrees = 0)
+		void renderRectangle(const Rect transforms, const Color4f colors[4], const glm::vec2 origin = {0,0}, const float rotationDegrees = 0, float positionZ = 0);
+		inline void renderRectangle(const Rect transforms, const Color4f colors = {1,1,1,1}, const glm::vec2 origin = {0,0}, const float rotationDegrees = 0, float positionZ = 0)
 		{
 			Color4f c[4] = {colors,colors,colors,colors};
-			renderRectangle(transforms, c, origin, rotationDegrees);
+			renderRectangle(transforms, c, origin, rotationDegrees, positionZ);
 		}
 
 		//abs rotation means that the rotaion is relative to the screen rather than object
-		void renderRectangleAbsRotation(const Rect transforms, const Color4f colors[4], const glm::vec2 origin = {0,0}, const float rotationDegrees = 0);
-		inline void renderRectangleAbsRotation(const Rect transforms, const Color4f colors = {1,1,1,1}, const glm::vec2 origin = {0,0}, const float rotationDegrees = 0)
+		void renderRectangleAbsRotation(const Rect transforms, const Color4f colors[4], const glm::vec2 origin = {0,0}, const float rotationDegrees = 0, float positionZ = 0);
+		inline void renderRectangleAbsRotation(const Rect transforms, const Color4f colors = {1,1,1,1}, const glm::vec2 origin = {0,0}, const float rotationDegrees = 0, float positionZ = 0)
 		{
 			Color4f c[4] = {colors,colors,colors,colors};
-			renderRectangleAbsRotation(transforms, c, origin, rotationDegrees);
+			renderRectangleAbsRotation(transforms, c, origin, rotationDegrees, positionZ);
 		}
 
-		void renderLine(const glm::vec2 position, const float angleDegrees, const float length, const Color4f color, const float width = 2.f);
+		void renderLine(const glm::vec2 position, const float angleDegrees, const float length, const Color4f color, const float width = 2.f, float positionZ = 0);
 
-		void renderLine(const glm::vec2 start, const glm::vec2 end, const Color4f color, const float width = 2.f);
+		void renderLine(const glm::vec2 start, const glm::vec2 end, const Color4f color, const float width = 2.f, float positionZ = 0);
 
-		void renderRectangleOutline(const glm::vec4 position, const Color4f color, const float width = 2.f, const glm::vec2 origin = {}, const float rotationDegrees = 0);
+		void renderRectangleOutline(const glm::vec4 position, const Color4f color, const float width = 2.f, const glm::vec2 origin = {}, const float rotationDegrees = 0, float positionZ = 0);
 
-		void renderCircleOutline(const glm::vec2 position, const float size, const Color4f color, const float width = 2.f, const unsigned int segments = 16);
+		void renderCircleOutline(const glm::vec2 position, const float size, const Color4f color, const float width = 2.f, const unsigned int segments = 16, float positionZ = 0);
 
 		//legacy, use render9Patch2
-		void render9Patch(const Rect position, const int borderSize, const Color4f color, const glm::vec2 origin, const float rotationDegrees, const Texture texture, const Texture_Coords textureCoords, const Texture_Coords inner_texture_coords);
+		void render9Patch(const Rect position, const int borderSize, const Color4f color, const glm::vec2 origin, const float rotationDegrees, const Texture texture, const Texture_Coords textureCoords, const Texture_Coords inner_texture_coords, float positionZ = 0);
 
 		//used for ui. draws a texture that scales the margins different so buttons of different sizes can be drawn.
-		void render9Patch2(const Rect position, const Color4f color, const glm::vec2 origin, const float rotationDegrees, const Texture texture, const Texture_Coords textureCoords, const Texture_Coords inner_texture_coords);
+		void render9Patch2(const Rect position, const Color4f color, const glm::vec2 origin, const float rotationDegrees, const Texture texture, const Texture_Coords textureCoords, const Texture_Coords inner_texture_coords, float positionZ = 0);
 
 		void clearScreen(const Color4f color = Color4f{0,0,0,0});
 
@@ -580,7 +649,4 @@ namespace gl2d
 
 
 
-
-
-
 };

File diff suppressed because it is too large
+ 351 - 204
Pika/thirdparty/gl2d/src/gl2d.cpp


Some files were not shown because too many files changed in this diff