Ejemplo n.º 1
0
static void statusDrawStart() {
	if (*style.activitytop1img) {
		DrawSplash(&top1Screen, style.activitytop1img);
//		if (*style.activitytop2img)
//			DrawSplash(&top2Screen, style.activitytop2img);
//		else
//			memcpy(top2Screen.buf2, top1Screen.buf2, top1Screen.size);
	} else if (*style.top1img) {
		DrawSplash(&top1Screen, style.top1img);
//		if (*style.top2img)
//			DrawSplash(&top2Screen, style.top2img);
//		else
//			memcpy(top2Screen.buf2, top1Screen.buf2, top1Screen.size);
	} else {
		ClearScreen(&top1Screen, BLACK);
//		ClearScreen(&top2Screen, BLACK);
	}
	if (*style.activitybottomimg)
		DrawSplash(&bottomScreen, style.activitybottomimg);
	else if (*style.bottomimg)
		DrawSplash(&bottomScreen, style.bottomimg);
	else
		ClearScreen(&bottomScreen, BLACK);
	DrawStringRect(&bottomScreen, status_caption, &style.activityRect, style.activityColor, style.activityAlign, 30);
}
Ejemplo n.º 2
0
void ConsoleShow() {
    wchar_t str[_MAX_LFN];

    void *tmpscreen = (void*)0x27000000;
    swprintf(str, _MAX_LFN, L"/rxTools/Theme/%u/app.bin", cfgs[CFG_THEME].val.i);
    DrawSplash(tmpscreen, str);
    if(!consoleInited) return;
    int titley = 2*FONT_HEIGHT;

    //for(int y = ConsoleY; y < ConsoleH + ConsoleY + BorderWidth; y++){
    //	for(int x = ConsoleX; x < ConsoleW + ConsoleX + BorderWidth; x++){
    //		if(//(x >= ConsoleX && x <= ConsoleX + BorderWidth) ||
    //		   //(x >= ConsoleW + ConsoleX - 1 && x <= ConsoleW + ConsoleX - 1 + BorderWidth) ||
    //		   (y >= ConsoleY && y <= ConsoleY + BorderWidth) ||
    //		   (y >= ConsoleH + ConsoleY - 1 && y <= ConsoleH + ConsoleY - 1 + BorderWidth) ||
    //		   (y >= ConsoleY + titley - BorderWidth && y <= ConsoleY + titley)){
    //			DrawPixel(x, y, BorderColor, (int)tmpscreen);
    //		}else{
    //			DrawPixel(x, y, BackgroundColor, (int)tmpscreen);
    //		}
    //	}
    //}
    int titlespace = 2*FONT_HEIGHT-2*BorderWidth;
    DrawString(tmpscreen, consoletitle, ConsoleX + BorderWidth + 2 * FONT_HWIDTH, ConsoleY + (titlespace - FONT_HEIGHT) / 2 + BorderWidth, TextColor, ConsoleGetBackgroundColor());

    for (int i = 0; i < CONSOLE_MAX_LINES; i++)
        DrawString(tmpscreen, console[i],
                   ConsoleX + FONT_HWIDTH * Spacing,
                   i * FONT_HEIGHT + ConsoleY + 15 + FONT_HEIGHT * (Spacing - 1) + titley,
                   TextColor, ConsoleGetBackgroundColor());

    memcpy(BOT_SCREEN, tmpscreen, SCREEN_SIZE);
}
Ejemplo n.º 3
0
void AdvFileManagerMain(){
	panel_t Panels[2];
	int currentPanel = 0;

	//Reset both panels
	for (i = 0; i < 2; i++)
	{
		Panels[i].pointer = 0;
		Panels[i].beginning = 0;
		Panels[i].openedFolder = 0;
		Panels[i].enabled = 0;
		wcscpy(Panels[i].dir, L"");		
		Panels[i].count = AdvFileManagerList(Panels[i].dir, &Panels[i].files);
	}
	Panels[0].enabled = 1;

	

	while (true)
	{
		//Background
		wchar_t str[_MAX_LFN];
		swprintf(str, _MAX_LFN, L"/rxTools/Theme/%u/FM.bin", cfgs[CFG_THEME].val.i);
		DrawSplash(screentmp, str);

		AdvFileManagerShow(&Panels[0], 0);
		AdvFileManagerShow(&Panels[1], 155);
		memcpy(BOT_SCREEN, screentmp, SCREEN_SIZE); //Trick to avoid screen flickering

		uint32_t pad_state = InputWait();
		if (pad_state & BUTTON_DOWN) AdvFileManagerNextSelection(&Panels[currentPanel]);
		else if (pad_state & BUTTON_UP) AdvFileManagerPrevSelection(&Panels[currentPanel]);
		else if (pad_state & BUTTON_A) AdvFileManagerSelect(&Panels[currentPanel]);
		else if (pad_state & BUTTON_B)
		{
			if (Panels[currentPanel].openedFolder == 0) break;
			else AdvFileManagerBack(&Panels[currentPanel]);
		}
		else if (pad_state & BUTTON_LEFT) currentPanel = 0;
		else if (pad_state & BUTTON_RIGHT)currentPanel = 1;

		//Change page
		if (Panels[currentPanel].pointer - Panels[currentPanel].beginning == 10)Panels[currentPanel].beginning += 10;
		if (Panels[currentPanel].pointer<Panels[currentPanel].beginning)Panels[currentPanel].beginning -= 10;

		//Set who's enabled
		if (!currentPanel) { Panels[0].enabled = 1; Panels[1].enabled = 0; }
		else { Panels[0].enabled = 0; Panels[1].enabled = 1; }
	}
}
Ejemplo n.º 4
0
static void OnSplashPaint(WindowControl * Sender, LKSurface& Surface) {
    if(!SplashBitmap) {
        SplashBitmap = LoadSplash(_T("LKSTART"));
    }
    DrawSplash(Surface, SplashBitmap);
}
Ejemplo n.º 5
0
void CCockpit::Draw()
{
	//---------------------------------
	//描画処理
	//---------------------------------
	Sint32 bx=0,by=0;
	Sint32 wx,wy;

	if( m_sNowLoadingWait )
	{
		DrawNowLoading();
	}

	if( m_bSplash )
	{
		DrawSplash();
	}

	wx = 0;
	wy = m_sHeight;

	m_pRaderDamage->SetHitPoint( m_sDispHitPoint );

	if( m_bArrow )                     DrawArrow(WINDOW_W/2,WINDOW_H/2);
	
	if( m_bSwitch[enSwitchRader]    )  m_pRaderControl->Draw(0,WINDOW_H+wy);
	if( m_bSwitch[enSwitchRed]      )  m_pRaderDamage->DrawSekigaisen(470+24,5);

	//左上U.I
	if( m_bSwitch[enSwitchBullet]   ) DrawRelord(36,36-wy);	//HP表示
	if( m_bSwitch[enSwitchPosition] ) m_pRaderDamage->Draw(8,10+by-wy);

	if( m_bSwitch[enSwitchTime]     )  DrawTime(400-16,24-wy);
	if( m_bSwitch[enSwitchScore]    )  DrawScore(400-32,8-wy);
	if( m_bOutogRange )                DrawOutOfArea(320,240+wy);
	if( m_bSwitch[enSwitchMessage]   ) DrawShortMessage(64,44-wy);

	if( m_sBlackMask ) 				   DrawBlackmask();

	if( m_bSwitch[enSwitchDamage]   ) 
	{
		//DrawHitPoint();
	}
	else
	{
		m_sDispHitPoint = 0;
	}

	if( m_sWhiteFade )
	{
		DrawGameOver();
	}

//		enSwitchDamage,		//残りHP(ON/OFF)
//		enSwitchMessage,	//ショートメッセージ(ON/OFF)
//		enSwitchBullet,		//残弾数(ON/OFF)
//		enSwitchHigher,		//敵高度表示(ON/OFF)

	m_pMsgWindow->Draw(6,WINDOW_H-74-m_sBlackMask*28/100);

	if( m_pStageClear ) m_pStageClear->Draw();

}
Ejemplo n.º 6
0
static void OnSplashPaint(WindowControl * Sender, LKSurface& Surface) {

    TCHAR srcfile[MAX_PATH];

    if (RUN_MODE == RUN_SHUTDOWN) return;

    if(RUN_MODE == RUN_WELCOME) {
        if(!StartBitmap) {
            StartBitmap = LoadSplash(_T("LKSTART"));
        }
        if(StartBitmap) {
            DrawSplash(Surface, StartBitmap);
        }
    } else {
        if(!ProfileBitmap) {
            ProfileBitmap = LoadSplash(_T("LKPROFILE"));
        }
        if(ProfileBitmap) {
            DrawSplash(Surface, ProfileBitmap);
        }
    }

    if (RUN_MODE == RUN_WELCOME) {
        TCHAR mes[100];
        int pos = 0;
        switch (ScreenSize) {
            case ss480x272:
                if (ScreenSizeX == 854)
                    pos = 14;
                else
#ifdef __linux__
                    pos = 12;
#else
                    pos = 11;
#endif
                break;
                // --------- portrait -------------
            case ss240x320:
#ifdef __linux__
                pos = 19;
#else
                pos = 17;
#endif
                break;
            default:
                // customized definition
                if (ScreenLandscape) {
                    switch (ScreenGeometry) {
                        case SCREEN_GEOMETRY_43:
                            pos = 12;
                            break;
                        case SCREEN_GEOMETRY_53:
                            pos = 12;
                            break;
                        case SCREEN_GEOMETRY_169:
                            pos = 11;
                            break;
                        default:
                            pos = 11;
                            break;
                    }
                } else {
                    // Portrait
                    // try to get a rule for text position...
                    switch (ScreenGeometry) {
                        case SCREEN_GEOMETRY_43:
#ifdef __linux__
                            pos = 18;
#else
                            pos = 17;
#endif
                            break;
                        case SCREEN_GEOMETRY_53:
                            pos = 20;
                            break;
                        case SCREEN_GEOMETRY_169:
#ifdef __linux__
                            pos = 22;
#else
                            pos = 20;
#endif
                            break;
                        default:
                            pos = 21;
                            break;
                    }

                }
                break;
        }
        if (FullResetAsked) {
            _stprintf(mes, _T("*** %s ***"), MsgToken(1757));
            RawWrite(Surface, mes, pos, 1, RGBDARKWHITE, WTMODE_NORMAL);
        } else {
#ifndef LKCOMPETITION
            _stprintf(mes, _T("Version %s.%s (%s)"), _T(LKVERSION), _T(LKRELEASE), _T(__DATE__));
#else
            _stprintf(mes, _T("V%s.%s (%s) COMPETITION"), _T(LKVERSION), _T(LKRELEASE), _T(__DATE__));
#endif
            RawWrite(Surface, mes, pos, 1, RGBDARKWHITE, WTMODE_NORMAL);
#ifdef KOBO
            if(IsKoboOTGKernel()) {
                RawWrite(Surface, _T("- USB host kernel -"), pos+1, 1, RGBDARKWHITE, WTMODE_NORMAL);
            }
#endif
        }
    }

    if (RUN_MODE != RUN_WELCOME) {

        // FillRect(hDC,&ScreenSizeR, LKBrush_Black); // REMOVE

        TCHAR mes[100];
#ifndef LKCOMPETITION
        _stprintf(mes, _T("%s v%s.%s - %s"), _T(LKFORK), _T(LKVERSION), _T(LKRELEASE), MsgToken(2054));
#else
        _stprintf(mes, _T("%sC v%s.%s - %s"), _T(LKFORK), _T(LKVERSION), _T(LKRELEASE), MsgToken(2054));
#endif
        #ifdef DITHER
        RawWrite(Surface, mes, 1, 1, RGBLIGHTGREY, WTMODE_OUTLINED);
        #else
        RawWrite(Surface, mes, 1, 1, RGBLIGHTGREY, WTMODE_NORMAL);
        #endif

        size_t freeram = CheckFreeRam() / 1024;
        TCHAR buffer[MAX_PATH];
        LocalPath(buffer);
        size_t freestorage = FindFreeSpace(buffer);
        _stprintf(mes, _T("free ram %.1uM  storage %.1uM"), (unsigned int) freeram / 1024, (unsigned int) freestorage / 1024);
        #ifdef DITHER
        RawWrite(Surface, mes, 3, 0, RGBLIGHTGREY, WTMODE_OUTLINED);
        #else
        RawWrite(Surface, mes, 3, 0, RGBLIGHTGREY, WTMODE_NORMAL);
        #endif

        if (ScreenSize != ss320x240 && ScreenLandscape)
            RawWrite(Surface, _T("_______________________"), 2, 2, RGBLIGHTGREY, WTMODE_NORMAL);

        if (FullResetAsked) {
            _stprintf(mes, _T("%s"), MsgToken(1757)); // LK8000 PROFILES RESET
            RawWrite(Surface, mes, 5, 2, RGBICEWHITE, WTMODE_OUTLINED);
            _stprintf(mes, _T("%s"), MsgToken(1759)); // SELECTED IN SYSTEM
            RawWrite(Surface, mes, 6, 2, RGBICEWHITE, WTMODE_OUTLINED);
        } else {
            _stprintf(mes, _T("%s"), PilotName_Config);
            RawWrite(Surface, mes, 4, 2, RGBICEWHITE, WTMODE_OUTLINED);

            _stprintf(mes, _T("%s"), AircraftRego_Config);
            RawWrite(Surface, mes, 5, 2, RGBAMBER, WTMODE_OUTLINED);

            _stprintf(mes, _T("%s"), AircraftType_Config);
            RawWrite(Surface, mes, 6, 2, RGBAMBER, WTMODE_OUTLINED);

            LKASSERT(szPolarFile[0]);
            extern void LK_tsplitpath(const TCHAR* path, TCHAR* drv, TCHAR* dir, TCHAR* name, TCHAR * ext);
            LK_tsplitpath(szPolarFile, (TCHAR*) NULL, (TCHAR*) NULL, srcfile, (TCHAR*) NULL);

            _stprintf(mes, _T("%s %s"), MsgToken(528), srcfile); // polar file
            RawWrite(Surface, mes, 7, 2, RGBAMBER, WTMODE_OUTLINED);

            LKASSERT(startProfileFile[0]);
            LK_tsplitpath(startProfileFile, (TCHAR*) NULL, (TCHAR*) NULL, srcfile, (TCHAR*) NULL);
            _stprintf(mes, _T("%s: %s"), MsgToken(1746), srcfile);
            RawWrite(Surface, mes, 11, 1, RGBICEWHITE, WTMODE_NORMAL);
        }


        // RawWrite(hDC,_T("_______________________"),8,2, RGB_LIGHTGREY,WTMODE_NORMAL); // REMOVE FOR THE 3.0

        return;
    }

}
Ejemplo n.º 7
0
//
// Called by LKDrawLook8000, this is what happens when we change mapspace mode, advancing through types.
// We paint infopages, nearest, tri, etc.etc.
// Normally there is plenty of cpu available because the map is not even calculated.
// This is why we bring to the Draw thread, in the nearest pages case, also calculations.
//
void MapWindow::DrawMapSpace(LKSurface& Surface,  const RECT& rc) {

  BrushReference hB;

  TextInBoxMode_t TextDisplayMode = {0};
  TCHAR Buffer[LKSIZEBUFFERLARGE*2];
#ifdef DRAWLKSTATUS
  bool dodrawlkstatus=false;
#endif


#ifndef DITHER
  if (MapSpaceMode==MSM_WELCOME) {
	if (INVERTCOLORS)
		hB=LKBrush_Petrol;
	  else
		hB=LKBrush_Mlight;
  } else {
	if (INVERTCOLORS)
	  hB=LKBrush_Mdark;
	else
	  hB=LKBrush_Mlight;

  }
#else
  if (INVERTCOLORS)
      hB=LKBrush_Black;
  else
      hB=LKBrush_White;
#endif

  const auto oldfont = Surface.SelectObject(LKINFOFONT); // save font
  if (MapSpaceMode==MSM_WELCOME) {
      LKBitmap WelcomeBitmap = LoadSplash(_T("LKPROFILE"));
      if(WelcomeBitmap) {
          DrawSplash(Surface, WelcomeBitmap);
      }
  } else {
      Surface.FillRect(&rc, hB);
  }

  // Paint borders in green, but only in nearest pages and welcome, and not in DITHER mode
  // In case we want it in dithered mode, some changes are ready to be used.
  #ifndef DITHER
  if (MapSpaceMode==MSM_WELCOME || (!IsMultiMap() && MapSpaceMode!=MSM_MAP) )
  {
     #ifdef DITHER
     LKPen BorderPen(PEN_SOLID, ScreenThinSize, INVERTCOLORS?RGB_WHITE:RGB_BLACK);
     #else
     LKPen BorderPen(PEN_SOLID, ScreenThinSize, INVERTCOLORS?RGB_GREEN:RGB_DARKGREEN);
     #endif
     auto OldPen = Surface.SelectObject(BorderPen);
     auto OldBrush = Surface.SelectObject(LK_HOLLOW_BRUSH);

     Surface.Rectangle(rc.left, rc.top, rc.right, rc.bottom - BottomSize);

     Surface.SelectObject(OldPen);
     Surface.SelectObject(OldBrush);
  }
  #endif


#ifdef DRAWLKSTATUS
  if (LKevent==LKEVENT_NEWRUN) dodrawlkstatus=true;
#endif

  // We are entering mapspacemodes with no initial check on configured subpages.
  // Thus we need to ensure that the page is really available, or find the first valid.
  // However, this will prevent direct customkey access to pages!
  // Instead, we do it when we call next page from InfoPageChange
  // if (!ConfIP[ModeIndex][CURTYPE]) NextModeType();
  switch (MapSpaceMode) {
	case MSM_WELCOME:
#if 0
		SetModeType(LKMODE_MAP,MP_MOVING);
		RefreshMap();
		break;
#endif
#if (1)
		if (!DrawInfo.NAVWarning) {
		static double firsttime=DrawInfo.Time;
		// delayed automatic exit from welcome mode
		if ( DrawInfo.Time > (firsttime+3.0) ) {
			SetModeType(LKMODE_MAP,MP_MOVING);
			LKevent=LKEVENT_NONE;
			LKSound(_T("LK_BEEP1.WAV"));
			RefreshMap();
			break;
		}
		}
#endif
		if(GlobalModelType==MODELTYPE_PNA_MINIMAP)
		{
			SetModeType(LKMODE_MAP,MP_MOVING);
			LKevent=LKEVENT_NONE;
			break;
		}

		DrawWelcome8000(Surface, rc);
		break;
	case MSM_MAPTRK:
		SetSideviewPage(IM_HEADING);
		LKDrawMultimap_Asp(Surface,rc);
		break;
	case MSM_MAPWPT:
		#if 0
		// If there is no destination, force jump to the map
		if (GetOvertargetIndex()<0) {
			SetModeType(LKMODE_MAP,MP_MOVING);
			LKevent=LKEVENT_NONE;
			break;
		}
		#endif
		SetSideviewPage(IM_NEXT_WP);
		LKDrawMultimap_Asp(Surface,rc);
		break;
	case MSM_MAPASP:
		SetSideviewPage(IM_NEAR_AS);
		LKDrawMultimap_Asp(Surface,rc);
		break;
	case MSM_MAPRADAR:
		LKDrawMultimap_Radar(Surface,rc);
		break;
	case MSM_VISUALGLIDE:
		SetSideviewPage(IM_VISUALGLIDE);
		LKDrawMultimap_Asp(Surface,rc);
		break;
	case MSM_MAPTEST:
		LKDrawMultimap_Test(Surface,rc);
		break;
	case MSM_LANDABLE:
	case MSM_NEARTPS:
	case MSM_AIRPORTS:
	case MSM_COMMON:
	case MSM_RECENT:
	case MSM_AIRSPACES:
	case MSM_THERMALS:
	case MSM_TRAFFIC:
		DrawNearest(Surface, rc);
		break;
	case MSM_MAP:
		break;
	case MSM_INFO_THERMAL:
	case MSM_INFO_CRUISE:
	case MSM_INFO_TASK:
	case MSM_INFO_AUX:
	case MSM_INFO_TRI:
	case MSM_INFO_HSI:
	case MSM_INFO_TRF:
	case MSM_INFO_TARGET:
	case MSM_INFO_CONTEST:
		DrawInfoPage(Surface,rc, false);
		break;

  default:
    memset((void*)&TextDisplayMode, 0, sizeof(TextDisplayMode));
    TextDisplayMode.Color = RGB_WHITE;
    TextDisplayMode.NoSetFont = 1;
    TextDisplayMode.AlligneCenter = 1;
    Surface.SelectObject(LK8TargetFont);
    _stprintf(Buffer,TEXT("MapSpaceMode=%d"),MapSpaceMode);
    TextInBox(Surface, &rc, Buffer, (rc.right+rc.left)/2, NIBLSCALE(50) , &TextDisplayMode, false);
    break;
  }
#ifdef DRAWLKSTATUS
  // no need to clear dodrawlkstatus, it is already reset at each run
  if (dodrawlkstatus) DrawLKStatus(hdc, rc);
#endif
  Surface.SelectObject(oldfont);
}