Browse Source

fixed container compatibility check bug

meemknight 2 years ago
parent
commit
dcf2384e05

+ 6 - 6
Pika/CMakeLists.txt

@@ -21,7 +21,7 @@ set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE) #under no circumstance we want th
 #declare projects
 #declare projects
 project(pikaCore)
 project(pikaCore)
 project(pikaGameplay)
 project(pikaGameplay)
-#project(pikaProduction)
+project(pikaProduction)
 
 
 
 
 #add third party libraries
 #add third party libraries
@@ -97,9 +97,9 @@ target_link_libraries(pikaGameplay PRIVATE glad glfw gl2d gl3d glui glm stb_imag
 #################^^^^^^^^^^^^^^############################
 #################^^^^^^^^^^^^^^############################
 
 
 
 
-#
-#
-##pikaProduction ###########################################
+
+
+#pikaProduction ###########################################
 #add_executable(pikaProduction)
 #add_executable(pikaProduction)
 #
 #
 #target_compile_definitions(pikaProduction PUBLIC PIKA_PRODUCTION)
 #target_compile_definitions(pikaProduction PUBLIC PIKA_PRODUCTION)
@@ -117,8 +117,8 @@ target_link_libraries(pikaGameplay PRIVATE glad glfw gl2d gl3d glui glm stb_imag
 #target_include_directories(pikaProduction PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/pluggins/")
 #target_include_directories(pikaProduction PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/pluggins/")
 #
 #
 #target_link_libraries(pikaProduction PRIVATE glad glfw gl2d gl3d glui glm stb_image stb_truetype imgui safeSave profilerLib)
 #target_link_libraries(pikaProduction PRIVATE glad glfw gl2d gl3d glui glm stb_image stb_truetype imgui safeSave profilerLib)
-#
-#
+
+
 
 
 #################^^^^^^^^^^^^^^############################
 #################^^^^^^^^^^^^^^############################
 
 

+ 2 - 3
Pika/core/pikaRuntime/containerManager/containerManager.cpp

@@ -1223,9 +1223,8 @@ bool pika::checkIfSnapshotIsCompatible(pika::RuntimeContainer &info, const char
 		return false;
 		return false;
 	}
 	}
 
 
-	//todo fix this
-	//todo remake this function probably 
-	if (loadedInfo.requestedContainerInfo.bonusAllocators != info.requestedContainerInfo.bonusAllocators)
+	
+	if (loadedInfo.bonusAllocators != info.bonusAllocators)
 	{
 	{
 		return false;
 		return false;
 	}
 	}

+ 0 - 2
Pika/core/pikaRuntime/pikaMain.cpp

@@ -136,7 +136,6 @@ int main()
 #endif
 #endif
 #pragma endregion
 #pragma endregion
 
 
-
 #pragma region init window opengl imgui and context
 #pragma region init window opengl imgui and context
 	PIKA_PERMA_ASSERT(glfwInit(), "Problem initializing glfw");
 	PIKA_PERMA_ASSERT(glfwInit(), "Problem initializing glfw");
 	//glfwSetErrorCallback(error_callback); todo
 	//glfwSetErrorCallback(error_callback); todo
@@ -169,7 +168,6 @@ int main()
 #pragma endregion
 #pragma endregion
 
 
 
 
-
 #pragma region shortcuts
 #pragma region shortcuts
 	pika::ShortcutManager shortcutManager;
 	pika::ShortcutManager shortcutManager;
 #pragma endregion
 #pragma endregion

+ 1 - 1
Pika/core/pikaSTD/logs/assert.cpp

@@ -60,7 +60,7 @@ namespace pika
 				#ifdef _MSC_VER
 				#ifdef _MSC_VER
 					__debugbreak();
 					__debugbreak();
 				#endif
 				#endif
-					terminate();
+					//terminate();
 
 
 					return;
 					return;
 				}
 				}

+ 1 - 1
Pika/core/sharedRuntime/baseContainer.h

@@ -22,7 +22,7 @@ typedef READENTIREFILE(readEntireFile_t);
 typedef GETFILESIZE(getFileSize_t);
 typedef GETFILESIZE(getFileSize_t);
 #undef GETFILESIZE
 #undef GETFILESIZE
 
 
