# HG changeset patch # User koryspansel # Date 1316712335 25200 # Node ID a986355cca5f410cada869055d27b591b8c968f6 # Parent 00d17d8f407d9491f2c259e766e716d409693a80 Move Tower structure into Environment diff -r 00d17d8f407d -r a986355cca5f LightClone/LightClone.vcproj --- a/LightClone/LightClone.vcproj Thu Sep 22 10:21:14 2011 -0700 +++ b/LightClone/LightClone.vcproj Thu Sep 22 10:25:35 2011 -0700 @@ -217,10 +217,6 @@ > - - @@ -371,10 +367,6 @@ > - - diff -r 00d17d8f407d -r a986355cca5f LightClone/Source/Dialog.h --- a/LightClone/Source/Dialog.h Thu Sep 22 10:21:14 2011 -0700 +++ b/LightClone/Source/Dialog.h Thu Sep 22 10:25:35 2011 -0700 @@ -62,7 +62,6 @@ if(eCode == Error_Success) { SetTexture("Data\\Textures\\Dialog0.tga", true); - //SetDimensions(300.0f, 200.0f); kLabel.Initialize(pResourceManager); kLabel.SetPosition(0.5f * kDimensions.x, 0.15f * kDimensions.y); @@ -82,16 +81,8 @@ kButton[i].SetColor(D3DCOLOR_XRGB(0, 0, 0)); kButton[i].Subscribe(GuiButton::EventClick, &Dialog::OnClick, this); - const D3DXVECTOR2& kButtonSize = kButton[i].GetDimensions(); - - //x = 0.5 * Wb - //1 = 0.5 * Wd - x - //2 = 0.25 * Wd - x; 0.75 * Wd - x - - const float fScale = 1.0f / (float)(ButtonCount + 1); - - const float fX = (i + 1) * fScale * kDimensions.x - 0.5f * kButtonSize.x; - const float fY = 0.65f * kDimensions.y; + const float fX = ((i + 1) * kDimensions.x / (float)(ButtonCount + 1)) - 0.5f * kButton[i].GetDimensions().x; + const float fY = 0.65f * kDimensions.y; kButton[i].SetPosition(fX, fY); diff -r 00d17d8f407d -r a986355cca5f LightClone/Source/Environment.h --- a/LightClone/Source/Environment.h Thu Sep 22 10:21:14 2011 -0700 +++ b/LightClone/Source/Environment.h Thu Sep 22 10:25:35 2011 -0700 @@ -11,6 +11,41 @@ #include "ResourceManager.h" /* + * Tower + */ +struct Tower +{ + /* + * Type + */ + uint32 Type; + + /* + * Height + */ + uint32 Height; + + /* + * State + */ + uint32 State; + + /* + * User + */ + uint32 User; + +public: + + /* + * Tower + */ + Tower() : Type(0), Height(1), State(0), User(0) + { + } +}; + +/* * Environment */ class Environment diff -r 00d17d8f407d -r a986355cca5f LightClone/Source/Tower.cpp --- a/LightClone/Source/Tower.cpp Thu Sep 22 10:21:14 2011 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -/* - * Tower - */ - -#include "Tower.h" - -/* - * Tower - */ -Tower::Tower() : Type(0), Height(1), State(0), User(0) -{ -} \ No newline at end of file diff -r 00d17d8f407d -r a986355cca5f LightClone/Source/Tower.h --- a/LightClone/Source/Tower.h Thu Sep 22 10:21:14 2011 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* - * Tower - */ - -#ifndef __TOWER_H__ -#define __TOWER_H__ - -#include "Core.h" - -/* - * Tower - */ -struct Tower -{ - /* - * Type - */ - uint32 Type; - - /* - * Height - */ - uint32 Height; - - /* - * State - */ - uint32 State; - - /* - * User - */ - uint32 User; - -public: - - /* - * Tower - */ - Tower(); -}; - -#endif //__TOWER_H__