Warning: session_start(): open(/home107a/sub005/sc13804-WGNH/pi/session/sess_70a2bce37a6a8820459b158c8be86599, O_RDWR) failed: No such file or directory (2) in /mounted-storage/home180/sub005/sc13804-WGNH/pi/inc/init.php on line 247

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /mounted-storage/home180/sub005/sc13804-WGNH/pi/inc/init.php:247) in /mounted-storage/home180/sub005/sc13804-WGNH/pi/inc/init.php on line 247

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /mounted-storage/home180/sub005/sc13804-WGNH/pi/inc/init.php:247) in /mounted-storage/home180/sub005/sc13804-WGNH/pi/inc/init.php on line 247

Warning: Cannot modify header information - headers already sent by (output started at /mounted-storage/home180/sub005/sc13804-WGNH/pi/inc/init.php:247) in /mounted-storage/home180/sub005/sc13804-WGNH/pi/inc/auth.php on line 424

Warning: Cannot modify header information - headers already sent by (output started at /mounted-storage/home180/sub005/sc13804-WGNH/pi/inc/init.php:247) in /mounted-storage/home180/sub005/sc13804-WGNH/pi/lib/plugins/badbehaviour/bad-behavior/screener.inc.php on line 9

Warning: session_write_close(): open(/home107a/sub005/sc13804-WGNH/pi/session/sess_70a2bce37a6a8820459b158c8be86599, O_RDWR) failed: No such file or directory (2) in /mounted-storage/home180/sub005/sc13804-WGNH/pi/doku.php on line 121

Warning: session_write_close(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/home107a/sub005/sc13804-WGNH/pi/session) in /mounted-storage/home180/sub005/sc13804-WGNH/pi/doku.php on line 121

Warning: Cannot modify header information - headers already sent by (output started at /mounted-storage/home180/sub005/sc13804-WGNH/pi/inc/init.php:247) in /mounted-storage/home180/sub005/sc13804-WGNH/pi/inc/actions.php on line 210

Warning: Cannot modify header information - headers already sent by (output started at /mounted-storage/home180/sub005/sc13804-WGNH/pi/inc/init.php:247) in /mounted-storage/home180/sub005/sc13804-WGNH/pi/lib/tpl/dokuwiki/main.php on line 12
devblogs:pokeparadox:revisiting_scaling [Project Infinity Wiki]

User Tools

Site Tools


devblogs:pokeparadox:revisiting_scaling

Revisiting Scaling

I want to go a little more in detail about what PenjinPrescale is actually doing. When scaling an image you have a few alternatives depending on the graphics API used and so on. In PenjinTwo I have included Scale2X if using SDL, you can change the display port size if using OpenGL/GLES and I also provide the option to use prescaling.

What is Prescaling

Prescaling is resizing the sprites/images at load time. PenjinTwo is setup to use states. In code written in this intended format you load the sprites when the state is created. While the sprite is loading if PenjinPrescale or PokeScale is active it will resize all images, text glyphs in this loading period.

How it Works

In the PenjinTwo config file you can set a BaseResolution which is the native resolution of your application. You can set this up in code an it will be written to the config on startup or shutdown. You can also set a Resolution which is a target resolution. From the BaseResolution and target resolution we can calculate a horizontal and vertical scale factor and using the scale factor we can ensure that all images are scaled correctly at load time (Using an optional smoothing filter).

How it affects game logic or physics

Generally I have tried to ensure that game logic is kept the same irrespective of the scaled output, where internal classes have been used, they know to take the scale factor into consideration. In some cases you may need to work around scaling problems and the scale factor can be obtained from the GPU object.

You could leave a comment if you were logged in.
devblogs/pokeparadox/revisiting_scaling.txt · Last modified: 2014/08/05 11:45 by pokeparadox