예제 #1
0
void
InitOscilloscope (DWORD x, DWORD y, DWORD width, DWORD height, FRAME f)
{
	scope_frame = f;
	if (!scope_init)
	{
		TFB_Canvas scope_bg_canvas, scope_surf_canvas;
		if (TFB_DrawCanvas_IsPaletted (scope_frame->image->NormalImg))
		{
			scope_bg_canvas = TFB_DrawCanvas_New_Paletted (width, height,
					scope_frame->image->Palette, -1);
			scope_surf_canvas = TFB_DrawCanvas_New_Paletted (width, height,
					scope_frame->image->Palette, -1);
		}
		else
		{
			scope_bg_canvas = TFB_DrawCanvas_New_ForScreen (width, height,
					FALSE);
			scope_surf_canvas = TFB_DrawCanvas_New_ForScreen (width, height,
					FALSE);
		}
		scope_bg = TFB_DrawImage_New (scope_bg_canvas);
		scope_surf = TFB_DrawImage_New (scope_surf_canvas);
		TFB_DrawImage_Image (scope_frame->image, 0, 0, 0, NULL, scope_bg);
		scope_init = 1;
	}
	/* remove compiler warnings */
	(void) x;
	(void) y;
}
예제 #2
0
TFB_Image*
TFB_DrawImage_CreateForScreen (int w, int h, BOOLEAN withalpha)
{
	TFB_Image* img = HMalloc (sizeof (TFB_Image));
	img->mutex = CreateMutex ("image lock", SYNC_CLASS_VIDEO);
	img->ScaledImg = NULL;
	img->MipmapImg = NULL;
	img->FilledImg = NULL;
	img->colormap_index = -1;
	img->colormap_version = 0;
	img->NormalHs = NullHs;
	img->MipmapHs = NullHs;
	img->last_scale_hs = NullHs;
	img->last_scale_type = -1;
	img->last_scale = 0;
	img->extent.width = w;
	img->extent.height = h;

	img->NormalImg = TFB_DrawCanvas_New_ForScreen (w, h, withalpha);

	return img;
}