Updated project files to use the same compiler flags and features on Windows/Linux builds

Also updated C++ standard from C++14 to C++20
This commit is contained in:
Coruja 2026-07-13 06:30:42 -03:00
parent a859b03259
commit 18b75d6f72
No known key found for this signature in database
3 changed files with 243 additions and 217 deletions

View file

@ -34,13 +34,14 @@
<ItemDefinitionGroup>
<ClCompile>
<ExceptionHandling>Async</ExceptionHandling>
<FloatingPointModel>Precise</FloatingPointModel>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<WarningLevel>Level2</WarningLevel>
</ClCompile>
<Link>
<AdditionalDependencies>libmysql.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>src\common\mysql\lib\x64</AdditionalLibraryDirectories>
<LanguageStandard>stdcpp14</LanguageStandard>
<LanguageStandard>stdcpp20</LanguageStandard>
<SubSystem>Windows</SubSystem>
</Link>
<PreBuildEvent>
@ -59,8 +60,8 @@ git rev-parse --is-inside-work-tree &gt;nul 2&gt;&amp;1 &amp;&amp; (
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<CallingConvention>StdCall</CallingConvention>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<EnableCOMDATFolding>false</EnableCOMDATFolding>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@ -75,7 +76,8 @@ git rev-parse --is-inside-work-tree &gt;nul 2&gt;&amp;1 &amp;&amp; (
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Nightly'">
<ClCompile>
<CallingConvention>FastCall</CallingConvention>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>_NIGHTLYBUILD;_THREAD_TRACK_CALLSTACK;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WholeProgramOptimization>true</WholeProgramOptimization>
</ClCompile>
@ -89,7 +91,8 @@ git rev-parse --is-inside-work-tree &gt;nul 2&gt;&amp;1 &amp;&amp; (
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<CallingConvention>FastCall</CallingConvention>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>_THREAD_TRACK_CALLSTACK;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WholeProgramOptimization>true</WholeProgramOptimization>
</ClCompile>
@ -102,22 +105,53 @@ git rev-parse --is-inside-work-tree &gt;nul 2&gt;&amp;1 &amp;&amp; (
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="src\common\CArray.cpp" />
<ClCompile Include="src\common\CAssoc.cpp" />
<ClCompile Include="src\common\CCacheableScriptFile.cpp" />
<ClCompile Include="src\common\CCSVFile.cpp" />
<ClCompile Include="src\common\CDataBase.cpp" />
<ClCompile Include="src\common\CEncrypt.cpp" />
<ClCompile Include="src\common\CException.cpp" />
<ClCompile Include="src\common\CExpression.cpp" />
<ClCompile Include="src\common\CFile.cpp" />
<ClCompile Include="src\common\CFileList.cpp" />
<ClCompile Include="src\common\CGrayData.cpp" />
<ClCompile Include="src\common\CGrayInst.cpp" />
<ClCompile Include="src\common\CGrayMap.cpp" />
<ClCompile Include="src\common\CListDefMap.cpp" />
<ClCompile Include="src\common\CMD5.cpp" />
<ClCompile Include="src\common\CQueue.cpp" />
<ClCompile Include="src\common\CRect.cpp" />
<ClCompile Include="src\common\CRegion.cpp" />
<ClCompile Include="src\common\CResourceBase.cpp" />
<ClCompile Include="src\common\CScript.cpp" />
<ClCompile Include="src\common\CScriptObj.cpp" />
<ClCompile Include="src\common\CSectorTemplate.cpp" />
<ClCompile Include="src\common\CSocket.cpp" />
<ClCompile Include="src\common\CString.cpp" />
<ClCompile Include="src\common\CTime.cpp" />
<ClCompile Include="src\common\CVarDefMap.cpp" />
<ClCompile Include="src\common\CVarFloat.cpp" />
<ClCompile Include="src\common\CWindow.cpp" />
<ClCompile Include="src\common\graycom.cpp" />
<ClCompile Include="src\common\sqlite\SQLite.cpp" />
<ClCompile Include="src\common\sqlite\sqlite3.c" />
<ClCompile Include="src\network\network.cpp" />
<ClCompile Include="src\network\packet.cpp" />
<ClCompile Include="src\network\receive.cpp" />
<ClCompile Include="src\network\send.cpp" />
<ClCompile Include="src\sphere\asyncdb.cpp" />
<ClCompile Include="src\sphere\linuxev.cpp" />
<ClCompile Include="src\sphere\mutex.cpp" />
<ClCompile Include="src\sphere\ProfileData.cpp" />
<ClCompile Include="src\sphere\strings.cpp" />
<ClCompile Include="src\sphere\threads.cpp" />
<ClCompile Include="src\common\twofish\twofish2.cpp" />
<ClCompile Include="src\common\zlib\adler32.c" />
<ClCompile Include="src\common\zlib\compress.c" />
<ClCompile Include="src\common\zlib\crc32.c" />
<ClCompile Include="src\common\zlib\deflate.c" />
<ClCompile Include="src\common\zlib\gzclose.c" />
<ClCompile Include="src\common\zlib\gzlib.c" />
<ClCompile Include="src\common\zlib\gzread.c" />
<ClCompile Include="src\common\zlib\gzwrite.c" />
<ClCompile Include="src\common\zlib\infback.c" />
<ClCompile Include="src\common\zlib\inffast.c" />
<ClCompile Include="src\common\zlib\inflate.c" />
<ClCompile Include="src\common\zlib\inftrees.c" />
<ClCompile Include="src\common\zlib\trees.c" />
<ClCompile Include="src\common\zlib\uncompr.c" />
<ClCompile Include="src\common\zlib\zutil.c" />
<ClCompile Include="src\graysvr\CAccount.cpp" />
<ClCompile Include="src\graysvr\CBase.cpp" />
<ClCompile Include="src\graysvr\CChar.cpp" />
@ -147,47 +181,6 @@ git rev-parse --is-inside-work-tree &gt;nul 2&gt;&amp;1 &amp;&amp; (
<ClCompile Include="src\graysvr\CItemMulti.cpp" />
<ClCompile Include="src\graysvr\CItemMultiCustom.cpp" />
<ClCompile Include="src\graysvr\CItemShip.cpp" />
<ClCompile Include="src\common\zlib\adler32.c" />
<ClCompile Include="src\common\zlib\compress.c" />
<ClCompile Include="src\common\zlib\crc32.c" />
<ClCompile Include="src\common\zlib\deflate.c" />
<ClCompile Include="src\common\zlib\gzclose.c" />
<ClCompile Include="src\common\zlib\gzlib.c" />
<ClCompile Include="src\common\zlib\gzread.c" />
<ClCompile Include="src\common\zlib\gzwrite.c" />
<ClCompile Include="src\common\zlib\infback.c" />
<ClCompile Include="src\common\zlib\inffast.c" />
<ClCompile Include="src\common\zlib\inflate.c" />
<ClCompile Include="src\common\zlib\inftrees.c" />
<ClCompile Include="src\common\zlib\trees.c" />
<ClCompile Include="src\common\zlib\uncompr.c" />
<ClCompile Include="src\common\zlib\zutil.c" />
<ClCompile Include="src\common\twofish\twofish2.cpp" />
<ClCompile Include="src\common\CArray.cpp" />
<ClCompile Include="src\common\CAssoc.cpp" />
<ClCompile Include="src\common\CDataBase.cpp" />
<ClCompile Include="src\common\CException.cpp" />
<ClCompile Include="src\common\CExpression.cpp" />
<ClCompile Include="src\common\CFile.cpp" />
<ClCompile Include="src\common\CFileList.cpp" />
<ClCompile Include="src\common\CGrayData.cpp" />
<ClCompile Include="src\common\CGrayInst.cpp" />
<ClCompile Include="src\common\CGrayMap.cpp" />
<ClCompile Include="src\common\CListDefMap.cpp" />
<ClCompile Include="src\common\CMD5.cpp" />
<ClCompile Include="src\common\CQueue.cpp" />
<ClCompile Include="src\common\CRect.cpp" />
<ClCompile Include="src\common\CRegion.cpp" />
<ClCompile Include="src\common\CResourceBase.cpp" />
<ClCompile Include="src\common\CScript.cpp" />
<ClCompile Include="src\common\CScriptObj.cpp" />
<ClCompile Include="src\common\CSectorTemplate.cpp" />
<ClCompile Include="src\common\CSocket.cpp" />
<ClCompile Include="src\common\CString.cpp" />
<ClCompile Include="src\common\CTime.cpp" />
<ClCompile Include="src\common\CVarDefMap.cpp" />
<ClCompile Include="src\common\CWindow.cpp" />
<ClCompile Include="src\common\graycom.cpp" />
<ClCompile Include="src\graysvr\CItemSpawn.cpp" />
<ClCompile Include="src\graysvr\CItemStone.cpp" />
<ClCompile Include="src\graysvr\CItemVend.cpp" />
@ -209,26 +202,70 @@ git rev-parse --is-inside-work-tree &gt;nul 2&gt;&amp;1 &amp;&amp; (
<ClCompile Include="src\graysvr\CWorldImport.cpp" />
<ClCompile Include="src\graysvr\CWorldMap.cpp" />
<ClCompile Include="src\graysvr\graysvr.cpp" />
<ClCompile Include="src\network\network.cpp" />
<ClCompile Include="src\network\packet.cpp" />
<ClCompile Include="src\network\receive.cpp" />
<ClCompile Include="src\network\send.cpp" />
<ClCompile Include="src\sphere\asyncdb.cpp" />
<ClCompile Include="src\sphere\linuxev.cpp" />
<ClCompile Include="src\sphere\mutex.cpp" />
<ClCompile Include="src\sphere\ProfileData.cpp" />
<ClCompile Include="src\sphere\strings.cpp" />
<ClCompile Include="src\sphere\threads.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\common\CArray.h" />
<ClInclude Include="src\common\CAssoc.h" />
<ClInclude Include="src\common\CCacheableScriptFile.h" />
<ClInclude Include="src\common\CCSVFile.h" />
<ClInclude Include="src\common\CDataBase.h" />
<ClInclude Include="src\common\CEncrypt.h" />
<ClInclude Include="src\common\CException.h" />
<ClInclude Include="src\common\CExpression.h" />
<ClInclude Include="src\common\CFile.h" />
<ClInclude Include="src\common\CFileList.h" />
<ClInclude Include="src\common\CGrayInst.h" />
<ClInclude Include="src\common\CGrayMap.h" />
<ClInclude Include="src\common\CListDefMap.h" />
<ClInclude Include="src\common\CMD5.h" />
<ClInclude Include="src\common\CMemBlock.h" />
<ClInclude Include="src\common\CQueue.h" />
<ClInclude Include="src\common\CRect.h" />
<ClInclude Include="src\common\CRegion.h" />
<ClInclude Include="src\common\CResourceBase.h" />
<ClInclude Include="src\common\CScript.h" />
<ClInclude Include="src\common\CScriptObj.h" />
<ClInclude Include="src\common\CSectorTemplate.h" />
<ClInclude Include="src\common\CSocket.h" />
<ClInclude Include="src\common\CString.h" />
<ClInclude Include="src\common\CTime.h" />
<ClInclude Include="src\common\CVarDefMap.h" />
<ClInclude Include="src\common\CVarFloat.h" />
<ClInclude Include="src\common\CWindow.h" />
<ClInclude Include="src\common\graycom.h" />
<ClInclude Include="src\common\graymul.h" />
<ClInclude Include="src\common\grayproto.h" />
<ClInclude Include="src\common\grayver.h" />
<ClInclude Include="src\common\os_common.h" />
<ClInclude Include="src\common\os_unix.h" />
<ClInclude Include="src\common\os_windows.h" />
<ClInclude Include="src\common\sqlite\SQLite.h" />
<ClInclude Include="src\common\sqlite\sqlite3.h" />
<ClInclude Include="src\common\twofish\aes.h" />
<ClInclude Include="src\common\twofish\debug.h" />
<ClInclude Include="src\common\twofish\platform.h" />
<ClInclude Include="src\common\twofish\table.h" />
<ClInclude Include="src\common\zlib\crc32.h" />
<ClInclude Include="src\common\zlib\deflate.h" />
<ClInclude Include="src\common\zlib\gzguts.h" />
<ClInclude Include="src\network\network.h" />
<ClInclude Include="src\network\packet.h" />
<ClInclude Include="src\network\receive.h" />
<ClInclude Include="src\network\send.h" />
<ClInclude Include="src\sphere\asyncdb.h" />
<ClInclude Include="src\sphere\containers.h" />
<ClInclude Include="src\sphere\linuxev.h" />
<ClInclude Include="src\sphere\mutex.h" />
<ClInclude Include="src\sphere\ProfileData.h" />
<ClInclude Include="src\sphere\strings.h" />
<ClInclude Include="src\sphere\threads.h" />
<ClInclude Include="src\common\zlib\inffast.h" />
<ClInclude Include="src\common\zlib\inffixed.h" />
<ClInclude Include="src\common\zlib\inflate.h" />
<ClInclude Include="src\common\zlib\inftrees.h" />
<ClInclude Include="src\common\zlib\trees.h" />
<ClInclude Include="src\common\zlib\zconf.h" />
<ClInclude Include="src\common\zlib\zlib.h" />
<ClInclude Include="src\common\zlib\zutil.h" />
<ClInclude Include="src\graysvr\CAccount.h" />
<ClInclude Include="src\graysvr\CBase.h" />
<ClInclude Include="src\graysvr\CChar.h" />
@ -256,68 +293,38 @@ git rev-parse --is-inside-work-tree &gt;nul 2&gt;&amp;1 &amp;&amp; (
<ClInclude Include="src\graysvr\CWebPage.h" />
<ClInclude Include="src\graysvr\CWorld.h" />
<ClInclude Include="src\graysvr\graysvr.h" />
<ClInclude Include="src\common\zlib\crc32.h" />
<ClInclude Include="src\common\zlib\deflate.h" />
<ClInclude Include="src\common\zlib\inffast.h" />
<ClInclude Include="src\common\zlib\inffixed.h" />
<ClInclude Include="src\common\zlib\inflate.h" />
<ClInclude Include="src\common\zlib\inftrees.h" />
<ClInclude Include="src\common\zlib\trees.h" />
<ClInclude Include="src\common\zlib\zconf.h" />
<ClInclude Include="src\common\zlib\zlib.h" />
<ClInclude Include="src\common\zlib\zutil.h" />
<ClInclude Include="src\common\twofish\aes.h" />
<ClInclude Include="src\common\twofish\debug.h" />
<ClInclude Include="src\common\twofish\platform.h" />
<ClInclude Include="src\common\twofish\table.h" />
<ClInclude Include="src\common\CArray.h" />
<ClInclude Include="src\common\CAssoc.h" />
<ClInclude Include="src\common\CDataBase.h" />
<ClInclude Include="src\common\CException.h" />
<ClInclude Include="src\common\CExpression.h" />
<ClInclude Include="src\common\CFile.h" />
<ClInclude Include="src\common\CFileList.h" />
<ClInclude Include="src\common\CGrayInst.h" />
<ClInclude Include="src\common\CGrayMap.h" />
<ClInclude Include="src\common\CListDefMap.h" />
<ClInclude Include="src\common\CMemBlock.h" />
<ClInclude Include="src\common\CQueue.h" />
<ClInclude Include="src\common\CRect.h" />
<ClInclude Include="src\common\CRegion.h" />
<ClInclude Include="src\common\CResourceBase.h" />
<ClInclude Include="src\common\CScript.h" />
<ClInclude Include="src\common\CScriptObj.h" />
<ClInclude Include="src\common\CSectorTemplate.h" />
<ClInclude Include="src\common\CSocket.h" />
<ClInclude Include="src\common\CString.h" />
<ClInclude Include="src\common\CTime.h" />
<ClInclude Include="src\common\CVarDefMap.h" />
<ClInclude Include="src\common\graycom.h" />
<ClInclude Include="src\common\graymul.h" />
<ClInclude Include="src\common\grayproto.h" />
<ClInclude Include="src\common\grayver.h" />
<ClInclude Include="src\common\os_common.h" />
<ClInclude Include="src\common\os_unix.h" />
<ClInclude Include="src\common\os_windows.h" />
<ClInclude Include="src\graysvr\resource.h" />
<ClInclude Include="src\network\network.h" />
<ClInclude Include="src\network\packet.h" />
<ClInclude Include="src\network\receive.h" />
<ClInclude Include="src\network\send.h" />
<ClInclude Include="src\sphere\asyncdb.h" />
<ClInclude Include="src\sphere\containers.h" />
<ClInclude Include="src\sphere\linuxev.h" />
<ClInclude Include="src\sphere\mutex.h" />
<ClInclude Include="src\sphere\ProfileData.h" />
<ClInclude Include="src\sphere\strings.h" />
<ClInclude Include="src\sphere\threads.h" />
</ItemGroup>
<ItemGroup>
<None Include="src\tables\CBaseBaseDef_props.tbl" />
<None Include="src\tables\CChar_functions.tbl" />
<None Include="src\tables\CChar_props.tbl" />
<None Include="src\tables\CCharBase_props.tbl" />
<None Include="src\tables\CCharNpc_props.tbl" />
<None Include="src\tables\CCharPlayer_functions.tbl" />
<None Include="src\tables\CCharPlayer_props.tbl" />
<None Include="src\tables\CChar_functions.tbl" />
<None Include="src\tables\CChar_props.tbl" />
<None Include="src\tables\CClient_functions.tbl" />
<None Include="src\tables\CClient_props.tbl" />
<None Include="src\tables\CFileObjContainer_functions.tbl" />
<None Include="src\tables\CFileObjContainer_props.tbl" />
<None Include="src\tables\CFile_functions.tbl" />
<None Include="src\tables\CFile_props.tbl" />
<None Include="src\tables\CFileObjContainer_functions.tbl" />
<None Include="src\tables\CFileObjContainer_props.tbl" />
<None Include="src\tables\CItem_functions.tbl" />
<None Include="src\tables\CItem_props.tbl" />
<None Include="src\tables\CItemBase_props.tbl" />
<None Include="src\tables\CItemStone_functions.tbl" />
<None Include="src\tables\CItemStone_props.tbl" />
<None Include="src\tables\CItem_functions.tbl" />
<None Include="src\tables\CItem_props.tbl" />
<None Include="src\tables\classnames.tbl" />
<None Include="src\tables\CObjBase_functions.tbl" />
<None Include="src\tables\CObjBase_props.tbl" />
@ -329,9 +336,13 @@ git rev-parse --is-inside-work-tree &gt;nul 2&gt;&amp;1 &amp;&amp; (
<None Include="src\tables\CStoneMember_props.tbl" />
<None Include="src\tables\defmessages.tbl" />
<None Include="src\tables\triggers.tbl" />
</ItemGroup>
<ItemGroup>
<Text Include="changelog.txt" />
<Text Include="src\sphere.ini" />
<Text Include="src\sphereCrypt.ini" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="src\graysvr\SphereSvr.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

166
makefile
View file

@ -1,37 +1,103 @@
# GLOBAL SETTINGS
MAKEFLAGS := -j$(shell nproc)
TARGET := spheresvr
CXX := g++ -std=c++14
CXX := g++ -std=c++20
CC := gcc
# CODE GENERATION FLAGS
OVERALL_FLAGS := -pipe
OPTIMIZATION_FLAGS := -O2 -ffast-math -flto=auto -fno-omit-frame-pointer -fno-strict-aliasing
OPTIMIZATION_FLAGS := -O2 -flto=auto -fno-omit-frame-pointer -fno-strict-aliasing
DEBUG_FLAGS :=
CODE_GEN_FLAGS := -fexceptions -fnon-call-exceptions
ARCH_FLAGS := -m64 -Dx64
CPPFLAGS := -D_THREAD_TRACK_CALLSTACK
ifdef DEBUG
CPPFLAGS += -D_DEBUG
CPPFLAGS := -D_DEBUG
DEBUG_FLAGS += -ggdb3
else
CPPFLAGS := -D_THREAD_TRACK_CALLSTACK
endif
ifdef NIGHTLY
CPPFLAGS += -D_NIGHTLYBUILD
endif
WARN_CXXFLAGS := -Wall -Wno-aggressive-loop-optimizations -Wno-lto-type-mismatch -Wno-return-local-addr
WARN_CFLAGS := -Wall -Wno-implicit-function-declaration -Wno-misleading-indentation -Wno-unused-result
# C/C++ FLAGS
WARN_CXXFLAGS := -Wall -Wno-register
CXXFLAGS := $(OVERALL_FLAGS) $(OPTIMIZATION_FLAGS) $(DEBUG_FLAGS) $(CODE_GEN_FLAGS) $(ARCH_FLAGS) $(CPPFLAGS) $(WARN_CXXFLAGS)
WARN_CFLAGS := -Wall -Wno-implicit-function-declaration -Wno-misleading-indentation -Wno-unused-result
CFLAGS := $(OVERALL_FLAGS) $(OPTIMIZATION_FLAGS) $(DEBUG_FLAGS) $(CODE_GEN_FLAGS) $(ARCH_FLAGS) $(CPPFLAGS) $(WARN_CFLAGS)
LDLIBS := -lmysqlclient -lpthread -ldl
LDFLAGS := -pthread -L/usr/lib/mysql
# LINKER FLAGS
WARN_LDFLAGS := -Wno-aggressive-loop-optimizations -Wno-lto-type-mismatch -Wno-return-local-addr
LDFLAGS := -L/usr/lib/mysql -pthread $(OPTIMIZATION_FLAGS) $(CODE_GEN_FLAGS) $(ARCH_FLAGS) $(WARN_LDFLAGS)
ifndef DEBUG
LDFLAGS += -s
endif
SRC := ./src/graysvr/CAccount.cpp \
LDLIBS := -lmysqlclient -lpthread -ldl
# SOURCE FILES
SRC := ./src/common/CArray.cpp \
./src/common/CAssoc.cpp \
./src/common/CCacheableScriptFile.cpp \
./src/common/CCSVFile.cpp \
./src/common/CDataBase.cpp \
./src/common/CEncrypt.cpp \
./src/common/CException.cpp \
./src/common/CExpression.cpp \
./src/common/CFile.cpp \
./src/common/CFileList.cpp \
./src/common/CGrayData.cpp \
./src/common/CGrayInst.cpp \
./src/common/CGrayMap.cpp \
./src/common/CListDefMap.cpp \
./src/common/CMD5.cpp \
./src/common/CQueue.cpp \
./src/common/CRect.cpp \
./src/common/CRegion.cpp \
./src/common/CResourceBase.cpp \
./src/common/CScript.cpp \
./src/common/CScriptObj.cpp \
./src/common/CSectorTemplate.cpp \
./src/common/CSocket.cpp \
./src/common/CString.cpp \
./src/common/CTime.cpp \
./src/common/CVarDefMap.cpp \
./src/common/CVarFloat.cpp \
./src/common/graycom.cpp \
./src/common/libev/wrapper_ev.c \
./src/common/sqlite/SQLite.cpp \
./src/common/sqlite/sqlite3.c \
./src/common/twofish/twofish2.cpp \
./src/common/zlib/adler32.c \
./src/common/zlib/compress.c \
./src/common/zlib/crc32.c \
./src/common/zlib/deflate.c \
./src/common/zlib/gzclose.c \
./src/common/zlib/gzlib.c \
./src/common/zlib/gzread.c \
./src/common/zlib/gzwrite.c \
./src/common/zlib/infback.c \
./src/common/zlib/inffast.c \
./src/common/zlib/inflate.c \
./src/common/zlib/inftrees.c \
./src/common/zlib/trees.c \
./src/common/zlib/uncompr.c \
./src/common/zlib/zutil.c \
./src/graysvr/CAccount.cpp \
./src/graysvr/CBase.cpp \
./src/graysvr/CChar.cpp \
./src/graysvr/CCharAct.cpp \
@ -80,68 +146,26 @@ SRC := ./src/graysvr/CAccount.cpp \
./src/graysvr/CWorldImport.cpp \
./src/graysvr/CWorldMap.cpp \
./src/graysvr/graysvr.cpp \
./src/common/twofish/twofish2.cpp \
./src/common/libev/wrapper_ev.c \
./src/common/zlib/adler32.c \
./src/common/zlib/compress.c \
./src/common/zlib/crc32.c \
./src/common/zlib/deflate.c \
./src/common/zlib/gzclose.c \
./src/common/zlib/gzlib.c \
./src/common/zlib/gzread.c \
./src/common/zlib/gzwrite.c \
./src/common/zlib/infback.c \
./src/common/zlib/inffast.c \
./src/common/zlib/inflate.c \
./src/common/zlib/inftrees.c \
./src/common/zlib/trees.c \
./src/common/zlib/uncompr.c \
./src/common/zlib/zutil.c \
./src/common/CArray.cpp \
./src/common/CAssoc.cpp \
./src/common/CCacheableScriptFile.cpp \
./src/common/CCSVFile.cpp \
./src/common/CDataBase.cpp \
./src/common/CEncrypt.cpp \
./src/common/CExpression.cpp \
./src/common/CException.cpp \
./src/common/CFile.cpp \
./src/common/CFileList.cpp \
./src/common/CGrayData.cpp \
./src/common/CGrayInst.cpp \
./src/common/CGrayMap.cpp \
./src/common/CListDefMap.cpp \
./src/common/CMD5.cpp \
./src/common/CQueue.cpp \
./src/common/CRect.cpp \
./src/common/CRegion.cpp \
./src/common/CResourceBase.cpp \
./src/common/CScript.cpp \
./src/common/CScriptObj.cpp \
./src/common/CSectorTemplate.cpp \
./src/common/CSocket.cpp \
./src/common/CTime.cpp \
./src/common/CString.cpp \
./src/common/CVarDefMap.cpp \
./src/common/CVarFloat.cpp \
./src/common/graycom.cpp \
./src/common/sqlite/SQLite.cpp \
./src/common/sqlite/sqlite3.c \
./src/sphere/mutex.cpp \
./src/sphere/strings.cpp \
./src/sphere/threads.cpp \
./src/sphere/linuxev.cpp \
./src/sphere/asyncdb.cpp \
./src/sphere/ProfileData.cpp \
./src/network/network.cpp \
./src/network/packet.cpp \
./src/network/receive.cpp \
./src/network/send.cpp \
./src/network/receive.cpp
./src/sphere/asyncdb.cpp \
./src/sphere/linuxev.cpp \
./src/sphere/mutex.cpp \
./src/sphere/ProfileData.cpp \
./src/sphere/strings.cpp \
./src/sphere/threads.cpp
# OBJECT FILES
OBJS := $(patsubst %.cpp,%.o,$(filter %.cpp,$(SRC))) \
$(patsubst %.c,%.o,$(filter %.c,$(SRC)))
# BUILD RULES
.PHONY: all clean flags version
all: $(TARGET)
@ -151,13 +175,21 @@ clean:
@find . -name "*.o" -type f -delete
flags:
@echo 'Compiler flags: $(CXX) $(CXXFLAGS)'
@echo 'C++ compiler: $(CXX)'
@echo 'C++ flags: $(CXXFLAGS)'
@echo ''
@echo 'C compiler: $(CC)'
@echo 'C flags: $(CFLAGS)'
@echo ''
@echo 'Linker flags: $(LDFLAGS)'
@echo 'Linker libs: $(LDLIBS)'
@echo ''
version: flags
@VERSIONING_FILE="./src/common/version.h"; \
echo "// This file is auto-generated by compiler pre-build event. Do not edit." > "$${VERSIONING_FILE}"; \
if [ "$$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then \
GIT_COMMIT_COUNT=$$(expr $$(git rev-list --count HEAD) - 2406); \
GIT_COMMIT_COUNT=$$(( $$(git rev-list --count HEAD) - 2406 )); \
GIT_COMMIT_HASH=$$(git rev-parse --short HEAD); \
echo "#define GIT_COMMIT_COUNT $${GIT_COMMIT_COUNT}" >> "$${VERSIONING_FILE}"; \
echo "#define GIT_COMMIT_HASH \"$${GIT_COMMIT_HASH}\"" >> "$${VERSIONING_FILE}"; \
@ -169,8 +201,8 @@ version: flags
$(OBJS): version
$(TARGET): $(OBJS)
@$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LDLIBS)
@echo ' $(lastword $(MAKEFILE_LIST)) -> $(shell readlink -f $(TARGET))'
@$(CXX) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
@echo ' $(lastword $(MAKEFILE_LIST)) -> $(shell readlink -f $@)'
%.o: %.cpp
@echo ' $(notdir $<)'

View file

@ -211,12 +211,7 @@ void CNTWindow::List_Add( COLORREF color, LPCTSTR pszText )
// If the select is on screen then keep scrolling.
if ( ! m_fLogScrollLock && ! GetCapture())
{
if ( GRAY_GetOSInfo()->dwPlatformId == VER_PLATFORM_WIN32_NT )
{
m_wndLog.Scroll();
}
}
m_wndLog.Scroll();
}
bool CNTWindow::RegisterClass(char *className) // static
@ -282,18 +277,15 @@ int CNTWindow::OnCreate( HWND hWnd, LPCREATESTRUCT lParam )
(HMENU)(UINT) IDC_M_INPUT, theApp.m_hInstance, NULL );
ASSERT( m_wndInput.m_hWnd );
if ( GRAY_GetOSInfo()->dwPlatformId > VER_PLATFORM_WIN32s )
{
memset(&pnid,0,sizeof(pnid));
pnid.cbSize = sizeof(NOTIFYICONDATA);
pnid.hWnd = m_hWnd;
pnid.uFlags = NIF_TIP | NIF_ICON | NIF_MESSAGE;
pnid.uCallbackMessage = WM_USER_TRAY_NOTIFY;
pnid.hIcon = theApp.LoadIcon( IDR_MAINFRAME );
strncpy(pnid.szTip, theApp.m_pszAppName, sizeof(pnid.szTip));
pnid.szTip[sizeof(pnid.szTip) - 1] = '\0';
Shell_NotifyIcon(NIM_ADD, &pnid);
}
memset(&pnid,0,sizeof(pnid));
pnid.cbSize = sizeof(NOTIFYICONDATA);
pnid.hWnd = m_hWnd;
pnid.uFlags = NIF_TIP | NIF_ICON | NIF_MESSAGE;
pnid.uCallbackMessage = WM_USER_TRAY_NOTIFY;
pnid.hIcon = theApp.LoadIcon(IDR_MAINFRAME);
strncpy(pnid.szTip, theApp.m_pszAppName, sizeof(pnid.szTip));
pnid.szTip[sizeof(pnid.szTip) - 1] = '\0';
Shell_NotifyIcon(NIM_ADD, &pnid);
NTWindow_SetWindowTitle();
@ -505,11 +497,8 @@ bool CNTWindow::OnSysCommand( WPARAM uCmdType, int xPos, int yPos )
switch ( uCmdType )
{
case SC_MINIMIZE:
if ( GRAY_GetOSInfo()->dwPlatformId > VER_PLATFORM_WIN32s )
{
ShowWindow(SW_HIDE);
return( true );
}
ShowWindow(SW_HIDE);
return true;
break;
}
return( false );
@ -782,11 +771,8 @@ bool NTWindow_Init(HINSTANCE hInstance, int nCmdShow)
void NTWindow_DeleteIcon()
{
if ( GRAY_GetOSInfo()->dwPlatformId > VER_PLATFORM_WIN32s )
{
theApp.m_wndMain.pnid.uFlags = 0;
Shell_NotifyIcon(NIM_DELETE, &theApp.m_wndMain.pnid);
}
theApp.m_wndMain.pnid.uFlags = 0;
Shell_NotifyIcon(NIM_DELETE, &theApp.m_wndMain.pnid);
}
void NTWindow_Exit()
@ -843,13 +829,10 @@ void NTWindow_SetWindowTitle( LPCTSTR pszText )
snprintf(szTitle, sizeof(szTitle), "%s - %s (%s) %s", theApp.m_pszAppName, g_Serv.GetName(), pszMode, pszText ? pszText : "");
theApp.m_wndMain.SetWindowText(szTitle);
if ( GRAY_GetOSInfo()->dwPlatformId > VER_PLATFORM_WIN32s )
{
theApp.m_wndMain.pnid.uFlags = NIF_TIP;
strncpy(theApp.m_wndMain.pnid.szTip, szTitle, sizeof(theApp.m_wndMain.pnid.szTip));
theApp.m_wndMain.pnid.szTip[sizeof(theApp.m_wndMain.pnid.szTip) - 1] = '\0';
Shell_NotifyIcon(NIM_MODIFY, &theApp.m_wndMain.pnid);
}
theApp.m_wndMain.pnid.uFlags = NIF_TIP;
strncpy(theApp.m_wndMain.pnid.szTip, szTitle, sizeof(theApp.m_wndMain.pnid.szTip));
theApp.m_wndMain.pnid.szTip[sizeof(theApp.m_wndMain.pnid.szTip) - 1] = '\0';
Shell_NotifyIcon(NIM_MODIFY, &theApp.m_wndMain.pnid);
}
bool NTWindow_PostMsgColor( COLORREF color )