// draws the oscilloscope void Oscilloscope (DWORD grab_data) { STAMP s; if (oscillDisabled) return; if (!grab_data) return; TFB_DrawImage_Image (scope_bg, 0, 0, 0, NULL, scope_surf); if (GetSoundData (scope_data)) { int i, r, g, b; TFB_DrawCanvas_GetPixel (scope_bg->NormalImg, scope_bg->extent.width / 2, scope_bg->extent.height / 2, &r, &g, &b); for (i = 0; i < RADAR_WIDTH - 3; ++i) TFB_DrawImage_Line (i + 1, scope_data[i], i + 2, scope_data[i + 1], r, g, b, scope_surf); } TFB_DrawImage_Image (scope_surf, 0, 0, 0, NULL, scope_frame->image); s.frame = scope_frame; s.origin.x = s.origin.y = 0; DrawStamp (&s); }
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; }
void FixContextFontEffect (void) { SIZE w, h; TFB_Image* img; if (!ContextActive () || (_get_context_font_backing () != 0 && !(_get_context_fbk_flags () & FBK_DIRTY))) return; if (!GetContextFontLeading (&h) || !GetContextFontLeadingWidth (&w)) return; img = _pCurContext->FontBacking; if (img) TFB_DrawScreen_DeleteImage (img); img = TFB_DrawImage_CreateForScreen (w, h, TRUE); if (_get_context_fbk_flags () & FBK_IMAGE) { // image pattern backing FRAME EffectFrame = _get_context_fonteff (); TFB_DrawImage_Image (EffectFrame->image, -EffectFrame->HotSpot.x, -EffectFrame->HotSpot.y, 0, 0, NULL, DRAW_REPLACE_MODE, img); } else { // solid color backing RECT r = { {0, 0}, {w, h} }; Color color = _get_context_fg_color (); TFB_DrawImage_Rect (&r, color, DRAW_REPLACE_MODE, img); } _pCurContext->FontBacking = img; UnsetContextFBkFlags (FBK_DIRTY); }