void EditorLandscape::HeihghtmapUpdated(const DAVA::Rect &forRect) { EditorLandscape *editorLandscape = dynamic_cast<EditorLandscape *>(nestedLandscape); if(editorLandscape) { editorLandscape->HeihghtmapUpdated(forRect); } }
void LandscapesController::HeghtWasChanged(const DAVA::Rect &changedRect) { landscapeRenderer->RebuildVertexes(changedRect); renderedHeightmap->HeghtWasChanged(changedRect); EditorLandscape *editorLandscape = dynamic_cast<EditorLandscape *>(currentLandscape); if(editorLandscape) { editorLandscape->HeihghtmapUpdated(changedRect); } }
void EditorLandscape::SetNestedLandscape(DAVA::Landscape *landscapeNode) { SafeRelease(nestedLandscape); nestedLandscape = SafeRetain(landscapeNode); EditorLandscape *editorLandscape = dynamic_cast<EditorLandscape *>(landscapeNode); if(editorLandscape) { editorLandscape->SetParentLandscape(this); } // RETURN TO THIS CODE LATER // SetDebugFlags(nestedLandscape->GetDebugFlags()); SetHeightmap(nestedLandscape->GetHeightmap()); heightmapPath = nestedLandscape->GetHeightmapPathname(); SetTexture(TEXTURE_TILE_FULL, nestedLandscape->GetTexture(TEXTURE_TILE_FULL)); bbox = nestedLandscape->GetBoundingBox(); CopyCursorData(nestedLandscape, this); SetDisplayedTexture(); }
bool LandscapesController::HideEditorLandscape(EditorLandscape *hiddingLandscape) { hiddingLandscape->FlushChanges(); EditorLandscape *parentLandscape = hiddingLandscape->GetParentLandscape(); Landscape *nestedLandscape = hiddingLandscape->GetNestedLandscape(); if(parentLandscape) { Heightmap *hmap = SafeRetain(parentLandscape->GetHeightmap()); parentLandscape->SetNestedLandscape(nestedLandscape); parentLandscape->SetHeightmap(hmap); SafeRelease(hmap); currentLandscape = parentLandscape; } else { EditorLandscape *editorLandscape = dynamic_cast<EditorLandscape *>(nestedLandscape); if(editorLandscape) { editorLandscape->SetParentLandscape(NULL); } Entity* lanscapeNode = EditorScene::GetLandscapeNode(scene); lanscapeNode->RemoveComponent(Component::RENDER_COMPONENT); lanscapeNode->AddComponent(new RenderComponent(nestedLandscape)); if(NeedToKillRenderer(nestedLandscape)) { SafeRelease(renderedHeightmap); SafeRelease(landscapeRenderer); } currentLandscape = nestedLandscape; } SafeRelease(hiddingLandscape); return true; }