If you've read the code for previous releases, you may have noticed that for some time now I've been intending to switch my lightmap struct to a class. This has now been done.
I'm still not a huge fan of Object-Oriented Programming - it feels very alien to me. There are however some very clear cases where it's a definite win, and this was one of them. Never mind structuring of design, etc, the big advantage to me is that you can set up an object to manage it's own internal state with clearly defined boundaries, so that some of the more - shall we say - delicate items (such as textures) become effectively immune from any meddling coming from elsewhere.
The code remains broadly the same as before (throwing away and rewriting working, debugged code is never a good idea), just that it's now wrapped in OOP shenanigans. It's another opportunity to use one of my favourite constructs too - the self-destroying linked list.
Some other changes include the removal of gl_flashblend (again!), restoration of the original 256 normal brightness (I had it at 264 to be consistent with ('m' - 'a') * 22), a resizing of initial memory allocations to be able to fit the peak usages for a full run through all of ID1 in (without requiring extension of memory used; about 32MB total) and the addition of cmdlist, cvarlist and cmdcvarlist. These last can dump to the console or to a text file (if you supply a file name as a param).
A new bug crept into this version which was quite nasty. Alias model caching was basically broken, and as a result all alias models were reloaded from scratch each map change, and re-cached every time. I had noticed quite a slowdown in map loading recently, and this was it. Run the automap for more than a few seconds and you could use up all your memory - ouch! Nice to get that one before release, woulda been embarrassing. I think I'm going to cache BSP bmodels (ammo boxes, etc) too.
More next time.
1 comments:
Mate looking forward to all you're cooking up with the pending release but wanted to drop you a line saying thank you. Mentioned ages ago wanting to mod these for running off CD. Instead have gone to running off a thumb drive and it works great. Of course H2 would round out my Quake and Quake2 collection ;)
Also, have recently got myself a little netbook and both DQ and DQ2 run (and look) beautifully on it.
Cheers, kempie
Post a Comment