Zoom Mode (xBRZ)

Bug #1436078 reported by Andre Novellino Gouvêa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Stratagus
Won't Fix
Wishlist
Unassigned

Bug Description

A wishlist item. I think that it would be very nice to have a zoom mode, specially for when the game is being played at higher resolutions. Using the xBRZ scaler provides rather good results, and could be used for such a mode. Here is how zoom mode would look like with the xBRZ scaler:

https://dl.dropboxusercontent.com/u/1732902/Wyrmsun/screen_zoom_mode.png

Revision history for this message
timfelgentreff (timfelgentreff) wrote :

Hi,
I added something very simple a while ago to play on HiRes touch screens, but simply by using OpenGL to scale it up (-Z command line option). Having something proper that scales at better quality would be nice, though

Revision history for this message
Andre Novellino Gouvêa (andre-ng) wrote :

That sounds nice, but when I tried to use the -Z command line option, nothing changed when playing (although trying to change resolution with this enabled yielded some weird effects).

I've managed to add the xBRZ scaler code to Stratagus on my machine, but haven't yet managed to make the engine make use of it.

The function to use for scaling is apparently this one:
void xbrz::scale(size_t factor, const uint32_t* src, uint32_t* trg, int srcWidth, int srcHeight, const xbrz::ScalerCfg& cfg, int yFirst, int yLast)

The last three arguments are optional.

Revision history for this message
timfelgentreff (timfelgentreff) wrote :

The scaling works for me if I do `./stratagus -F -Z -v 640x400 -d ../../war1gus/data.wc1/`, for example. Then the game runs fullscreen but scaled up large, and the mouse events should get translated appropriately.

Revision history for this message
Kyran Jackson (erstmap) wrote :

Can we scale down too? Gotta get 320x240 mode working!

Revision history for this message
Andre Novellino Gouvêa (andre-ng) wrote :

Tim, I tried that now, but the results seem a bit worse than the default fullscreen rescaling algorithm.

In regards to xbrz, I tried using the code like this in CGraphic::DrawSub just to see if it would work:
xbrz::scale(2, (Uint32 *)Surface->pixels, (Uint32 *)TheScreen->pixels, w, h)

...but the result was quite bad (the result was just a couple of weird lines).

Revision history for this message
Andre Novellino Gouvêa (andre-ng) wrote :

Kyran, scaling down should be much easier, and the result would probably look quite good, as long as the size is divided by 2 or 4. xBRZ can't scale down, but a rescaling algorithm like the one that handles the fullscreen rescaling should be able to rescale down by a factor of 2 well.

Revision history for this message
cybermind (iddqd-mail) wrote :

Why not just use a lower resolution?

Revision history for this message
Andre Novellino Gouvêa (andre-ng) wrote :

For three reasons:

1. The xBRZ scaler gives much better results than the current scaler used for full screen.
2. To be able to have larger graphics while in windowed mode.
3. To be able to have the interface remain the size it currently is, while increasing the size of the map graphics.

Revision history for this message
timfelgentreff (timfelgentreff) wrote :

Kyran, scaling down also works with OpenGL viewport scaling. Quality is so-so.

cybermind (iddqd-mail)
Changed in stratagus:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Kyran Jackson (erstmap) wrote :

Cyber, because nothing would fit on the screen.

Revision history for this message
Andre Novellino Gouvêa (andre-ng) wrote :

I was trying to scale the cursor with xBRZ, and I almost managed to do it:
https://dl.dropboxusercontent.com/u/1732902/Wyrmsun/screen_xbrz_cursor.png

Now I only need to fix the transparency...

Revision history for this message
Andre Novellino Gouvêa (andre-ng) wrote :

Thanks to Chris Beck I managed to have the rescaling fully functional:

https://dl.dropboxusercontent.com/u/1732902/Wyrmsun/screen_xbrz_cursor_new.png

Now that it works, it's just a matter of adding the "zoom mode" as an option :) I'll begin working on that.

Revision history for this message
timfelgentreff (timfelgentreff) wrote : Moving to GitHub

This project was moved to https://github.com/Wargus/stratagus. All issues were migrated there.

Changed in stratagus:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.