SDL_net
This commit is contained in:
parent
1723f7b547
commit
d2adde5d9f
@ -13,7 +13,7 @@
|
|||||||
File: ZE_Defines.h <br>
|
File: ZE_Defines.h <br>
|
||||||
Description: Defines header file for ZEngine class, where all #define statements to control compilation options are placed. <br>
|
Description: Defines header file for ZEngine class, where all #define statements to control compilation options are placed. <br>
|
||||||
Author(s): James Turk <br>
|
Author(s): James Turk <br>
|
||||||
$Id: ZE_Defines.h,v 1.7 2003/01/19 05:43:40 cozman Exp $<br>
|
$Id: ZE_Defines.h,v 1.8 2003/02/16 21:38:49 cozman Exp $<br>
|
||||||
|
|
||||||
\file ZE_Defines.h
|
\file ZE_Defines.h
|
||||||
\brief Define file for ZEngine.
|
\brief Define file for ZEngine.
|
||||||
@ -31,6 +31,8 @@ $Id: ZE_Defines.h,v 1.7 2003/01/19 05:43:40 cozman Exp $<br>
|
|||||||
#define USE_SDL_IMAGE
|
#define USE_SDL_IMAGE
|
||||||
//! Define to include sound support.
|
//! Define to include sound support.
|
||||||
#define USE_SDL_MIXER
|
#define USE_SDL_MIXER
|
||||||
|
//! Define to include net support.
|
||||||
|
#define USE_SDL_NET
|
||||||
//! Define to use the Physfs file system.
|
//! Define to use the Physfs file system.
|
||||||
//#define USE_PHYSFS
|
//#define USE_PHYSFS
|
||||||
//! Version number.
|
//! Version number.
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
File: ZE_Includes.h <br>
|
File: ZE_Includes.h <br>
|
||||||
Description: Header file for ZEngine universal includes. <br>
|
Description: Header file for ZEngine universal includes. <br>
|
||||||
Author(s): James Turk <br>
|
Author(s): James Turk <br>
|
||||||
$Id: ZE_Includes.h,v 1.5 2003/01/13 05:53:47 cozman Exp $<br>
|
$Id: ZE_Includes.h,v 1.6 2003/02/16 21:38:50 cozman Exp $<br>
|
||||||
|
|
||||||
\file ZE_Includes.h
|
\file ZE_Includes.h
|
||||||
\brief Include file for SDL and C++ Includes that many ZEngine files need.
|
\brief Include file for SDL and C++ Includes that many ZEngine files need.
|
||||||
@ -39,6 +39,9 @@ $Id: ZE_Includes.h,v 1.5 2003/01/13 05:53:47 cozman Exp $<br>
|
|||||||
#ifdef USE_SDL_MIXER
|
#ifdef USE_SDL_MIXER
|
||||||
#include "SDL_mixer.h"
|
#include "SDL_mixer.h"
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef USE_SDL_NET
|
||||||
|
#include "SDL_net.h"
|
||||||
|
#endif
|
||||||
#ifdef USE_PHYSFS
|
#ifdef USE_PHYSFS
|
||||||
#include "physfs.h"
|
#include "physfs.h"
|
||||||
#include "external/physfsrwops.h"
|
#include "external/physfsrwops.h"
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
File: ZE_ZEngine.cpp <br>
|
File: ZE_ZEngine.cpp <br>
|
||||||
Description: Implementation source file for ZEngine library main singleton class. <br>
|
Description: Implementation source file for ZEngine library main singleton class. <br>
|
||||||
Author(s): James Turk <br>
|
Author(s): James Turk <br>
|
||||||
$Id: ZE_ZEngine.cpp,v 1.27 2003/02/02 23:30:15 cozman Exp $<br>
|
$Id: ZE_ZEngine.cpp,v 1.28 2003/02/16 21:38:50 cozman Exp $<br>
|
||||||
|
|
||||||
\file ZE_ZEngine.cpp
|
\file ZE_ZEngine.cpp
|
||||||
\brief Central source file for ZEngine.
|
\brief Central source file for ZEngine.
|
||||||
@ -238,18 +238,34 @@ bool ZEngine::CreateDisplay(string title, string icon)
|
|||||||
}
|
}
|
||||||
#endif //USE_SDL_TTF
|
#endif //USE_SDL_TTF
|
||||||
|
|
||||||
|
#ifdef USE_SDL_NET
|
||||||
|
if(!mInitialized)
|
||||||
|
{
|
||||||
|
if(SDLNet_Init() < 0)
|
||||||
|
{
|
||||||
|
ReportError(ZERR_NET_INIT,SDLNet_GetError());
|
||||||
|
status = false; //possible to go on without SDL_Net
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif //USE_SDL_NET
|
||||||
|
|
||||||
if(!mInitialized)
|
if(!mInitialized)
|
||||||
mLastTime = mPausedTime = SDL_GetTicks();
|
mLastTime = mPausedTime = SDL_GetTicks();
|
||||||
mActive = true;
|
mActive = true;
|
||||||
mInitialized = true; //if it makes it to the end it has been initialized
|
mInitialized = true; //if it makes it to the end it has been initialized
|
||||||
|
|
||||||
return status; //return true (false will be returned if TTF or Mixer fail)
|
return status; //return true (false will be returned if TTF or Mixer or Net fail)
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZEngine::CloseDisplay()
|
void ZEngine::CloseDisplay()
|
||||||
{
|
{
|
||||||
if(mInitialized)
|
if(mInitialized)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#ifdef USE_SDL_NET
|
||||||
|
SDLNet_Quit();
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef USE_SDL_TTF
|
#ifdef USE_SDL_TTF
|
||||||
TTF_Quit();
|
TTF_Quit();
|
||||||
#endif
|
#endif
|
||||||
@ -595,6 +611,7 @@ ZErrorCode ZEngine::GetLastError()
|
|||||||
void ZEngine::WriteLog(string str)
|
void ZEngine::WriteLog(string str)
|
||||||
{
|
{
|
||||||
fprintf(mErrlog,str.c_str());
|
fprintf(mErrlog,str.c_str());
|
||||||
|
fprintf(mErrlog,"\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZEngine::LogError(ZError error)
|
void ZEngine::LogError(ZError error)
|
||||||
|
Loading…
Reference in New Issue
Block a user