Thursday, 26 March 2026

Fix Google Drive Images not displaying in Blogger posts

I noticed recently that the images in my last few Blogger posts were shown as image placeholders and only displayed when you clicked on the placeholder.

These images used URLs to images stored on Google Drive.

I switched to Google Drive for images I think due to Open LiveWriter no longer working directly with Blogger. I am sure the images displayed in the posts at the time.

To fix, I first copied the images to Google Photos from Google Drive.

I created a draft post in Blogger and inserted the images for an affected post to that draft. I only uploaded the higher resolution image. Live Writer had created a low res and hi res image.

Insert Image

For each image I copied the link for the image in the draft post and replaced the link for the missing image in the post. This only changed the URL for when the image was clicked.

Copy link

The source for the image had to be replaced as well which could only be done by switching to HTML view in the Blogger editor and replacing the old link for the "src" attribute with the new link.

Compose view


Toggle HTML view

I left all other attributes the same so as to preserve the original size and style.



Monday, 21 June 2021

WIP: WAD2 Remapper

Version: 1.0

Status: Released

 

A program for the Tomb Raider Level Editor (TRLE) community.

The WadTool program included with Tomb Editor does not yet have a remap feature.

EDIT 23 July 2021: Remapping ability added to WadTool version 1.3.16. (Tools>Mesh Editor)

Remapping is where a vertex’s index number is changed so it is below a certain limit.

This is needed for vertices in the LARA_SKIN meshes that connect to LARA_JOINTS meshes.

WadTool uses a new file format, *.WAD2, which is incompatible with StrPix, the program used to remap vertices for the old wad format, so I wrote this program.

See GitHub for source code and release. [link]

If a 32 bit version of the program is needed please let me know in the comments or at the Level Editor forum at tombraiderforums.com.

Please do not ignore the warning about always having a backup copy of your WAD2 file.

This program may corrupt the file.

 

Usage:

Open your WAD2.

Expand a moveable in the treeview.

Select a mesh.

Swap vertices as required.

There are two ways to swap vertices.

  1. Left click a vertex to select it and then hold "Control" and left click on another vertex to swap them.

  2. Enter the two vertex numbers to swap in the boxes and click "Swap".

Save the WAD2. Do not save over your WAD2 unless it is a copy.

 

3D Viewport Controls:

Left mouse button - Select vertex

Right mouse button - Rotate view

Middle mouse button - Pan view

Mouse wheel - Zoom view

Note that sometimes you might click through a mesh and select the vertex hidden behind the mesh.

 

Screenshot

Built using free Delphi Community Edition 10.3.3.  (A Firemonkey 3D project)

Monday, 31 August 2020

Delphi bug: Invalid Window Handle Error 1400

My program developed a bug where sometimes on exit an access violation error and invalid window handle error would appear.

invalidhandle

The bug wasn’t totally random but occurred when some sectors in a grid were selected but not when other sectors in the same grid were selected. The grid was an image.

The program uses several TMemo components to display information pertaining to the sector selected and the number of lines displayed in each TMemo varies for each sector.

By trial and error it was found that the bug was caused by appending strings to a TMemo which happened to be the seventh and last TMemo on the form.

I am not skilled enough to get to the bottom of the cause but it seems the bug was caused by the number of lines appended to the TMemo and the length of the lines. No exceptions were raised here though.

Fewer lines no problem. More lines no problem. Shorter lines no problem.

I don’t know why but a TMemo.Lines.Text length between 284 and 308 caused the error.

I fixed the error by ensuring the text length was not between these two values.

Using Delphi Community Edition 10.2.3 on Windows 10.

Friday, 28 August 2020

Restore window border GOG Tomb Raider 4 & 5

The GOG versions of Tomb Raider 4 and Tomb Raider 5 include a fix to remove the window border when playing fullscreen on modern Windows versions.

This fix however also removes the window border when playing in windowed mode and leaves the user unable to move the window.

This post details how to undo the fix and restore the window border.

TR5noborder


Tuesday, 21 July 2020

Building Wadmerger with Visual Basic 6

The Wadmerger source code was released recently [link]. Wadmerger is a program used in Tomb Raider Level Editor (TRLE) building.

Wadmerger was written in Visual basic 6 which is an old language and this post shows how to get it working on Windows 10 using a Windows XP virtual machine.

Tuesday, 9 June 2020

Corrupt Open Live Writer draft fix

I use Open Live Writer to create posts for this blog.

Recently one of my draft posts became corrupted.

In a draft of about 100 lines and many pictures only the first few lines were selectable in the Edit view.

When I switched to Source view all the unselectable text and pictures disappeared destroying my post.

The problem was a stray </div> tag in the post that somehow appeared after inserted a split post.

Since most of the text disappeared when I switched to Source view I had trouble deleting the problematic </div>.

The solution was to close Open Live Writer and restart. But before loading my corrupt draft file, switch to Source view.

This way all the html source appeared and I was able to delete the unmatched </div> tag.

Sunday, 31 May 2020

Building Tomb Raider III in Visual Studio 2019

This post will outline the steps involved in building the leaked Tomb Raider 3 code in Visual Studio 2019 Community Edition.


Friday, 8 May 2020

Sunday, 1 December 2019

UV mapped model to TRLE wad using Blender 2.79

teme9 posted a technique for getting a UV mapped model into a Tomb Raider Level Editor (TRLE) wad [link] but since the information is scattered throughout the thread I decided to gather it all together here.

