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:
@@ -35,6 +35,7 @@ enum
|
|||||||
TFB_DRAWCOMMANDTYPE_SCISSORDISABLE,
|
TFB_DRAWCOMMANDTYPE_SCISSORDISABLE,
|
||||||
|
|
||||||
TFB_DRAWCOMMANDTYPE_SETPALETTE,
|
TFB_DRAWCOMMANDTYPE_SETPALETTE,
|
||||||
|
TFB_DRAWCOMMANDTYPE_SETMIPMAP,
|
||||||
TFB_DRAWCOMMANDTYPE_DELETEIMAGE,
|
TFB_DRAWCOMMANDTYPE_DELETEIMAGE,
|
||||||
TFB_DRAWCOMMANDTYPE_SENDSIGNAL,
|
TFB_DRAWCOMMANDTYPE_SENDSIGNAL,
|
||||||
};
|
};
|
||||||
@@ -95,6 +96,12 @@ typedef struct tfb_dc_setpal
|
|||||||
int r, g, b;
|
int r, g, b;
|
||||||
} TFB_DrawCommand_SetPalette;
|
} TFB_DrawCommand_SetPalette;
|
||||||
|
|
||||||
|
typedef struct tfb_dc_setmip
|
||||||
|
{
|
||||||
|
TFB_Image *image;
|
||||||
|
TFB_Canvas mipmap;
|
||||||
|
} TFB_DrawCommand_SetMipmap;
|
||||||
|
|
||||||
typedef struct tfb_dc_delimg
|
typedef struct tfb_dc_delimg
|
||||||
{
|
{
|
||||||
TFB_Image *image;
|
TFB_Image *image;
|
||||||
@@ -117,6 +124,7 @@ typedef struct tfb_drawcommand
|
|||||||
TFB_DrawCommand_CopyToImage copytoimage;
|
TFB_DrawCommand_CopyToImage copytoimage;
|
||||||
TFB_DrawCommand_Scissor scissor;
|
TFB_DrawCommand_Scissor scissor;
|
||||||
TFB_DrawCommand_SetPalette setpalette;
|
TFB_DrawCommand_SetPalette setpalette;
|
||||||
|
TFB_DrawCommand_SetMipmap setmipmap;
|
||||||
TFB_DrawCommand_DeleteImage deleteimage;
|
TFB_DrawCommand_DeleteImage deleteimage;
|
||||||
TFB_DrawCommand_SendSignal sendsignal;
|
TFB_DrawCommand_SendSignal sendsignal;
|
||||||
} data;
|
} data;
|
||||||
|
|||||||
@@ -502,6 +502,11 @@ TFB_FlushGraphics () // Only call from main thread!!
|
|||||||
}
|
}
|
||||||
break;
|
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:
|
case TFB_DRAWCOMMANDTYPE_IMAGE:
|
||||||
{
|
{
|
||||||
TFB_Image *DC_image = DC.data.image.image;
|
TFB_Image *DC_image = DC.data.image.image;
|
||||||
|
|||||||
+16
-11
@@ -19,6 +19,8 @@
|
|||||||
#include "starcon.h"
|
#include "starcon.h"
|
||||||
#include "libs/graphics/gfx_common.h"
|
#include "libs/graphics/gfx_common.h"
|
||||||
#include "libs/graphics/drawable.h"
|
#include "libs/graphics/drawable.h"
|
||||||
|
#include "libs/graphics/drawcmd.h"
|
||||||
|
#include "options.h"
|
||||||
|
|
||||||
COUNT DisplayFreeList;
|
COUNT DisplayFreeList;
|
||||||
PRIMITIVE DisplayArray[MAX_DISPLAY_PRIMS];
|
PRIMITIVE DisplayArray[MAX_DISPLAY_PRIMS];
|
||||||
@@ -981,22 +983,25 @@ PostProcessQueue (register VIEW_STATE view_state, register SIZE scroll_x,
|
|||||||
[index],
|
[index],
|
||||||
ElementPtr->next.image.frame);
|
ElementPtr->next.image.frame);
|
||||||
#endif /* SAFE */
|
#endif /* SAFE */
|
||||||
|
if (optMeleeScale == TFB_SCALE_TRILINEAR && index < 2 && scale != 256)
|
||||||
LockMutex (((PFRAME_DESC)ElementPtr->next.image.frame)->image->mutex);
|
|
||||||
if (index < 2 && scale != 256)
|
|
||||||
{
|
{
|
||||||
// assigns next (smaller) zoom level image as mipmap, needed for trilinear scaling
|
// enqueues drawcommand to assign next (smaller) zoom
|
||||||
((PFRAME_DESC)ElementPtr->next.image.frame)->image->MipmapImg =
|
// level image as mipmap, needed for trilinear scaling
|
||||||
|
|
||||||
|
TFB_DrawCommand DC;
|
||||||
|
TFB_Image *mmimg =
|
||||||
((PFRAME_DESC)SetEquFrameIndex (
|
((PFRAME_DESC)SetEquFrameIndex (
|
||||||
ElementPtr->next.image.farray
|
ElementPtr->next.image.farray
|
||||||
[index + 1],
|
[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
|
#endif
|
||||||
}
|
}
|
||||||
DisplayArray[ElementPtr->PrimIndex].Object.Stamp.frame =
|
DisplayArray[ElementPtr->PrimIndex].Object.Stamp.frame =
|
||||||
|
|||||||
Reference in New Issue
Block a user