32bit Graphics Extra Zoom Patch
Posted: 15 Jan 2008 19:26
As I already told on the forums a couple of times, I did miss the extra zoom levels for the 32bpp graphics a lot. So now the graphics creation is progressing quite nicely, I decided to take a look at the code and try to create a patch to make the extra zoom levels possible again. It did cost me quite a lot of time, but I succeeded!
It is still heavily in development, but I could not wait any longer to present it to you.
Features
---------
-2 extra zoom levels
-transparency options give real transparency
-For now, it only works for the 32bpp-optimized blitter.
-Better zoom out graphics
-Bigger company manager faces
-32bpp company colours iso just 8 colours
-Interpolate 8bpp sprites when zooming in. (V13)
-User modifiable saturation and brightness of company colours
Difference with the now dead 32bpp branch
----------------------------
-in sync with trunk version 16366
-uses new tarloader as used in trunk, so png s must be pngcodec'd. The naming convention (similar to the 32bpp branch: default level zoom: nnnn_z2.png (nnnn is the sprite number), one level zoomed in nnnn_z1.png, 2 levels zoomed in nnnn_z0.png.
-no pixels are left when scrolling most zoomed in level, or moving a window over the viewport. This meant changing the use of the coordinate system, which took a lot of time.
-transparency options give real transparency
-reimplemented the spritecache of Egladil in the trunk
-reimplemented the sprite resizing of Egladil in the trunk, actually this meant only taking the idea, and completely reimplement according to the new situation.
Installation instruction
------------------------
up/downgrade trunkversion to the version indicated in the diff file name
apply the patch and recompile ( maybe someone can create a windows binary(testers, not the one I sent you, some changes were made afterwards), cause I want to spend my time on improving the patch, and not on porting to windows ( I develop on Gentoo Linux ))
put the tar file in the data directory (it's just an example tar, with the new grass)
modify openttd.cfg:
-set sprite_cache_size to 64 to prevent out of sprite memory errors
Done. Start openttd with the 32bpp-optimized blitter. It only works for this blitter. This can also be set in the cfg file, if you want it to be default.
Known bugs
----------
-clicking on cities etc does not work correct on zooms other than default
-smoke on zoom out levels is not correct
-minimap is not always correct
-no sound when you build a train track in most zoomed in level
-problem with foundation on traintrack half tiles
-once reported, when removing crashed trains, game crashes.
-------
Solved
--------
-names of cities etc are not updated correct on zooms other than default, esp. on zoomed out levels.(solved in v7)
-no colour remapping on transparency sprites (solution is known, I will start a discussion about this soon) (solved in v7)
-when loading the sprites, no check is done yet whether a higher level zoom sprite exists, and rescale that. Solution also known, just need to implement it. (solved in v7)
-plane shadows not correct (solved in v8)
-resize of sprites to zoomed out levels is worse than in 32bpp branch (solved in v8)
-implement improved company colour and recolour mapping algorithm ( that is, with more colours than just 8, as in trunk) (implemented in v7, for some colour variations)
-rescale of sloped sprites to half size leaves a black pixel (check this on the zoom out levels) (solved in V9)
-8bpp graphics do not rescale right when zooming outl (solved in V9)
-mixing 32bpp trunk tars with tar in the format of this patch does give graphical problems (solved in V9)
-applying company colours on 32bpp sprites on an RGB pixel value of (0,0,0) does apply fully saturated CC iso black. (solved in V9)
TODO/ Suggestion list
------------
-no optimization has been done yet
-code needs some cleaning up (like commented debug statements, partly improved in V9)
-implement other blitters
-user adjustable transparency
-improve hue of gray/white/transparent colours
------
A lot of thanks must go to the alpha testers for their useful input: Anathasios, Ben Robbins, Wacki, Soeb,
and someone who wants to stay anonymous. Although the bug list is still impressive, so I don't have to be bored the next weeks, they also told me the quality of the patch is equal to, or higher than the last 32bpp branch version, so it is fit to present to a larger audience.
So try it, give some feedback what needs to be solved first, and most important of all: have fun and post those zoomed in tars and screenshots!
Latest version: here
It is still heavily in development, but I could not wait any longer to present it to you.
Features
---------
-2 extra zoom levels
-transparency options give real transparency
-For now, it only works for the 32bpp-optimized blitter.
-Better zoom out graphics
-Bigger company manager faces
-32bpp company colours iso just 8 colours
-Interpolate 8bpp sprites when zooming in. (V13)
-User modifiable saturation and brightness of company colours
Difference with the now dead 32bpp branch
----------------------------
-in sync with trunk version 16366
-uses new tarloader as used in trunk, so png s must be pngcodec'd. The naming convention (similar to the 32bpp branch: default level zoom: nnnn_z2.png (nnnn is the sprite number), one level zoomed in nnnn_z1.png, 2 levels zoomed in nnnn_z0.png.
-no pixels are left when scrolling most zoomed in level, or moving a window over the viewport. This meant changing the use of the coordinate system, which took a lot of time.
-transparency options give real transparency
-reimplemented the spritecache of Egladil in the trunk
-reimplemented the sprite resizing of Egladil in the trunk, actually this meant only taking the idea, and completely reimplement according to the new situation.
Installation instruction
------------------------
up/downgrade trunkversion to the version indicated in the diff file name
apply the patch and recompile ( maybe someone can create a windows binary(testers, not the one I sent you, some changes were made afterwards), cause I want to spend my time on improving the patch, and not on porting to windows ( I develop on Gentoo Linux ))
put the tar file in the data directory (it's just an example tar, with the new grass)
modify openttd.cfg:
-set sprite_cache_size to 64 to prevent out of sprite memory errors
Done. Start openttd with the 32bpp-optimized blitter. It only works for this blitter. This can also be set in the cfg file, if you want it to be default.
Known bugs
----------
-clicking on cities etc does not work correct on zooms other than default
-smoke on zoom out levels is not correct
-minimap is not always correct
-no sound when you build a train track in most zoomed in level
-problem with foundation on traintrack half tiles
-once reported, when removing crashed trains, game crashes.
-------
Solved
--------
-names of cities etc are not updated correct on zooms other than default, esp. on zoomed out levels.(solved in v7)
-no colour remapping on transparency sprites (solution is known, I will start a discussion about this soon) (solved in v7)
-when loading the sprites, no check is done yet whether a higher level zoom sprite exists, and rescale that. Solution also known, just need to implement it. (solved in v7)
-plane shadows not correct (solved in v8)
-resize of sprites to zoomed out levels is worse than in 32bpp branch (solved in v8)
-implement improved company colour and recolour mapping algorithm ( that is, with more colours than just 8, as in trunk) (implemented in v7, for some colour variations)
-rescale of sloped sprites to half size leaves a black pixel (check this on the zoom out levels) (solved in V9)
-8bpp graphics do not rescale right when zooming outl (solved in V9)
-mixing 32bpp trunk tars with tar in the format of this patch does give graphical problems (solved in V9)
-applying company colours on 32bpp sprites on an RGB pixel value of (0,0,0) does apply fully saturated CC iso black. (solved in V9)
TODO/ Suggestion list
------------
-no optimization has been done yet
-code needs some cleaning up (like commented debug statements, partly improved in V9)
-implement other blitters
-user adjustable transparency
-improve hue of gray/white/transparent colours
------
A lot of thanks must go to the alpha testers for their useful input: Anathasios, Ben Robbins, Wacki, Soeb,
and someone who wants to stay anonymous. Although the bug list is still impressive, so I don't have to be bored the next weeks, they also told me the quality of the patch is equal to, or higher than the last 32bpp branch version, so it is fit to present to a larger audience.
So try it, give some feedback what needs to be solved first, and most important of all: have fun and post those zoomed in tars and screenshots!
Latest version: here