Skip to content

Commit

Permalink
project cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
adafcaefc committed Dec 6, 2024
1 parent 9ef5e4f commit aad5ee3
Show file tree
Hide file tree
Showing 24 changed files with 132 additions and 127 deletions.
14 changes: 7 additions & 7 deletions Geome3Dash/Geome3Dash.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
<ClCompile Include="src\CocosShaderProgram.cpp" />
<ClCompile Include="src\GameObjectModel.cpp" />
<ClCompile Include="src\game\component\G3DProgressBar.cpp" />
<ClCompile Include="src\game\editor\CameraKeyframeEditorLoader.cpp" />
<ClCompile Include="src\game\editor\CameraKeyframeEditorPopup.cpp" />
<ClCompile Include="src\game\editor\G3DCameraKeyframeEditorLoader.cpp" />
<ClCompile Include="src\game\editor\G3DCameraKeyframeEditorPopup.cpp" />
<ClCompile Include="src\game\editor\G3DCurveEditorLoader.cpp" />
<ClCompile Include="src\game\editor\G3DCurveEditorPopup.cpp" />
<ClCompile Include="src\game\planet\G3DPlanetPopup.cpp" />
Expand Down Expand Up @@ -68,7 +68,7 @@
</ClCompile>
<ClCompile Include="src\game\component\G3DBaseNode.cpp" />
<ClCompile Include="src\game\component\G3DFragmentShaderLayer.cpp" />
<ClCompile Include="src\game\editor\G3DEditorPopup.cpp" />
<ClCompile Include="src\game\editor\G3DCameraEditorPopup.cpp" />
<ClCompile Include="src\game\component\G3DNumberSetting.cpp" />
<ClCompile Include="src\game\planet\G3DPlanetLayer.cpp" />
<ClCompile Include="src\game\playing\G3DPlayLayer.cpp" />
Expand Down Expand Up @@ -126,8 +126,8 @@
<ClInclude Include="src\delegate\CustomTouch.h" />
<ClInclude Include="src\GameObjectModel.h" />
<ClInclude Include="src\game\component\G3DProgressBar.h" />
<ClInclude Include="src\game\editor\CameraKeyframeEditorLoader.h" />
<ClInclude Include="src\game\editor\CameraKeyframeEditorPopup.h" />
<ClInclude Include="src\game\editor\G3DCameraKeyframeEditorLoader.h" />
<ClInclude Include="src\game\editor\G3DCameraKeyframeEditorPopup.h" />
<ClInclude Include="src\game\editor\G3DCurveEditorLoader.h" />
<ClInclude Include="src\game\editor\G3DCurveEditorPopup.h" />
<ClInclude Include="src\game\planet\G3DPlanetPopup.h" />
Expand All @@ -140,7 +140,7 @@
<ClInclude Include="src\engine\sus3d\ShaderProgram.h" />
<ClInclude Include="src\engine\sus3d\Shaders.h" />
<ClInclude Include="src\engine\sus3d\Texture.h" />
<ClInclude Include="src\game\editor\G3DEditorPopup.h" />
<ClInclude Include="src\game\editor\G3DCameraEditorPopup.h" />
<ClInclude Include="src\game\component\G3DBaseNode.h" />
<ClInclude Include="src\game\component\G3DFragmentShaderLayer.h" />
<ClInclude Include="src\game\component\G3DNumberSetting.h" />
Expand Down Expand Up @@ -183,7 +183,7 @@
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>ClangCL</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down
12 changes: 6 additions & 6 deletions Geome3Dash/Geome3Dash.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<ClCompile Include="src\game\component\G3DFragmentShaderLayer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\game\editor\G3DEditorPopup.cpp">
<ClCompile Include="src\game\editor\G3DCameraEditorPopup.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\game\component\G3DNumberSetting.cpp">
Expand Down Expand Up @@ -207,10 +207,10 @@
<ClCompile Include="src\transformer\SplineCameraPlayerObjectModelTransformer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\game\editor\CameraKeyframeEditorLoader.cpp">
<ClCompile Include="src\game\editor\G3DCameraKeyframeEditorLoader.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\game\editor\CameraKeyframeEditorPopup.cpp">
<ClCompile Include="src\game\editor\G3DCameraKeyframeEditorPopup.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\helper\CameraKeyframeBuffer.cpp">
Expand Down Expand Up @@ -284,7 +284,7 @@
<ClInclude Include="src\engine\sus3d\Texture.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\game\editor\G3DEditorPopup.h">
<ClInclude Include="src\game\editor\G3DCameraEditorPopup.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\game\component\G3DBaseNode.h">
Expand Down Expand Up @@ -383,10 +383,10 @@
<ClInclude Include="src\transformer\SplineCameraPlayerObjectModelTransformer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\game\editor\CameraKeyframeEditorLoader.h">
<ClInclude Include="src\game\editor\G3DCameraKeyframeEditorLoader.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\game\editor\CameraKeyframeEditorPopup.h">
<ClInclude Include="src\game\editor\G3DCameraKeyframeEditorPopup.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\helper\CameraKeyframeBuffer.h">
Expand Down
2 changes: 1 addition & 1 deletion Geome3Dash/src/BlockModelStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ namespace g3d
if (auto blockModel = getModel(modelPath)) { blockModels[i] = blockModel; }
}
}
catch (const std::filesystem::filesystem_error& e)
catch (...)
{

}
Expand Down
4 changes: 2 additions & 2 deletions Geome3Dash/src/GameObjectModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ namespace g3d
protected:
float opacity = 1.0f;
sus3d::Model* model;
std::vector<GameObjectModelTransformer*> transformers;
GameObject* gameObject;
std::vector<GameObjectModelTransformer*> transformers;
public:
GameObject* getGameObject() { return this->gameObject; }
sus3d::Model* getModel() { return this->model; }
Expand Down Expand Up @@ -50,7 +50,7 @@ namespace g3d
{
// memory leak but idk how to fix yet
// nvm I think the scene should own the pointer to transformers
for (auto& transformer : transformers) { /*delete transformer;*/ }
// for (auto& transformer : transformers) { /*delete transformer;*/ }
}
};
}
3 changes: 2 additions & 1 deletion Geome3Dash/src/LevelDataManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ namespace g3d
// NLOHMANN_DEFINE_TYPE_INTRUSIVE(CubicBezier, x0, y0, cx1, cy1, cx2, cy2, x1, y1);
//};