Tutorial for Blender 2.80 is here [link].

Wednesday, 20 November 2019

UV mapped model to TRLE wad using Blender 2.80

teme9 published a technique for converting a UV mapped model to a form that was suitable for a Tomb Raider level Editor (TRLE) .wad file using Blender 2.7x.

https://www.tombraiderforums.com/showthread.php?t=208076

This post is an update of teme9’s tutorial for Blender 2.80.


Friday, 17 May 2019

Reading .zip files in Delphi and Python

Metasequoia uses a new default file format from version 4.7 which has extension *.mqoz.
This a just a *.zip file that contains an *.mqo file and a thumbnail.jpg file and maybe an *.mqx file.

Below are examples in Delphi 10.2 and Python 2.7 that show how to read the *.mqo inside the *.zip.

Sunday, 5 May 2019

Automatic mouse cursor move program

I needed a program to move the mouse cursor every so often to stop a PC from timing out while I was watching videos.

I didn't have admin rights for the PC so I could not adjust the timeout settings.


Monday, 22 April 2019

2: Tomb Raider 3 source code notes

Further investigation of the Tomb Raider 3 source code that was leaked online. See the first post in this series for details. [link]

I am studying the modified version mentioned in the comments of the first post (“TR3_ok”) because this version can be successfully built in Visual Studio 2013 as is. I wasn’t the genius who modified the code though.

To run the game, copy the “data” and “pix” folders from the retail version into the project’s folder.

Note on my PC I had to locate the project folder on a USB drive because the setup dialog for the game didn’t have any display resolution options if I used a project folder located on my system.

The leaked source code is not the version used for the retail game. It is an earlier version and some things are unfinished. The members of the discord channel refer to this version as Tomb Raider 2.1.

Be aware that the code contains some rude/offensive language by original programmers in the comments.

It seems that the source code was used for the PC and PSX versions of the game since blocks of code are contained in #ifdef PC_VERSION and #ifdef PSX_VERSION compiler directives. The modified version of the code I am using builds the PC version.

Thursday, 25 October 2018

Delphi Classes - fields

Some information I didn’t know about declaring fields in classes.

The var keyword is optional. However, if it is not used, then all field declarations must occur before any property or method declarations. After any property or method declarations, the var may be used to introduce any additional field declarations.
Source: http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Fields_(Delphi)


If a member's declaration appears without its own visibility specifier, the member has the same visibility as the one that precedes it. Members at the beginning of a class declaration that do not have a specified visibility are by default published, provided the class is compiled in the {$M+} state or is derived from a class compiled in the {$M+} state; otherwise, such members are public.
Source: http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Classes_and_Objects_(Delphi)

 

Thursday, 3 May 2018

Delphi 10.2 TQuaternion3D Example

Delphi’s System.Math.Vectors unit contains the TQuaternion3D class.

There is no information about the class in the Help so I post some code here so I remember how to use the class.

Following are some code snippets showing how to use quaternions to transform the mesh vertices in a model according to a skeletal hierarchy.

The procedures are used to build the models from old classic Tomb Raider games and export them to a 3D modelling program.

In Tomb Raider the animation data is stored as an (x,y,z) offset for the root bone and YXZ Euler angles for the rotations of all the bones.

In Tomb Raider a right handed coordinate system is used but the –Y axis is up so usually a further transformation is needed to get the models the right way up in other programs.

Here I do a 180 degree rotation about the X axis.

It is important to do this transformation last since then you don’t have to worry about adjusting the angles or offsets.

The code snippets also use System.Generics.Collections TStack and TList.

I also include a small example for the System.Math.Vectors TMatrix3D class which similarly has no Help topic.

Tuesday, 20 March 2018

Tomb Raider 3 source code notes

The source code for TR2/TR3 was briefly leaked online in March 2018 (see info).

This post will document my studies of the code.

Wednesday, 13 September 2017

3DS max 2016 Metasequoia (.MQO) Importer

Since the website with the Metasequoia importers/exporters for modern versions of 3DS max has disappeared I tried my hand at compiling sio29’s 3DS max 9 code for 3DS max 2016.

Sunday, 18 June 2017

Github Desktop Program Tutorial

Github Desktop is a GUI program for git version control that is distributed by Github.com.

The video below explains how to use it the best in my opinion.

https://www.youtube.com/watch?v=_qXXAWsxldg




Markdown cheatsheet for writing readme.md is here. [link]


Friday, 26 May 2017

WIP: TR42PRJ

Version: 0.71
Status: Released

An attempt to replicate aktrekker’s TR2PRJ program for the TRLE community.

I noticed aktrekker’s program gets some of the geometry incorrect, especially some split sectors and some sectors beneath horizontal doors.

Unlike aktrekker’s program I only extract geometry so rooms will have to be manually reconnected, retextured, and triggers, objects and lights added.

aktrekker’s program seems to convert black in the textures to magenta instead of alpha to magenta so I fixed this too.

Source and release at GitHub. [link]

If building from source you need to download the Vampyre Imaging Library. The latest released version does not compile under Delphi XE7 so get the version from Mercurial repository. [link]

Since I don’t know how aktrekker extracted textures and created doors I may in future add ability to import TR2PRJ’s prj file and inject this data into the prj I create.

Usage:
  • Open .TR4 file
  • Click Save As to save .prj and .tga file