Giter Site home page Giter Site logo

Zoom Mode (xBRZ) about stratagus HOT 12 CLOSED

wargus avatar wargus commented on May 23, 2024
Zoom Mode (xBRZ)

from stratagus.

Comments (12)

timfel avatar timfel commented on May 23, 2024

(by timfelgentreff)
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

from stratagus.

timfel avatar timfel commented on May 23, 2024

(by andre-ng)
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.

from stratagus.

timfel avatar timfel commented on May 23, 2024

(by timfelgentreff)
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.

from stratagus.

timfel avatar timfel commented on May 23, 2024

(by erstmap)
Can we scale down too? Gotta get 320x240 mode working!

from stratagus.

timfel avatar timfel commented on May 23, 2024

(by andre-ng)
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).

from stratagus.

timfel avatar timfel commented on May 23, 2024

(by andre-ng)
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.

from stratagus.

timfel avatar timfel commented on May 23, 2024

(by iddqd-mail)
Why not just use a lower resolution?

from stratagus.

timfel avatar timfel commented on May 23, 2024

(by andre-ng)
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.

from stratagus.

timfel avatar timfel commented on May 23, 2024

(by timfelgentreff)
Kyran, scaling down also works with OpenGL viewport scaling. Quality is so-so.

from stratagus.

timfel avatar timfel commented on May 23, 2024

(by erstmap)
Cyber, because nothing would fit on the screen.

from stratagus.

timfel avatar timfel commented on May 23, 2024

(by andre-ng)
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...

from stratagus.

timfel avatar timfel commented on May 23, 2024

(by andre-ng)
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.

from stratagus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.