r12607 chris_y - in /trunk/netsurf/amiga: dist/NetSurf.guide font.c
options.h
netsurf at semichrome.net
netsurf at semichrome.net
Sun Jul 17 15:48:19 BST 2011
Author: chris_y
Date: Sun Jul 17 09:48:19 2011
New Revision: 12607
URL: http://source.netsurf-browser.org?rev=12607&view=rev
Log:
Correct aspect ratio correctly and support widescreen displays
Modified:
trunk/netsurf/amiga/dist/NetSurf.guide
trunk/netsurf/amiga/font.c
trunk/netsurf/amiga/options.h
Modified: trunk/netsurf/amiga/dist/NetSurf.guide
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/dist/NetSurf.guide?rev=12607&r1=12606&r2=12607&view=diff
==============================================================================
--- trunk/netsurf/amiga/dist/NetSurf.guide (original)
+++ trunk/netsurf/amiga/dist/NetSurf.guide Sun Jul 17 09:48:19 2011
@@ -43,6 +43,7 @@
@{b}printer_unit@{ub} Specifies which printer.device unit to print to
@{b}drag_save_icons@{ub} Enables displaying Workbench-style transparent icons under the pointer when performing drag saves (ctrl-drag of objects available if NetSurf is running on the Workbench screen) and text selection drags. If set to 0 the pointer style will change instead. OS 4.0 users may want to set this to 0 as icons will appear opaque and obscure the drop position.
@{b}cairo_renderer@{ub} Set rendering engine (SObjs version only). 0 = graphics.library, 1 = Cairo/graphics.library mixed (recommended), 2 = Full Cairo.
+@{b}widescreen@{ub} Correct aspect ratio for widescreen displays.
@{b}url_file@{ub} Path to URL database file
@{b}hotlist_file@{ub} Path to Hotlist file
Modified: trunk/netsurf/amiga/font.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/font.c?rev=12607&r1=12606&r2=12607&view=diff
==============================================================================
--- trunk/netsurf/amiga/font.c (original)
+++ trunk/netsurf/amiga/font.c Sun Jul 17 09:48:19 2011
@@ -657,7 +657,6 @@
{
DisplayInfoHandle dih;
struct DisplayInfo dinfo;
- Point dinfo_res;
ULONG ydpi = option_amiga_ydpi;
ULONG xdpi = option_amiga_ydpi;
@@ -670,11 +669,21 @@
if(GetDisplayInfoData(dih, &dinfo, sizeof(struct DisplayInfo),
DTAG_DISP, 0))
{
- dinfo_res = dinfo.Resolution;
- xdpi = (dinfo_res.x / dinfo_res.y) * ydpi;
-
- LOG(("XDPI = %ld, YDPI = %ld (DisplayInfo resolution %ld x %ld)",
- xdpi, ydpi, dinfo_res.x , dinfo_res.y));
+ int xres = dinfo.Resolution.x;
+ int yres = dinfo.Resolution.y;
+
+ if(option_widescreen)
+ {
+ /* AmigaOS sees 4:3 modes as square in the DisplayInfo database,
+ * so we correct 16:10 modes to square for widescreen displays. */
+ xres = (xres * 16) / 4;
+ yres = (yres * 10) / 3;
+ }
+
+ xdpi = (yres * ydpi) / xres;
+
+ LOG(("XDPI = %ld, YDPI = %ld (DisplayInfo resolution %ld x %ld, corrected %ld x %ld)",
+ xdpi, ydpi, dinfo.Resolution.x, dinfo.Resolution.y, xres, yres));
}
}
}
Modified: trunk/netsurf/amiga/options.h
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/options.h?rev=12607&r1=12606&r2=12607&view=diff
==============================================================================
--- trunk/netsurf/amiga/options.h (original)
+++ trunk/netsurf/amiga/options.h Sun Jul 17 09:48:19 2011
@@ -66,6 +66,7 @@
extern int option_cairo_renderer;
extern bool option_direct_render;
extern int option_amiga_ydpi;
+extern bool option_widescreen;
#define EXTRA_OPTION_DEFINE \
char *option_url_file = 0; \
@@ -114,6 +115,7 @@
int option_cairo_renderer = 1; \
bool option_direct_render = false; \
int option_amiga_ydpi = 72; \
+bool option_widescreen = false; \
#define EXTRA_OPTION_TABLE \
{ "url_file", OPTION_STRING, &option_url_file }, \
@@ -161,5 +163,6 @@
{ "cookies_window_ysize", OPTION_INTEGER, &option_cookies_window_ysize}, \
{ "cairo_renderer", OPTION_INTEGER, &option_cairo_renderer}, \
{ "direct_render", OPTION_BOOL, &option_direct_render}, \
-{ "amiga_ydpi", OPTION_INTEGER, &option_amiga_ydpi},
+{ "amiga_ydpi", OPTION_INTEGER, &option_amiga_ydpi}, \
+{ "widescreen", OPTION_BOOL, &option_widescreen},
#endif
More information about the netsurf-commits
mailing list