Changes required for skybox switching and spam control
--HG-- branch : nfb
This commit is contained in:
@@ -77,6 +77,13 @@ void KRCamera::loadXML(tinyxml2::XMLElement *e)
|
|||||||
KRNode::loadXML(e);
|
KRNode::loadXML(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void KRCamera::flushSkybox()
|
||||||
|
{
|
||||||
|
KRTexture *tobedeleted = m_pSkyBoxTexture;
|
||||||
|
m_pSkyBoxTexture = NULL;
|
||||||
|
// delete tobedeleted; // FINDME - this delete is not thread safe .. it crashes the texture streamer
|
||||||
|
}
|
||||||
|
|
||||||
void KRCamera::renderFrame(float deltaTime, GLint renderBufferWidth, GLint renderBufferHeight)
|
void KRCamera::renderFrame(float deltaTime, GLint renderBufferWidth, GLint renderBufferHeight)
|
||||||
{
|
{
|
||||||
// ----====---- Record timing information for measuring FPS ----====----
|
// ----====---- Record timing information for measuring FPS ----====----
|
||||||
|
|||||||
@@ -68,6 +68,8 @@ public:
|
|||||||
|
|
||||||
std::string getDebugText();
|
std::string getDebugText();
|
||||||
|
|
||||||
|
void flushSkybox(); // this will delete the skybox and cause the camera to reload a new skybox based on the settings
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void createBuffers(GLint renderBufferWidth, GLint renderBufferHeight);
|
void createBuffers(GLint renderBufferWidth, GLint renderBufferHeight);
|
||||||
|
|
||||||
|
|||||||
@@ -237,14 +237,14 @@ void kraken::set_debug_text(const std::string &print_text)
|
|||||||
NSString *bundlePath = [[NSBundle mainBundle] pathForResource:bundleName ofType:@"bundle"];
|
NSString *bundlePath = [[NSBundle mainBundle] pathForResource:bundleName ofType:@"bundle"];
|
||||||
NSBundle *bundle = [NSBundle bundleWithPath:bundlePath];
|
NSBundle *bundle = [NSBundle bundleWithPath:bundlePath];
|
||||||
if(bundle == nil) {
|
if(bundle == nil) {
|
||||||
NSLog(@"ERROR - Standard asset bundle could not be found.");
|
KRContext::Log(KRContext::LOG_LEVEL_ERROR, "%s", "ERROR - Standard asset bundle could not be found.");
|
||||||
} else {
|
} else {
|
||||||
NSEnumerator *bundleEnumerator = [[bundle pathsForResourcesOfType: nil inDirectory: nil] objectEnumerator];
|
NSEnumerator *bundleEnumerator = [[bundle pathsForResourcesOfType: nil inDirectory: nil] objectEnumerator];
|
||||||
NSString * p = nil;
|
NSString * p = nil;
|
||||||
while (p = [bundleEnumerator nextObject]) {
|
while (p = [bundleEnumerator nextObject]) {
|
||||||
NSString *file_name = [p lastPathComponent];
|
NSString *file_name = [p lastPathComponent];
|
||||||
if([file_name hasSuffix: @".vsh"] || [file_name hasSuffix: @".fsh"] || [file_name hasSuffix: @".krbundle"] ||[file_name hasPrefix:@"font."]) {
|
if([file_name hasSuffix: @".vsh"] || [file_name hasSuffix: @".fsh"] || [file_name hasSuffix: @".krbundle"] ||[file_name hasPrefix:@"font."]) {
|
||||||
NSLog(@" %@\n", file_name);
|
KRContext::Log(KRContext::LOG_LEVEL_INFORMATION, "%s", [file_name UTF8String]);
|
||||||
[self loadResource:p];
|
[self loadResource:p];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,8 +126,8 @@ void KRScene::render(KRCamera *pCamera, unordered_map<KRAABB, int> &visibleBound
|
|||||||
std::vector<KRDirectionalLight *>directional_lights;
|
std::vector<KRDirectionalLight *>directional_lights;
|
||||||
std::vector<KRSpotLight *>spot_lights;
|
std::vector<KRSpotLight *>spot_lights;
|
||||||
|
|
||||||
pCamera->settings.setSkyBox(m_skyBoxName); // This is temporary until the camera is moved into the scene graph
|
// pCamera->settings.setSkyBox(m_skyBoxName); // This is temporary until the camera is moved into the scene graph
|
||||||
|
// NOTE: the skybox is now selected in the CircaViewController
|
||||||
|
|
||||||
std::set<KRNode *> outerNodes = std::set<KRNode *>(m_nodeTree.getOuterSceneNodes()); // HACK - Copying the std::set as it is potentially modified as KRNode's update their bounds during the iteration. This is very expensive and will be eliminated in the future.
|
std::set<KRNode *> outerNodes = std::set<KRNode *>(m_nodeTree.getOuterSceneNodes()); // HACK - Copying the std::set as it is potentially modified as KRNode's update their bounds during the iteration. This is very expensive and will be eliminated in the future.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user