Changed mipmap assigning to use DCQ

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@895 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
gewlitys
2003-03-17 01:22:04 +00:00
parent 9a829b73ed
commit 0697f1e799
3 changed files with 29 additions and 11 deletions
+8
View File
@@ -35,6 +35,7 @@ enum
TFB_DRAWCOMMANDTYPE_SCISSORDISABLE,
TFB_DRAWCOMMANDTYPE_SETPALETTE,
TFB_DRAWCOMMANDTYPE_SETMIPMAP,
TFB_DRAWCOMMANDTYPE_DELETEIMAGE,
TFB_DRAWCOMMANDTYPE_SENDSIGNAL,
};
@@ -95,6 +96,12 @@ typedef struct tfb_dc_setpal
int r, g, b;
} TFB_DrawCommand_SetPalette;
typedef struct tfb_dc_setmip
{
TFB_Image *image;
TFB_Canvas mipmap;
} TFB_DrawCommand_SetMipmap;
typedef struct tfb_dc_delimg
{
TFB_Image *image;
@@ -117,6 +124,7 @@ typedef struct tfb_drawcommand
TFB_DrawCommand_CopyToImage copytoimage;
TFB_DrawCommand_Scissor scissor;
TFB_DrawCommand_SetPalette setpalette;
TFB_DrawCommand_SetMipmap setmipmap;
TFB_DrawCommand_DeleteImage deleteimage;
TFB_DrawCommand_SendSignal sendsignal;
} data;
@@ -502,6 +502,11 @@ TFB_FlushGraphics () // Only call from main thread!!
}
break;
}
case TFB_DRAWCOMMANDTYPE_SETMIPMAP:
LockMutex (DC.data.setmipmap.image->mutex);
DC.data.setmipmap.image->MipmapImg = DC.data.setmipmap.mipmap;
UnlockMutex (DC.data.setmipmap.image->mutex);
break;
case TFB_DRAWCOMMANDTYPE_IMAGE:
{
TFB_Image *DC_image = DC.data.image.image;
+16 -11
View File
@@ -19,6 +19,8 @@
#include "starcon.h"
#include "libs/graphics/gfx_common.h"
#include "libs/graphics/drawable.h"
#include "libs/graphics/drawcmd.h"
#include "options.h"
COUNT DisplayFreeList;
PRIMITIVE DisplayArray[MAX_DISPLAY_PRIMS];
@@ -981,22 +983,25 @@ PostProcessQueue (register VIEW_STATE view_state, register SIZE scroll_x,
[index],
ElementPtr->next.image.frame);
#endif /* SAFE */
LockMutex (((PFRAME_DESC)ElementPtr->next.image.frame)->image->mutex);
if (index < 2 && scale != 256)
if (optMeleeScale == TFB_SCALE_TRILINEAR && index < 2 && scale != 256)
{
// assigns next (smaller) zoom level image as mipmap, needed for trilinear scaling
((PFRAME_DESC)ElementPtr->next.image.frame)->image->MipmapImg =
// enqueues drawcommand to assign next (smaller) zoom
// level image as mipmap, needed for trilinear scaling
TFB_DrawCommand DC;
TFB_Image *mmimg =
((PFRAME_DESC)SetEquFrameIndex (
ElementPtr->next.image.farray
[index + 1],
ElementPtr->next.image.frame))->image->NormalImg;
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);
}
else
{
((PFRAME_DESC)ElementPtr->next.image.frame)->image->MipmapImg = NULL;
}
UnlockMutex (((PFRAME_DESC)ElementPtr->next.image.frame)->image->mutex);
#endif
}
DisplayArray[ElementPtr->PrimIndex].Object.Stamp.frame =