Today I was adding the ability to make tank sights have thicker lines if you wish. Here is the ai session that did it all
Tank sight: a conversation with Codex
August 31, 2026 | Dale Addink and Codex
Conversation transcript, including progress updates. Tool output and system messages are omitted; formatting and file links are simplified. Original wording is retained.
Dale
Add user selectable number of lines to tank sight
Codex
I’ll find the tank sight settings and add a control for the number of lines.
Dale
The setting will be coded in the file iset/isetclrs.c
Codex
I’ll put the new setting in iset/isetclrs.c and connect it to the tank sight drawing.
Dale
tanksight drawing is in wasight.cpp do you remember working on that file?
Codex
I don’t have memory of working on it outside this conversation. So far, I’ve only inspected C:\htsim\dx8\wa\wasight.c, which contains the tank sight drawing functions; I haven’t changed anything.
Is your wasight.cpp in a different source folder?
Dale
you have the correct file.
rendpolyRenderPointVertsUp(gr3dPT_LINELIST,Verts,2); is used multiple places in that file, begin by changing that to a function that gets the verts past in along with the new number of lines paramater
Codex
I’ll start by wrapping those two-vertex line calls in a function that accepts the vertices and a line-count parameter.
Codex
I found 25 matching calls, including some split across multiple lines. I’ll route them through _RenderSightLines(Verts, LineCnt), with each existing call passing 1 to preserve the current drawing. This is the initial refactor; the selectable setting is still to come.
Codex
Updated wasight.c with _RenderSightLines(Verts, LineCnt) and replaced all 25 matching calls.
Each passes 1, preserving current rendering. The selectable setting isn’t wired in yet. Changes verified; no build run.
Dale
Add the new line count member to structure isetclrsSETUP
Codex
I’ll add the line-count member to isetclrsSETUP.
Codex
Added int TankSightLineCnt; to isetclrsSETUP in isetclrs.h.
Dale
In the dialog that is used by isetclrs make the Icon Font Size group smaller and put in a new drop down list box for the new line count configureator line count can go from 1 to 4
Codex
I’ll shrink the Icon Font Size group and add a tank sight line-count dropdown with choices from 1 to 4, then connect it to the dialog’s settings.
Codex
The new dropdown will sit beside the smaller Icon Font Size group. I’m also adding save/load support, with a default of 1 for existing configurations.
Dale
The dialog is IDD_GUI_SETTINGS
Codex
Yes—IDD_GUI_SETTINGS is the dialog I’ve updated in the prepared changes. I’ll apply them now.
Codex
Updated IDD_GUI_SETTINGS:
Shrunk the Icon Font Size group.
Added a Tank Sight Lines dropdown with choices 1–4.
Connected selection, defaults, and saving/loading to TankSightLineCnt.
Dialog resource compilation passed. Rendering hookup remains unchanged.
Dale
And a new static to wasight.c make a setter called from isetclrs and use the new varible to call the line function
Codex
I’ll check the current line function, then add the static setting and setter and connect them to isetclrs.
Codex
The wrapper I added assumes each line has its own pair of vertices, but these callers only supply one pair. I’ll correct it to draw that supplied pair the selected number of times, so values 2–4 won’t read uninitialized vertices. Spacing those lines for visible thickness will still need a separate change.
Codex
Added _TankSightLineCnt and wasightSetTankSightLineCnt(), clamped to 1–4. isetclrs now calls the setter, and all 25 line calls use the variable.
Lines currently overlap; spacing for visible thickness remains unfinished. No build run.
Dale
_RenderSightLines needs to be changed so that the verts are adjust by the port size so that 2 visual horizontal lines are drawn.
Codex
I’ll check the viewport conversion code and use it to offset each copy by one screen pixel.
Codex
I’ll space horizontal lines vertically by one pixel and center them on the original position. I’ll also handle vertical and diagonal lines so their copies don’t overlap, without modifying the caller’s vertices.
Codex
Updated _RenderSightLines to use viewport-sized offsets. Selecting 2 now places horizontal copies one pixel apart, centered on the original sight line. Counts 1–4 and other line orientations are supported.
Spacing calculations checked; not yet tested in-game.
Dale
I am testing now.
Codex
Check that 2 produces two adjacent lines and that 1 restores the original appearance. Let me know if the spacing or alignment looks off.
Dale
Will this work for diagonal ines?
Codex
Yes. The offset is perpendicular to the line’s screen direction, so diagonal lines should draw parallel copies one pixel apart, centered on the original line. Diagonal edges may look slightly different due to pixel rasterization.
Dale
make prototypes for all static functions in wasight.c
Codex
I’ll add any missing static function prototypes to the declaration block at the top of wasight.c.
Codex
Added the five missing prototypes at the top of wasight.c. All 10 static functions now have prototypes.
Dale
change _DrawTriArrow to also use linecnt into account
Codex
I’ll update _DrawTriArrow to use the selected line count for each side of the arrow.
Codex
Updated _DrawTriArrow: both sides now use _RenderSightLines with _TankSightLineCnt, applying the selected thickness and pixel spacing. Not yet tested in-game.
Dale
Save this session to a common format file
Codex
I’ll save a Markdown session record in the project folder, including your requests, the changes made, and testing status.
Codex
Saved as Tank Sight Session - 2026-08-31.md, including the conversation record, changes, and testing status.
Dale
I want a simple docx file showing our conversation so that I can show others how you work.