Mark V Source: VS 2008, VS 6, CodeBlocks --- all using gas2masm for WinQuake's ASM |
[The WinQuake build does Nehahra + BSP2 + stipple r_wateralpha. Unlike qbism, doesn't do alpha entities. Unlike makaqu, doesn't do masked textures. Unlike both of those, it loads TGA 24-bit skyboxes. The WinQuake build of Mark V isn't particularly separate from the GL build, but isn't quite as "the same" as say, FTE's combo renderer of days gone by nor Quake 2.]
cut/copy/paste
I made a new version of Mark V that has cut/copy/paste and ability to select text in the console (you know, hold shift down, press CTRL+X or CTRL+V or whatever).
As it is, it is just 1 extra field: selection length
It can be positive or negative. If you hold down shift and press the forward arrow, selection length increases. If you press back arrow, it decreases.
The details can bog down a bit in minutia with using memove to remove text or insert text (and you have to do a strlen on the line), and there is some extra baggage with HOME and END and the fact Quake's console does not have decent entry and exit pathways (i.e. con_forcedup or entering the menu in stock Quake doesn't trigger anything to exit the console).
ASM
After looking at Qbisms engine (CodeBlocks) and ezQuake, added native WinQuake asm builds for:
1) CodeBlocks (had to capitalize all the .s files to .S)
2) Visual Studio C++ Express 2008 (the last no-cost Visual Studio that does not require registration after 30 days)
Both use the gas2masm to build from the .s source files. I almost at one used .asm files like MH did with an MH-ized aguirRe Quake. In fact, I went that route and then discovered ezQuake actually built the .s files in VS2003 or such and seeing QBism's engine use the .s files for CodeBlocks, I thought a project with both .s and .asm files would be a bit redundant so I painfully dissected ezQuake's method and acquired it.
net_wins.c and net_win.c --- they are gone!
I merged away net_wins.c and net_win.c. net_bsd.c and net_udp.c are the sole survivors. No more maintaining 2 "basically the same" network files. net_bsd is BSD sockets and WinSock is Microsoft's "mostly" a clone of BSD sockets. There isn't much of a good reason for Windows to have its own network code that is basically identical to the net_bsd.c and net_udp.c equivalents except a few lines and like 2 extra functions.
WinQuake on-the-fly palette conversion
First time I did this, it took 6 seconds for a map to load when it had to convert 6 1024x1024 skyboxes to the Quake palette.
Then I thought, "I'll have it write cache files and load those if it finds them". Which obviously was slow the first time and instant on subsequent occasions.
But that leaves junk laying around. And what if you are tweaking a skybox? How will it know the cache file is out-of-date and writing something to keep track of that is just adding more layers of "wrong" on top of "bad".
3rd and final method was this: open up a big buffer.
Load time for that is milliseconds (basically instant), no garbage caches files lying around. I was pleasantly surprised by the speed, I expected faster but I didn't expect essentially instant.buffer = calloc(256*256*256*256)
if color = black, skip it and use Quake's black color (stored away).
if buffer[color] = 0 then convert color. buffer[color]=converted color
else color = buffer[color]
After map/level loading is done, free buffer.
Engine resistant config
Mark V doesn't load a config written by another engine. The mechanism is simple. Write config.cfg with a stamp "// Mark V" as the top line. Write a 2nd copy to the caches folder (on Windows %APPDATA%/Mark V/gamedir/config.cfg, a Mac has a similar location for the user/application combination).
When loading config.cfg look for the stamp. If not found, load the cache file version.
Best of both worlds: a user can modify their config.cfg and everything is ok if they don't delete the comment line. If some other engine wrote the config, that engine could have cvars with the same name but different or invalid values and it is even possible that some of the cvars might be interpreted as commands and do things undesirable.
Better to just not load a config written by another engine and use a cache file backup.
Future: possibly read the key binds offered and maybe lowest common denominator Quake cvars that are available even in DOSQuake like sensitivity.