struct LevelData
class LevelData
{
public:
//CubicBezierLD bezierCurve; // Bezier values
//double bezierMultiplier; // Path size
//std::vector<CameraActionLD> actions; // Camera actions
Expand Down
1 change: 1 addition & 0 deletions Geome3Dash/src/PlayerObjectModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "GameObjectModel.h"

class GameObject;
class PlayerObject;

namespace g3d
{
Expand Down
2 changes: 1 addition & 1 deletion Geome3Dash/src/engine/sus3d/Mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ namespace sus3d
shaderProgram->setVec3("Ks", isCustomKs ? customKs : Ks);
shaderProgram->setFloat("shininess", 32);
shaderProgram->setFloat("d", isCustomD ? customD : d);
glDrawElements(GL_TRIANGLES, indices.size(), GL_UNSIGNED_INT, NULL);
glDrawElements(GL_TRIANGLES, static_cast<int>(indices.size()), GL_UNSIGNED_INT, NULL);
glBindVertexArray(0);
glDisable(GL_DEPTH_TEST);
glDisable(GL_BLEND);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "pch.h"

#include "game/editor/G3DEditorPopup.h"
#include "game/editor/G3DCameraEditorPopup.h"
#include "game/component/G3DBaseNode.h"

#include "helper/OpenGLStateHelper.h"
Expand Down Expand Up @@ -33,7 +33,7 @@ namespace g3d
// //spike->setScale(glm::vec3(0.75));
//}

void G3DEditorScene::drawModel()
void G3DCameraEditorScene::drawModel()
{
static std::chrono::steady_clock::time_point lastUpdate;
auto now = std::chrono::steady_clock::now();
Expand Down Expand Up @@ -112,7 +112,7 @@ namespace g3d
for (auto& block : blocks) { block.render(shaderProgram, camera, light); }
}

void G3DEditorScene::draw()
void G3DCameraEditorScene::draw()
{
CCNode::draw();

Expand All @@ -128,12 +128,12 @@ namespace g3d
OpenGLStateHelper::pushState();
}

G3DEditorScene::~G3DEditorScene()
G3DCameraEditorScene::~G3DCameraEditorScene()
{

}

bool G3DEditorScene::init(LevelEditorLayer* lel)
bool G3DCameraEditorScene::init(LevelEditorLayer* lel)
{
this->lel = lel;
playerObj = PlayerObject::create(0, 0, lel, lel->m_objectLayer, false);
Expand Down Expand Up @@ -179,13 +179,13 @@ namespace g3d
return CCNode::init();
}

void G3DEditorPopup::onClose(CCObject* ob)
void G3DCameraEditorPopup::onClose(CCObject* ob)
{
setLevelData(lel, currentLevelData);
geode::Popup<LevelEditorLayer*>::onClose(ob);
}

void G3DEditorPopup::updateCamera()
void G3DCameraEditorPopup::updateCamera()
{
if (m_spikeScene)
{
Expand All @@ -202,13 +202,13 @@ namespace g3d
}
}

void G3DEditorPopup::updateState(G3DNumberSetting* invoker)
void G3DCameraEditorPopup::updateState(G3DNumberSetting* invoker)
{
updateCamera();
for (auto& sett : m_settings) { sett->updateState(nullptr); }
}

bool G3DEditorPopup::setup(LevelEditorLayer* plel)
bool G3DCameraEditorPopup::setup(LevelEditorLayer* plel)
{
lel = plel;

Expand Down Expand Up @@ -283,7 +283,7 @@ namespace g3d
m_mainLayer->addChildAtPosition(
scrollBar, geode::Anchor::Center, ccp(layerBG->getContentWidth() / 2 + 10, 0));

m_spikeScene = G3DEditorScene::create(lel);
m_spikeScene = G3DCameraEditorScene::create(lel);
this->m_mainLayer->addChild(m_spikeScene);

layerBG->setPositionX(layerBG->getPositionX() + 90);
Expand All @@ -301,10 +301,10 @@ namespace g3d
return true;
}

void G3DEditorPopup::scene(LevelEditorLayer* plel)
void G3DCameraEditorPopup::scene(LevelEditorLayer* plel)
{
const CCSize uiSize = CCDirector::sharedDirector()->getWinSize() - CCSize(60, 40);
G3DEditorPopup* instance = new G3DEditorPopup();
G3DCameraEditorPopup* instance = new G3DCameraEditorPopup();
if (instance && instance->initAnchored(uiSize.width, uiSize.height, plel))
{
instance->m_noElasticity = true;
Expand All @@ -318,7 +318,7 @@ namespace g3d
}
}

void G3DEditorScene::onGLFWMouseCallBack(GLFWwindow* window, int button, int action, int mods) {
void G3DCameraEditorScene::onGLFWMouseCallBack(GLFWwindow* window, int button, int action, int mods) {
if (button == GLFW_MOUSE_BUTTON_RIGHT) {
if (action == GLFW_PRESS) {
isRightClicking = true;
Expand All @@ -330,7 +330,7 @@ namespace g3d
}
}

void G3DEditorScene::onGLFWMouseMoveCallBack(GLFWwindow* window, double x, double y) {
void G3DCameraEditorScene::onGLFWMouseMoveCallBack(GLFWwindow* window, double x, double y) {
if (isRightClicking) {
if (!isRightClickingGetPos) {
lastMouseX = static_cast<float>(x);
Expand Down Expand Up @@ -358,15 +358,15 @@ namespace g3d
currentLevelData.z = playerCameraOffset.z;
currentLevelData.yaw = playerCameraYawOffset;
currentLevelData.pitch = playerCameraPitchOffset;
if (auto layer = dynamic_cast<G3DEditorPopup*>(this->getParent()->getParent()))
if (auto layer = dynamic_cast<G3DCameraEditorPopup*>(this->getParent()->getParent()))
{
layer->updateState();
}
}
}
}

void G3DEditorScene::scrollWheel(float y, float x) {
void G3DCameraEditorScene::scrollWheel(float y, float x) {
if (isPressingControl) {
// Adjust the camera zoom level using the scroll wheel
float zoomSensitivity = -0.128f;
Expand All @@ -376,13 +376,13 @@ namespace g3d
currentLevelData.z = playerCameraOffset.z;
currentLevelData.yaw = playerCameraYawOffset;
currentLevelData.pitch = playerCameraPitchOffset;
if (auto layer = dynamic_cast<G3DEditorPopup*>(this->getParent()->getParent())) {
if (auto layer = dynamic_cast<G3DCameraEditorPopup*>(this->getParent()->getParent())) {
layer->updateState();
}
}
}

void G3DEditorScene::onKey(enumKeyCodes key, bool pressed, bool holding) {
void G3DCameraEditorScene::onKey(enumKeyCodes key, bool pressed, bool holding) {
switch (key) {
case KEY_Control:
isPressingControl = pressed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

namespace g3d
{
class G3DEditorScene
class G3DCameraEditorScene
: public CCNode
, public CustomKeyboardDelegate
, public CustomMouseDelegate
Expand Down Expand Up @@ -84,10 +84,10 @@ namespace g3d
virtual void onGLFWMouseMoveCallBack(GLFWwindow* window, double x, double y) override;
virtual void scrollWheel(float y, float x) override;

~G3DEditorScene();
~G3DCameraEditorScene();

static auto create(LevelEditorLayer* lel) {
auto node = new G3DEditorScene;
auto node = new G3DCameraEditorScene;
if (node->init(lel)) {
node->autorelease();
}
Expand All @@ -98,7 +98,7 @@ namespace g3d
}
};

class G3DEditorPopup : public geode::Popup<LevelEditorLayer*>
class G3DCameraEditorPopup : public geode::Popup<LevelEditorLayer*>
{
public:
static void scene(LevelEditorLayer* plel);
Expand All @@ -109,7 +109,7 @@ namespace g3d
bool setup(LevelEditorLayer*) override;
//void addLabel(const char* text, const CCPoint& position);

G3DEditorScene* m_spikeScene;
G3DCameraEditorScene* m_spikeScene;
geode::ScrollLayer* m_list;
geode::TextInput* m_searchInput;
std::vector<geode::Ref<G3DNumberSetting>> m_settings;
Expand All @@ -121,6 +121,6 @@ namespace g3d
private:
//static CCSize popupPadding;

G3DEditorPopup() { }
G3DCameraEditorPopup() { }
};
}
Loading

0 comments on commit aad5ee3

Please sign in to comment.