Purged SetGraphicStrength, as the arith_blit_frame routine supercedes it.

Cleaned up DCQ code appropriately to reflect this.


git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@626 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
mcmartin
2003-02-01 06:02:50 +00:00
parent 366c385cb0
commit fcccc5a8f5
11 changed files with 45 additions and 79 deletions
+2
View File
@@ -1,4 +1,6 @@
Changes towards version 0.2:
- Removed the GraphicStrength code, since all that is handled with
an arithmetic blit routine outside of the drawing thread
- Added an improved version of biadapt scaling filter,
working name "biadv" (use --scale=biadv) -fOSSiL
- Removed SDL_mixer sound module
-4
View File
@@ -57,7 +57,6 @@ typedef struct tfb_dc_img
{
TFB_Image *image;
int x, y;
int BlendNumerator, BlendDenominator;
SCREEN destBuffer;
BOOLEAN UsePalette;
BOOLEAN UseScaling;
@@ -68,7 +67,6 @@ typedef struct tfb_dc_filledimg
TFB_Image *image;
int x, y;
int r, g, b;
int BlendNumerator, BlendDenominator;
SCREEN destBuffer;
BOOLEAN UseScaling;
} TFB_DrawCommand_FilledImage;
@@ -76,7 +74,6 @@ typedef struct tfb_dc_filledimg
typedef struct tfb_dc_copy
{
int x, y, w, h;
int BlendNumerator, BlendDenominator;
SCREEN srcBuffer, destBuffer;
} TFB_DrawCommand_Copy;
@@ -84,7 +81,6 @@ typedef struct tfb_dc_copyimg
{
TFB_Image *image;
int x, y, w, h;
int BlendNumerator, BlendDenominator;
SCREEN srcBuffer;
} TFB_DrawCommand_CopyToImage;
+22 -7
View File
@@ -33,15 +33,30 @@ int ScreenWidthActual;
int ScreenHeightActual;
int GraphicsDriver;
int TFB_DEBUG_HALT = 0;
int BlendNumerator = 4;
int BlendDenominator = 4;
// Status: Ignored (only used in fmv.c)
void
SetGraphicStrength (int numerator, int denominator)
SetGraphicUseOtherExtra (int other) //Could this possibly be more cryptic?!? :)
{
//fprintf (stderr, "SetGraphicsStrength %d %d\n",numerator, denominator);
BlendNumerator = numerator;
BlendDenominator = denominator;
//fprintf(stderr, "SetGraphicUseOtherExtra %d\n", other);
}
// Status: Ignored (only used in solarsys.c)
void
SetGraphicGrabOther (int grab_other)
{
//fprintf(stderr, "SetGraphicGrabOther %d\n", grab_other);
}
void
DrawFromExtraScreen (PRECT r)
{
TFB_DrawScreen_Copy(r, TFB_SCREEN_EXTRA, TFB_SCREEN_MAIN);
}
void
LoadIntoExtraScreen (PRECT r)
{
TFB_DrawScreen_Copy(r, TFB_SCREEN_MAIN, TFB_SCREEN_EXTRA);
}
@@ -53,11 +53,9 @@ void TFB_ProcessEvents (void);
void LoadIntoExtraScreen (PRECT r);
void DrawFromExtraScreen (PRECT r);
void SetGraphicStrength (int numer, int denom);
void SetGraphicGrabOther (int grab_other);
void SetGraphicScale (int scale);
void SetGraphicUseOtherExtra (int other);
void *GetScreenBitmap (void);
void ScreenTransition (int transition, PRECT pRect);
extern float FrameRate;
@@ -72,8 +70,6 @@ extern int ScreenHeight;
extern int ScreenWidthActual;
extern int ScreenHeightActual;
extern int GraphicsDriver;
extern int BlendNumerator;
extern int BlendDenominator;
int Starcon2Main (void *);
+5 -8
View File
@@ -24,6 +24,11 @@
static int gscale;
void
SetGraphicScale (int scale)
{
gscale = scale;
}
static void
blt (PRECT pClipRect, PRIMITIVEPTR PrimPtr)
@@ -364,12 +369,4 @@ LoadDisplay (PDISPLAY_INTERFACE *pDisplay)
*pDisplay = &DisplayInterface;
}
// Status: Unimplemented
void
SetGraphicScale (int scale)
//Calibration...
{
gscale = scale;
}
#endif
@@ -80,20 +80,6 @@ FlushGraphics ()
TFB_DrawScreen_WaitForSignal ();
}
// Status: Ignored (only used in fmv.c)
void
SetGraphicUseOtherExtra (int other) //Could this possibly be more cryptic?!? :)
{
//fprintf(stderr, "SetGraphicUseOtherExtra %d\n", other);
}
// Status: Ignored (only used in solarsys.c)
void
SetGraphicGrabOther (int grab_other)
{
//fprintf(stderr, "SetGraphicGrabOther %d\n", grab_other);
}
static int
transition_task_func (void *data)
{
@@ -172,18 +158,6 @@ ScreenTransition (int TransType, PRECT pRect)
}
}
void
DrawFromExtraScreen (PRECT r) //No scaling?
{
TFB_DrawScreen_Copy(r, TFB_SCREEN_EXTRA, TFB_SCREEN_MAIN);
}
void
LoadIntoExtraScreen (PRECT r)
{
TFB_DrawScreen_Copy(r, TFB_SCREEN_MAIN, TFB_SCREEN_EXTRA);
}
// Status: Ignored
BOOLEAN
InitVideo (BOOLEAN useCDROM) //useCDROM doesn't really apply to us...
+4 -4
View File
@@ -60,7 +60,7 @@ TFB_DrawCanvas_Rect (PRECT rect, int r, int g, int b, TFB_Canvas target)
}
void
TFB_DrawCanvas_Image (TFB_Image *img, int x, int y, BOOLEAN scaled, TFB_Palette *palette, TFB_Canvas target, int bn, int bd)
TFB_DrawCanvas_Image (TFB_Image *img, int x, int y, BOOLEAN scaled, TFB_Palette *palette, TFB_Canvas target)
{
SDL_Rect targetRect;
SDL_Surface *surf;
@@ -92,12 +92,12 @@ TFB_DrawCanvas_Image (TFB_Image *img, int x, int y, BOOLEAN scaled, TFB_Palette
}
}
TFB_BlitSurface(surf, NULL, target, &targetRect, bn, bd);
SDL_BlitSurface(surf, NULL, (NativeCanvas) target, &targetRect);
UnlockMutex (img->mutex);
}
void
TFB_DrawCanvas_FilledImage (TFB_Image *img, int x, int y, BOOLEAN scaled, int r, int g, int b, TFB_Canvas target, int bn, int bd)
TFB_DrawCanvas_FilledImage (TFB_Image *img, int x, int y, BOOLEAN scaled, int r, int g, int b, TFB_Canvas target)
{
SDL_Rect targetRect;
SDL_Surface *surf;
@@ -128,6 +128,6 @@ TFB_DrawCanvas_FilledImage (TFB_Image *img, int x, int y, BOOLEAN scaled, int r,
}
SDL_SetColors (surf, pal, 0, 256);
TFB_BlitSurface(surf, NULL, target, &targetRect, bn, bd);
SDL_BlitSurface(surf, NULL, (NativeCanvas) target, &targetRect);
UnlockMutex (img->mutex);
}
@@ -585,8 +585,7 @@ TFB_FlushGraphics () // Only call from main thread!!
TFB_DrawCanvas_Image (DC_image, x, y,
DC.data.image.UseScaling, pal,
SDL_Screens[DC.data.image.destBuffer],
DC.data.image.BlendNumerator, DC.data.image.BlendDenominator);
SDL_Screens[DC.data.image.destBuffer]);
break;
}
@@ -603,8 +602,7 @@ TFB_FlushGraphics () // Only call from main thread!!
TFB_DrawCanvas_FilledImage (DC.data.filledimage.image, DC.data.filledimage.x, DC.data.filledimage.y,
DC.data.filledimage.UseScaling, DC.data.filledimage.r, DC.data.filledimage.g,
DC.data.filledimage.b, SDL_Screens[DC.data.filledimage.destBuffer],
DC.data.filledimage.BlendNumerator, DC.data.filledimage.BlendDenominator);
DC.data.filledimage.b, SDL_Screens[DC.data.filledimage.destBuffer]);
break;
}
case TFB_DRAWCOMMANDTYPE_LINE:
@@ -662,7 +660,7 @@ TFB_FlushGraphics () // Only call from main thread!!
dest.x = 0;
dest.y = 0;
TFB_BlitSurface(SDL_Screens[DC.data.copytoimage.srcBuffer], &src, DC_image->NormalImg, &dest, DC.data.copytoimage.BlendNumerator, DC.data.copytoimage.BlendDenominator);
SDL_BlitSurface(SDL_Screens[DC.data.copytoimage.srcBuffer], &src, DC_image->NormalImg, &dest);
UnlockMutex (DC_image->mutex);
break;
}
@@ -678,7 +676,7 @@ TFB_FlushGraphics () // Only call from main thread!!
TFB_BBox_RegisterPoint (src.x + src.w, src.y + src.h);
TFB_BlitSurface(SDL_Screens[DC.data.copy.srcBuffer], &src, SDL_Screens[DC.data.copy.destBuffer], &dest, DC.data.copy.BlendNumerator, DC.data.copy.BlendDenominator);
SDL_BlitSurface(SDL_Screens[DC.data.copy.srcBuffer], &src, SDL_Screens[DC.data.copy.destBuffer], &dest);
break;
}
case TFB_DRAWCOMMANDTYPE_DELETEIMAGE:
+2 -14
View File
@@ -115,8 +115,6 @@ TFB_DrawScreen_Image (TFB_Image *img, int x, int y, BOOLEAN scaled, TFB_Palette
}
DC.data.image.destBuffer = dest;
DC.data.image.BlendNumerator = BlendNumerator;
DC.data.image.BlendDenominator = BlendDenominator;
TFB_EnqueueDrawCommand (&DC);
Unlock_DCQ ();
@@ -136,8 +134,6 @@ TFB_DrawScreen_FilledImage (TFB_Image *img, int x, int y, BOOLEAN scaled, int r,
DC.data.filledimage.g = g;
DC.data.filledimage.b = b;
DC.data.filledimage.destBuffer = dest;
DC.data.filledimage.BlendNumerator = BlendNumerator;
DC.data.filledimage.BlendDenominator = BlendDenominator;
TFB_EnqueueDrawCommand (&DC);
}
@@ -155,9 +151,6 @@ TFB_DrawScreen_CopyToImage (TFB_Image *img, PRECT lpRect, SCREEN src)
DC.data.copytoimage.image = img;
DC.data.copytoimage.srcBuffer = src;
DC.data.copytoimage.BlendNumerator = BlendNumerator;
DC.data.copytoimage.BlendDenominator = BlendDenominator;
TFB_EnqueueDrawCommand (&DC);
}
@@ -183,9 +176,6 @@ TFB_DrawScreen_Copy (PRECT r, SCREEN src, SCREEN dest)
DC.data.copy.srcBuffer = src;
DC.data.copy.destBuffer = dest;
DC.data.copy.BlendNumerator = BlendNumerator;
DC.data.copy.BlendDenominator = BlendDenominator;
TFB_EnqueueDrawCommand (&DC);
}
@@ -217,8 +207,6 @@ TFB_DrawScreen_WaitForSignal (void)
WaitForSignal ();
}
/* These don't compile until I write the DrawCanvas commands. */
void
TFB_DrawImage_Line (int x1, int y1, int x2, int y2, int r, int g, int b, TFB_Image *dest)
{
@@ -241,7 +229,7 @@ void
TFB_DrawImage_Image (TFB_Image *img, int x, int y, BOOLEAN scaled, TFB_Palette *palette, TFB_Image *target)
{
LockMutex (target->mutex);
TFB_DrawCanvas_Image (img, x, y, scaled, palette, target->NormalImg, 4, 4);
TFB_DrawCanvas_Image (img, x, y, scaled, palette, target->NormalImg);
target->dirty = TRUE;
UnlockMutex (target->mutex);
}
@@ -250,7 +238,7 @@ void
TFB_DrawImage_FilledImage (TFB_Image *img, int x, int y, BOOLEAN scaled, int r, int g, int b, TFB_Image *target)
{
LockMutex (target->mutex);
TFB_DrawCanvas_FilledImage (img, x, y, scaled, r, g, b, target->NormalImg, 4, 4);
TFB_DrawCanvas_FilledImage (img, x, y, scaled, r, g, b, target->NormalImg);
target->dirty = TRUE;
UnlockMutex (target->mutex);
}
+2 -2
View File
@@ -69,7 +69,7 @@ void TFB_DrawImage_FilledImage (TFB_Image *img, int x, int y, BOOLEAN scaled, in
void TFB_DrawCanvas_Line (int x1, int y1, int x2, int y2, int r, int g, int b, TFB_Canvas dest);
void TFB_DrawCanvas_Rect (PRECT rect, int r, int g, int b, TFB_Canvas image);
void TFB_DrawCanvas_Image (TFB_Image *img, int x, int y, BOOLEAN scaled, TFB_Palette *palette, TFB_Canvas target, int bn, int bd);
void TFB_DrawCanvas_FilledImage (TFB_Image *img, int x, int y, BOOLEAN scaled, int r, int g, int b, TFB_Canvas target, int bn, int bd);
void TFB_DrawCanvas_Image (TFB_Image *img, int x, int y, BOOLEAN scaled, TFB_Palette *palette, TFB_Canvas target);
void TFB_DrawCanvas_FilledImage (TFB_Image *img, int x, int y, BOOLEAN scaled, int r, int g, int b, TFB_Canvas target);
#endif