[00:49:58] --> ShadwChsr has joined #pentagram
[01:25:17] <ShadwChsr> anyone alive? :)
[02:15:54] <pupnik> hi
[02:16:22] <pupnik> watt and wjp were just in here fixing sorting bugs ShadwChsr
[02:17:04] <ShadwChsr> maybe 2 hours ago?
[02:17:47] <ShadwChsr> Cool
[03:28:52] --> kyle__ has joined #pentagram
[03:29:43] <-- kyle__ has left IRC (Client Quit)
[03:29:54] --> kyle__ has joined #pentagram
[03:30:01] <-- kyle__ has left IRC (Client Quit)
[03:30:37] --> KyleW has joined #pentagram
[03:30:39] <-- KyleW has left IRC (Client Quit)
[03:31:04] --> Kyle_W has joined #pentagram
[03:31:56] <Kyle_W> do you guys have a texture extraction tool?
[03:32:05] <Kyle_W> that would work for crusader
[03:45:24] <-- Kyle_W has left #pentagram ()
[04:48:06] <ShadwChsr> Nope, sorry
[04:48:10] <ShadwChsr> Just a shape viewer
[05:11:18] <-- ShadwChsr has left IRC (Read error: 110 (Connection timed out))
[05:13:33] --> ShadwChsr has joined #pentagram
[05:13:39] <ShadwChsr> Hey
[05:20:50] <-- ShadwChsr has left IRC (Read error: 60 (Operation timed out))
[05:21:42] --> ShadwChsr has joined #pentagram
[05:46:04] <-- ShadwChsr has left IRC (Read error: 113 (No route to host))
[05:50:18] --> ShadwChsr has joined #pentagram
[06:10:21] <-- ShadwChsr has left IRC (Read error: 113 (No route to host))
[06:16:32] --> ShadwChsr has joined #pentagram
[06:36:06] <-- ShadwChsr has left IRC (Read error: 113 (No route to host))
[06:39:54] --> ShadwChsr has joined #pentagram
[07:04:26] <-- ShadwChsr has left IRC (Read error: 113 (No route to host))
[07:52:52] --> pupnik_ has joined #pentagram
[08:09:07] <-- pupnik has left IRC (Read error: 110 (Connection timed out))
[11:15:23] --> Mrrrr has joined #pentagram
[12:25:28] <-- Kirben has left IRC (Read error: 110 (Connection timed out))
[13:05:46] <-- watt has left IRC ()
[13:51:20] --> watt has joined #pentagram
[13:51:20] --- ChanServ gives channel operator status to watt
[14:00:34] <-- watt has left IRC ()
[14:51:44] --> watt has joined #pentagram
[14:51:44] --- ChanServ gives channel operator status to watt
[17:26:25] --> ShadwChsr has joined #pentagram
[20:01:19] <ShadwChsr> Afternoon ;)
[20:01:31] <ShadwChsr> SortItem patch still looking okay?
[20:18:27] --- pupnik_ is now known as pupnik
[20:40:19] --> Kirben has joined #pentagram
[20:40:20] --- ChanServ gives channel operator status to Kirben
[21:35:20] <wjp> _snprintf doesn't null-terminate in msvc? yikes
[21:35:44] <ShadwChsr> :S
[21:35:54] <ShadwChsr> "If len > count, then count characters are stored in buffer, no null-terminator is appended, and a negative value is returned."
[21:35:57] <ShadwChsr> Yeah, scary stuff
[21:35:58] <wjp> "The functions snprintf() and vsnprintf() write at most size bytes (including the trailing null byte ('\0')) to str."
[21:36:25] <ShadwChsr> Microsoft deprecated their screwed up implementations for newer versions in VC++
[21:36:33] <ShadwChsr> _snprintf_s
[21:38:08] <ShadwChsr> http://www.di-mgt.com.au/cprog.html "More on buffer overflows - MSVC's _snprintf function"
[21:38:50] <ShadwChsr> The latest Windows SDK includes "vcbuild" - it's possible to add "/analyze" as a compiler switch and run vcbuild on the solution.
[21:39:10] <ShadwChsr> It runs something called prefast on it - static analysis for overflows, uninitialized variables, etc
[21:40:03] <wjp> nice
[21:40:50] <wjp> heh, is it me or does that di-mgt.com.au page list a broken wrapper function? (for the case when len == count-1)
[21:41:09] <ShadwChsr> Probably ;)
[21:41:19] <Colourless> in msvc sprintf_s is what you want
[21:41:38] <ShadwChsr> sprintf_s will solve some of my compiler warnings anyhow :P
[21:41:40] <Colourless> its part of their 'secure' library
[21:42:11] <Colourless> it removes the ambiguity and explictiy specifies that buffer size of the destination and will null terminate
[21:42:17] <ShadwChsr> I think there's a kludgey way to override the behavior and always use the secure one, but its not as ideal as directly using it.
[21:42:22] <ShadwChsr> Due to the buffer size parameter
[21:42:57] <Colourless> the C++ sprintf_s macros are kind of cool, as they can be used without specifiying the buffer size if you are using a fixed sized array
[21:43:57] <Colourless> anyway, gtg, work to do
[21:44:06] <ShadwChsr> Also check out WindowsMidiDriver.cpp(208)
[21:44:22] <ShadwChsr> _streamBuffer may be null there
[21:44:43] <ShadwChsr> You can see it's diligently checking if(_streamBuffer) then using it anyways ;)
[21:46:08] <ShadwChsr> Console::CheckResize can use up to 32KB of stack as well
[21:46:53] <ShadwChsr> "assert" is being used to protect a lot of buffer overruns too :O
[21:47:44] <wjp> could you file bug reports for those too?
[21:47:59] <wjp> (the _streamBuffer / CheckResize I mean)
[21:48:04] <ShadwChsr> Sure
[21:48:26] <wjp> I don't mind if a couple of these quickly fixed code quality issues are bunched together in one bug report
[21:48:54] <ShadwChsr> Whats your policy on assert regarding code protection?
[21:49:26] <ShadwChsr> There are quite a few cases of assert protecting some overflows and/or null pointers that could theoretically be called in release mode
[21:49:46] <ShadwChsr> Probably issues that would be caught during development, but depends on your defensive programming policies I suppose
[21:50:11] <wjp> hm
[21:51:08] <ShadwChsr> About 20 variable/scope redefinitions within a function as well
[21:51:57] <wjp> I think the implicit policy is that asserts were 'good enough'. I'd be open to patches I guess
[21:52:22] <wjp> if you can easily copy/paste those shadows into a bug report that would also be good
[21:52:37] <wjp> we should probably also enable that warning in gcc
[21:58:34] * ShadwChsr nods
[21:58:44] <ShadwChsr> There are 289 warnings, but I posted the easier/more obvious ones
[21:58:48] <ShadwChsr> Most are related to assert
[21:59:23] <ShadwChsr> A few size_t to uint32 warnings too, stuff like that.
[22:06:09] <wjp> thanks
[22:06:23] <ShadwChsr> No problem
[22:06:47] <ShadwChsr> The other day you mentioned that some of the U8 map shapes are "truncated" to tile boundaries
[22:07:13] <ShadwChsr> Do you know where the behavior happens?
[22:07:40] <ShadwChsr> I looked into the sorter at the Zealan Shrine a bit more and my rounding guess/fix didn't help.
[22:08:09] <ShadwChsr> That only leaves a flaw in the map loading code leading to incorrect coordinates (not likely) or the fact those specific type of shapes are aligned to tile boundaries
[22:08:23] <ShadwChsr> I'm not sure if that happens *anywhere* in U8 though
[22:11:37] <wjp> it happens with the spawn coordinates of glob eggs
[22:12:05] <wjp> globs are basically pregenerated fixed blocks of items that can be created at arbitrary locations
[22:12:26] <ShadwChsr> Ahhhhhhh
[22:12:27] <wjp> (used for common repeated structures such as vegetation, simple rooms, etc..)
[22:12:32] * ShadwChsr nods
[22:12:40] <ShadwChsr> Makes sense
[22:12:54] <wjp> see world/GlobEgg.cpp, GlobEgg::enterFastArea()
[22:13:07] <ShadwChsr> U8 doesn't make a special distinction for "ground", correct?
[22:13:18] <wjp> not as far as I know
[22:13:20] <ShadwChsr> To the engine it's just a list of sorted objects with collission boundaries?
[22:13:31] <wjp> yes
[22:13:40] <ShadwChsr> Weird. I can't come up with an explaination for the Zealan Shrine then.
[22:14:01] <wjp> do you have access to a savegame from the original?
[22:14:02] <ShadwChsr> I fired up a debugger and looked at the true game world coordinates - they're not on tile boundaries
[22:14:08] <wjp> or that :-)
[22:14:59] <ShadwChsr> I found a screenshot of it - definitely appeared correct in the original
[22:16:06] <wjp> oh, did you run a debugger on U8 or pentagram?
[22:16:10] <ShadwChsr> Pentagram
[22:16:13] <wjp> ah
[22:16:32] <wjp> it would be interesting to get a savegame near there from the original to see what coordinates are saved in there for the carpets
[22:16:57] <ShadwChsr> You can lookup coordinates in the original game?
[22:17:49] <wjp> probably, but I know you can in the savegame :-)
[22:18:03] <wjp> there is also a 'dump item info' cheat I believe
[22:18:19] <ShadwChsr> Ahhhhh
[22:18:31] <ShadwChsr> I'll see what I can find, maybe there's a dump of old savegames somewhere online :)
[22:18:41] <wjp> do you have u8 running in dosbox?
[22:19:29] <wjp> I have this little perl script that patches usecode to make the bedroll a teleporter to any coordinates :-)
[22:20:54] <wjp> hm, do you have coordinates of the zealan shrine handy?
[22:21:25] <wjp> oh, my pentagram autosave is in there; never mind :-)
[22:23:40] <wjp> do you feel like taking a look? I have an itemcach file from the original in the zealan shrine here
[22:25:06] <ShadwChsr> How do itemcache scripts work?
[22:25:15] <ShadwChsr> I don't have u8 running in dosbox right now, but I can always set it up
[22:25:32] <ShadwChsr> (sorry, itemcache files)
[22:25:39] <wjp> itemcach is basically a dump of the items currently loaded items in U8
[22:25:52] <ShadwChsr> What format is it in?
[22:25:59] <wjp> it's an array of X coordinates followed by an array of Y coordinates followed by...
[22:26:18] <wjp> docs/u8mapfmt.txt has info on it
[22:26:29] * ShadwChsr nods
[22:26:59] <wjp> http://www.usecode.org/pentagram/itemcach
[22:27:06] <ShadwChsr> Can you attach a copy of it to the bug report?
[22:27:14] <ShadwChsr> I'll grab it when I get home and take a look
[22:27:26] <ShadwChsr> Or that works :)
[22:27:39] <ShadwChsr> Your webserver is serving it up as text though
[22:27:48] <wjp> oh, hm
[22:28:08] <ShadwChsr> Can you change it to another data type so it serves up as octet-stream?
[22:28:29] <wjp> http://www.usecode.org/pentagram/itemcach.bin
[22:29:35] <ShadwChsr> Got it, thanks :)
[22:29:47] <wjp> that should determine if it's a loading or rendering issue
[22:30:00] * ShadwChsr nods
[22:30:39] <ShadwChsr> How are gumps closed in U8? A usecode call?
[22:31:45] <wjp> GUIApp::I_closeItemGumps
[22:31:57] <wjp> there may also be other functions that do this implicitly
[22:32:08] <wjp> and we may also have missed one or two of those
[22:32:24] <ShadwChsr> Ahhhhh, I was wondering about that
[22:32:56] <ShadwChsr> I have this weird hunch that certain camera panning operations may do it - since they're used for 'cinematic' sequences
[22:33:28] <-- Mrrrr has left IRC (Read error: 113 (No route to host))
[22:33:36] <wjp> hm, could be, yes
[22:34:47] --> Mrrrr has joined #pentagram
[22:38:35] <ShadwChsr> Now that people can complete the game, you should bump the project status to alpha and close the "build an Ultima 8 engine" tracker item ;)
[22:38:56] <wjp> overlaying two screenshots and fixing the altar in place:
[22:39:17] <wjp> the pieces of carpet that are tile-aligned are drawn in the same spot relative to the altar
[22:39:32] <wjp> (two screenshots: one of pentagram, one of U8)
[22:39:42] <ShadwChsr> Can you upload the screenshots somewhere?
[22:40:29] <wjp> I picked the altar as a reference point because that is tile aligned, by the way
[22:40:48] <wjp> yes, one sec
[22:41:28] <ShadwChsr> You probably could determine whether it's a rendering bug by checking if the carpet's x and ycoords are aligned on a multiple of 128
[22:41:53] <wjp> http://www.usecode.org/pentagram/shrine_u8.png vs http://www.usecode.org/pentagram/shrine_pent.png
[22:42:13] <wjp> avatar is teleported to the exact same coordinates in both
[22:43:35] <wjp> map 54, (12286,2946,8)
[22:43:57] <wjp> interestingly the avatar is not drawn in the same spot relative to the altar
[22:44:59] <ShadwChsr> hrmmmmmm
[22:45:01] <wjp> fixing the avatar in place (which _is_ on even coordinates), only the items on odd coordinates are different between the two screenshots
[22:45:14] <wjp> s/odd/even/, sorry
[22:45:22] <wjp> except for the avatar...
[22:45:31] <ShadwChsr> How far off is the avatar?
[22:46:17] <wjp> all differences in the screenshot are one vertical pixel
[22:46:54] <wjp> (ignoring the movable items like the shield and skeleton and such)
[22:47:32] <ShadwChsr> That would seem to indicate a rounding bug after all ;)
[22:48:25] <wjp> yes, although it's a bit puzzling that the avatar behaves differently
[22:48:55] <wjp> (although I guess it could be an edge case somewhere since the camera is on the avatar)
[22:49:51] <ShadwChsr> Does it still happen if your screen is set to 320x240?
[22:50:29] <wjp> what do you mean?
[22:51:00] <ShadwChsr> I dont know much about how the scalers work - could it be in there?
[22:51:06] <ShadwChsr> Or at least exposing the rounding issue?
[22:51:14] <wjp> no, the rendering is done pre-scaling
[22:51:25] * ShadwChsr nods
[22:51:29] <wjp> the game is 320x200 by the way
[23:05:24] <-- watt has left IRC (kornbluth.freenode.net irc.freenode.net)
[23:05:24] <-- LordNAway has left IRC (kornbluth.freenode.net irc.freenode.net)
[23:05:24] <-- Colourless has left IRC (kornbluth.freenode.net irc.freenode.net)
[23:05:24] <-- wjp has left IRC (kornbluth.freenode.net irc.freenode.net)
[23:05:24] <-- servus has left IRC (kornbluth.freenode.net irc.freenode.net)
[23:05:42] --> watt has joined #pentagram
[23:05:42] --> LordNAway has joined #pentagram
[23:05:42] --> Colourless has joined #pentagram
[23:05:42] --> wjp has joined #pentagram
[23:05:42] --> servus has joined #pentagram
[23:21:01] <wjp> good night
[23:21:19] <ShadwChsr> Night
[23:39:32] <-- watt has left IRC ()