Bugfixes, read more

* Manual modifications to the database caused the map to act unusual
* The server's packet must be created and deleted as a char array
* removed UnloadAll() from several singleton destructors
* added SDL_Delay() to BaseScene::RenderFrame(), to reduce heavy CPU use in menus
This commit is contained in:
Kayne Ruse
2014-08-19 01:48:48 +10:00
parent 0fdaa90a83
commit f52a022e64
5 changed files with 5 additions and 3 deletions
+1
View File
@@ -86,6 +86,7 @@ void BaseScene::RenderFrame() {
SDL_FillRect(screen, 0, 0); SDL_FillRect(screen, 0, 0);
Render(screen); Render(screen);
SDL_Flip(screen); SDL_Flip(screen);
SDL_Delay(10);
} }
//------------------------- //-------------------------
+1
View File
@@ -17,6 +17,7 @@ tiles = {
--custom generation systems here --custom generation systems here
function islandGenerator(region) function islandGenerator(region)
io.write("Generating (", Region.GetX(region), ", ", Region.GetY(region), ")\n")
for i = 1, Region.GetWidth(region) do for i = 1, Region.GetWidth(region) do
for j = 1, Region.GetHeight(region) do for j = 1, Region.GetHeight(region) do
local dist = math.dist(0, 0, i + Region.GetX(region) -1, j + Region.GetY(region) -1) local dist = math.dist(0, 0, i + Region.GetX(region) -1, j + Region.GetY(region) -1)
+1 -1
View File
@@ -51,7 +51,7 @@ private:
friend Singleton<AccountManager>; friend Singleton<AccountManager>;
AccountManager() = default; AccountManager() = default;
~AccountManager() { UnloadAll(); }; ~AccountManager() = default;
std::map<int, AccountData> accountMap; std::map<int, AccountData> accountMap;
sqlite3* database = nullptr; sqlite3* database = nullptr;
+1 -1
View File
@@ -54,7 +54,7 @@ private:
friend Singleton<CharacterManager>; friend Singleton<CharacterManager>;
CharacterManager() = default; CharacterManager() = default;
~CharacterManager() { UnloadAll(); }; ~CharacterManager() = default;
std::map<int, CharacterData> characterMap; std::map<int, CharacterData> characterMap;
sqlite3* database = nullptr; sqlite3* database = nullptr;
+1 -1
View File
@@ -150,7 +150,7 @@ void ServerApplication::Proc() {
//give the computer a break //give the computer a break
SDL_Delay(10); SDL_Delay(10);
} }
delete packetBuffer; delete reinterpret_cast<char*>(packetBuffer);
} }
void ServerApplication::Quit() { void ServerApplication::Quit() {