Opened 20 years ago

Closed 20 years ago

Last modified 6 years ago

#8388 closed patch

Selfscaling GUI

Reported by: lordhoto Owned by: fingolfin
Priority: normal Component: GUI
Version: Keywords:
Cc: Game:

Description

Hi,

I extened the GUI, now it scales itself when using a resolution different than 320x200 or 320x240. Now the GUI in COMI looks nicer than the older( I hope ). Currently I found a bug if some message is displayed at the OSD in COMI you can't read the message, because the OSD of the SDL backend is using the Font class and now the font class sclaes the font.

Ticket imported from: #1092994. Ticket imported from: patches/493.

Attachments (6)

scaleableGui-v1.patch (16.7 KB ) - added by lordhoto 20 years ago.
initial patch
ScaledGUI.PNG (160.8 KB ) - added by lordhoto 20 years ago.
how it looks like
scaleableGui-v2.patch (9.3 KB ) - added by lordhoto 20 years ago.
patch on top of 'scaleableGui-v1.patch'
scaleableGui-v3.patch (731 bytes ) - added by lordhoto 20 years ago.
patch on top of 'scaleableGui-v2.patch'
scaleableGui-v4.patch (22.1 KB ) - added by lordhoto 20 years ago.
patch against CVS
scaleableGUI-v5.patch (22.7 KB ) - added by lordhoto 20 years ago.
patch against CVS (02.01.2005)

Download all attachments as: .zip

Change History (15)

by lordhoto, 20 years ago

Attachment: scaleableGui-v1.patch added

initial patch

by lordhoto, 20 years ago

Attachment: ScaledGUI.PNG added

how it looks like

comment:1 by lordhoto, 20 years ago

fixed glitches with the OSD and the console(console looked very ugly in COMI and was not usable).

by lordhoto, 20 years ago

Attachment: scaleableGui-v2.patch added

patch on top of 'scaleableGui-v1.patch'

by lordhoto, 20 years ago

Attachment: scaleableGui-v3.patch added

patch on top of 'scaleableGui-v2.patch'

comment:2 by fingolfin, 20 years ago

Please don't submit "patches for patches", or "patches atop other patches" -- a single patch that applies for all. All else just leads to confusion and makes it hard to review your changes -- in particular, I always review patches directly before even thinking about applying & trying them.

Anyway, what you describe (automatically scaling the font) sounds like something I wouldn't accept into CVS anyway. Proper solution would be to provide a second "big" font; how that font then works (by scaling one of the "small" fonts, or by providing font data for a bigger font) isn't so important then.

Also note: we are working on a new revised overlay system which then allows the GUI to work in 640x400 "natively".

comment:3 by lordhoto, 20 years ago

"* Add ability to scale GUI ..." ;)

i think the 'big' font should be created at runtime. Or we could copy all drawn charakter into a surface and than scale the hole surface.

by lordhoto, 20 years ago

Attachment: scaleableGui-v4.patch added

patch against CVS

comment:4 by fingolfin, 20 years ago

The patch sadly seems to be somewhat messed up, it contains far too many newlines :-). Would be good to get a proper patch eventually. I also noticed that you added/removed whitespaces in a lot of places; that makes the patch bigger than necessary and seems to serve no purpose. I'd suggest you undo these changes, that'll make reviewing the patch easier.

Also, it appears the patch is partially (e.g. for newgui.cpp) reversed. Which'd make it even more impossible to apply :-)

Why don't you just "cvs diff -u" to create the patch? That or an equivalent should be available in any CVS client, and will avoid all the line ending issues you appear to have, as well as gurantee a clean working patch against CVS.

As for the font: I'd still prefer to add another bigger font to CVS, even if initially it would be just a scaled version of the normal font. I have lots of nice BDF fonts in various sizes sitting around here which we could use instead, though.

by lordhoto, 20 years ago

Attachment: scaleableGUI-v5.patch added

patch against CVS (02.01.2005)

comment:5 by lordhoto, 20 years ago

with all whitespaces delted comes from my editor it deletes all whitesspaces/tabs at the end of a line and I can't disable it :/

So new patch against current cvs :)

comment:6 by fingolfin, 20 years ago

I am not 100% happy with how the patch works, but since it'll be easy to disable the thing if we don't want it, I'll commit it for now anyway. That way it'll be easier to do further work on it.

comment:7 by fingolfin, 20 years ago

I rewrote the code to use a seperate font in the "scaled" mode. I also introduced a "FontManager" for this. For details, see CVS.

comment:8 by fingolfin, 20 years ago

Owner: set to fingolfin
Status: newclosed

comment:9 by digitall, 6 years ago

Component: GUI
Note: See TracTickets for help on using tickets.