=== modified file 'src/core/geometry_type.hpp' --- src/core/geometry_type.hpp 2008-05-04 13:31:57 +0000 +++ src/core/geometry_type.hpp 2008-05-10 13:26:13 +0000 @@ -42,12 +42,28 @@ * (relative) width/height */ struct PointDimension { + PointDimension() { }; + PointDimension(int px, int py, int pwidth, int pheight): x(px), y(py), width(pwidth), height(pheight) { }; + PointDimension(const PointDimension &pd): x(pd.x), y(pd.y), width(pd.width), height(pd.height) { }; + PointDimension& operator=(const PointDimension &pd); + int x; int y; int width; int height; }; +FORCEINLINE PointDimension& PointDimension::operator=(const PointDimension &pd) +{ + if (&pd != this) { + x = pd.x; + y = pd.y; + width = pd.width; + height = pd.height; + } + return *this; +} + /** A pair of two integers */ struct Pair { int a; === modified file 'src/texteff.cpp' --- src/texteff.cpp 2008-05-07 18:35:07 +0000 +++ src/texteff.cpp 2008-05-10 13:07:00 +0000 @@ -59,7 +59,7 @@ /* The chatbox grows from the bottom so the coordinates are pixels from * the left and pixels from the bottom. The height is the maximum height */ -static const PointDimension _chatmsg_box = {10, 30, 500, 150}; +static const PointDimension _chatmsg_box(10, 30, 500, 150); static uint8 _chatmessage_backup[150 * 500 * 6]; // (height * width) static inline uint GetChatMessageCount() === modified file 'src/window.cpp' --- src/window.cpp 2008-05-10 13:04:00 +0000 +++ src/window.cpp 2008-05-10 13:09:28 +0000 @@ -811,7 +811,7 @@ */ Window::Window(int x, int y, int width, int height, WindowProc *proc, WindowClass cls, const Widget *widget, void *data) { - PointDimension pd = { x, y, width, height }; + PointDimension pd(x, y, width, height); this->Initialize(pd, width, height, proc, cls, widget, 0, data); } @@ -838,10 +838,7 @@ } } - pos.x = left; - pos.y = top; - pos.width = width; - pos.height = height; + pos = PointDimension(left, top, width, height); return true; } @@ -865,10 +862,7 @@ } } - pos.x = left; - pos.y = top; - pos.width = width; - pos.height = height; + pos = PointDimension(left, top, width, height); return true; } @@ -917,11 +911,7 @@ } } - pd.x = left; - pd.y = top; - pd.width = width; - pd.height = height; - return pd; + return PointDimension(left, top, width, height); } }