]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Statusline update.
authorToni Wilen <twilen@winuae.net>
Sun, 27 Sep 2020 18:06:58 +0000 (21:06 +0300)
committerToni Wilen <twilen@winuae.net>
Sun, 27 Sep 2020 18:06:58 +0000 (21:06 +0300)
drawing.cpp
include/statusline.h
od-win32/direct3d.cpp
od-win32/direct3d11.cpp
od-win32/picasso96_win.cpp
od-win32/statusline_win32.cpp
od-win32/win32_scaler.cpp
statusline.cpp

index abfe74198af3a4c3c75e0a2643db412fe1556036..8da58b10594c43e72609ba8acd4395b69e3dad1b 100644 (file)
@@ -3966,7 +3966,7 @@ static void draw_frame_extras(struct vidbuffer *vb, int y_start, int y_end)
 {
        if ((currprefs.leds_on_screen & STATUSLINE_CHIPSET) && softstatusline()) {
                int slx, sly;
-               int mult = statusline_get_multiplier(vb->monitor_id);
+               int mult = statusline_get_multiplier(vb->monitor_id) / 100;
                statusline_getpos(vb->monitor_id, &slx, &sly, vb->outwidth, vb->outheight);
                statusbar_y1 = sly + min_ypos_for_screen - 1;
                statusbar_y2 = statusbar_y1 + TD_TOTAL_HEIGHT * mult + 1;
index f2234f66c905755098e0462f1ffe7d722781d897..355a2b943df1d48d19610a3b897b86eb187e69ad 100644 (file)
@@ -3,8 +3,8 @@
 
 #include "uae/types.h"
 
-#define TD_PADX 4
-#define TD_PADY 2
+#define TD_DEFAULT_PADX 4
+#define TD_DEFAULT_PADY 2
 #define TD_DEFAULT_WIDTH 30
 #define TD_DEFAULT_LED_WIDTH 24
 #define TD_DEFAULT_LED_HEIGHT 4
@@ -14,6 +14,7 @@
 
 extern int td_numbers_pos;
 extern int td_numbers_width, td_numbers_height;
+extern int td_numbers_padx, td_numbers_pady;
 extern const TCHAR *td_characters;
 extern int td_led_width;
 extern int td_width;
@@ -21,7 +22,7 @@ extern int td_width;
 #define TD_DEFAULT_NUM_WIDTH 7
 #define TD_DEFAULT_NUM_HEIGHT 7
 
-#define TD_TOTAL_HEIGHT (TD_PADY * 2 + td_numbers_height)
+#define TD_TOTAL_HEIGHT (td_numbers_pady * 2 + td_numbers_height)
 
 #define NUMBERS_NUM 20
 
index 28f72ad176cb2e8f1e904c30f698aea7367e6d25..344fce2b5eb858ea3ff54d325a0523a1aa8ee527 100644 (file)
@@ -1426,7 +1426,7 @@ static int createledtexture (struct d3dstruct *d3d)
 {
        struct AmigaMonitor *mon = &AMonitors[d3d - d3ddata];
 
-       d3d->statusbar_hx = d3d->statusbar_vx = statusline_set_multiplier(mon->monitor_id, d3d->tout_w, d3d->tout_h);
+       d3d->statusbar_hx = d3d->statusbar_vx = statusline_set_multiplier(mon->monitor_id, d3d->tout_w, d3d->tout_h) / 100;
        d3d->ledwidth = d3d->window_w;
        d3d->ledheight = TD_TOTAL_HEIGHT * d3d->statusbar_vx;
        d3d->ledtexture = createtext(d3d, d3d->ledwidth, d3d->ledheight * d3d->statusbar_vx, D3DFMT_A8R8G8B8);
index 3a16dd765d4098acdce34f015bb691e13b8fa94c..51fdc5973ab358d69bf2c07151a8ade0a4d27c65 100644 (file)
@@ -2003,7 +2003,7 @@ static bool CreateTexture(struct d3d11struct *d3d)
 
        UpdateVertexArray(d3d, d3d->m_vertexBuffer, 0, 0, 0, 0, 0, 0, 0, 0);
 
-       d3d->statusbar_hx = d3d->statusbar_vx = statusline_set_multiplier(mon->monitor_id, d3d->m_screenWidth, d3d->m_screenHeight);
+       d3d->statusbar_hx = d3d->statusbar_vx = statusline_set_multiplier(mon->monitor_id, d3d->m_screenWidth, d3d->m_screenHeight) / 100;
        d3d->ledwidth = d3d->m_screenWidth;
        d3d->ledheight = TD_TOTAL_HEIGHT * d3d->statusbar_vx;
        allocsprite(d3d, &d3d->osd, d3d->ledwidth, d3d->ledheight, true);
index f1eeb6d2373d3e396de0874b9679276183aca485..498a200c22c094842fb040fe8f37d653104e941f 100644 (file)
@@ -4215,7 +4215,7 @@ void picasso_statusline(int monid, uae_u8 *dst)
        if (currprefs.gfx_api) {
                statusline_render(monid, dst + sly * pitch, vidinfo->pixbytes, pitch, dst_width, dst_height, p96rc, p96gc, p96bc, NULL);
        }
-       int m = statusline_get_multiplier(monid);
+       int m = statusline_get_multiplier(monid) / 100;
        for (y = 0; y < TD_TOTAL_HEIGHT * m; y++) {
                uae_u8 *buf = dst + (y + sly) * pitch;
                draw_status_line_single(monid, buf, vidinfo->pixbytes, y, dst_width, p96rc, p96gc, p96bc, NULL);
index f251ccad41167669022fe02a50ce4c76aeaced3f..8d7e42385e92dbd6f1f14a25f7b8a8107197bfcb 100644 (file)
@@ -70,7 +70,8 @@ static void create_led_font(int monid)
 
        hdc = CreateCompatibleDC(NULL);
        if (hdc) {
-               int fontsize = -MulDiv(8, GetDeviceCaps(hdc, LOGPIXELSY), 72);
+               int y = GetDeviceCaps(hdc, LOGPIXELSY);
+               int fontsize = -MulDiv(6, y, 72);
                fontsize = fontsize * statusline_get_multiplier(monid) / 100;
                lp = (LOGPALETTE *)xcalloc(uae_u8, sizeof(LOGPALETTE) + 3 * sizeof(PALETTEENTRY));
                if (lp) {
@@ -102,7 +103,7 @@ static void create_led_font(int monid)
                                                RealizePalette(hdc);
                                                HFONT font = CreateFont(fontsize, 0,
                                                        0, 0,
-                                                       FW_MEDIUM,
+                                                       FW_NORMAL,
                                                        FALSE,
                                                        FALSE,
                                                        FALSE,
@@ -111,7 +112,7 @@ static void create_led_font(int monid)
                                                        CLIP_DEFAULT_PRECIS,
                                                        PROOF_QUALITY,
                                                        FIXED_PITCH | FF_DONTCARE,
-                                                       _T("Courier New"));
+                                                       _T("Lucida Console"));
                                                if (font) {
                                                        SelectObject(hdc, font);
                                                        SetTextColor(hdc, PALETTEINDEX(2));
@@ -119,7 +120,7 @@ static void create_led_font(int monid)
                                                        TEXTMETRIC tm;
                                                        GetTextMetrics(hdc, &tm);
                                                        int w = 0;
-                                                       int h = tm.tmAscent;
+                                                       int h = tm.tmAscent + 2;
                                                        for (int i = 0; i < td_characters[i]; i++) {
                                                                SIZE sz;
                                                                if (GetTextExtentPoint32(hdc, &td_characters[i], 1, &sz)) {
@@ -128,7 +129,8 @@ static void create_led_font(int monid)
                                                                }
                                                        }
                                                        int offsetx = 10;
-                                                       int offsety = 10 + (tm.tmDescent + 1) / 2;
+                                                       int offsety = 10 - 1;
+                                                       w += 1;
                                                        td_new_numbers = xcalloc(char, w * h * NUMBERS_NUM);
                                                        if (td_new_numbers) {
                                                                for (int i = 0; i < td_characters[i]; i++) {
@@ -290,10 +292,10 @@ void statusline_render(int monid, uae_u8 *buf, int bpp, int pitch, int width, in
                textwidth = size.cx;
                if (isfullscreen()) {
                        if (td_numbers_pos & TD_RIGHT) {
-                               bar_xstart = width - TD_PADX - VISIBLE_LEDS * td_width;
+                               bar_xstart = width - td_numbers_padx - VISIBLE_LEDS * td_width;
                                x = bar_xstart - textwidth - td_led_width;
                        } else {
-                               bar_xstart = TD_PADX;
+                               bar_xstart = td_numbers_padx;
                                x = bar_xstart + textwidth + td_led_width;
                        }
                }
index 63b9dc68015fb788793a12ab63e5a91388a6ce6d..153c81add9e826626e543a728f1e7fae5f911e26 100644 (file)
@@ -815,7 +815,7 @@ static void statusline(int monid)
        if (!(currprefs.leds_on_screen & STATUSLINE_CHIPSET) || !tempsurf)
                return;
        statusline_getpos(monid, &slx, &sly, dst_width, dst_height);
-       int m = statusline_get_multiplier(monid);
+       int m = statusline_get_multiplier(monid) / 100;
        lx = dst_width;
        ly = dst_height;
        SetRect(&sr, slx, 0, slx + lx, TD_TOTAL_HEIGHT * m);
index 030885ffa350a315cde08bfd9f57e7e4586e9532..def98150062c546c4ff374b5f68ec848adddd272 100644 (file)
@@ -52,6 +52,8 @@ void statusline_getpos(int monid, int *x, int *y, int width, int height)
 int td_numbers_pos = TD_RIGHT | TD_BOTTOM;
 int td_numbers_width = TD_DEFAULT_NUM_WIDTH;
 int td_numbers_height = TD_DEFAULT_NUM_HEIGHT;
+int td_numbers_padx = TD_DEFAULT_PADX;
+int td_numbers_pady = TD_DEFAULT_PADY;
 const TCHAR *td_characters = _T("0123456789CHD%+-PNKV");
 int td_led_width = TD_DEFAULT_LED_WIDTH;
 static int td_led_height = TD_DEFAULT_LED_HEIGHT;
@@ -115,6 +117,8 @@ void statusline_set_font(const char *newnumbers, int width, int height)
 {
        td_numbers_width = TD_DEFAULT_NUM_WIDTH;
        td_numbers_height = TD_DEFAULT_NUM_HEIGHT;
+       td_numbers_padx = TD_DEFAULT_PADX;
+       td_numbers_pady = TD_DEFAULT_PADY;
        td_led_width = TD_DEFAULT_LED_WIDTH;
        td_led_height = TD_DEFAULT_LED_HEIGHT;
        td_width = TD_DEFAULT_WIDTH;
@@ -125,7 +129,7 @@ void statusline_set_font(const char *newnumbers, int width, int height)
        numbers = newnumbers;
        td_numbers_width = width;
        td_numbers_height = height;
-       td_led_width = td_numbers_width * 3;
+       td_led_width = td_numbers_width * 3 + td_numbers_width / 2;
        td_width = td_led_width + 10;
        td_custom = true;
 }
@@ -135,8 +139,8 @@ int statusline_set_multiplier(int monid, int width, int height)
        struct amigadisplay *ad = &adisplays[monid];
        int idx = ad->picasso_on ? 1 : 0;
        int mult = currprefs.leds_on_screen_multiplier[idx];
-       if (mult < 100) {
-               mult = 100;
+       if (mult < 1 * 100) {
+               mult = 1 * 100;
        }
        if (mult > 4 * 100) {
                mult = 4 * 100;
@@ -149,8 +153,8 @@ int statusline_get_multiplier(int monid)
 {
        struct amigadisplay *ad = &adisplays[monid];
        int idx = ad->picasso_on ? 1 : 0;
-       if (statusline_mult[idx] <0)
-               return 1;
+       if (statusline_mult[idx] < 1 * 100)
+               return 1 * 100;
        return statusline_mult[idx];
 }
 
@@ -170,9 +174,9 @@ void draw_status_line_single(int monid, uae_u8 *buf, int bpp, int y, int totalwi
        c2 = ledcolor (0x00000000, rc, gc, bc, alpha);
 
        if (td_numbers_pos & TD_RIGHT)
-               x_start = totalwidth - (TD_PADX + VISIBLE_LEDS * td_width) * mult;
+               x_start = totalwidth - (td_numbers_padx + VISIBLE_LEDS * td_width) * mult;
        else
-               x_start = TD_PADX * mult;
+               x_start = td_numbers_padx * mult;
 
        for (led = 0; led < LED_MAX; led++) {
                int pos, num1 = -1, num2 = -1, num3 = -1, num4 = -1;
@@ -387,21 +391,21 @@ void draw_status_line_single(int monid, uae_u8 *buf, int bpp, int y, int totalwi
                        }
                }
 
-               if (y >= TD_PADY && y - TD_PADY < td_numbers_height) {
+               if (y >= td_numbers_pady && y - td_numbers_pady < td_numbers_height) {
                        if (num3 >= 0) {
                                x += (td_led_width - am * td_numbers_width) * mult / 2;
                                if (num1 > 0) {
-                                       write_tdnumber(buf, bpp, x, y - TD_PADY, num1, pen_rgb, c2, mult);
+                                       write_tdnumber(buf, bpp, x, y - td_numbers_pady, num1, pen_rgb, c2, mult);
                                        x += td_numbers_width * mult;
                                }
                                if (num2 >= 0) {
-                                       write_tdnumber(buf, bpp, x, y - TD_PADY, num2, pen_rgb, c2, mult);
+                                       write_tdnumber(buf, bpp, x, y - td_numbers_pady, num2, pen_rgb, c2, mult);
                                        x += td_numbers_width * mult;
                                }
-                               write_tdnumber(buf, bpp, x, y - TD_PADY, num3, pen_rgb, c2, mult);
+                               write_tdnumber(buf, bpp, x, y - td_numbers_pady, num3, pen_rgb, c2, mult);
                                x += td_numbers_width * mult;
                                if (num4 > 0)
-                                       write_tdnumber(buf, bpp, x, y - TD_PADY, num4, pen_rgb, c2, mult);
+                                       write_tdnumber(buf, bpp, x, y - td_numbers_pady, num4, pen_rgb, c2, mult);
                        }
                }
        }