Esempio n. 1
0
bool masked_image::pos_visible(coord_int x, coord_int y) const
{
  int p = getpixel(image,x-get_cx(),y-get_cy());
  if (p == -1 || p == bitmap_mask_color(image)) return false;

  return true;
}
Esempio n. 2
0
/* This simple function is called whenever a subliminal window's sub-buffer is
 * changed at all. The 'sub_changed_hook' function is called, and then the 
 * window is displayed. If linear, only the portion that was changed is displayed,
 * otherwise, the entire window is redrawn.
 */
void window_sub::sub_buffer_updated(zone* list)
{
  sub_changed_hook(list); // Call the hook

  if (flag(grx_sensitive) && list) 
  {
    // If this subliminal window is a linear, just display the effected areas by
    // calling 'draw_arb_zones' with no recursion flags
    if (linear) 
    {
      list->offset_list(get_cx(), get_cy());
      draw_arb_zones(list, DAZ_F_SPYSUB);
    } else display(); // If it isn't linear, display the entire window.
  }
}
Esempio n. 3
0
int Cwsa_dune2_file::extract_as_pcx(const Cfname& name, const t_palet _palet) const
{
	t_palet palet;
	convert_palet_18_to_24(_palet, palet);
	int error = 0;
	const int cx = get_cx();
	const int cy = get_cy();
	const int c_frames = get_c_frames();
	byte* frame = new byte[cx * cy];
	byte* s = new byte[64 << 10];
	byte* d = new byte[cx * cy * 2];
	memset(frame, 0, cx * cy);
	for (int i = 0; i < c_frames; i++)
	{
		if (get_offset(i))
		{
			decode80(get_frame(i), s);
			decode40(s, frame);
		}
		int cb_d = pcx_encode(frame, d, cx, cy, 1);
		Cpcx_file_write f;
		Cfname t = name;
		t.set_title(name.get_ftitle() + " " + nwzl(4, i));
		error = f.open_write(t);
		if (error)
			break;
		f.set_size(cx, cy, 1);
		error = f.write_header();
		if (!error)
			error = f.write_image(d, cb_d);
		if (!error)
			error = f.write_palet(palet);
		f.close();
		if (error)
			break;
	}
	delete[] d;
	delete[] s;
	delete[] frame;
	return error;
}