Skip to content

Commit

Permalink
Remove SETGET macros
Browse files Browse the repository at this point in the history
Replace SETGET macros with public data members named the same
as the corresponding property. This results in the fewest
lines of code changed.
  • Loading branch information
Jaedan committed Apr 15, 2018
1 parent 07640aa commit d469a13
Show file tree
Hide file tree
Showing 365 changed files with 5,205 additions and 5,161 deletions.
16 changes: 8 additions & 8 deletions OrionUO/CharacterList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ void CCharacterList::Clear()
IFOR(i, 0, 7)
m_Name[i] = "";

m_Selected = 0;
m_OnePerson = false;
m_Have6Slot = false;
m_Have7Slot = false;
Selected = 0;
OnePerson = false;
Have6Slot = false;
Have7Slot = false;
}
//----------------------------------------------------------------------------------
/*!
Expand All @@ -46,7 +46,7 @@ void CCharacterList::SetName(intptr_t pos, const string &name)
{
WISPFUN_DEBUG("c182_f3");
//!При корректной позиции записываем имя
if (pos >= 0 && pos < m_Count)
if (pos >= 0 && pos < Count)
m_Name[pos] = name;
}
//----------------------------------------------------------------------------------
Expand All @@ -61,7 +61,7 @@ string CCharacterList::GetName(intptr_t pos) const
string result = "";

//!При корректной позиции возвращаем имя
if (pos >= 0 && pos < m_Count)
if (pos >= 0 && pos < Count)
result = m_Name[pos];

return result;
Expand All @@ -77,8 +77,8 @@ string CCharacterList::GetSelectedName() const
string result = "";

//!При корректной позиции возвращаем имя
if (m_Selected >= 0 && m_Selected < m_Count)
result = m_Name[m_Selected];
if (Selected >= 0 && Selected < Count)
result = m_Name[Selected];

return result;
}
Expand Down
15 changes: 8 additions & 7 deletions OrionUO/CharacterList.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
//!Класс списка персонажей для экрана выбора персонажей
class CCharacterList
{
SETGET(int, Count, 5);
SETGET(int, Selected, 0);
SETGET(bool, OnePerson, false);
SETGET(bool, Have6Slot, false);
SETGET(bool, Have7Slot, false);
SETGET(ushort, ClientFlag, 0);
public:
int Count = 5;
int Selected = 0;
bool OnePerson = false;
bool Have6Slot = false;
bool Have7Slot = false;
ushort ClientFlag = 0;

SETGET(string, LastCharacterName, "");
string LastCharacterName = "";

private:
//!Память под 7 персонажей
Expand Down
2 changes: 1 addition & 1 deletion OrionUO/CityList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void CCityItem::InitCity()
{
WISPFUN_DEBUG("c183_f1");
//!Линкуем город
m_City = g_CityManager.GetCity(m_Name);
m_City = g_CityManager.GetCity(Name);
}
//----------------------------------------------------------------------------------
//-------------------------------------CCityItemNew---------------------------------
Expand Down
22 changes: 11 additions & 11 deletions OrionUO/CityList.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
//!Класс города (для старых клиентов)
class CCityItem
{
SETGET(uchar, LocationIndex, 0);
SETGET(string, Name, "");
SETGET(string, Area, "");
SETGET(bool, Selected, false);

public:
uchar LocationIndex = 0;
string Name = "";
string Area = "";
bool Selected = false;

CCityItem();
virtual ~CCityItem();

Expand All @@ -41,13 +41,13 @@ class CCityItem
//!Класс города (для новых клиентов)
class CCityItemNew : public CCityItem
{
SETGET(uint, X, 0);
SETGET(uint, Y, 0);
SETGET(uint, Z, 0);
SETGET(uint, MapIndex, 0);
SETGET(uint, Cliloc, 0);

public:
uint X = 0;
uint Y = 0;
uint Z = 0;
uint MapIndex = 0;
uint Cliloc = 0;

CCityItemNew();
virtual ~CCityItemNew();

Expand Down
26 changes: 13 additions & 13 deletions OrionUO/ClickObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ void CClickObject::Clear(CRenderObject *obj)
{
m_Object = NULL;
m_Gump = NULL;
m_Timer = 0;
m_X = 0;
m_Y = 0;
m_Enabled = false;
m_Page = 0;
Timer = 0;
X = 0;
Y = 0;
Enabled = false;
Page = 0;
}
}
//----------------------------------------------------------------------------------
Expand All @@ -33,22 +33,22 @@ void CClickObject::Clear()
WISPFUN_DEBUG("c185_f2");
m_Object = NULL;
m_Gump = NULL;
m_Timer = 0;
Timer = 0;
//m_X = 0;
//m_Y = 0;
m_Enabled = false;
m_Page = 0;
Enabled = false;
Page = 0;
}
//----------------------------------------------------------------------------------
void CClickObject::Init(CRenderObject *obj, CGump *gump)
{
WISPFUN_DEBUG("c185_f3");
m_Enabled = true;
Enabled = true;
m_Object = obj;
m_Gump = gump;
m_Timer = 0;
m_X = 0;
m_Y = 0;
m_Page = 0;
Timer = 0;
X = 0;
Y = 0;
Page = 0;
}
//----------------------------------------------------------------------------------
12 changes: 6 additions & 6 deletions OrionUO/ClickObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
//!Объект клика мышкой
class CClickObject
{
SETGET(uint, Timer, 0);
SETGET(ushort, X, 0);
SETGET(ushort, Y, 0);
SETGET(bool, Enabled, false);
SETGET(uint, Page, 0);
public:
uint Timer = 0;
ushort X = 0;
ushort Y = 0;
bool Enabled = false;
uint Page = 0;
SETGETP(CRenderObject*, Object, NULL);
SETGETP(CGump*, Gump, NULL);

public:
CClickObject() {}
~CClickObject() {}

Expand Down
28 changes: 14 additions & 14 deletions OrionUO/Container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ void CContainerRect::Calculate(ushort gumpID)
//!Если выключено смещение - открываем гамп в правом верхнем углу клиента
if (!g_ConfigManager.OffsetInterfaceWindows)
{
m_X = m_DefaultX;
m_Y = m_DefaultY;
X = DefaultX;
Y = DefaultY;
}
else //!Или вычисляем смещение и открываем в результируемых координатах
{
Expand All @@ -79,26 +79,26 @@ void CContainerRect::Calculate(ushort gumpID)
IFOR(i, 0, 4 && !passed)
{
//!Пора изменять смещение по оси Y и обнулять по оси X
if (m_X + tex->Width + CONTAINERS_RECT_STEP > g_OrionWindow.Size.Width)
if (X + tex->Width + CONTAINERS_RECT_STEP > g_OrionWindow.Size.Width)
{
m_X = CONTAINERS_RECT_DEFAULT_POS;
X = CONTAINERS_RECT_DEFAULT_POS;

//!Если смещение по оси Y достигло максимума - выставим стандартное значение
if (m_Y + tex->Height + CONTAINERS_RECT_LINESTEP > g_OrionWindow.Size.Height)
m_Y = CONTAINERS_RECT_DEFAULT_POS;
if (Y + tex->Height + CONTAINERS_RECT_LINESTEP > g_OrionWindow.Size.Height)
Y = CONTAINERS_RECT_DEFAULT_POS;
else
m_Y += CONTAINERS_RECT_LINESTEP;
Y += CONTAINERS_RECT_LINESTEP;
}
//!Пора изменять смещение по оси X и обнулять по оси Y
else if (m_Y + tex->Height + CONTAINERS_RECT_STEP > g_OrionWindow.Size.Height)
else if (Y + tex->Height + CONTAINERS_RECT_STEP > g_OrionWindow.Size.Height)
{
//!Если смещение по оси X достигло максимума - выставим стандартное значение
if (m_X + tex->Width + CONTAINERS_RECT_LINESTEP > g_OrionWindow.Size.Width)
m_X = CONTAINERS_RECT_DEFAULT_POS;
if (X + tex->Width + CONTAINERS_RECT_LINESTEP > g_OrionWindow.Size.Width)
X = CONTAINERS_RECT_DEFAULT_POS;
else
m_X += CONTAINERS_RECT_LINESTEP;
X += CONTAINERS_RECT_LINESTEP;

m_Y = CONTAINERS_RECT_DEFAULT_POS;
Y = CONTAINERS_RECT_DEFAULT_POS;
}
else //!Все отлично, пропускаем дальше
passed = (int)i + 1;
Expand All @@ -108,8 +108,8 @@ void CContainerRect::Calculate(ushort gumpID)
MakeDefault();
else if (passed == 1) //!Прошло с 1 раза, можно изменить смещение
{
m_X += CONTAINERS_RECT_STEP;
m_Y += CONTAINERS_RECT_STEP;
X += CONTAINERS_RECT_STEP;
Y += CONTAINERS_RECT_STEP;
}
}
}
Expand Down
36 changes: 18 additions & 18 deletions OrionUO/Container.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,50 +13,50 @@
//!Структура данных с информацией о доступных координатах дропа предметов в гампы контейнеров
class CContainerOffsetRect
{
SETGET(int, MinX, 0);
SETGET(int, MinY, 0);
SETGET(int, MaxX, 0);
SETGET(int, MaxY, 0);

public:
int MinX = 0;
int MinY = 0;
int MaxX = 0;
int MaxY = 0;

CContainerOffsetRect() {}
CContainerOffsetRect(const int &minX, const int &minY, const int &maxX, const int &maxY)
: m_MinX(minX), m_MinY(minY), m_MaxX(maxX), m_MaxY(maxY) {}
: MinX(minX), MinY(minY), MaxX(maxX), MaxY(maxY) {}
~CContainerOffsetRect() {}
};
//----------------------------------------------------------------------------------
//!Информация о гампе и звуках контейнеров
class CContainerOffset
{
public:
//!Индекс картинки гампа
SETGET(ushort, Gump, 0);
ushort Gump = 0;

//!Индекс звука открытия (0 - нет звука)
SETGET(ushort, OpenSound, 0);
ushort OpenSound = 0;

//!Индекс звука закрытия (0 - нет звука)
SETGET(ushort, CloseSound, 0);
ushort CloseSound = 0;

//!Координаты в гампе для дропа
SETGET(CContainerOffsetRect, Rect, CContainerOffsetRect());
CContainerOffsetRect Rect = CContainerOffsetRect();

public:
CContainerOffset() {}
CContainerOffset(const ushort &gump, const ushort &openSound, const ushort &closeSound, const CContainerOffsetRect &rect)
: m_Gump(gump), m_OpenSound(openSound), m_CloseSound(closeSound), m_Rect(rect) {}
: Gump(gump), OpenSound(openSound), CloseSound(closeSound), Rect(rect) {}
~CContainerOffset() {}
};
//----------------------------------------------------------------------------------
//!Класс для вычисления смещения открытия гампов контейнеров
class CContainerRect
{
SETGET(short, DefaultX, 40);
SETGET(short, DefaultY, 40);
public:
short DefaultX = 40;
short DefaultY = 40;

SETGET(short, X, 40);
SETGET(short, Y, 40);
short X = 40;
short Y = 40;

public:
CContainerRect() {}
~CContainerRect() {}

Expand All @@ -71,7 +71,7 @@ class CContainerRect
Выставим параметры по-умолчанию
@return
*/
void MakeDefault() { m_X = m_DefaultX; m_Y = m_DefaultY; }
void MakeDefault() { X = DefaultX; Y = DefaultY; }
};
//----------------------------------------------------------------------------------
//!Данные о контейнерах
Expand Down
4 changes: 2 additions & 2 deletions OrionUO/ContainerStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ deque<CContainerStackItem> g_ContainerStack;
uint g_CheckContainerStackTimer = 0;
//----------------------------------------------------------------------------------
CContainerStackItem::CContainerStackItem(const uint &serial, const short &x, const short &y, const short &minimizedX, const short &minimizedY, const bool &minimized, const bool &lockMoving)
: m_Serial(serial), m_X(x), m_Y(y), m_MinimizedX(minimizedX), m_MinimizedY(minimizedY),
m_Minimized(minimized), m_LockMoving(lockMoving)
: Serial(serial), X(x), Y(y), MinimizedX(minimizedX), MinimizedY(minimizedY),
Minimized(minimized), LockMoving(lockMoving)
{
}
//----------------------------------------------------------------------------------
16 changes: 8 additions & 8 deletions OrionUO/ContainerStack.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
//!Класс стека контейнеров, используется для хранения информации при загрузке гапмов контейнеров из конфига при входе в игру
class CContainerStackItem
{
SETGET(uint, Serial, 0);
SETGET(short, X, 0);
SETGET(short, Y, 0);
SETGET(short, MinimizedX, 0);
SETGET(short, MinimizedY, 0);
SETGET(bool, Minimized, false);
SETGET(bool, LockMoving, false);

public:
uint Serial = 0;
short X = 0;
short Y = 0;
short MinimizedX = 0;
short MinimizedY = 0;
bool Minimized = false;
bool LockMoving = false;

CContainerStackItem(const uint &serial, const short &x, const short &y, const short &minimizedX, const short &minimizedY, const bool &minimized, const bool &lockMoving);
~CContainerStackItem() {}
};
Expand Down
2 changes: 1 addition & 1 deletion OrionUO/ExceptionFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ LONG __stdcall OrionUnhandledExceptionFilter(struct _EXCEPTION_POINTERS *excepti
}

Wisp::g_WispCrashLogger.Close();
string crashlogPath = "\"" + Wisp::g_WispCrashLogger.GetFileName() + "\"";
string crashlogPath = "\"" + Wisp::g_WispCrashLogger.FileName + "\"";
STARTUPINFOA si;
PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(si));
Expand Down
Loading

0 comments on commit d469a13

Please sign in to comment.