[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src/unit unit_draw.c
From: |
address@hidden |
Subject: |
[Stratagus-CVS] stratagus/src/unit unit_draw.c |
Date: |
10 Jan 2004 07:15:08 +1100 |
CVSROOT: /home/strat
Module name: stratagus
Changes by: <address@hidden> 04/01/10 07:15:08
Modified files:
src/unit : unit_draw.c
Log message:
Clean up
Patches:
Index: stratagus/src/unit/unit_draw.c
diff -u stratagus/src/unit/unit_draw.c:1.199
stratagus/src/unit/unit_draw.c:1.200
--- stratagus/src/unit/unit_draw.c:1.199 Sat Jan 3 11:33:02 2004
+++ stratagus/src/unit/unit_draw.c Sat Jan 10 07:15:07 2004
@@ -5,12 +5,12 @@
// /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
// \/ \/ \//_____/ \/
// ______________________ ______________________
-// T H E W A R B E G I N S
-// Stratagus - A free fantasy real time strategy game engine
+// T H E W A R B E G I N S
+// Stratagus - A free fantasy real time strategy game engine
//
-/address@hidden unit_draw.c - The draw routines for units. */
+/address@hidden unit_draw.c - The draw routines for units. */
//
-// (c) Copyright 1998-2003 by Lutz Sammer, Jimmy Salmon, Nehal Mistry
+// (c) Copyright 1998-2004 by Lutz Sammer, Jimmy Salmon, Nehal Mistry
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit_draw.c,v 1.199 2004/01/03 00:33:02 jsalmon3 Exp $
+// $Id: unit_draw.c,v 1.200 2004/01/09 20:15:07 jsalmon3 Exp $
//@{
@@ -219,6 +219,9 @@
type->TileHeight * TileSizeY / 2 - type->BoxHeight/2 -
(type->Height - VideoGraphicHeight(type->Sprite)) / 2;
DrawSelection(*color, x, y, x + type->BoxWidth, y + type->BoxHeight);
+#ifdef USE_SDL_SURFACE
+ free(color);
+#endif
}
/**
@@ -741,7 +744,7 @@
{
#if 0
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: decorations $Id: unit_draw.c,v 1.199
2004/01/03 00:33:02 jsalmon3 Exp $\n\n");
+ CLprintf(file, ";;; MODULE: decorations $Id: unit_draw.c,v 1.200
2004/01/09 20:15:07 jsalmon3 Exp $\n\n");
CLprintf(file, "(mana-sprite \"%s\" %d %d %d %d)\n",
ManaSprite.File, ManaSprite.HotX, ManaSprite.HotY,
@@ -1785,22 +1788,18 @@
}
/**
-** Change current color set to units colors.
+** Change current color set to units colors.
**
-** FIXME: use function pointer here.
-**
-** @param unit Pointer to unit.
-** @param sprite Change the palette entries 208-210 in
this sprite.
+** @param unit Pointer to unit.
+** @param sprite Change the palette entries 208-211 in this sprite.
*/
local void GraphicUnitPixels(const Unit* unit, const Graphic* sprite)
{
#ifdef USE_SDL_SURFACE
- SDL_LockSurface(sprite->Surface);
SDL_SetColors(sprite->Surface, unit->Colors->Colors, 208, 4);
if (sprite->SurfaceFlip) {
SDL_SetColors(sprite->SurfaceFlip, unit->Colors->Colors, 208,
4);
}
- SDL_UnlockSurface(sprite->Surface);
#else
switch (VideoBpp) {
case 8:
- [Stratagus-CVS] stratagus/src/unit unit_draw.c,
address@hidden <=