Mercurial > LightClone
changeset 41:a986355cca5f
Move Tower structure into Environment
author | koryspansel |
---|---|
date | Thu, 22 Sep 2011 10:25:35 -0700 |
parents | 00d17d8f407d |
children | 91e927584f92 |
files | LightClone/LightClone.vcproj LightClone/Source/Dialog.h LightClone/Source/Environment.h LightClone/Source/Tower.cpp LightClone/Source/Tower.h |
diffstat | 5 files changed, 37 insertions(+), 74 deletions(-) [+] |
line wrap: on
line diff
--- 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 @@ > </File> <File - RelativePath=".\Source\Tower.cpp" - > - </File> - <File RelativePath=".\Source\VirtualMachine.cpp" > </File> @@ -371,10 +367,6 @@ > </File> <File - RelativePath=".\Source\Tower.h" - > - </File> - <File RelativePath=".\Source\VirtualMachine.h" > </File>
--- 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);
--- 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
--- 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
--- 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__