2007-01-15 12:09:25 -08:00
|
|
|
/*
|
|
|
|
This file is part of Warzone 2100.
|
|
|
|
Copyright (C) 1999-2004 Eidos Interactive
|
2010-07-26 16:36:29 -07:00
|
|
|
Copyright (C) 2005-2010 Warzone 2100 Project
|
2007-01-15 12:09:25 -08:00
|
|
|
|
|
|
|
Warzone 2100 is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Warzone 2100 is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Warzone 2100; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2010-10-13 11:25:57 -07:00
|
|
|
#include "lib/framework/frame.h"
|
2010-12-31 13:37:14 -08:00
|
|
|
#include "lib/ivis_opengl/rendmode.h"
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2010-10-13 13:09:31 -07:00
|
|
|
iSurface *iV_SurfaceCreate(int width, int height)
|
2007-06-28 10:47:08 -07:00
|
|
|
{
|
2010-12-05 08:25:43 -08:00
|
|
|
iSurface *s = (iSurface *)malloc(sizeof(iSurface));
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2007-12-31 06:04:21 -08:00
|
|
|
if (!s)
|
|
|
|
{
|
2010-10-13 09:22:45 -07:00
|
|
|
debug(LOG_ERROR, "of memory");
|
2007-06-28 10:47:08 -07:00
|
|
|
return NULL;
|
2007-12-31 06:04:21 -08:00
|
|
|
}
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2010-10-13 12:25:26 -07:00
|
|
|
s->xcentre = width / 2;
|
|
|
|
s->ycentre = height / 2;
|
2007-06-28 10:47:08 -07:00
|
|
|
s->width = width;
|
|
|
|
s->height = height;
|
|
|
|
s->clip.left = 0;
|
2010-10-13 12:25:26 -07:00
|
|
|
s->clip.right = width - 1;
|
2007-06-28 10:47:08 -07:00
|
|
|
s->clip.top = 0;
|
|
|
|
s->clip.bottom = height-1;
|
|
|
|
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
void iV_SurfaceDestroy(iSurface *s)
|
|
|
|
{
|
2010-10-13 11:25:57 -07:00
|
|
|
free(s);
|
2007-06-28 10:47:08 -07:00
|
|
|
}
|