From: Thomas Debesse Date: Tue, 18 Jun 2019 21:38:06 +0000 (+0000) Subject: Merge branch 'quake2' into 'master' X-Git-Url: http://de.git.xonotic.org/?a=commitdiff_plain;h=3f73d11e873690677967faf486b12e9ea20344cb;hp=b93e4301658d8788d90a627de5c685871d146a4f;p=xonotic%2Fnetradiant.git Merge branch 'quake2' into 'master' cmake: building quake2 and heretic2 tools to be on par with legacy makefile See merge request xonotic/netradiant!134 --- diff --git a/icons/h2data.ico b/icons/h2data.ico index 8f441941..cc465b8f 100644 Binary files a/icons/h2data.ico and b/icons/h2data.ico differ diff --git a/icons/h2data.xcf b/icons/h2data.xcf new file mode 100644 index 00000000..90bb0939 Binary files /dev/null and b/icons/h2data.xcf differ diff --git a/icons/q2map.ico b/icons/q2map.ico index 5c508c91..fdbefc29 100644 Binary files a/icons/q2map.ico and b/icons/q2map.ico differ diff --git a/icons/q3data.ico b/icons/q3data.ico index 8f441941..cc4f2d3f 100644 Binary files a/icons/q3data.ico and b/icons/q3data.ico differ diff --git a/icons/q3data.xcf b/icons/q3data.xcf new file mode 100644 index 00000000..90973846 Binary files /dev/null and b/icons/q3data.xcf differ diff --git a/icons/q3map2.ico b/icons/q3map2.ico index 4fe56fa6..52758dc4 100644 Binary files a/icons/q3map2.ico and b/icons/q3map2.ico differ diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 4c2c5d28..b36bb6cf 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,6 +1,8 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}") +add_subdirectory(quake2) +add_subdirectory(quake2/qdata_heretic2) add_subdirectory(quake3) add_custom_target(tools) -add_dependencies(tools quake3) +add_dependencies(tools quake2 heretic2 quake3) diff --git a/tools/quake2/CMakeLists.txt b/tools/quake2/CMakeLists.txt new file mode 100644 index 00000000..6945ee67 --- /dev/null +++ b/tools/quake2/CMakeLists.txt @@ -0,0 +1,99 @@ +include_directories(BEFORE common) + +find_package(LibXml2 REQUIRED) +include_directories(${LIBXML2_INCLUDE_DIR}) + +radiant_tool(q2map + WIN32 q2map/q2map.rc + + common/bspfile.c common/bspfile.h + common/cmdlib.c common/cmdlib.h + common/inout.c common/inout.h + common/l3dslib.c common/l3dslib.h + common/lbmlib.c common/lbmlib.h + common/mathlib.c common/mathlib.h + common/md4.c common/md4.h + common/path_init.c + common/qfiles.h + common/polylib.c common/polylib.h + common/scriplib.c common/scriplib.h + common/threads.c common/q2_threads.h + common/trilib.c common/trilib.h + + q2map/brushbsp.c + q2map/csg.c + q2map/faces.c + q2map/flow.c +# q2map/gldraw.c + q2map/glfile.c + q2map/leakfile.c + q2map/lightmap.c + q2map/main.c q2map/q2map.h + q2map/map.c + q2map/nodraw.c + q2map/patches.c + q2map/portals.c + q2map/prtfile.c + q2map/qbsp.c + q2map/qbsp.h + q2map/qrad.c + q2map/qrad.h + q2map/qvis.c + q2map/qvis.h + q2map/textures.c + q2map/trace.c + q2map/tree.c + q2map/writebsp.c +) + +target_compile_definitions(q2map + PRIVATE +) + +target_link_libraries(q2map + ${LIBXML2_LIBRARIES} + l_net +) + +radiant_tool(qdata3 + WIN32 qdata/qdata.rc + + common/bspfile.c common/bspfile.h + common/cmdlib.c common/cmdlib.h + common/inout.c common/inout.h + common/l3dslib.c common/l3dslib.h + common/lbmlib.c common/lbmlib.h + common/mathlib.c common/mathlib.h + common/md4.c common/md4.h + common/path_init.c + common/qfiles.h + common/polylib.c common/polylib.h + common/scriplib.c common/scriplib.h + common/threads.c common/q2_threads.h + common/trilib.c common/trilib.h + + qdata/anorms.h + qdata/images.c + qdata/models.c + qdata/qdata.c qdata/qdata.h + qdata/sprites.c + qdata/tables.c + qdata/video.c +) + +target_compile_definitions(qdata3 + PRIVATE +) + +target_link_libraries(qdata3 + ${LIBXML2_LIBRARIES} + l_net +) + +add_custom_target(quake2) +add_dependencies(quake2 q2map qdata3) + +if (UNIX) + target_link_libraries(q2map pthread m) + target_link_libraries(qdata3 pthread m) +endif () diff --git a/tools/quake2/q2map/q2map.rc b/tools/quake2/q2map/q2map.rc new file mode 100644 index 00000000..29e1dbd3 --- /dev/null +++ b/tools/quake2/q2map/q2map.rc @@ -0,0 +1 @@ +101 ICON DISCARDABLE "..\\..\\..\\icons\\q2map.ico" diff --git a/tools/quake2/qdata/qdata.rc b/tools/quake2/qdata/qdata.rc new file mode 100644 index 00000000..d6e75b93 --- /dev/null +++ b/tools/quake2/qdata/qdata.rc @@ -0,0 +1 @@ +101 ICON DISCARDABLE "..\\..\\..\\icons\\qdata3.ico" diff --git a/tools/quake2/qdata_heretic2/CMakeLists.txt b/tools/quake2/qdata_heretic2/CMakeLists.txt new file mode 100644 index 00000000..aae46591 --- /dev/null +++ b/tools/quake2/qdata_heretic2/CMakeLists.txt @@ -0,0 +1,73 @@ +include_directories(BEFORE . common qcommon) + +find_package(OpenGL REQUIRED) + +find_package(LibXml2 REQUIRED) +include_directories(${LIBXML2_INCLUDE_DIR}) + +radiant_tool(h2data + WIN32 h2data.rc + + common/bspfile.c common/bspfile.h + common/cmdlib.c common/cmdlib.h + common/inout.c common/inout.h + common/l3dslib.c common/l3dslib.h + common/lbmlib.c common/lbmlib.h + common/mathlib.c common/mathlib.h + common/md4.c common/md4.h + common/path_init.c + common/polylib.c common/polylib.h + common/qfiles.c common/qfiles.h + common/scriplib.c common/scriplib.h + common/threads.c common/her2_threads.h + common/token.c common/token.h + common/trilib.c common/trilib.h + + qcommon/angles.h + qcommon/arrayedlist.h + qcommon/flex.h + qcommon/fmodel.h + qcommon/h2common.h + qcommon/placement.h + qcommon/qfiles.h + qcommon/q_typedef.h + qcommon/reference.c qcommon/reference.h + qcommon/resourcemanager.c qcommon/resourcemanager.h + qcommon/skeletons.c qcommon/skeletons.h + + adpcm.h + animcomp.c animcomp.h + anorms.h + book.c + fmodels.c qd_fmodel.h + images.c + jointed.c + jointed.h + joints.h + models.c + pics.c + qdata.c qdata.h + qd_skeletons.c qd_skeletons.h + resource.h + sprites.c + svdcmp.c + tables.c + tmix.c + video.c +) + +target_compile_definitions(h2data + PRIVATE +) + +target_link_libraries(h2data + ${LIBXML2_LIBRARIES} + l_net +) + +add_custom_target(heretic2) +add_dependencies(heretic2 h2data) + +if (UNIX) + target_link_libraries(h2data pthread m) +endif () diff --git a/tools/quake2/qdata_heretic2/common/threads.c b/tools/quake2/qdata_heretic2/common/threads.c index 5fe28940..239226b7 100644 --- a/tools/quake2/qdata_heretic2/common/threads.c +++ b/tools/quake2/qdata_heretic2/common/threads.c @@ -86,7 +86,7 @@ void ThreadWorkerFunction( int threadnum ){ if ( work == -1 ) { break; } -//Sys_Printf ("thread %i, work %i\n", threadnum, work); + //Sys_Printf ("thread %i, work %i\n", threadnum, work); workfunction( work ); } } @@ -112,7 +112,8 @@ void RunThreadsOnIndividual( int workcnt, qboolean showpacifier, void ( *func )( #include -int numthreads = -1; +// Setting default Threads to 1 +int numthreads = 1; CRITICAL_SECTION crit; static int enter; @@ -227,6 +228,7 @@ void ThreadSetDefault( void ){ } } + #include pthread_mutex_t *my_mutex; @@ -405,7 +407,8 @@ void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){ ======================================================================= */ -int numthreads = 4; +// Setting default Threads to 1 +int numthreads = 1; void ThreadSetDefault( void ){ if ( numthreads == -1 ) { // not set manually @@ -527,12 +530,9 @@ void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){ if ( pthread_mutexattr_init( &mattrib ) != 0 ) { Error( "pthread_mutexattr_init failed" ); } -#if __GLIBC_MINOR__ == 1 - if ( pthread_mutexattr_settype( &mattrib, PTHREAD_MUTEX_FAST_NP ) != 0 ) -#else - if ( pthread_mutexattr_settype( &mattrib, PTHREAD_MUTEX_ADAPTIVE_NP ) != 0 ) -#endif - { Error( "pthread_mutexattr_settype failed" ); } + if ( pthread_mutexattr_settype( &mattrib, PTHREAD_MUTEX_ERRORCHECK ) != 0 ) { + Error( "pthread_mutexattr_settype failed" ); + } recursive_mutex_init( mattrib ); for ( i = 0 ; i < numthreads ; i++ ) diff --git a/tools/quake2/qdata_heretic2/h2data.rc b/tools/quake2/qdata_heretic2/h2data.rc new file mode 100644 index 00000000..21540bc2 --- /dev/null +++ b/tools/quake2/qdata_heretic2/h2data.rc @@ -0,0 +1,115 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_ICON1 ICON DISCARDABLE "..\\..\\..\\icons\\h2data.ico" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "Heavily modified from original ID tool\0" + VALUE "CompanyName", "Raven Software\0" + VALUE "FileDescription", "qdata\0" + VALUE "FileVersion", "2.0\0" + VALUE "InternalName", "qdata\0" + VALUE "LegalCopyright", "Copyright © 1998\0" + VALUE "OriginalFilename", "qdata.exe\0" + VALUE "ProductName", "Raven Software qdata\0" + VALUE "ProductVersion", "2.0\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/tools/quake2/qdata_heretic2/icon1.ico b/tools/quake2/qdata_heretic2/icon1.ico deleted file mode 100644 index 8f441941..00000000 Binary files a/tools/quake2/qdata_heretic2/icon1.ico and /dev/null differ diff --git a/tools/quake2/qdata_heretic2/images.c b/tools/quake2/qdata_heretic2/images.c index a7138b11..555303bc 100644 --- a/tools/quake2/qdata_heretic2/images.c +++ b/tools/quake2/qdata_heretic2/images.c @@ -25,7 +25,11 @@ #include #endif +#if GDEF_OS_MACOS && !defined( XWINDOWS ) +#include +#else #include +#endif #if 1 extern char *g_outputDir; diff --git a/tools/quake2/qdata_heretic2/script1.aps b/tools/quake2/qdata_heretic2/script1.aps deleted file mode 100644 index 6650b67c..00000000 Binary files a/tools/quake2/qdata_heretic2/script1.aps and /dev/null differ diff --git a/tools/quake2/qdata_heretic2/script1.rc b/tools/quake2/qdata_heretic2/script1.rc deleted file mode 100644 index 7d053745..00000000 --- a/tools/quake2/qdata_heretic2/script1.rc +++ /dev/null @@ -1,115 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_ICON1 ICON DISCARDABLE "icon1.ico" - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "Heavily modified from original ID tool\0" - VALUE "CompanyName", "Raven Software\0" - VALUE "FileDescription", "qdata\0" - VALUE "FileVersion", "2.0\0" - VALUE "InternalName", "qdata\0" - VALUE "LegalCopyright", "Copyright © 1998\0" - VALUE "OriginalFilename", "qdata.exe\0" - VALUE "ProductName", "Raven Software qdata\0" - VALUE "ProductVersion", "2.0\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED -