Page 1 of 2
Double Size Filter Patch
Posted: 12 Nov 2006 15:41
by Zevensoft
Hello, I have made a patch to enable doublesize (CTRL+D) mode in SDL.
Also I have made some selectable filters to apply to this mode, including:
- None (Default, straight upscale, blocky and fast

)
- Good (Rounds off text, nice and only slight performance hit)
- High Quality (Attempts to discover vectors within the image and smooth accordingly, very nice image, slow to process)
- TV Filter (Every second line is black, darkens image but might be good on bright high res native LCD displays, fast)
Please try this patch and perhaps give comments

Posted: 12 Nov 2006 22:34
by Quark
hmm, can it work with 32bpp branch?
Posted: 13 Nov 2006 07:47
by Zevensoft
Quark: Not that I know of.
I've edited and redone the patch slightly, also adding a bilinear filter for those who requested it.
edit: changed xfactor and yfactor to vfactor
Also note because of the bilinear filter's preprocess event, it takes a long time to initialize/resize
Posted: 13 Nov 2006 15:09
by Zevensoft
Here is updated version (last ver had really bad initialization code, optimized a bit now)
To enable doublesize mode use CTRL+D (in both win32 and sdl, if problems on keystroke combo make a comment), go to patches menu to change filter.
Sorry these are 8bpp only, I'm looking into 32bpp versions.
filters included:
None (just a blocky doubler)
Diagonal (Seems to work ok on text and newspaper, sharp)
Bilinear (The worlds most common filter)
Vector Smooth (Tries to smooth tracks without wrecking other graphics, may or may not be to your liking)
TV Filter (every other line is black, common filter)
Posted: 13 Nov 2006 16:26
by Quark
awaiting for 32 bpp patch, attaching map fix for it (it is very bad because i was lazy — maybe you rewrite it in the right way)
Code: Select all
--- smallmap_gui.c Wed Nov 08 15:54:52 2006
+++ smallmap_gui.c Mon Nov 13 01:55:45 2006
@@ -16,6 +16,7 @@
#include "tunnel_map.h"
#include "window.h"
#include "gfx.h"
+#include "gfx_util.h"
#include "spritecache.h"
#include "viewport.h"
#include "player.h"
@@ -231,8 +232,17 @@
# endif
}
#else
-# define WRITE_PIXELS(dst, val) *(uint32*)(dst) = (val);
-# define WRITE_PIXELS_OR(dst,val) *(uint32*)(dst) |= (val);
+//# define WRITE_PIXELS(dst, val) *(uint32*)(dst) = (val);
+//# define WRITE_PIXELS_OR(dst,val) *(uint32*)(dst) |= (val);
+
+static inline void WRITE_PIXELS_OR(Pixel *d, uint32 val)
+{
+ d[0] |= LookupColourInPalette(GB(val, 0, 8));
+ d[1] |= LookupColourInPalette(GB(val, 8, 8));
+ d[2] |= LookupColourInPalette(GB(val, 16, 8));
+ d[3] |= LookupColourInPalette(GB(val, 24, 8));
+}
+
#endif
#define MKCOLOR(x) TO_LE32X(x)
Posted: 14 Nov 2006 18:19
by Grolsch
Zevensoft wrote:Here is updated version (last ver had really bad initialization code, optimized a bit now)
To enable doublesize mode use CTRL+D (in both win32 and sdl, if problems on keystroke combo make a comment), go to patches menu to change filter.
Sorry these are 8bpp only, I'm looking into 32bpp versions.
filters included:
None (just a blocky doubler)
Diagonal (Seems to work ok on text and newspaper, sharp)
Bilinear (The worlds most common filter)
Vector Smooth (Tries to smooth tracks without wrecking other graphics, may or may not be to your liking)
TV Filter (every other line is black, common filter)
is it possible to get a preview of every mode in this topic? thanks!
Posted: 15 Nov 2006 07:24
by Zevensoft
Sure here you go:
Posted: 15 Nov 2006 10:06
by Zevensoft
- continued -
Posted: 16 Nov 2006 01:25
by CobraA1
Google 2xsai, that may help.
Posted: 02 Dec 2006 12:59
by Quark
any news about this patch for 32bpp branch?
there is also good library for scaling screen with Super 2xSaI algorithm and with support for 32bpp
and
another (hq2x) algorithm
Posted: 03 Dec 2006 01:49
by Aegir
That vector smoothing is mightilly impressive. One question though, could these be implemented as an additional zoom level? as well as the double-size mode?
Posted: 03 Dec 2006 01:51
by Quark
talking about zoom levels, I will glad to see hq2x, hq3x and hq4x zoom

Posted: 03 Dec 2006 12:24
by Grolsch
Wow, this vector zoom really looks amazing! Love to see it as an extra zoom-level

Posted: 03 Dec 2006 14:55
by Born Acorn
I too would love to see it as an extra Zoom level. Wow the Vector Smoothing looks good.
Posted: 05 Dec 2006 11:56
by Korenn
I'm going to jump on the bandwagon:
That vector smooth is awesome. How does it even work?
Posted: 10 Dec 2006 19:59
by athanasios
As eye candy OK but of what practical value?
Why not lower your resolution instead?
Posted: 13 Dec 2006 19:52
by Grolsch
athanasios wrote:As eye candy OK but of what practical value?
Why not lower your resolution instead?
Why not buy a bigger screen, why not use a magnifier?
Because it's simpeler to scroll up with your scroll wheel.
Grolsch mumbles something about stupid questions...
Posted: 28 Feb 2007 11:42
by Quark
What about
OpenGL-HQ for SDL patch?
- OpenGL-HQ is a video "driver" for SDL that uses your graphics hardware to scale the output to any size you want. It was originally written for 2D games/emulators like dosbox, scummvm or exult.
Features • uses your hardware to get fast scaling
• scales any 2D SDL program
• scales with any scaling factor, even fractional ones
• switches back to the native driver if an app tries to use OpenGL
• portable
• configurable like SDL
• see the screenshots, really
Requirements • a Radeon 9600, GeForce 5700 or higher with current driver (OpenGL extension ARB_fragment_program must be supported and hardware-accelerated, EXT_framebuffer_object is also needed)
• OpenGL-support for your OS in SDL (which means Windows, Linux/X11 or MacOS X)
How to use
If you're running on Windows, there is a prebuilt SDL.DLL included in the source archive. Copy it to your application directory, overwriting the old SDL.DLL. Then read the file README contained in the archive to see how to enable it.
Posted: 01 Mar 2007 06:05
by iNVERTED
athanasios wrote:As eye candy OK but of what practical value?
Why not lower your resolution instead?
Because lowering your screen resolution will make TFT screens VERY blurry. Hence why it's better to resize in software.
As for the topic, HQ2X FTW. And I agree that it would be a good idea to implement this as a terrain zoom without changing the size of everything else too.
Posted: 02 Mar 2007 02:08
by athanasios
iNVERTED wrote:athanasios wrote:As eye candy OK but of what practical value?
Why not lower your resolution instead?
Because lowering your screen resolution will make TFT screens VERY blurry. Hence why it's better to resize in software.
That's why I don't buy a TFT
And not the only reason:
1280x1024

what kinda resolution is this? For dummies? Why don't they make a 1280x1280 also

!
Widescreen 1680x1050?

I though widescreen is 16:9 aka 1600x900...
WIDE EIZO S2410 1600x1200 for 1600 euros?

EIZO thinks we are fools?
My 200 euro CRT can handle 1600x1200 and many many more custom to play games from any platform, box... Thanks I will not buy.