diff options
author | alberth <alberth@openttd.org> | 2009-09-19 11:31:12 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2009-09-19 11:31:12 +0000 |
commit | 116c77c342d0f628235a7f5dbacfbb5bc3fb0829 (patch) | |
tree | d2dd74828426b0c82b4dab368e6aff5ff71f3bad /src/main_gui.cpp | |
parent | 9d7fe9bd8688f2d4123dc98e2b222a5be70b306f (diff) | |
download | openttd-116c77c342d0f628235a7f5dbacfbb5bc3fb0829.tar.xz |
(svn r17572) -Codechange: Use the Window::GetWidget() function to access nested widgets through the nested_array.
Diffstat (limited to 'src/main_gui.cpp')
-rw-r--r-- | src/main_gui.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp index cd8c43b43..147a521ae 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -215,7 +215,7 @@ struct MainWindow : Window this->InitNested(&_main_window_desc, 0); ResizeWindow(this, _screen.width, _screen.height); - NWidgetViewport *nvp = (NWidgetViewport *)this->nested_array[MW_VIEWPORT]; + NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(MW_VIEWPORT); nvp->InitializeViewport(this, TileXY(32, 32), ZOOM_LVL_VIEWPORT); } @@ -386,7 +386,7 @@ struct MainWindow : Window virtual void OnResize(Point delta) { if (this->viewport != NULL) { - NWidgetViewport *nvp = (NWidgetViewport *)this->nested_array[MW_VIEWPORT]; + NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(MW_VIEWPORT); nvp->UpdateViewportCoordinates(this); } } |