Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 706 vs 707 for /trunk/Source Code/Environment/Sky/Sky.cpp

Diff revisions: vs.
  @@ -36,6 +36,10 @@
36 36 RemoveResource(_skybox);
37 37 }
38 38
39 + void Sky::AddRef() {
40 + TrackedObject::AddRef();
41 + }
42 +
39 43 bool Sky::load() {
40 44 if (_sky != nullptr) {
41 45 return false;
  @@ -60,6 +64,7 @@
60 64 skyboxTextures.setPropertyDescriptor<SamplerDescriptor>(skyboxSampler);
61 65 skyboxTextures.setThreadedLoading(false);
62 66 _skybox = CreateResource<Texture>(skyboxTextures);
67 + REGISTER_TRACKED_DEPENDENCY(_skybox);
63 68
64 69 F32 radius = _diameter * 0.5f;
65 70
  @@ -68,12 +73,15 @@
68 73 skybox.setID(4); // resolution
69 74 skybox.setEnumValue(to_uint(radius)); // radius
70 75 _sky = CreateResource<Sphere3D>(skybox);
71 -
76 + _sky->renderState().setDrawState(false);
77 +
72 78 ResourceDescriptor skyShaderDescriptor("sky.Display");
73 79 _skyShader = CreateResource<ShaderProgram>(skyShaderDescriptor);
80 + REGISTER_TRACKED_DEPENDENCY(_skyShader);
74 81
75 82 ResourceDescriptor skyShaderPrePassDescriptor("sky.PrePass");
76 83 _skyShaderPrePass = CreateResource<ShaderProgram>(skyShaderPrePassDescriptor);
84 + REGISTER_TRACKED_DEPENDENCY(_skyShaderPrePass);
77 85
78 86 assert(_skyShader && _skyShaderPrePass);
79 87 _skyShader->Uniform("texSky", ShaderProgram::TextureUsage::UNIT0);
  @@ -88,11 +96,8 @@
88 96 to_const_uint(SGNComponent::ComponentType::BOUNDS) |
89 97 to_const_uint(SGNComponent::ComponentType::RENDERING);
90 98
91 - if (_sky == nullptr) {
92 - load();
93 - }
99 + assert(_sky != nullptr);
94 100
95 - _sky->renderState().setDrawState(false);
96 101 sgn.addNode(*_sky, normalMask, PhysicsGroup::GROUP_IGNORE);
97 102
98 103 RenderingComponent* renderable = sgn.get<RenderingComponent>();