-static constexpr size_t MaxAllocatorsCount = 128;
+static constexpr size_t MaxAllocatorsCount = 64;
 
 
 struct CreateContainerInfo
 struct CreateContainerInfo
 {
 {

BIN
Pika/engineResources/engineSaves/options1.bin


BIN
Pika/engineResources/engineSaves/options2.bin


BIN
Pika/engineResources/engineSaves/window1.bin


BIN
Pika/engineResources/engineSaves/window2.bin


BIN
Pika/engineResources/engineSaves/windowPos1.bin


BIN
Pika/engineResources/engineSaves/windowPos2.bin


BIN
Pika/engineResources/record.recording


+ 4 - 0
Pika/gameplay/containers/mario/mario.h

@@ -16,6 +16,8 @@ struct Mario: public Container
 	mario::GameplayRenderer renderer;
 	mario::GameplayRenderer renderer;
 	mario::Player player;
 	mario::Player player;
 	
 	
+	int data[100];
+
 	pika::FileChanged fileChanged;
 	pika::FileChanged fileChanged;
 	gl2d::FrameBuffer fbo;
 	gl2d::FrameBuffer fbo;
 	gl2d::ShaderProgram postProcessShader;
 	gl2d::ShaderProgram postProcessShader;
@@ -91,6 +93,8 @@ struct Mario: public Container
 			glDeleteShader(postProcessShader.id);
 			glDeleteShader(postProcessShader.id);
 			loadShader(requestedInfo);
 			loadShader(requestedInfo);
 		}
 		}
+		//requestedInfo.readEntireFile
+
 
 
 		{
 		{
 			int delta = 0;
 			int delta = 0;

+ 1 - 2
Pika/gameplay/containers/mario/marioEditor.h

@@ -53,7 +53,7 @@ struct MarioEditor: public Container
 	bool create(RequestedContainerInfo &requestedInfo, pika::StaticString<256> commandLineArgument)
 	bool create(RequestedContainerInfo &requestedInfo, pika::StaticString<256> commandLineArgument)
 	{
 	{
 
 
-		renderer.create();
+		renderer.create(requestedInfo.requestedFBO.fbo);
 		//gl2d::setErrorFuncCallback() //tood
 		//gl2d::setErrorFuncCallback() //tood
 		//pika::initShortcutApi();
 		//pika::initShortcutApi();
 
 
@@ -137,7 +137,6 @@ struct MarioEditor: public Container
 		glm::ivec2 maxV;
 		glm::ivec2 maxV;
 		//render
 		//render
 		{
 		{
-
 			minV = {viewRect.x-1, viewRect.y-1};
 			minV = {viewRect.x-1, viewRect.y-1};
 			maxV = minV + glm::ivec2{viewRect.z+2, viewRect.w+2};
 			maxV = minV + glm::ivec2{viewRect.z+2, viewRect.w+2};
 			minV = glm::max(minV, {0,0});
 			minV = glm::max(minV, {0,0});

+ 2 - 0
Pika/gameplay/containers/minecraftDungeons/mcDungeonsgameplay.h

@@ -28,6 +28,8 @@ struct McDungeonsGameplay: public Container
 		info.requestImguiFbo = true;
 		info.requestImguiFbo = true;
 		info.requestImguiIds = 1;
 		info.requestImguiIds = 1;
 
 
+		//info.openOnApplicationStartup = true;
+
 		return info;
 		return info;
 	}
 	}
 
 

+ 1 - 1
Pika/gameplay/containers/pikaGameplay.h

@@ -49,7 +49,7 @@ struct Gameplay : public Container
 
 
 	bool create(RequestedContainerInfo &requestedInfo, pika::StaticString<256> commandLineArgument)
 	bool create(RequestedContainerInfo &requestedInfo, pika::StaticString<256> commandLineArgument)
 	{
 	{
-		renderer.create();
+		renderer.create(requestedInfo.requestedFBO.fbo);
 		//pika::initShortcutApi();
 		//pika::initShortcutApi();
 		r = new float;
 		r = new float;
 
 

+ 3 - 2
Pika/resources/logs.txt

@@ -1,2 +1,3 @@
-#2023-05-28 21:06:07: Created container: Mario
-#2023-05-28 21:08:14: Destroyed continer: Mario #1
+#2023-06-21 15:36:18: Created container: Gameplay
+#2023-06-21 15:36:18: Loaded snapshot
+#2023-06-21 15:36:27: Destroyed continer: Gameplay #1

+ 1 - 1
Pika/thirdparty/gl2d/include/gl2d/gl2d.h

@@ -50,7 +50,7 @@
 #define GL2D_OPNEGL_SHADER_PRECISION "precision highp float;"
 #define GL2D_OPNEGL_SHADER_PRECISION "precision highp float;"
 
 
 //this is the default capacity of the renderer
 //this is the default capacity of the renderer
-#define GL2D_Renderer2D_Max_Triangle_Capacity 4200
+#define GL2D_Renderer2D_Max_Triangle_Capacity 420000
 #define GL2D_DefaultTextureCoords (glm::vec4{ 0, 1, 1, 0 })
 #define GL2D_DefaultTextureCoords (glm::vec4{ 0, 1, 1, 0 })
 
 
 #include <glad/glad.h>
 #include <glad/glad.h>