Jump to content

Editor Graphic 701


Ishad Nha

Recommended Posts

From Graphics.cpp: "It seems one of the terrain graphics sheets is covered up by (same resource number as) an editor graphic. So I had to copy that sheet into 3D editor graphics and make this horrible hack (in multiple places!)"

This comment is found in four separate places in the source file. I deleted the mentioned hack from the Windows code and nothing seemed to be wrong with the display of the graphics from G701.bmp. Said hack is:

("if(a.which_sheet == 701)

a.which_sheet = 4916;")

 

Is this an artifact from the original Mac code? Apparently it is, for this is found in the Mac version of the same source file:

"if (pattern_gworld == NULL)

pattern_gworld = load_pict(701);//(850);"

From what I can see, this is the Mac equivalent of Windows G4901.bmp. In Windows this graphic is never used by the game itself. I doubt that it would be used by the Mac game if it has the same number as the second floor graphics sheet. Hence it seems that Mac code should have Editor graphic 701 renamed to 4916 or whatever. This may take some doing with the antiquated format and lack of programs…

 

Link to comment
Share on other sites

I don't know about the details on the Windows side, but this relates to the (outdated) resource loading system used by the Mac editor and a number collision made by Jeff.

 

Sheet 701 used by the game is of course a set of cave floor tiles. For the Mac version of the game it resides in the file Terrain Graphics. The Mac editor has an additional resource file containing graphics used by it but not by the game named Blades of Avernum Ed Graphics. This file holds various button images, and also an image containing the textures used for backgrounds in the editor. For whatever reason, Jeff assigned that texture image the number 701 as well. When the editor opens both resource files, there can be only one resource of type PICT and number 701, so the sheet in whichever file is opened later takes precedence.

 

In the old, 2D editor this wasn't an issue, since the isometric floor and terrain images were never used. However, with Isaac's upgrade to allow 3D drawing, they are needed, and so the editor runs into the problem that it needs access to both of the sheets 701. Someone (Isaac, perhaps) duplicated the sheet 701 containing floors, and placed it among the editor resources with the new number 916. Then, whenever the editor needs to draw a terrain or floor whose sheet number is supposed to be 701, it uses the special case logic and fetches the graphics from sheet 916 instead.

 

None of this matters to the game, since it never loads the Blades of Avernum Ed Graphics file. I'm not sure what the situation is for the Windows editor, since I've never looked closely into its resource loading and handling systems, so I'll leave it up to your judgement; just do whatever works, I'd say.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...