Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:NeilKleistGao/NginD
Browse files Browse the repository at this point in the history
  • Loading branch information
NeilKleistGao committed Oct 23, 2021
2 parents ad01e65 + f360240 commit 65b2fb1
Show file tree
Hide file tree
Showing 14 changed files with 201 additions and 190 deletions.
2 changes: 1 addition & 1 deletion extern/physics/physics_listener.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ std::pair<RigidBody*, RigidBody*> PhysicsListener::getContactingBodies(b2Contact
void PhysicsListener::sendMessage(const std::string& name, objects::Object* sender, objects::Object* other) {
auto ob = script::Observer::getInstance();
luabridge::setGlobal(script::LuaState::getInstance()->getState(), other, "__PHYSICS_CONTACT_DATA__");
ob->notifySiblings("BeginContact", sender, luabridge::getGlobal(script::LuaState::getInstance()->getState(), "__PHYSICS_CONTACT_DATA__"));
ob->notifySiblings(name, sender, luabridge::getGlobal(script::LuaState::getInstance()->getState(), "__PHYSICS_CONTACT_DATA__"));
luabridge::setGlobal(script::LuaState::getInstance()->getState(), 0, "__PHYSICS_CONTACT_DATA__");
}

Expand Down
6 changes: 5 additions & 1 deletion extern/physics/physics_world.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,19 @@ PhysicsWorld* PhysicsWorld::create(const typename resources::ConfigResource::Jso

void PhysicsWorld::clearRigidBody(objects::Object* node) {
auto body = node->getComponent<RigidBody>("RigidBody");
_world.SetContactListener(nullptr);
if (body != nullptr) {
_world.DestroyBody(body->_body);
auto temp = body->_body;
body->_body = nullptr;
_world.DestroyBody(temp);
}

auto children = node->getChildren();
for (auto* child : children) {
clearRigidBody(child);
}

_world.SetContactListener(&listener);
}

} // namespace ngind::physics
2 changes: 2 additions & 0 deletions kernel/log/logger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

#include "logger.h"

#include <ctime>

namespace ngind::log {
void Logger::log(const std::string& msg) {
std::string format_msg;
Expand Down
2 changes: 2 additions & 0 deletions kernel/rendering/renderer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "renderer.h"
#include "camera.h"
#include "log/logger_factory.h"
#include "adaptor.h"

namespace ngind::rendering {
Renderer* Renderer::_instance = nullptr;
Expand Down Expand Up @@ -99,6 +100,7 @@ void Renderer::createWindow(int screen_width,
glEnable(GL_BLEND);
setBlendFactor(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_MULTISAMPLE);
Adaptor::getInstance()->setWindowSize({screen_width, screen_height});
Camera::getInstance()->init({resolution_width / 2.0f, resolution_height / 2.0f},
resolution_width, resolution_height);
}
Expand Down
7 changes: 6 additions & 1 deletion kernel/rendering/window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,13 @@ void Window::setFullScreen(const bool& is_full) {
if (is_full) {
glfwSetWindowMonitor(this->_window, monitor, 0, 0, mode->width, mode->height, mode->refreshRate);

#ifdef PLATFORM_WINDOWS
auto scale = getContentScale();
Adaptor::getInstance()->setWindowSize({mode->width * scale.first, mode->height * scale.second});
Adaptor::getInstance()->setWindowSize({ mode->width, mode->height });
#else
auto scale = getContentScale();
Adaptor::getInstance()->setWindowSize({ mode->width * scale.first, mode->height * scale.second });
#endif
}
else {
glfwSetWindowMonitor(this->_window, nullptr, 0, 0, _width, _height, 0);
Expand Down
2 changes: 2 additions & 0 deletions kernel/ui/kd_tree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

#include "kd_tree.h"

#include <algorithm>

namespace ngind::ui {
KDTree::KDTree() : _root(new KDNode()) {
}
Expand Down
8 changes: 4 additions & 4 deletions win32/ALL_BUILD.vcxproj

Large diffs are not rendered by default.

Empty file added win32/NGIND_ARCHIVE.json
Empty file.
127 changes: 63 additions & 64 deletions win32/NginD.vcxproj

Large diffs are not rendered by default.

171 changes: 84 additions & 87 deletions win32/NginD.vcxproj.filters

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions win32/ZERO_CHECK.vcxproj

Large diffs are not rendered by default.

Binary file removed win32/capture_test.png
Binary file not shown.
32 changes: 16 additions & 16 deletions win32/compress.vcxproj

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions win32/crypto.vcxproj

Large diffs are not rendered by default.

0 comments on commit 65b2fb1

Please # to comment.