示例#1
0
        public void DrawRacersTime(int racer, DrawingSurface ds, int x, int y)
        {
            float total_time = Racers[racer].Time;
            int   minutes    = FloatToInt(total_time / 60.0f, eRoundDown);
            int   seconds    = FloatToInt(total_time - IntToFloat(minutes) * 60.0f, eRoundDown);
            int   subsecs    = FloatToInt((total_time - IntToFloat(minutes) * 60.0f - IntToFloat(seconds)) * 60.0f, eRoundDown);

            AzureItalicFont.DrawText(StringFormatAGS("%02d:%02d:%02d", minutes, seconds, subsecs), ds, x, y);
        }
示例#2
0
        public void DrawRaceOverlay(bool firstDraw)
        {
            //int COLOR_TRANSPARENT = 35000;
            DrawingSurface ds = RaceOverlay.GetDrawingSurface();

            if (firstDraw)
            {
                int y1 = (1 + ThisRace.Opponents) * 53;
                int y2 = 6 * 53;
                if (y1 < y2)
                {
                    ds.DrawingColor = COLOR_TRANSPARENT;
                    ds.DrawRectangle(0, y1, 160, y2);
                }
            }
            int i = 0;

            for (i = 0; i < MAX_RACING_CARS; i += 1)
            {
                int racer = ThisRace.DriverPositions[i];
                if (racer < 0 || !Racers[racer].IsActive)
                {
                    continue;
                }
                int x = 0;
                int y = 53 * i;
                ds.DrawImage(x + 4, y + 2, 100 + Racers[racer].Driver);
                if (Racers[racer].Finished > 0)
                {
                    ds.DrawingColor = COLOR_TRANSPARENT;
                    ds.DrawRectangle(x + 36, y + 17, x + 102, y + 51);
                    DrawRacersTime(racer, ds, x + 42, y + 22);
                }
            }
            ds.DrawingColor = COLOR_TRANSPARENT;
            ds.DrawRectangle(50, 369, 160, 400);
            AzureItalicFont.DrawText(StringFormatAGS("%02d/%02d", Racers[0].Lap, ThisRace.Laps), ds, 52, 377);
            DrawRacersTime(0, ds, 52, 389);
            ds.Release();
        }