forked from Mirrors/openclonk
Remove C4ENGINE define
Most files using it weren't used by c4group-the-application anymore, and the remaining stuff can be dealt with by using stubs or the same code in both cases.
parent
fd07c9e385
commit
ff8d950e85
|
@ -701,7 +701,7 @@ target_link_libraries(c4group
|
||||||
${ZLIB_LIBRARIES}
|
${ZLIB_LIBRARIES}
|
||||||
${OPENSSL_LIBRARIES}
|
${OPENSSL_LIBRARIES}
|
||||||
)
|
)
|
||||||
set_property(TARGET clonk APPEND PROPERTY COMPILE_DEFINITIONS C4ENGINE GLEW_STATIC)
|
set_property(TARGET clonk APPEND PROPERTY COMPILE_DEFINITIONS GLEW_STATIC)
|
||||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG _DEBUG)
|
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG _DEBUG)
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
|
@ -60,7 +60,6 @@ AM_CPPFLAGS = \
|
||||||
-I$(srcdir)/src/game/object \
|
-I$(srcdir)/src/game/object \
|
||||||
-I$(srcdir)/src/lib/texture \
|
-I$(srcdir)/src/lib/texture \
|
||||||
-I$(srcdir)/src/script \
|
-I$(srcdir)/src/script \
|
||||||
-DC4ENGINE \
|
|
||||||
$(GLEW_CFLAGS) $(GTK_CFLAGS) $(FREETYPE_CFLAGS) $(SDL_CFLAGS)
|
$(GLEW_CFLAGS) $(GTK_CFLAGS) $(FREETYPE_CFLAGS) $(SDL_CFLAGS)
|
||||||
|
|
||||||
#various hacks to get dependency tracking working with a precompiled C4Include
|
#various hacks to get dependency tracking working with a precompiled C4Include
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
C4ComponentHost *pCmpHost=NULL;
|
C4ComponentHost *pCmpHost=NULL;
|
||||||
|
|
||||||
#if defined(C4ENGINE) && defined(_WIN32)
|
#ifdef _WIN32
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
|
||||||
BOOL CALLBACK ComponentDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
|
BOOL CALLBACK ComponentDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||||
|
@ -313,20 +313,14 @@ bool C4ComponentHost::Save(C4Group &hGroup)
|
||||||
|
|
||||||
void C4ComponentHost::Open()
|
void C4ComponentHost::Open()
|
||||||
{
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
pCmpHost=this;
|
pCmpHost=this;
|
||||||
|
|
||||||
#if defined(C4ENGINE) && defined(_WIN32)
|
|
||||||
|
|
||||||
DialogBox(Application.GetInstance(),
|
DialogBox(Application.GetInstance(),
|
||||||
MAKEINTRESOURCE(IDD_COMPONENT),
|
MAKEINTRESOURCE(IDD_COMPONENT),
|
||||||
Application.GetWindowHandle(),
|
Application.GetWindowHandle(),
|
||||||
(DLGPROC) ComponentDlgProc);
|
(DLGPROC) ComponentDlgProc);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pCmpHost=NULL;
|
pCmpHost=NULL;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool C4ComponentHost::GetLanguageString(const char *szLanguage, StdStrBuf &rTarget)
|
bool C4ComponentHost::GetLanguageString(const char *szLanguage, StdStrBuf &rTarget)
|
||||||
|
|
|
@ -35,7 +35,6 @@
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <sys/utime.h>
|
#include <sys/utime.h>
|
||||||
#include <shellapi.h>
|
|
||||||
#else
|
#else
|
||||||
#include <utime.h>
|
#include <utime.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
@ -47,7 +46,6 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <openssl/sha.h>
|
#include <openssl/sha.h>
|
||||||
|
|
||||||
#include "MacUtility.h"
|
|
||||||
|
|
||||||
//------------------------------ File Sort Lists -------------------------------------------
|
//------------------------------ File Sort Lists -------------------------------------------
|
||||||
|
|
||||||
|
@ -1585,30 +1583,6 @@ bool C4Group::Delete(const char *szFiles, bool fRecursive)
|
||||||
return true; // Would be nicer to return the file count and add up all counts from recursive actions...
|
return true; // Would be nicer to return the file count and add up all counts from recursive actions...
|
||||||
}
|
}
|
||||||
|
|
||||||
// delete item to the recycle bin
|
|
||||||
bool EraseItemSafe(const char *szFilename)
|
|
||||||
{
|
|
||||||
#ifdef _WIN32
|
|
||||||
char Filename[_MAX_PATH+1];
|
|
||||||
SCopy(szFilename, Filename, _MAX_PATH);
|
|
||||||
Filename[SLen(Filename)+1]=0;
|
|
||||||
SHFILEOPSTRUCT shs;
|
|
||||||
shs.hwnd=0;
|
|
||||||
shs.wFunc=FO_DELETE;
|
|
||||||
shs.pFrom=Filename;
|
|
||||||
shs.pTo=NULL;
|
|
||||||
shs.fFlags=FOF_ALLOWUNDO | FOF_NOCONFIRMATION | FOF_SILENT;
|
|
||||||
shs.fAnyOperationsAborted=false;
|
|
||||||
shs.hNameMappings=0;
|
|
||||||
shs.lpszProgressTitle=NULL;
|
|
||||||
return !SHFileOperation(&shs);
|
|
||||||
#elif defined(USE_SDL_MAINLOOP) && defined(C4ENGINE) && defined(__APPLE__)
|
|
||||||
MacUtility::sendFileToTrash(szFilename);
|
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
bool C4Group::DeleteEntry(const char *szFilename, bool fRecycle)
|
bool C4Group::DeleteEntry(const char *szFilename, bool fRecycle)
|
||||||
{
|
{
|
||||||
switch (Status)
|
switch (Status)
|
||||||
|
|
|
@ -88,8 +88,6 @@ bool C4Group_ReadFile(const char *szFilename, char **pData, size_t *iSize);
|
||||||
bool C4Group_GetFileCRC(const char *szFilename, uint32_t *pCRC32);
|
bool C4Group_GetFileCRC(const char *szFilename, uint32_t *pCRC32);
|
||||||
bool C4Group_GetFileSHA1(const char *szFilename, BYTE *pSHA1);
|
bool C4Group_GetFileSHA1(const char *szFilename, BYTE *pSHA1);
|
||||||
|
|
||||||
bool EraseItemSafe(const char *szFilename);
|
|
||||||
|
|
||||||
extern const char *C4CFN_FLS[];
|
extern const char *C4CFN_FLS[];
|
||||||
|
|
||||||
extern time_t C4Group_AssumeTimeOffset;
|
extern time_t C4Group_AssumeTimeOffset;
|
||||||
|
|
|
@ -106,7 +106,7 @@ bool C4GroupSet::RegisterGroup(C4Group &rGroup, bool fOwnGrp, int32_t Priority,
|
||||||
pNewNode->Priority = Priority;
|
pNewNode->Priority = Priority;
|
||||||
pNewNode->Contents = Contents;
|
pNewNode->Contents = Contents;
|
||||||
|
|
||||||
#if defined(C4ENGINE) && !defined(USE_CONSOLE)
|
#if !defined(USE_CONSOLE)
|
||||||
// always add fonts directly
|
// always add fonts directly
|
||||||
if (Contents & C4GSCnt_FontDefs)
|
if (Contents & C4GSCnt_FontDefs)
|
||||||
Game.FontLoader.LoadDefs(rGroup, Config);
|
Game.FontLoader.LoadDefs(rGroup, Config);
|
||||||
|
|
|
@ -56,6 +56,10 @@ char strExecuteAtEnd[_MAX_PATH + 1] = "";
|
||||||
|
|
||||||
int iResult = 0;
|
int iResult = 0;
|
||||||
|
|
||||||
|
bool EraseItemSafe(const char *szFilename) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool Log(const char *msg) {
|
bool Log(const char *msg) {
|
||||||
if (!fQuiet)
|
if (!fQuiet)
|
||||||
printf("%s\n", msg);
|
printf("%s\n", msg);
|
||||||
|
|
|
@ -56,7 +56,7 @@ bool isGermanSystem()
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (PRIMARYLANGID(GetUserDefaultLangID()) == LANG_GERMAN) return true;
|
if (PRIMARYLANGID(GetUserDefaultLangID()) == LANG_GERMAN) return true;
|
||||||
#elif defined(__APPLE__) and defined(C4ENGINE)
|
#elif defined(__APPLE__)
|
||||||
return MacUtility::isGerman();
|
return MacUtility::isGerman();
|
||||||
#else
|
#else
|
||||||
if (strstr(setlocale(LC_MESSAGES, 0), "de")) return true;
|
if (strstr(setlocale(LC_MESSAGES, 0), "de")) return true;
|
||||||
|
|
|
@ -411,11 +411,6 @@ C4Def::C4Def()
|
||||||
void C4Def::Default()
|
void C4Def::Default()
|
||||||
{
|
{
|
||||||
DefaultDefCore();
|
DefaultDefCore();
|
||||||
|
|
||||||
#if !defined(C4ENGINE) && !defined(C4GROUP)
|
|
||||||
Picture=NULL;
|
|
||||||
Image=NULL;
|
|
||||||
#endif
|
|
||||||
Next=NULL;
|
Next=NULL;
|
||||||
Temporary=false;
|
Temporary=false;
|
||||||
Maker[0]=0;
|
Maker[0]=0;
|
||||||
|
@ -536,42 +531,6 @@ bool C4Def::Load(C4Group &hGroup,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if !defined(C4ENGINE) && !defined(C4GROUP)
|
|
||||||
|
|
||||||
// Override PictureRect if PictureRectFE is given
|
|
||||||
if (PictureRectFE.Wdt > 0)
|
|
||||||
PictureRect = PictureRectFE;
|
|
||||||
|
|
||||||
// Read picture section (this option is currently unused...)
|
|
||||||
if (dwLoadWhat & C4D_Load_Picture)
|
|
||||||
// Load from PNG graphics
|
|
||||||
if (!hGroup.AccessEntry(C4CFN_DefGraphicsPNG)
|
|
||||||
|| !hGroup.ReadPNGSection(&Picture,NULL,PictureRect.x,PictureRect.y,PictureRect.Wdt,PictureRect.Hgt))
|
|
||||||
// Load from BMP graphics
|
|
||||||
if (!hGroup.AccessEntry(C4CFN_DefGraphics)
|
|
||||||
|| !hGroup.ReadDDBSection(&Picture,NULL,PictureRect.x,PictureRect.y,PictureRect.Wdt,PictureRect.Hgt))
|
|
||||||
// None loaded
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Read picture section for use in image list
|
|
||||||
if (dwLoadWhat & C4D_Load_Image)
|
|
||||||
// Load from PNG title
|
|
||||||
if (!hGroup.AccessEntry(C4CFN_ScenarioTitlePNG)
|
|
||||||
|| !hGroup.ReadPNGSection(&Image, NULL, -1, -1, -1, -1, 32, 32))
|
|
||||||
// Load from BMP title
|
|
||||||
if (!hGroup.AccessEntry(C4CFN_ScenarioTitle)
|
|
||||||
|| !hGroup.ReadDDBSection(&Image, NULL, -1, -1, -1, -1, 32, 32, true))
|
|
||||||
// Load from PNG graphics
|
|
||||||
if (!hGroup.AccessEntry(C4CFN_DefGraphicsPNG)
|
|
||||||
|| !hGroup.ReadPNGSection(&Image, NULL, PictureRect.x, PictureRect.y, PictureRect.Wdt, PictureRect.Hgt, 32, 32))
|
|
||||||
// Load from BMP graphics
|
|
||||||
if (!hGroup.AccessEntry(C4CFN_DefGraphics)
|
|
||||||
|| !hGroup.ReadDDBSection(&Image, NULL, PictureRect.x, PictureRect.y, PictureRect.Wdt, PictureRect.Hgt, 32, 32, true))
|
|
||||||
// None loaded
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Read script
|
// Read script
|
||||||
if (dwLoadWhat & C4D_Load_Script)
|
if (dwLoadWhat & C4D_Load_Script)
|
||||||
{
|
{
|
||||||
|
|
|
@ -239,11 +239,6 @@ class C4Def: public C4PropList
|
||||||
C4Def();
|
C4Def();
|
||||||
~C4Def();
|
~C4Def();
|
||||||
public:
|
public:
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined(C4ENGINE) && !defined(C4GROUP)
|
|
||||||
HBITMAP Picture;
|
|
||||||
HBITMAP Image;
|
|
||||||
#endif
|
|
||||||
char Maker[C4MaxName+1];
|
char Maker[C4MaxName+1];
|
||||||
char Filename[_MAX_FNAME+1];
|
char Filename[_MAX_FNAME+1];
|
||||||
int32_t Creation;
|
int32_t Creation;
|
||||||
|
|
|
@ -23,14 +23,7 @@
|
||||||
|
|
||||||
#include "C4Include.h"
|
#include "C4Include.h"
|
||||||
#include <Standard.h>
|
#include <Standard.h>
|
||||||
#if defined(HAVE_PTHREAD) && defined(C4ENGINE)
|
|
||||||
// c4group is single-threaded
|
|
||||||
#include <StdSync.h>
|
#include <StdSync.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#include <shellapi.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <sys/timeb.h>
|
#include <sys/timeb.h>
|
||||||
|
@ -796,7 +789,7 @@ const char* SGetParameter(const char *strCommandLine, int iParameter, char *strT
|
||||||
|
|
||||||
/* Some part of the Winapi */
|
/* Some part of the Winapi */
|
||||||
|
|
||||||
#if defined(HAVE_PTHREAD) && defined(C4ENGINE) && defined(NEED_FALLBACK_ATOMIC_FUNCS)
|
#ifdef NEED_FALLBACK_ATOMIC_FUNCS
|
||||||
static CStdCSec SomeMutex;
|
static CStdCSec SomeMutex;
|
||||||
long InterlockedIncrement(long * var)
|
long InterlockedIncrement(long * var)
|
||||||
{
|
{
|
||||||
|
|
|
@ -357,6 +357,7 @@ template <typename T>
|
||||||
// open a weblink in an external browser
|
// open a weblink in an external browser
|
||||||
bool OpenURL(const char *szURL);
|
bool OpenURL(const char *szURL);
|
||||||
|
|
||||||
|
bool EraseItemSafe(const char *szFilename);
|
||||||
|
|
||||||
#endif // INC_STANDARD
|
#endif // INC_STANDARD
|
||||||
|
|
||||||
|
|
|
@ -441,7 +441,7 @@ void C4Facet::Set(CSurface &rSfc)
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
void C4Facet::Draw(HWND hWnd, int32_t iTx, int32_t iTy, int32_t iTWdt, int32_t iTHgt, bool fAspect, int32_t iPhaseX, int32_t iPhaseY)
|
void C4Facet::Draw(HWND hWnd, int32_t iTx, int32_t iTy, int32_t iTWdt, int32_t iTHgt, bool fAspect, int32_t iPhaseX, int32_t iPhaseY)
|
||||||
{
|
{
|
||||||
#if defined(C4ENGINE) && defined(USE_DIRECTX)
|
#if defined(USE_DIRECTX)
|
||||||
if (!pD3D || !Surface || !hWnd || !Wdt || !Hgt) return;
|
if (!pD3D || !Surface || !hWnd || !Wdt || !Hgt) return;
|
||||||
|
|
||||||
if (fAspect)
|
if (fAspect)
|
||||||
|
|
|
@ -3139,11 +3139,7 @@ void C4NetIOUDP::DoCheck() // (mt-safe)
|
||||||
#endif
|
#endif
|
||||||
void C4NetIOUDP::OpenDebugLog()
|
void C4NetIOUDP::OpenDebugLog()
|
||||||
{
|
{
|
||||||
#if defined C4ENGINE //&& 0
|
|
||||||
const char *szFileBase = Config.AtExePath("NetIOUDP%d.log");
|
|
||||||
#else
|
|
||||||
const char *szFileBase = "NetIOUDP%d.log";
|
const char *szFileBase = "NetIOUDP%d.log";
|
||||||
#endif
|
|
||||||
char szFilePath[_MAX_PATH + 1];
|
char szFilePath[_MAX_PATH + 1];
|
||||||
for(int i = 0; i < 1000; i++)
|
for(int i = 0; i < 1000; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -63,3 +63,28 @@ bool OpenURL(const char *szURL)
|
||||||
// operating system not supported, or all opening method(s) failed
|
// operating system not supported, or all opening method(s) failed
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// delete item to the recycle bin
|
||||||
|
bool EraseItemSafe(const char *szFilename)
|
||||||
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
char Filename[_MAX_PATH+1];
|
||||||
|
SCopy(szFilename, Filename, _MAX_PATH);
|
||||||
|
Filename[SLen(Filename)+1]=0;
|
||||||
|
SHFILEOPSTRUCT shs;
|
||||||
|
shs.hwnd=0;
|
||||||
|
shs.wFunc=FO_DELETE;
|
||||||
|
shs.pFrom=Filename;
|
||||||
|
shs.pTo=NULL;
|
||||||
|
shs.fFlags=FOF_ALLOWUNDO | FOF_NOCONFIRMATION | FOF_SILENT;
|
||||||
|
shs.fAnyOperationsAborted=false;
|
||||||
|
shs.hNameMappings=0;
|
||||||
|
shs.lpszProgressTitle=NULL;
|
||||||
|
return !SHFileOperation(&shs);
|
||||||
|
#endif
|
||||||
|
#ifdef __APPLE__
|
||||||
|
return MacUtility::sendFileToTrash(szFilename);
|
||||||
|
#endif
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue