mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-22 10:20:26 +01:00
Various patches to get this closer to compiling again.
This commit is contained in:
parent
6ac856824f
commit
28a8b5cb2e
|
@ -6,6 +6,7 @@
|
|||
#include <Engine/Base/Stream.h>
|
||||
#include <Engine/Base/ErrorReporting.h>
|
||||
#include <Engine/Base/Anim.h>
|
||||
#include <Engine/Base/Shell.h>
|
||||
#include <Engine/Graphics/Texture.h>
|
||||
#include <Engine/Models/ModelObject.h>
|
||||
#include <Engine/Sound/SoundObject.h>
|
||||
|
|
|
@ -381,7 +381,7 @@ static void ListSymbols(void)
|
|||
void Echo(void* pArgs)
|
||||
{
|
||||
CTString str = *NEXTARGUMENT(CTString*);
|
||||
CPrintF("%s", str);
|
||||
CPrintF("%s", (const char *) str);
|
||||
}
|
||||
|
||||
|
||||
|
@ -879,7 +879,7 @@ void CShell::StorePersistentSymbols(const CTFileName &fnScript)
|
|||
} else if (stBase.st_sttType==STT_STRING) {
|
||||
// dump all members
|
||||
for(INDEX i=0; i<st.st_ctArraySize; i++) {
|
||||
fScript.FPrintF_t("%s[%d]=\"%s\";\n", (const char *) ss.ss_strName, i, (const char*)(ScriptEsc(*(CTString*)ss.ss_pvValue)[i]) );
|
||||
fScript.FPrintF_t("%s[%d]=\"%c\";\n", (const char *) ss.ss_strName, i, (ScriptEsc(*(CTString*)ss.ss_pvValue)[i]) );
|
||||
}
|
||||
// otherwise
|
||||
} else {
|
||||
|
|
|
@ -17,12 +17,19 @@
|
|||
// maximum length of file that can be saved (default: 8Mb)
|
||||
ENGINE_API extern ULONG _ulMaxLengthOfSavingFile;
|
||||
|
||||
#ifdef _MSC_VER // no __try/__except elsewhere.
|
||||
#define CTSTREAM_BEGIN CTStream::EnableStreamHandling(); __try
|
||||
#define CTSTREAM_END __except( CTStream::ExceptionFilter( GetExceptionCode(),\
|
||||
GetExceptionInformation()) )\
|
||||
{\
|
||||
CTStream::ExceptionFatalError();\
|
||||
}; CTStream::DisableStreamHandling();
|
||||
#else
|
||||
|
||||
#define CTSTREAM_BEGIN CTStream::EnableStreamHandling();
|
||||
#define CTSTREAM_END CTStream::DisableStreamHandling();
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Chunk ID class
|
||||
|
|
|
@ -32,10 +32,6 @@
|
|||
#include <Engine/Templates/StaticArray.cpp>
|
||||
#include <Engine/Base/IFeel.h>
|
||||
|
||||
#if (defined PLATFORM_MACOSX)
|
||||
#include <Carbon/Carbon.h>
|
||||
#endif
|
||||
|
||||
// this version string can be referenced from outside the engine
|
||||
ENGINE_API CTString _strEngineBuild = "";
|
||||
ENGINE_API ULONG _ulEngineBuildMajor = _SE_BUILD_MAJOR;
|
||||
|
@ -108,6 +104,7 @@ BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReser
|
|||
}
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void DetectCPU(void)
|
||||
{
|
||||
|
@ -411,6 +408,8 @@ ENGINE_API void SE_InitEngine(const char *argv0, CTString strGameID)
|
|||
}
|
||||
|
||||
#elif (defined PLATFORM_MACOSX)
|
||||
STUBBED("Use some Gestalt replacement, or whatever");
|
||||
#if 0
|
||||
long osver = 0x0000;
|
||||
OSErr err = Gestalt(gestaltSystemVersion, &osver);
|
||||
if (err != noErr)
|
||||
|
@ -419,6 +418,12 @@ ENGINE_API void SE_InitEngine(const char *argv0, CTString strGameID)
|
|||
sys_iOSMajor = ((osver & 0x0F00) >> 8) + (((osver & 0xF000) >> 12) * 10);
|
||||
sys_iOSMinor = ((osver & 0x00F0) >> 4);
|
||||
sys_iOSBuild = ((osver & 0x000F) >> 0);
|
||||
#else
|
||||
sys_iOSMajor = 10; // !!! FIXME: just flatly false.
|
||||
sys_iOSMinor = 6;
|
||||
sys_iOSBuild = 0;
|
||||
#endif
|
||||
|
||||
sys_strOS = "Mac OS X";
|
||||
sys_strOSMisc = "Mac OS";
|
||||
CPrintF(TRANSV(" Type: %s\n"), (const char*)sys_strOS);
|
||||
|
|
|
@ -6,7 +6,21 @@
|
|||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <Engine/Network/Socket.h>
|
||||
#ifdef PLATFORM_UNIX
|
||||
#include <fcntl.h>
|
||||
#include <netdb.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#define INVALID_SOCKET -1
|
||||
#define SOCKET_ERROR -1
|
||||
#define closesocket close
|
||||
typedef int SOCKET;
|
||||
typedef struct hostent HOSTENT;
|
||||
typedef struct sockaddr_in SOCKADDR_IN;
|
||||
typedef struct sockaddr SOCKADDR;
|
||||
#define WSAGetLastError() (INDEX) errno
|
||||
#endif
|
||||
|
||||
#define SERVER_CLIENTS 16
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ template<class Type>
|
|||
inline Type *CStaticStackArray<Type>::Push(INDEX ct) {
|
||||
sa_UsedCount+=ct;
|
||||
while(sa_UsedCount>CStaticArray<Type>::Count()) {
|
||||
Expand(CStaticArray<Type>::Count()+sa_ctAllocationStep);
|
||||
this->Expand(CStaticArray<Type>::Count()+sa_ctAllocationStep);
|
||||
}
|
||||
ASSERT(sa_UsedCount <= CStaticArray<Type>::Count());
|
||||
return &CStaticArray<Type>::operator[](sa_UsedCount-ct);
|
||||
|
|
Loading…
Reference in New Issue
Block a user