Re: [Alephmodular-devel] Preserving/Restoring editor hooks?
Status: Pre-Alpha
Brought to you by:
brefin
From: Br'fin <br...@ma...> - 2005-06-24 04:03:35
|
On Jun 23, 2005, at 3:39 PM, Timothy Collett wrote: > On Jun 22, 2005, at 12:13 PM, Br'fin wrote: >> But in the process I've been hacking apart the functions that used >> to serve as a way for the editor to load a map into the in- >> application viewer. These functions were already corrupted by the >> hosting of serialization information. >> >> From what I can determine, the original editor sat as generally >> separate code and had it's own internal version of process_map_wad >> (). Where that function in game_wad.cpp handles loading a map from >> file to memory. The editor's version would already be working with >> an in memory copy. > > Hmm...I have no idea of the nature of these hooks, so... > > Would it be possible to ditch them now, and rebuild them in a more > elegant fashion later, once things stabilize a bit? Or is the form > they're in the only form they could take? > > If they're becoming a hindrance to what AM is trying to be, then it > might be best to get rid of them. > > I could probably provide more coherent rambling if you could, > perhaps explain something of what form these hooks take? > > Timothy Collett I will first comment that the code I've been adding in this section is hardly better or more elegant. In other words, some of the way I've been managing things I'm unhappy about. It's better perhaps, but isn't necessarily clean or elegant. Also, I only just connected the dots to see how load_points, load_sides, load_polygons and complete_loading_level connected the dots with the unreleased editor code. In the current code all map loading is processed through process_map_wad. Which basically extracts data from tagged elements of the wad file, and then feeds them to other load functions most of the time. Extract map points from the wad, then feed that data to load_points. load_points historically has two arguments, a pointer to an array of points, and a count of points. During serialization, not noticing that most of these load functions are exported to be called from editor code not included, this became somewhat corrupted. It gets those two arguments, then casts them back to a uint8* so that they can be deserialized. It's not pretty, but works for loading the map. But it means load_points doesn't do what it originally promised it would do. Most of these elements might be pretty straightforward in shape. But there are some complex spots. For instance, the requests to scan and add platform data to platform polygons. And especially recalculating all the redundant map data. Also, since there doesn't seem to be an A1 or AM or even M2 specific map editor that works under a current operating system, it seems out of line to further cut off potential ties to an editor. I agree that in the future a better way of splitting things out may very well be in order. But this seems to be an area of overlap between game_wad.cpp and map.h/.cpp that we are better served by repairing in the current code base rather than excising. -Jeremy Parsons http://alephmodular.sourceforge.net/ |