void vsx_widget_controller_slider::draw()
{
  if (!visible) return;

  vsx_widget_controller_base::draw();
  glLineWidth(1.0f);
  float ypos=parentpos.y+pos.y+get_y_pos();
  ((vsx_widget_base_edit*)editor)->set_string(vsx_string_helper::f2s(presentation_value,15));
  glBegin(GL_LINES);
    glColor4f(1,1,1,0.2);
    float ymin=parentpos.y+pos.y-size.y/2+handlesize/2,
          ymax=parentpos.y+pos.y+size.y/2-handlesize/2,
          stepfactor=(ymax-ymin)/20;
    int c=0;
    for (float yy=ymax;yy>=ymin-(stepfactor/2);yy-=stepfactor)
    {
      float ww=size.x*0.25;
      if (c%2==1) ww=size.x*0.4;
      if (c%10==0) ww=size.x*0.1;
      ++c;
      glVertex3f(parentpos.x+pos.x+size.x/2, yy,pos.z);
      glVertex3f(parentpos.x+pos.x+ww, yy,pos.z);
      glVertex3f(parentpos.x+pos.x-size.x/2, yy,pos.z);
      glVertex3f(parentpos.x+pos.x-ww, yy,pos.z);
    }
    glColor4f(0,0,0,1);
    glVertex3f(parentpos.x+pos.x, parentpos.y+pos.y+size.y/2-handlesize/2,pos.z);
    glVertex3f(parentpos.x+pos.x, parentpos.y+pos.y-size.y/2+handlesize/2,pos.z);
  glEnd();
  glBegin(GL_TRIANGLE_FAN);
    glColor4f(lightshade*color.r,lightshade*color.g,lightshade*color.b,color.a);
    glVertex3f(parentpos.x+pos.x+size.x/3, ypos+handlesize*0.5,pos.z);//top right
    glColor4f(darkshade*color.r,darkshade*color.g,darkshade*color.b,color.a);
    glVertex3f(parentpos.x+pos.x+size.x/3, ypos,pos.z);//right center
    glColor4f(lightshade*color.r,lightshade*color.g,lightshade*color.b,color.a);
    glVertex3f(parentpos.x+pos.x+size.x/3,ypos-handlesize*0.5,pos.z); //bottom right
    glVertex3f(parentpos.x+pos.x-size.x/3,ypos-handlesize*0.5,pos.z); //bottom left
    glColor4f(darkshade*color.r,darkshade*color.g,darkshade*color.b,color.a);
    glVertex3f(parentpos.x+pos.x-size.x/3, ypos,pos.z); //left center
    glColor4f(lightshade*color.r,lightshade*color.g,lightshade*color.b,color.a);
    glVertex3f(parentpos.x+pos.x-size.x/3,ypos+handlesize*0.5,pos.z); //top left
    glVertex3f(parentpos.x+pos.x+size.x/3, ypos+handlesize*0.5,pos.z);//top right
  glEnd();
  glBegin(GL_LINES);
    glColor4f(0,0,0,1);
    glVertex3f(parentpos.x+pos.x+size.x/3, ypos,pos.z);
    glVertex3f(parentpos.x+pos.x-size.x/3, ypos,pos.z);
  glEnd();
  draw_children();
}
示例#2
0
文件: tank8.cpp 项目: MASHinfo/mame
void tank8_state::draw_bullets(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int i;

	for (i = 0; i < 8; i++)
	{
		int x = get_x_pos(8 + i);
		int y = get_y_pos(8 + i);

		x -= 4; /* ? */

		rectangle rect(x, x + 3, y, y + 4);
		rect &= cliprect;

		bitmap.fill((i << 1) | 0x01, rect);
	}
}
int vsx_widget_controller_slider::inside_xy_l(vsx_vector3<> &test, vsx_vector3<> &global)
{
  float ypos = get_y_pos();
  if (coord_type == VSX_WIDGET_COORD_CENTER)
  {
    if (
       (test.x > global.x-target_size.x*0.5f) &&
       (test.x < global.x+target_size.x*0.5f) &&
       (test.y > global.y+ypos-handlesize/2) &&
       (test.y < global.y+ypos+handlesize/2)
    )
    {
       return coord_type;
    }
  }
  return 0;
}
示例#4
0
文件: tank8.c 项目: j4y4r/j4ymame
static void draw_bullets(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	tank8_state *state = machine.driver_data<tank8_state>();
	int i;

	for (i = 0; i < 8; i++)
	{
		int x = get_x_pos(state, 8 + i);
		int y = get_y_pos(state, 8 + i);

		x -= 4; /* ? */

		rectangle rect(x, x + 3, y, y + 4);
		rect &= cliprect;

		bitmap.fill((i << 1) | 0x01, rect);
	}
}
示例#5
0
文件: tank8.cpp 项目: MASHinfo/mame
void tank8_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int i;

	for (i = 0; i < 8; i++)
	{
		uint8_t code = ~m_pos_d_ram[i];

		int x = get_x_pos(i);
		int y = get_y_pos(i);

		m_gfxdecode->gfx((code & 0x04) ? 2 : 3)->transpen(bitmap,cliprect,
			code & 0x03,
			i,
			code & 0x10,
			code & 0x08,
			x,
			y, 0);
	}
}
示例#6
0
文件: tank8.c 项目: j4y4r/j4ymame
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	tank8_state *state = machine.driver_data<tank8_state>();
	int i;

	for (i = 0; i < 8; i++)
	{
		UINT8 code = ~state->m_pos_d_ram[i];

		int x = get_x_pos(state, i);
		int y = get_y_pos(state, i);

		drawgfx_transpen(bitmap, cliprect, machine.gfx[(code & 0x04) ? 2 : 3],
			code & 0x03,
			i,
			code & 0x10,
			code & 0x08,
			x,
			y, 0);
	}
}
示例#7
0
文件: tank8.c 项目: crazii/mameplus
void tank8_state::screen_eof_tank8(screen_device &screen, bool state)
{
	// on falling edge
	if (!state)
	{
		int x;
		int y;
		const rectangle &visarea = m_screen->visible_area();

		m_tilemap->draw(screen, m_helper1, visarea, 0, 0);

		m_helper2.fill(8, visarea);
		m_helper3.fill(8, visarea);

		draw_sprites(m_helper2, visarea);
		draw_bullets(m_helper3, visarea);

		for (y = visarea.min_y; y <= visarea.max_y; y++)
		{
			int _state = 0;

			const UINT16* p1 = &m_helper1.pix16(y);
			const UINT16* p2 = &m_helper2.pix16(y);
			const UINT16* p3 = &m_helper3.pix16(y);

			if ((m_screen->frame_number() ^ y) & 1)
				continue; /* video display is interlaced */

			for (x = visarea.min_x; x <= visarea.max_x; x++)
			{
				UINT8 index;

				/* neither wall nor mine */
				if ((p1[x] != 0x11) && (p1[x] != 0x13))
				{
					_state = 0;
					continue;
				}

				/* neither tank nor bullet */
				if ((p2[x] == 8) && (p3[x] == 8))
				{
					_state = 0;
					continue;
				}

				/* bullets cannot hit mines */
				if ((p3[x] != 8) && (p1[x] == 0x13))
				{
					_state = 0;
					continue;
				}

				if (_state)
					continue;

				if (p3[x] != 8)
				{
					index = ((p3[x] & ~0x01) >> 1) | 0x18;

					if (1)
						index |= 0x20;

					if (0)
						index |= 0x40;

					if (1)
						index |= 0x80;
				}
				else
				{
					int sprite_num = (p2[x] & ~0x01) >> 1;
					index = sprite_num | 0x10;

					if (p1[x] == 0x11)
						index |= 0x20;

					if (y - get_y_pos(sprite_num) >= 8)
						index |= 0x40; /* collision on bottom side */

					if (x - get_x_pos(sprite_num) >= 8)
						index |= 0x80; /* collision on right side */
				}

				timer_set(screen.time_until_pos(y, x), TIMER_COLLISION, index);

				_state = 1;
			}