protected override Surface CreateSurface() { return(GuiUtil.CreateSurfaceFromBitmap(grp.GetFrame(frame), grp.Width, grp.Height, Palette, true)); }
void TileRow(Surface surf, Grp grp, byte[] pal, int l, int c, int r, int y) { Surface lsurf = GuiUtil.CreateSurfaceFromBitmap(grp.GetFrame(l), grp.Width, grp.Height, pal, 41, 0); Surface csurf = GuiUtil.CreateSurfaceFromBitmap(grp.GetFrame(c), grp.Width, grp.Height, pal, 41, 0); Surface rsurf = GuiUtil.CreateSurfaceFromBitmap(grp.GetFrame(r), grp.Width, grp.Height, pal, 41, 0); surf.Blit(lsurf, new Point(0, y)); for (int x = grp.Width; x < surf.Width - grp.Width; x += grp.Width) { surf.Blit(csurf, new Point(x, y)); } surf.Blit(rsurf, new Point(surf.Width - grp.Width, y)); }
void DoPlayFrame(int frame_num) { if (current_frame != frame_num) { current_frame = frame_num; if (sprite_surface != null) { sprite_surface.Dispose(); } sprite_surface = GuiUtil.CreateSurfaceFromBitmap(grp.GetFrame(frame_num), grp.Width, grp.Height, palette, true); Invalidate(); } }
void Paint(DateTime now) { int draw_x = (int)(x - hot_x); int draw_y = (int)(y - hot_y); if (current_frame == grp.FrameCount) { current_frame = 0; } if (surfaces[current_frame] == null) { surfaces[current_frame] = GuiUtil.CreateSurfaceFromBitmap(grp.GetFrame(current_frame), grp.Width, grp.Height, palette, true); } Painter.Blit(surfaces[current_frame], new Point(draw_x, draw_y)); }