Merge pull request #569 from marynate/PR-3d-disabled-build

Fixed #553: Disable 3D nodes for smaller executable
This commit is contained in:
reduz 2014-07-03 09:06:06 -03:00
commit cd80d442a2
2 changed files with 16 additions and 5 deletions

View file

@ -276,7 +276,7 @@ void Viewport::_notification(int p_what) {
} break; } break;
case NOTIFICATION_READY: { case NOTIFICATION_READY: {
#ifndef _3D_DISABLED
if (cameras.size() && !camera) { if (cameras.size() && !camera) {
//there are cameras but no current camera, pick first in tree and make it current //there are cameras but no current camera, pick first in tree and make it current
Camera *first=NULL; Camera *first=NULL;
@ -290,6 +290,7 @@ void Viewport::_notification(int p_what) {
if (first) if (first)
first->make_current(); first->make_current();
} }
#endif
} break; } break;
case NOTIFICATION_EXIT_SCENE: { case NOTIFICATION_EXIT_SCENE: {

View file

@ -225,17 +225,22 @@ struct SpatialIndexer {
void World::_register_camera(Camera* p_camera) { void World::_register_camera(Camera* p_camera) {
#ifndef _3D_DISABLED
indexer->_add_camera(p_camera); indexer->_add_camera(p_camera);
#endif
} }
void World::_update_camera(Camera* p_camera){ void World::_update_camera(Camera* p_camera){
#ifndef _3D_DISABLED
indexer->_update_camera(p_camera); indexer->_update_camera(p_camera);
#endif
} }
void World::_remove_camera(Camera* p_camera){ void World::_remove_camera(Camera* p_camera){
#ifndef _3D_DISABLED
indexer->_remove_camera(p_camera); indexer->_remove_camera(p_camera);
#endif
} }
@ -243,26 +248,31 @@ void World::_remove_camera(Camera* p_camera){
void World::_register_notifier(VisibilityNotifier* p_notifier,const AABB& p_rect){ void World::_register_notifier(VisibilityNotifier* p_notifier,const AABB& p_rect){
#ifndef _3D_DISABLED
indexer->_notifier_add(p_notifier,p_rect); indexer->_notifier_add(p_notifier,p_rect);
#endif
} }
void World::_update_notifier(VisibilityNotifier* p_notifier,const AABB& p_rect){ void World::_update_notifier(VisibilityNotifier* p_notifier,const AABB& p_rect){
#ifndef _3D_DISABLED
indexer->_notifier_update(p_notifier,p_rect); indexer->_notifier_update(p_notifier,p_rect);
#endif
} }
void World::_remove_notifier(VisibilityNotifier* p_notifier){ void World::_remove_notifier(VisibilityNotifier* p_notifier){
#ifndef _3D_DISABLED
indexer->_notifier_remove(p_notifier); indexer->_notifier_remove(p_notifier);
#endif
} }
void World::_update(uint64_t p_frame) { void World::_update(uint64_t p_frame) {
#ifndef _3D_DISABLED
indexer->_update(p_frame); indexer->_update(p_frame);
#endif
} }