signs.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #include "stdafx.h"
00013 #include "landscape.h"
00014 #include "signs_base.h"
00015 #include "signs_func.h"
00016 #include "strings_func.h"
00017 #include "core/pool_func.hpp"
00018
00019 #include "table/strings.h"
00020
00021
00022 SignPool _sign_pool("Sign");
00023 INSTANTIATE_POOL_METHODS(Sign)
00024
00025 Sign::Sign(Owner owner)
00026 {
00027 this->owner = owner;
00028 }
00029
00030 Sign::~Sign()
00031 {
00032 free(this->name);
00033
00034 if (CleaningPool()) return;
00035
00036 DeleteRenameSignWindow(this->index);
00037 }
00038
00042 void Sign::UpdateVirtCoord()
00043 {
00044 Point pt = RemapCoords(this->x, this->y, this->z);
00045 SetDParam(0, this->index);
00046 this->sign.UpdatePosition(pt.x, pt.y - 6, STR_WHITE_SIGN);
00047 }
00048
00050 void UpdateAllSignVirtCoords()
00051 {
00052 Sign *si;
00053
00054 FOR_ALL_SIGNS(si) {
00055 si->UpdateVirtCoord();
00056 }
00057 }
00058
00064 void InitializeSigns()
00065 {
00066 _sign_pool.CleanPool();
00067 }