Esempio n. 1
0
static _Noreturn void mainLoop()
{
	uint32_t pad;

	while (true) {
		drawBottom();
		pad = InputWait();

		if (pad & BUTTON_A) rxMode(1);		//EMUNAND
		if (pad & BUTTON_X) rxMode(0);		//SYSNAND
		if (pad & BUTTON_Y) PastaMode();	//PASTAMODE
		if (pad & BUTTON_B) ShutDown(1);	//SHUTDOWN
		if (pad & BUTTON_LEFT)
		{
			if(cfgs[CFG_DEFAULT].val.i == 0) cfgs[CFG_DEFAULT].val.i = 3;
			else cfgs[CFG_DEFAULT].val.i--;
			writeCfg();

		}
		if(pad & BUTTON_RIGHT)
		{
			if(cfgs[CFG_DEFAULT].val.i == 3) cfgs[CFG_DEFAULT].val.i = 0;
			else cfgs[CFG_DEFAULT].val.i++;
			writeCfg();
		}
	}
}
Esempio n. 2
0
void	drawWalls()
{
  drawLeft();
  drawTop();
  drawBottom();
  drawRight();
}
Esempio n. 3
0
void LLCylinder::renderface(F32 pixel_area, S32 face)
{
	if (face < 0 || face > 2)
	{
		llerror("LLCylinder::renderface() invalid face number", face);
		return;
	}

	glMatrixMode(GL_MODELVIEW);
	glPushMatrix();

	S32 level_of_detail;

	if (pixel_area > 20000.f)
	{
		level_of_detail = 0;
	}
	else if (pixel_area > 1600.f)
	{
		level_of_detail = 1;
	}
	else if (pixel_area > 200.f)
	{
		level_of_detail = 2;
	}
	else
	{
		level_of_detail = 3;
	}

	if (level_of_detail < 0 || CYLINDER_LEVELS_OF_DETAIL <= level_of_detail)
	{
		llerror("LLCylinder::renderface() invalid level of detail", level_of_detail);
		return;
	}

	LLVertexBuffer::unbind();
	
	switch(face)
	{
	case 0:
		glTranslatef(0.f, 0.f, -0.5f);
		drawSide(level_of_detail);
		break;
	case 1:
		glTranslatef(0.0f, 0.f, 0.5f);
		drawTop(level_of_detail);
		break;
	case 2:
		glTranslatef(0.0f, 0.f, -0.5f);
		drawBottom(level_of_detail);
		break;
	default:
		llerror("LLCylinder::renderface() fell out of switch", 0);
		break;
	}

	glMatrixMode(GL_MODELVIEW);
	glPopMatrix();
}
Esempio n. 4
0
  sp<Retval> GdMonCpustat::draw(int num, sp<info>& info, sp<MonBase>& dest
                        , const char* path)
  {
      sp<Retval> retval;
      if( DFW_RET(retval, MonCpustat::draw(num, info, dest, path)) )
          return DFW_RETVAL_D(retval);
      if( DFW_RET(retval, baseInit()) )
          return DFW_RETVAL_D(retval);

      struct max_st  max;
      struct data_st dt;
      getMax(&max, info, m_g.cs.w);
      setData(&dt);

      drawHead(dest->m_sec, info->m_sec);

      uint64_t first_sec;
      uint64_t last_sec = dest->m_sec;
      for(int k=info->m_aLists.size(), dx=m_g.cr.ex; ((k>0)&&(dx>m_g.cr.sx));)
      {
          sp<GdMonCpustat> p  = info->m_aLists.get(k-1);
          sp<GdMonCpustat> pp = info->m_aLists.get(k-2);
          procData(dx, &max, &dt, p, pp);
          drawData(dx, &dt);
          k--;
          dx--;
          first_sec = p->m_sec;
      }

      drawBottom(dest, &max, &dt);
      drawLast(first_sec, last_sec);
      if( DFW_RET(retval, savePng(path, savename(), 0)) )
          return DFW_RETVAL_D(retval);
      return NULL;
  }
