Skip to content

Commit

Permalink
Fixes for Release 4.0
Browse files Browse the repository at this point in the history
- Corrected "bullet" path to lib
- CreateExistingMesgGO now uses ToAdd
- Stop deleting Mesh Dynamic buffer (dirty fix)
- Must look into dynamic buffer management for Mesh
  • Loading branch information
Hekbas committed May 17, 2024
1 parent ed1f4de commit 2b29e40
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 4 deletions.
3 changes: 3 additions & 0 deletions TheOneBuilder/BuilderSceneManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ bool BuilderSceneManager::Start()
engine->N_sceneManager->LoadScene("MainMenu");
engine->N_sceneManager->Start();

// pew pew pew :3
Resources::LoadFromLibrary<Model>("Library/Meshes/SM_Cube/pCube1.mesh");

return true;
}

Expand Down
File renamed without changes.
14 changes: 14 additions & 0 deletions TheOneEditor/Library/Materials/pCube1/lambert1.toematerial
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"shader": "Library/Shaders/MeshColor.toeshader",
"uniforms": [
{
"Name": "u_Color",
"Vec4": {
"w": 1.0,
"x": 0.4000000059604645,
"y": 0.4000000059604645,
"z": 0.4000000059604645
}
}
]
}
Binary file added TheOneEditor/Library/Meshes/pCube1/pCube1.mesh
Binary file not shown.
4 changes: 2 additions & 2 deletions TheOneEngine/Mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Mesh::Mesh(std::shared_ptr<GameObject> containerGO, Mesh* ref) : Component(conta

Mesh::~Mesh()
{
if (dynamicVAO) {
/*if (dynamicVAO) {
GLCALL(glDeleteVertexArrays(1, &dynamicVAO));
dynamicVAO = 0;
}
Expand All @@ -136,7 +136,7 @@ Mesh::~Mesh()
if (dynamicIBO) {
GLCALL(glDeleteBuffers(1, &dynamicIBO));
dynamicIBO = 0;
}
}*/
}


Expand Down
3 changes: 2 additions & 1 deletion TheOneEngine/MonoRegisterer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ static vec3f GetTransformRight(GameObject* GOptr)
//GameObject
static GameObject* InstantiateBullet(vec3f* initialPosition, vec3f* direction)
{
engine->N_sceneManager->CreateMeshGO("Assets/Meshes/SM_Cube.fbx");
engine->N_sceneManager->CreateExistingMeshGO("Library/Meshes/pCube1/pCube1.mesh");

GameObject* go = engine->N_sceneManager->objectsToAdd.back().get();

SetPosition(go, initialPosition);
Expand Down
2 changes: 1 addition & 1 deletion TheOneEngine/N_SceneManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ void N_SceneManager::CreateExistingMeshGO(std::string path)
if (isSingleMesh)
{
meshGO.get()->parent = currentScene->GetRootSceneGO();
currentScene->GetRootSceneGO().get()->children.push_back(meshGO);
engine->N_sceneManager->objectsToAdd.push_back(meshGO);
}
else
{
Expand Down

0 comments on commit 2b29e40

Please sign in to comment.