From 15992f45f07227cf2e1bcdf609f58792021e1af1 Mon Sep 17 00:00:00 2001 From: gewlitys Date: Mon, 28 Oct 2002 02:40:50 +0000 Subject: [PATCH] Hotspot fixes git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@170 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/graphics/sdl/3do_getbody.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sc2/src/sc2code/libs/graphics/sdl/3do_getbody.c b/sc2/src/sc2code/libs/graphics/sdl/3do_getbody.c index c04872552..36f12f240 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/3do_getbody.c +++ b/sc2/src/sc2code/libs/graphics/sdl/3do_getbody.c @@ -41,7 +41,7 @@ static void process_image (FRAMEPTR FramePtr, SDL_Surface *img[], AniData *ani, int cel_ct) { TFB_Image *tfbimg; - int hx = 0, hy = 0; + int hx, hy; TYPE_SET (FramePtr->TypeIndexAndFlags, WANT_PIXMAP << FTYPE_SHIFT); INDEX_SET (FramePtr->TypeIndexAndFlags, cel_ct); @@ -49,15 +49,13 @@ process_image (FRAMEPTR FramePtr, SDL_Surface *img[], AniData *ani, int cel_ct) if (img[cel_ct]->format->palette) { if (ani[cel_ct].transparent_color != -1) - SDL_SetColorKey(img[cel_ct], SDL_SRCCOLORKEY, ani[cel_ct].transparent_color); - - if (ani[cel_ct].hotspot_x != -1) - hx = ani[cel_ct].hotspot_x; - if (ani[cel_ct].hotspot_y != -1) - hy = ani[cel_ct].hotspot_y; + SDL_SetColorKey(img[cel_ct], SDL_SRCCOLORKEY, ani[cel_ct].transparent_color); } - FramePtr->DataOffs = (BYTE *)TFB_LoadImage (img[cel_ct]) - (BYTE *)FramePtr; + hx = ani[cel_ct].hotspot_x; + hy = ani[cel_ct].hotspot_y; + + FramePtr->DataOffs = (BYTE *)TFB_LoadImage (img[cel_ct]) - (BYTE *)FramePtr; tfbimg = (TFB_Image *)((BYTE *)FramePtr + FramePtr->DataOffs); tfbimg->colormap_index = ani[cel_ct].colormap_index;