void ThirtyChoice::draw() const
{
    C2D_SceneBegin(g_renderTargetTop);
    Gui::sprite(ui_sheet_part_mtx_5x6_idx, 0, 0);

    int x = (hid.index() % 6) * 67;
    int y = (hid.index() / 6) * 48;
    // Selector
    C2D_DrawRectSolid(x, y, 0.5f, 66, 47, COLOR_MASKBLACK);
    C2D_DrawRectSolid(x, y, 0.5f, 66, 1, COLOR_YELLOW);
    C2D_DrawRectSolid(x, y, 0.5f, 1, 47, COLOR_YELLOW);
    C2D_DrawRectSolid(x + 65, y, 0.5f, 1, 47, COLOR_YELLOW);
    C2D_DrawRectSolid(x, y + 46, 0.5f, 66, 1, COLOR_YELLOW);

    for (int y = 0; y < 5; y++)
    {
        for (int x = 0; x < 6; x++)
        {
            size_t index = x + y * 6 + hid.page() * hid.maxVisibleEntries();
            if (index >= (size_t) items)
            {
                break;
            }
            Gui::pkm(pkms[index].species, pkms[index].form, gen, 0, x * 67 + 18, y * 48 + 1);
            std::string text = StringUtils::wrap(labels[index], FONT_SIZE_9, 65.0f, 2);
            Gui::dynamicText(labels[index], x * 67 + 32, y * 48 + 39, FONT_SIZE_9, FONT_SIZE_9, COLOR_WHITE, TextPosX::CENTER, TextPosY::CENTER);
        }
    }

    drawBottom();
}
Esempio n. 6
0
QString CFileTransferAction::getMessage()
{
    QString content;

    //如果传输成功,且文件是图片,则直接在消息对话框中显示图片
    if(m_File->GetError() == CFileTransfer::NoError
            && m_File->GetState() == CFileTransfer::FinishedState
            && CTool::isImageFile(m_File->GetLocalFileUrl().toLocalFile()))
    {
        return drawImageFile();
    }

    //content += "<table bgcolor='#00ffff'>";
    content += "<table>";
    content += drawTop();
    content += drawProgressBar();
    content += drawBottom();
    content += "</table>";
    return content;
}
Esempio n. 7
0
void LLCone::render(S32 level_of_detail)
{
	GLfloat height = 1.0f;

	if (level_of_detail < 0 || CONE_LEVELS_OF_DETAIL <= level_of_detail)
	{
		llerror("LLCone::render() invalid level of detail", level_of_detail);
		return;
	}

	glMatrixMode(GL_MODELVIEW);
	glPushMatrix();

	// center object at 0
	glTranslatef(0.f, 0.f, - height / 2.0f);

	drawSide(level_of_detail);
	drawBottom(level_of_detail);

	glMatrixMode(GL_MODELVIEW);
	glPopMatrix();
}
Esempio n. 8
0
void LLCone::renderface(S32 level_of_detail, S32 face)
{
	if (face < 0 || face > 1)
	{
		llerror("LLCone::renderface() invalid face number", face);
		return;
	}

	if (level_of_detail < 0 || CONE_LEVELS_OF_DETAIL <= level_of_detail)
	{
		llerror("LLCone::renderface() invalid level of detail", level_of_detail);
		return;
	}

	glMatrixMode(GL_MODELVIEW);
	glPushMatrix();

	LLVertexBuffer::unbind();
	
	switch(face)
	{
	case 0:
		glTranslatef(0.f, 0.f, -0.5f);
		drawSide(level_of_detail);
		break;
	case 1:
		glTranslatef(0.f, 0.f, -0.5f);
		drawBottom(level_of_detail);
		break;
	default:
		llerror("LLCylinder::renderface() fell out of switch", 0);
		break;
	}

	glMatrixMode(GL_MODELVIEW);
	glPopMatrix();
}
void DragFrameShape::draw_Bottom(const DrawBuf &buf) const
 {
  drawBottom(buf,dragBottom,dragColor(DragType_Bottom));
 }
Esempio n. 10
0
void GuiSetBorder::setBottom(bool border)
{
	bottom_.set = border;
	drawBottom(border);
}
Esempio n. 11
0
void GuiSetBorder::setBottomEnabled(bool border)
{
	bottom_.enabled = border;
	drawBottom(border);
}