Esempio n. 1
0
void
ScreenGraphics::InitAirspacePens(const SETTINGS_MAP &settings_map)
{
  for (int i = 0; i < AIRSPACECLASSCOUNT; i++)
    hAirspacePens[i].set(Layout::Scale(2),
                         GetAirspaceColourByClass(i, settings_map));
}
Esempio n. 2
0
void
ScreenGraphics::Initialise(HINSTANCE hInstance, const SETTINGS_MAP &settings_map)
{
  int i;

  StartupStore(TEXT("Initialise graphics\n"));

  LoadUnitSymbols();

  infoSelectedBrush.set(MapGfx.ColorSelected);
  infoUnselectedBrush.set(MapGfx.ColorUnselected);
  buttonBrush.set(MapGfx.ColorButton);

  redBrush.set(Color::RED);
  yellowBrush.set(Color::YELLOW);
  greenBrush.set(Color::GREEN);

  hBackgroundBrush.set(BackgroundColor);

  hFLARMTraffic.load(IDB_FLARMTRAFFIC);
  hTerrainWarning.load(IDB_TERRAINWARNING);
  hTurnPoint.load(IDB_TURNPOINT);
  hSmall.load(IDB_SMALL);
  hAutoMacCready.load(IDB_AUTOMACCREADY);
  hGPSStatus1.load(IDB_GPSSTATUS1);
  hGPSStatus2.load(IDB_GPSSTATUS2);
  hLogger.load(IDB_LOGGER);
  hLoggerOff.load(IDB_LOGGEROFF);
  hBmpTeammatePosition.load(IDB_TEAMMATE_POS);

  hCruise.load(IDB_CRUISE);
  hClimb.load(IDB_CLIMB);
  hFinalGlide.load(IDB_FINALGLIDE);
  hAbort.load(IDB_ABORT);

  // airspace brushes and colors
  hAirspaceBitmap[0].load(IDB_AIRSPACE0);
  hAirspaceBitmap[1].load(IDB_AIRSPACE1);
  hAirspaceBitmap[2].load(IDB_AIRSPACE2);
  hAirspaceBitmap[3].load(IDB_AIRSPACE3);
  hAirspaceBitmap[4].load(IDB_AIRSPACE4);
  hAirspaceBitmap[5].load(IDB_AIRSPACE5);
  hAirspaceBitmap[6].load(IDB_AIRSPACE6);
  hAirspaceBitmap[7].load(IDB_AIRSPACE7);

  hAboveTerrainBitmap.load(IDB_ABOVETERRAIN);

  for (i = 0; i < NUMAIRSPACEBRUSHES; i++) {
    hAirspaceBrushes[i].set(hAirspaceBitmap[i]);
  }
  hAboveTerrainBrush.set(hAboveTerrainBitmap);

#if (MONOCHROME_SCREEN > 0)
  hbWind.set(Color(0x80, 0x80, 0x80));
#else
  hbWind.set(Color(0x80, 0x80, 0x80));
#endif

  hBmpMapScale.load(IDB_MAPSCALE_A);
  hBrushFlyingModeAbort.set(Color::RED);

  hBmpThermalSource.load(IDB_THERMALSOURCE);
  hBmpTarget.load(IDB_TARGET);

#if (MONOCHROME_SCREEN > 0)
  hbCompass.set(Color::WHITE);
#else
  hbCompass.set(Color(0x40, 0x40, 0xFF));
#endif
  hbThermalBand.set(Color(0x80, 0x80, 0xFF));
  hbBestCruiseTrack.set(Color::BLUE);
  hbFinalGlideBelow.set(Color::RED);
  hbFinalGlideBelowLandable.set(Color(0xFF, 180, 0x00));
  hbFinalGlideAbove.set(Color::GREEN);

  // all below depend on settings!

  BYTE Red,Green,Blue;

  int iwidth;
  int minwidth;
  minwidth = max(IBLSCALE(2),IBLSCALE(settings_map.SnailWidthScale)/16);

  for (i = 0; i < NUMSNAILCOLORS; i++) {
    short ih = i * 200 / (NUMSNAILCOLORS - 1);
    ColorRampLookup(ih, Red, Green, Blue, snail_colors, NUMSNAILRAMP, 6);

    if (i < NUMSNAILCOLORS / 2) {
      iwidth = minwidth;
    } else {
      iwidth = max(minwidth,
                   (i - NUMSNAILCOLORS/2)
                   * IBLSCALE(settings_map.SnailWidthScale) / NUMSNAILCOLORS);
    }

    hSnailColours[i] = Color((BYTE)Red, (BYTE)Green, (BYTE)Blue);
    hSnailPens[i].set(iwidth, hSnailColours[i]);
  }

  hpCompassBorder.set(IBLSCALE(3), Color::WHITE);

  if (Appearance.InverseAircraft) {
    hpAircraft.set(IBLSCALE(3), Color::BLACK);
    hpAircraftBorder.set(IBLSCALE(1), Color::WHITE);
  } else {
    hpAircraft.set(IBLSCALE(3), Color::WHITE);
    hpAircraftBorder.set(IBLSCALE(1), Color::BLACK);
  }

#if (MONOCHROME_SCREEN > 0)
  hpWind.set(IBLSCALE(2), Color::BLACK);
#else
  hpWind.set(IBLSCALE(2), Color::RED);
#endif

  hpWindThick.set(IBLSCALE(4), Color(255, 220, 220));

  hpBearing.set(IBLSCALE(2), Color(0, 0, 0));
  hpBestCruiseTrack.set(IBLSCALE(1), Color::BLUE);
#if (MONOCHROME_SCREEN > 0)
  hpCompass.set(IBLSCALE(1), Color::BLACK);
  //hpCompass.set(1, Color(0xff,0xff,0xff));
#else
  hpCompass.set(IBLSCALE(1), Color(0xcf, 0xcf, 0xFF));
#endif
  hpThermalBand.set(IBLSCALE(2), Color(0x40, 0x40, 0xFF));
  hpThermalBandGlider.set(IBLSCALE(2), Color(0x00, 0x00, 0x30));

  hpFinalGlideBelow.set(IBLSCALE(1), Color(0xFF, 0xA0, 0xA0));
  hpFinalGlideBelowLandable.set(IBLSCALE(1), Color(255, 196, 0));

  // TODO enhancement: support red/green Color blind
  hpFinalGlideAbove.set(IBLSCALE(1), Color(0xA0, 0xFF, 0xA0));

  hpSpeedSlow.set(IBLSCALE(1), Color::RED);
  hpSpeedFast.set(IBLSCALE(1), Color::GREEN);

  hpStartFinishThick.set(IBLSCALE(5), TaskColor);

  hpStartFinishThin.set(IBLSCALE(1), Color(255, 0, 0));

  hpMapScale.set(IBLSCALE(1), Color(0, 0, 0));
  hpTerrainLine.set(Pen::DASH, IBLSCALE(1), Color(0x30, 0x30, 0x30));
  hpTerrainLineBg.set(IBLSCALE(1), Color::WHITE);
  // VENTA3
  hpVisualGlideLightBlack.set(Pen::DASH, IBLSCALE(1), Color(0x0, 0x0, 0x0));
  hpVisualGlideHeavyBlack.set(Pen::DASH, IBLSCALE(2), Color(0x0, 0x0, 0x0));
  hpVisualGlideLightRed.set(Pen::DASH, IBLSCALE(1), Color::RED);
  hpVisualGlideHeavyRed.set(Pen::DASH, IBLSCALE(2), Color::RED);

  if (Appearance.IndLandable == wpLandableDefault) {
    hBmpAirportReachable.load(IDB_REACHABLE);
    hBmpAirportUnReachable.load(IDB_LANDABLE);
    hBmpFieldReachable.load(IDB_REACHABLE);
    hBmpFieldUnReachable.load(IDB_LANDABLE);
  } else if (Appearance.IndLandable == wpLandableAltA){
    hBmpAirportReachable.load(IDB_AIRPORT_REACHABLE);
    hBmpAirportUnReachable.load(IDB_AIRPORT_UNREACHABLE);
    hBmpFieldReachable.load(IDB_OUTFILED_REACHABLE);
    hBmpFieldUnReachable.load(IDB_OUTFILED_UNREACHABLE);
  }

  for (int i = 0; i < AIRSPACECLASSCOUNT; i++) {
    hAirspacePens[i].set(IBLSCALE(2), GetAirspaceColourByClass(i, settings_map));
  }
}