Move some BMP-loading helpers to C4Landscape.cpp

Günther Brammer 2011-01-19 23:52:46 +01:00
parent cb34973ffc
commit 5151177d44
11 changed files with 22 additions and 100 deletions

View File

@ -394,8 +394,6 @@ set(OC_CLONK_SOURCES
src/lib/texture/C4GraphicsResource.cpp
src/lib/texture/C4GraphicsResource.h
src/lib/texture/C4Surface.cpp
src/lib/texture/C4SurfaceFile.cpp
src/lib/texture/C4SurfaceFile.h
src/lib/texture/C4Surface.h
src/lib/texture/StdPNG.cpp
src/lib/texture/StdPNG.h

View File

@ -148,8 +148,6 @@ src/lib/texture/C4FacetEx.cpp \
src/lib/texture/C4FacetEx.h \
src/lib/texture/C4Facet.h \
src/lib/texture/C4Surface.cpp \
src/lib/texture/C4SurfaceFile.cpp \
src/lib/texture/C4SurfaceFile.h \
src/lib/texture/C4Surface.h \
src/lib/texture/StdPNG.cpp \
src/lib/texture/StdPNG.h

View File

@ -38,7 +38,6 @@
#include <C4ObjectInfo.h>
#include <C4Random.h>
#include <C4ObjectCom.h>
#include <C4SurfaceFile.h>
#include <C4FullScreen.h>
#include <C4Startup.h>
#include <C4Viewport.h>

View File

@ -29,7 +29,6 @@
#include <C4Application.h>
#include <C4Console.h>
#include <C4Random.h>
#include <C4SurfaceFile.h>
#include <C4FullScreen.h>
#include <C4Gui.h>
#include <C4LoaderScreen.h>

View File

@ -26,16 +26,17 @@
#include <C4Include.h>
#include <C4Landscape.h>
#include <C4SolidMask.h>
#include <C4Game.h>
#include <C4Group.h>
#include <C4Map.h>
#include <C4MapCreatorS2.h>
#include <C4SolidMask.h>
#include <C4Object.h>
#include <C4Physics.h>
#include <C4Random.h>
#include <C4SurfaceFile.h>
#include <C4Surface.h>
#include <C4ToolsDlg.h>
#ifdef DEBUGREC
#include <C4Record.h>
@ -52,7 +53,7 @@
#include <C4GraphicsSystem.h>
#include <C4Texture.h>
#include <C4Record.h>
#include <StdSurface8.h>
#include <StdPNG.h>
const int C4LS_MaxLightDistY = 8;
@ -603,6 +604,24 @@ bool C4Landscape::PostInitMap()
return true;
}
static CSurface8 *GroupReadSurface8(CStdStream &hGroup)
{
// create surface
CSurface8 *pSfc=new CSurface8();
if (!pSfc->Read(hGroup))
{ delete pSfc; return NULL; }
return pSfc;
}
static CSurface8 *GroupReadSurfaceOwnPal8(CStdStream &hGroup)
{
// create surface
CSurface8 *pSfc=new CSurface8();
if (!pSfc->Read(hGroup))
{ delete pSfc; return NULL; }
return pSfc;
}
bool C4Landscape::Init(C4Group &hGroup, bool fOverloadCurrent, bool fLoadSky, bool &rfLoaded, bool fSavegame)
{
// set map seed, if not pre-assigned

View File

@ -28,7 +28,6 @@
#include <C4Game.h>
#include <C4Random.h>
#include <C4SurfaceFile.h>
#include <C4Components.h>
#include <C4Weather.h>
#include <C4GraphicsResource.h>

View File

@ -25,7 +25,6 @@
#include <C4Include.h>
#include <C4Texture.h>
#include <C4SurfaceFile.h>
#include <C4Group.h>
#include <C4Game.h>
#include <C4Config.h>

View File

@ -31,7 +31,6 @@
#include <C4GameVersion.h>
#include <C4FileMonitor.h>
#include <C4SurfaceFile.h>
#include <C4Log.h>
#include <C4Components.h>
#include <C4Config.h>

View File

@ -27,7 +27,6 @@
#include <C4Include.h>
#include <C4DefGraphics.h>
#include <C4SurfaceFile.h>
#include <C4Object.h>
#include <C4ObjectInfo.h>
#include <C4Config.h>

View File

@ -1,55 +0,0 @@
/*
* OpenClonk, http://www.openclonk.org
*
* Copyright (c) 1998-2000 Matthes Bender
* Copyright (c) 2002 Sven Eberhardt
* Copyright (c) 2006-2007 Günther Brammer
* Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de
*
* Portions might be copyrighted by other authors who have contributed
* to OpenClonk.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
* See isc_license.txt for full license and disclaimer.
*
* "Clonk" is a registered trademark of Matthes Bender.
* See clonk_trademark_license.txt for full license.
*/
/* Another C4Group bitmap-to-surface loader and saver */
#include <C4Include.h>
#include <C4SurfaceFile.h>
#include <C4Surface.h>
#include <StdSurface8.h>
#include <C4Group.h>
C4Surface *GroupReadSurface(CStdStream &hGroup)
{
// create surface
C4Surface *pSfc=new C4Surface();
if (!pSfc->ReadBMP(hGroup))
{ delete pSfc; return NULL; }
return pSfc;
}
CSurface8 *GroupReadSurface8(CStdStream &hGroup)
{
// create surface
CSurface8 *pSfc=new CSurface8();
if (!pSfc->Read(hGroup))
{ delete pSfc; return NULL; }
return pSfc;
}
CSurface8 *GroupReadSurfaceOwnPal8(CStdStream &hGroup)
{
// create surface
CSurface8 *pSfc=new CSurface8();
if (!pSfc->Read(hGroup))
{ delete pSfc; return NULL; }
return pSfc;
}

View File

@ -1,32 +0,0 @@
/*
* OpenClonk, http://www.openclonk.org
*
* Copyright (c) 1998-2000 Matthes Bender
* Copyright (c) 2001 Sven Eberhardt
* Copyright (c) 2007 Günther Brammer
* Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de
*
* Portions might be copyrighted by other authors who have contributed
* to OpenClonk.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
* See isc_license.txt for full license and disclaimer.
*
* "Clonk" is a registered trademark of Matthes Bender.
* See clonk_trademark_license.txt for full license.
*/
/* Another C4Group bitmap-to-surface loader and saver */
#ifndef INC_C4SurfaceFile
#define INC_C4SurfaceFile
C4Surface *GroupReadSurface(CStdStream &hGroup);
CSurface8 *GroupReadSurface8(CStdStream &hGroup);
CSurface8 *GroupReadSurfaceOwnPal8(CStdStream &hGroup);
/*bool SaveSurface(const char *szFilename, SURFACE sfcSurface, BYTE *bpPalette);*/
#endif