df21-net / editor Goto Github PK
View Code? Open in Web Editor NEWSource code for the Dark Forces Editor
Source code for the Dark Forces Editor
It's dying on Vertex Multiselect section starting on line 702 in MAPPER.PAS.
TheSector.Vx.Objects[StrToInt(Copy(VX_MULTIS[m],5,4))]
Why is it happening? After deleting a vertex (it doesn't handle multiple of them), it attempts to redraw the editor by updating the multi-selected vertices. However, the editor doesn't update the VX_MULTIS array for visibility from those that were deleting. So when it tries to dereference deleted vertices, it blows up with out of bounds.
I think the solution is as simple as updating the VX_MULTIS.
Ensure all functionality works.
From reading the code and some tests we have two options both of them doable:
DO_StoreUndo
to generate snapshots of WDFUSE's memory objects instead of the current manual snapshot: Requires code analysis of when to perform this calls so every map function should store a snapshot, minimal code changes probably aside from a list of objects storing all the snapshots.I think the best idea is to do 1., the same way the UNDO is leveraged could be used to apply snaphots of undone events, after implementing this we could observe how limited this is and build features on top.
We should be able to zoom with a mouse in 2021.
To reproduce. Choose a sector, change a floor altitude value (or any editable field) and highlight it . Choose another sector with a different value of the floor altitude. The value displayed in the sector editor is the old one. However, if you click on the sector editor again - the value is updated. I am guessing the issue is due to it not refreshing.
The interesting thing is if you click on another sector the name of the sector editor window is updated, but no the highlighted fields.
The editor click that updates the sector editor window is in M_EDITOR.PAS and looks like this
`
procedure DO_Fill_SectorEditor;
var
TheSector : TSector;
numvx : Integer;
numwl : Integer;
begin
TheSector := TSector(MAP_SEC.Objects[SC_HILITE]);
numvx := TheSector.Vx.Count;
numwl := TheSector.Wl.Count;
SectorEditor.Caption := Format('SC %d %s', [SC_HILITE, TheSector.Name]);
SectorEditor.SCEd.Cells[1, 0] := TheSector.Name;
SectorEditor.SCEd.Cells[1, 1] := IntToStr(TheSector.Ambient);
SectorEditor.SCEd.Cells[1, 2] := IntToStr(TheSector.Flag1);
SectorEditor.SCEd.Cells[1, 3] := IntToStr(TheSector.Flag2);
SectorEditor.SCEd.Cells[1, 4] := IntToStr(TheSector.Flag3);
SectorEditor.SCEd.Cells[1, 5] := RTrim(Format('%-5.2f', [TheSector.Floor_Alt]));
SectorEditor.SCEd.Cells[1, 6] := TheSector.Floor.Name;
SectorEditor.SCEd.Cells[1, 7] := RTrim(Format('%-5.2f', [TheSector.Floor.f1]));
SectorEditor.SCEd.Cells[1, 8] := RTrim(Format('%-5.2f', [TheSector.Floor.f2]));
SectorEditor.SCEd.Cells[1, 9] := IntToStr(TheSector.Floor.i);
SectorEditor.SCEd.Cells[1, 10] := RTrim(Format('%-5.2f', [TheSector.Ceili_Alt]));
SectorEditor.SCEd.Cells[1, 11] := TheSector.Ceili.Name;
SectorEditor.SCEd.Cells[1, 12] := RTrim(Format('%-5.2f', [TheSector.Ceili.f1]));
SectorEditor.SCEd.Cells[1, 13] := RTrim(Format('%-5.2f', [TheSector.Ceili.f2]));
SectorEditor.SCEd.Cells[1, 14] := IntToStr(TheSector.Ceili.i);
SectorEditor.SCEd.Cells[1, 15] := RTrim(Format('%-5.2f', [TheSector.Second_Alt]));
SectorEditor.SCEd.Cells[1, 16] := IntToStr(TheSector.Layer);
SectorEditor.PanelVXNum.Caption := IntToStr(numvx);
SectorEditor.PanelWLNum.Caption := IntToStr(numwl);
DO_SectorEditor_Specials_Init;
`
The Actual window is defined in M_SCEDIT.PAS
Implement the opposite of Undo, preserve all states .
Need to ensure cancelling operations restores original data. At the moment if you press cancel the whole map iswiped.
I am guessing something to do with RLE decompression, similar to issues here --> njankowski/dftools@0d19741
Tracing to V_util32.PAS
It should center around where we point instead of simply just increasing based on the center of the map.
Need to up the asset buffer
At the moment, polygonal sector creation consists of creating walls. That means that for each wall it will try to record a store call meaning for one insertion it may call 4 (sector and 3+ walls) or more stores. As a result you have to undo four times to go back to the original state.
Need to add a muting variable so it only stores in undo only once.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.