This is Bananattack.


Posted by Overkill on May 15, 2010 at 7:30 pm under Uncategorized

So in my previous, almost stream of consciousness post, I had briefly mentioned about updating Verge. One of those features in particular is the replacement of DirectDraw with GDI in terms of rendering. DirectDraw was old, deprecated, and broke Aero on newer machines. GDI, on the other hand, is still supported, and doesn’t need to lock the screen surface.

Along with the move to GDI, hardware fullscreen was removed. This at first sounds like a major loss, but this is for the best, I think. After all, Verge games are entirely software-drawn anyways, and many video cards do not support the lower resolutions that most Verge games are made in. Verge now instead uses a fake fullscreen mode, which means that non-native resolutions can be used without problems. As a result, that window switching is also much faster if you’re doing multiple things, and switching back and forth between fullscreen mode and windowed mode with ALT+ENTER is almost instant.

This however, wasn’t the only thing that got changed. There were a couple bugs and undesirable behaviours that somehow crept their way into the engine. Until I fixed them, that is.

When I added type-aliases to VC a bit of a while back, I somehow wrecked arrays in structures, but that is now fixed. I noticed that it was only expecting ONE dimension of the array when compiling (if you actually put one dimension only and it was a multi-dimensional array, the interpreter would choke). Now that’s taken care of.

I also fixed a bug I introduced with FileEOF. I thought I was being smart by making Verge’s FileEOF for physical files (non-packed files) into a simple call to feof(). But then when I later found this sort of thing in one of my older games:

    s = FileReadLn(f);
    // ...

…I noticed it was freezing! It turns out that FileEOF() had slightly different semantics than feof(), because the latter only is true when you’ve read PAST the end of the file. Meanwhile, FileReadLn apparently just returns nothing and does not trigger EOF if there’s nothing left to read. So I reverted that change. Instead, I’ve made the internal filesize() call on physical files be cached (since FileEOF should only be used in read mode anyways). If at some point, we get an “update” mode for files, I may need to turn off caching in that instance, but at any rate, this will cut down on the number of seeks to calculate file size happening EVERY time you call FileEOF().

Kildorf added escape characters to string literals. But most VC games were written without this, and expected a \ to put a single raw backslash. So I added an “oldstring” configuration setting. When oldstring is found on a line in the verge.cfg, it will go back to the old way of handling string literals. Sadly, there’s no way to mix files which use backslashes raw in string, and files that use escape characters in string without adjusting one or the other, but I think this is acceptable, since it’s a pretty trivial thing to do. I just added in the backwards compatibility so that old projects ran with a newer Verge would still work without digging through and fixing every string in the code.

I also fixed a bug with ColorFilter, where translucency settings were not being obeyed. Apparently that has been there for a while, and is now fixed. The code WAS blending the pixels, but it turns out directly after the blend, it just did a direct pixel copy of the filtered color (which wasn’t necessary, and prevented the blend from being displayed).

Oh, and I also added a few new window scaling settings. There are a couple modes to how the Verge screen can be scaled/fit into its window and fullscreen view. This called for new configuration settings. For windowed mode, there is “scalewin”. For fullscreen, there is “scalefull”. Both of these have a few settings that can be taken on:

  • scalewin 0 / scalefull 0 – Letter-box. The old Verge method of scaling the screen, which often resulted in distorted pixels. If the window was not perfect aspect, it would scale according to ratio (but the ratio could be non-integer, resulting in the chunky distortion), and it would fill in with letterboxes along the shorter axis. No longer the default, or only way of scaling. But left in, in case anybody prefers this.
  • scalewin 1 / scalefull 1 – Aspect-aware mode. Get the largest integer factor of screen size that fits in the render area. Makes sure that no distortion of the screen occurs, only uniform integer scaling. (Default windowed mode setting).
  • scalewin 2 / scalefull 2 – Scale to size of render area. (Default fullscreen mode setting).

    In most cases, a little bit of stretching can be acceptable. For instance, my monitor is 1440×900 (16:10), and game resolution is (4:3), but since the game is low-resolution pixel graphics, the bit of non-uniformity doesn’t stand out too badly (I think).

If you already looked at the SVN before this post, then you should know that I updated one other thing. I fixed ALT+ENTER from fullscreen to maximized (fullscreen is also maximized, so the window size doesn’t change unless you restore first). I also greatly improved the GDI renderer performance by removing accidental triple-buffering from the engine, which was slowing my netbook down to a crawl when I was doing a simple 640×480-sized window (eek!). So that’s been repaired.

You can peruse the SVN (anonymous/anonymous), or to be a little more friendly, you can download the exe here. If there aren’t any major bugs, maybe in a couple weeks we can have a full release.

So what are you waiting for?

Get it here!

Tags: , , , , , , ,


« Older: A lengthy departure.      Newer: Alive and Lethargic »
ErayMan on May 17, 2010 at 10:24 pm (comment)

Wow! The new window/resolution management works like a charm and is definitely what I was waiting for! I couldn’t run in fullscreen mode the way it was before and it was starting to get annoying.
And rapid switching with alt-enter is a big bonus! :)
Thanks for your work, Overkill!

Ben McGraw on May 19, 2010 at 12:39 pm (comment)

…why not put that on the vrpg frontpage?


Add your comment!

Name (required)
Email (this will not be published, but it is required.)

You can use the following HTML code:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>