From ee0339e0b80e701b05bb2b8b83468686469885a1 Mon Sep 17 00:00:00 2001 From: gewlitys Date: Mon, 12 May 2003 00:44:49 +0000 Subject: [PATCH] Made mipmap assigning safer, should fix bug #349 git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@960 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/process.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/sc2/src/sc2code/process.c b/sc2/src/sc2code/process.c index e21ab8e7a..245be6367 100644 --- a/sc2/src/sc2code/process.c +++ b/sc2/src/sc2code/process.c @@ -988,19 +988,23 @@ PostProcessQueue (register VIEW_STATE view_state, register SIZE scroll_x, // enqueues drawcommand to assign next (smaller) zoom // level image as mipmap, needed for trilinear scaling - TFB_DrawCommand DC; - TFB_Image *mmimg = - ((PFRAME_DESC)SetEquFrameIndex ( + PFRAME_DESC frame = + (PFRAME_DESC)SetAbsFrameIndex ( ElementPtr->next.image.farray [index + 1], - ElementPtr->next.image.frame))->image; - - DC.Type = TFB_DRAWCOMMANDTYPE_SETMIPMAP; - DC.data.setmipmap.image = ((PFRAME_DESC)ElementPtr->next.image.frame)->image; - LockMutex (mmimg->mutex); - DC.data.setmipmap.mipmap = mmimg->NormalImg; - UnlockMutex (mmimg->mutex); - TFB_EnqueueDrawCommand (&DC); + GetFrameIndex (ElementPtr->next.image.frame)); + + if (frame && frame->image) + { + TFB_DrawCommand DC; + TFB_Image *mmimg = frame->image; + DC.Type = TFB_DRAWCOMMANDTYPE_SETMIPMAP; + DC.data.setmipmap.image = ((PFRAME_DESC)ElementPtr->next.image.frame)->image; + LockMutex (mmimg->mutex); + DC.data.setmipmap.mipmap = mmimg->NormalImg; + UnlockMutex (mmimg->mutex); + TFB_EnqueueDrawCommand (&DC); + } } #endif }