From 530a5aad80f182f7e8dc3e006f9a0666823d7c41 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 13 May 2007 04:43:52 +0000 Subject: [PATCH] fixed various linux compilation problems added menus to the makefile --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40784 --- core/Makefile | 2 +- core/MenuManager.cpp | 1 - core/MenuStyle_Base.cpp | 4 ++-- core/MenuStyle_Base.h | 4 ++-- core/MenuStyle_Valve.cpp | 8 ++++---- core/sm_fastlink.h | 2 +- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/core/Makefile b/core/Makefile index fc813335..a25efdd0 100644 --- a/core/Makefile +++ b/core/Makefile @@ -23,7 +23,7 @@ OBJECTS = AdminCache.cpp CDataPack.cpp ConCmdManager.cpp ConVarManager.cpp CoreC Database.cpp DebugReporter.cpp EventManager.cpp GameConfigs.cpp HalfLife2.cpp Logger.cpp \ MemoryUtils.cpp PlayerManager.cpp TextParsers.cpp TimerSys.cpp Translator.cpp UserMessages.cpp \ sm_autonatives.cpp sm_memtable.cpp sm_srvcmds.cpp sm_stringutil.cpp sm_trie.cpp \ - sourcemm_api.cpp sourcemod.cpp + sourcemm_api.cpp sourcemod.cpp MenuStyle_Base.cpp MenuStyle_Valve.cpp MenuManager.cpp OBJECTS += smn_admin.cpp smn_bitbuffer.cpp smn_console.cpp smn_core.cpp \ smn_datapacks.cpp smn_entities.cpp smn_events.cpp smn_fakenatives.cpp \ smn_filesystem.cpp smn_float.cpp smn_functions.cpp smn_gameconfigs.cpp smn_halflife.cpp smn_handles.cpp smn_keyvalues.cpp \ diff --git a/core/MenuManager.cpp b/core/MenuManager.cpp index 7d9b102e..70657d59 100644 --- a/core/MenuManager.cpp +++ b/core/MenuManager.cpp @@ -513,7 +513,6 @@ skip_search: if (exitButton || (displayNext || displayPrev)) { /* Add spacers so we can pad to the end */ - unsigned int null_pos = 0; for (unsigned int i=0; iDrawItem(padItem); diff --git a/core/MenuStyle_Base.cpp b/core/MenuStyle_Base.cpp index 976d5dd4..8731b13e 100644 --- a/core/MenuStyle_Base.cpp +++ b/core/MenuStyle_Base.cpp @@ -421,7 +421,7 @@ CBaseMenu::~CBaseMenu() bool CBaseMenu::AppendItem(const char *info, const ItemDrawInfo &draw) { - if (m_Pagination == MENU_NO_PAGINATION + if (m_Pagination == (unsigned)MENU_NO_PAGINATION && m_items.size() >= m_pStyle->GetMaxPageItems()) { return false; @@ -444,7 +444,7 @@ bool CBaseMenu::AppendItem(const char *info, const ItemDrawInfo &draw) bool CBaseMenu::InsertItem(unsigned int position, const char *info, const ItemDrawInfo &draw) { - if (m_Pagination == MENU_NO_PAGINATION + if (m_Pagination == (unsigned)MENU_NO_PAGINATION && m_items.size() >= m_pStyle->GetMaxPageItems()) { return false; diff --git a/core/MenuStyle_Base.h b/core/MenuStyle_Base.h index cff8bd73..600333ff 100644 --- a/core/MenuStyle_Base.h +++ b/core/MenuStyle_Base.h @@ -111,12 +111,12 @@ public: protected: String m_Title; IMenuStyle *m_pStyle; + BaseStringTable m_Strings; unsigned int m_Pagination; CVector m_items; - BaseStringTable m_Strings; bool m_ExitButton; - bool m_bCancelling; bool m_bShouldDelete; + bool m_bCancelling; }; #endif //_INCLUDE_MENUSTYLE_BASE_H diff --git a/core/MenuStyle_Valve.cpp b/core/MenuStyle_Valve.cpp index fb1e6e04..2d052234 100644 --- a/core/MenuStyle_Valve.cpp +++ b/core/MenuStyle_Valve.cpp @@ -22,8 +22,8 @@ SH_DECL_HOOK4_void(IServerPluginHelpers, CreateMessage, SH_NOATTRIB, false, edict_t *, DIALOG_TYPE, KeyValues *, IServerPluginCallbacks *); ValveMenuStyle g_ValveMenuStyle; -const char *g_OptionNumTable[]; -const char *g_OptionCmdTable[]; +extern const char *g_OptionNumTable[]; +extern const char *g_OptionCmdTable[]; IServerPluginCallbacks *g_pVSPHandle = NULL; CallClass *g_pSPHCC = NULL; @@ -378,12 +378,12 @@ bool CValveMenu::SetExitButton(bool set) return false; } -static const char *g_OptionNumTable[11] = +const char *g_OptionNumTable[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }; -static const char *g_OptionCmdTable[11] = +const char *g_OptionCmdTable[] = { "sm_vmenuselect 0", /* INVALID! */ "sm_vmenuselect 1", diff --git a/core/sm_fastlink.h b/core/sm_fastlink.h index bc204558..3de9526a 100644 --- a/core/sm_fastlink.h +++ b/core/sm_fastlink.h @@ -183,8 +183,8 @@ public: private: size_t m_Size; unsigned int m_FirstLink; - unsigned int m_LastLink; unsigned int m_FreeNodes; + unsigned int m_LastLink; unsigned int m_MaxSize; FastLinkNode *m_Nodes; };