Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Kazan on October 28, 2003, 12:35:25 pm

Title: FS Dev Studio Update
Post by: Kazan on October 28, 2003, 12:35:25 pm
Well i have the syntax highlighting table editor working

(http://www.cs.iastate.edu/~kazan/fsdevstudio0001.jpg)

the only problem is it's slow as molassis in january on large files - i cannot find a fast was of performing it - no way of getting only the visible range, not to mention to good way to catch all screen changes

I cannot optimize my function any further - it's the underyling wxWindows calls that are slowing **** down.


Maybe i should ***** to them and in future releases get it speed up
Title: FS Dev Studio Update
Post by: FreeTerran on October 28, 2003, 01:32:04 pm
:( a red X
Title: FS Dev Studio Update
Post by: Kazan on October 28, 2003, 01:43:34 pm
helps to upload the image..
Title: FS Dev Studio Update
Post by: karajorma on October 28, 2003, 01:59:04 pm
Can you lvlshot that pic please Kazan? Oh and ask Tolwyn if he minds you giving his ICQ number away? :lol:

Looks good so far though. Hope you find a way to speed it up cause I'm definately waiting for this with baited breath.
Title: FS Dev Studio Update
Post by: KARMA on October 28, 2003, 02:31:14 pm
ehy that's a truely nice idea:)
Title: FS Dev Studio Update
Post by: mikhael on October 28, 2003, 02:34:51 pm
out of curiosity, could you write a custom version of he wx widget that reported viewable range?
Title: FS Dev Studio Update
Post by: Kazan on October 28, 2003, 02:44:56 pm
actually that's my ICQ number

mikhael - not familiar with wx widget - i am new to wxWindows but i like what i see thus far
Title: FS Dev Studio Update
Post by: mikhael on October 28, 2003, 03:23:28 pm
well, by wxWidget, I mean the wxWindows widget you're using for the edit display. at some point, it must keep track of how big the display area is, and the offset into the edit buffer where the display starts (I'm guessing here, I've not started working with wxWin yet myself. Its on the to do list). If the current version won't tell you those things, you can probably write wx$Control-Kazan that does, and that might help.

On the other hand, when we're talking about dog slow, how dog slow are we talking here?
Title: FS Dev Studio Update
Post by: karajorma on October 28, 2003, 03:31:51 pm
Quote
Originally posted by Kazan
actually that's my ICQ number


Doh! I use Trillian all the time too! :)
Title: FS Dev Studio Update
Post by: Kazan on October 28, 2003, 03:45:30 pm
none of the classes that wxTextCtrl are derived from have an intelligent way of determining the first visible line in the text control (if i want to do this i have to violating portability and use direct win32 calls) and there is no way to intelligently tell the last visible line - and there is no effective way of catching every visibility range change currently


i guess i could brute force it with a wxTimer and compairing the last visible first line before with the currently last visible first line - and then add something like 75 to it for last line (my screen can exceed 50 lines visible - but not 75 and im wrunning 1600x1200)
Title: FS Dev Studio Update
Post by: mikhael on October 28, 2003, 07:53:34 pm
That bites. You'd think that there would be an accessor for the general range of visible lines in a text control.

I say rewrite wxTextCtrl and submit a patch. ;)
Title: FS Dev Studio Update
Post by: Kazan on October 28, 2003, 07:59:41 pm
you know how much of a ***** that would be... oui
Title: FS Dev Studio Update
Post by: mikhael on October 28, 2003, 09:06:22 pm
Yeah. Doom.

I wonder how stuff like ConTEXT (though that's written in Delphi) or the other various editors do context highlighting so fast.
Title: FS Dev Studio Update
Post by: Setekh on October 29, 2003, 02:23:16 am
Lookin' good, Kazan.
Title: FS Dev Studio Update
Post by: kasperl on October 29, 2003, 10:39:33 am
erm, wouldn't it be possible to do this at load, and at an edit, only for the edited line?

/me stupid n00b, /me only knows QB
Title: FS Dev Studio Update
Post by: mikhael on October 29, 2003, 11:08:29 am
That's actually a good point. Does wxTextCtrl let you screw about arbitrarily with the current line? Does it at least expose the address of the current line so that you can work with it?
Title: FS Dev Studio Update
Post by: Goober5000 on October 29, 2003, 12:12:31 pm
Yeah; if that's the case, you could just go an arbitrary number of lines up and down from the current line.
Title: FS Dev Studio Update
Post by: Gloriano on October 29, 2003, 12:29:49 pm
looks good:yes: :yes: :)
Title: FS Dev Studio Update
Post by: Kazan on October 30, 2003, 04:49:12 pm
ok - instead of dealing with all kinds of **** in autohighlight - i added "Highlight" to the right-click menu .. it'll process the entire document at once and show a progress bar
Title: FS Dev Studio Update
Post by: Flipside on October 30, 2003, 05:05:02 pm
Well, I'm going to copy ad paste my comments from the original idea post to here, just in case it was missed :)

One thing that would be nice is a bit more flexibility to the table editor, so you could, for example, create a ship table entry using a form, and then the program would insert it into ships.tbl at a specified point (By species/role), the same would also be good for other tables as well, though it would take a more 'aware' parser, which is more work for Kazan, who already seems rushed off his feet. I suppose the best part of this would be if the 'insert' info was saveable, so you could save a single table entry, and just run it through the program to insert it into someone elses tables. This would be great for Modders working on projects who are trying to keep their tables in order
Another nice idea would be 'Replace this item with original'. This way you could choose a ship or weapons etc that you have altered and the program could replace it with the original from the .tbl. I am sure we have all tweaked a ship but not wanted to replace the whole table again when we have finished, just a glorified cut&paste, but useful

Flipside :D
Title: FS Dev Studio Update
Post by: Kazan on October 30, 2003, 05:16:42 pm
the more advanced one is coming later


holy mother of trash
NEVER run the highlight on the ships.tbl (fortunate I put in the abort) just the "$*:" tag pass was estimated by wxWindows to take 10 minutes! then there's the " " pass (two big passes) which i've never gotten to

remove the wxTextCtrl::SetStyle calls and the entire document takes a few seconds - so it's not my code at fault!
Title: FS Dev Studio Update
Post by: Kazan on October 30, 2003, 05:38:27 pm
oh man.. the problem is all the way down at the operating system level
Title: FS Dev Studio Update
Post by: Flipside on October 30, 2003, 05:40:11 pm
Dontcha just love Microsoft :)

I coded in the days of 6502 & Z80 so I can't offer any constructive help, sorry :(

Flipside :D
Title: FS Dev Studio Update
Post by: Goober5000 on October 30, 2003, 05:56:47 pm
Would you be willing to post the code in the SCP internal?
Title: FS Dev Studio Update
Post by: kasperl on October 31, 2003, 11:40:43 am
from what i gather, the problem is setting the font right? couldn't you set the font tags in an internal array, coded by you, and have ms only thouch the code currently onscreen?
Title: FS Dev Studio Update
Post by: Kazan on October 31, 2003, 11:50:27 am
that would require the ability to determine what lines were currently onscreen - which you cannot do
Title: FS Dev Studio Update
Post by: Kazan on November 04, 2003, 07:34:03 pm
(http://www.cs.iastate.edu/~kazan/POFEditor.jpg)

general layout
Title: FS Dev Studio Update
Post by: Taristin on November 04, 2003, 08:02:49 pm
Can only get better from here. :D
Title: FS Dev Studio Update
Post by: Liberator on November 04, 2003, 08:24:53 pm
Lookin' good!