#uwadv@irc.freenode.net logs for 4 Mar 2004 (GMT)

Archive Today Yesterday Tomorrow
Underworld Adventures homepage


[00:00:40] <-- Leo56k has left IRC ("Nothing hurts a project more than developers not taking the time to let their community know what is going on.")
[11:42:06] --> Leo56k has joined #uwadv
[16:19:02] <-- wjp has left IRC (Remote closed the connection)
[16:19:46] --> wjp has joined #uwadv
[16:42:01] --- ChanServ gives channel operator status to wjp
[18:13:48] --> Leo44 has joined #uwadv
[18:17:25] <-- Leo56k has left IRC (Read error: 110 (Connection timed out))
[18:43:07] <-- Leo44 has left IRC ("Nothing hurts a project more than developers not taking the time to let their community know what is going on.")
[22:47:28] --> vividos has joined #uwadv
[22:47:28] --- ChanServ gives channel operator status to vividos
[22:56:41] <wjp> hi
[22:56:44] <wjp> compile errors :-)
[22:59:13] <wjp> hm, you're using iterators as pointers
[23:00:28] <wjp> ret = get_message_text(msg.msg_text.begin(), text_size); <-- bad
[23:03:22] * wjp pokes vividos; still here? :-)
[23:05:05] <vividos> yes
[23:05:14] <vividos> yes, that's bad
[23:05:23] <vividos> should better use a std::vector?
[23:06:20] <wjp> or have get_message_text return a string
[23:06:26] <wjp> or pass it a string by reference
[23:07:18] <vividos> the problem is that get_message_text is called over dll boundaries, and the uwadv.exe and uadebug.dll cannot assume that they use the same implementation of std::string
[23:07:32] <wjp> ah
[23:07:38] <wjp> temp buffer in get_message, then?
[23:08:36] <vividos> the inline get_message one?
[23:08:38] <wjp> char tmp = new char[text_size+1]; ret = get_message_text(tmp, text_size); msg.msg_text = tmp; should do it
[23:08:48] <wjp> uh, char*
[23:08:52] <wjp> and delete it, of course
[23:09:02] <wjp> yes, the inline one
[23:09:21] <vividos> then I could also use a std::vector<char> and take the ptr of the first element :)
[23:09:44] <wjp> sure
[23:10:53] <wjp> so you want to change msg_text to a vector? or use a temp vector?
[23:11:08] <vividos> I'll commit it on sunday or monday
[23:11:23] <vividos> no:
[23:11:34] <vividos> std::vector<char>(length) buffer;
[23:11:55] <vividos> and then pass &buffer[0] as const cha
[23:11:55] <vividos> sorry
[23:12:05] <vividos> then pass &buffer[0] as char* to get_message_text
[23:12:21] * wjp nods; that's what I meant with a temp vector
[23:12:37] <vividos> ok
[23:12:41] <vividos> for all that want to test current CVS (with a few minor modifications): http://www.asamnet.de/~finkm/uwadv/uwadv-0.9-test1-win32.exe
[23:12:53] <wjp> but I don't really see the advantage of that over a simple char*, unless you want to keep the vector around outside get_message
[23:13:21] <wjp> anyway, it compiles if I fix this error
[23:13:33] <vividos> ok
[23:13:58] <vividos> the advantage over using a simple char* allocated with new is that you don't have to call delete afterwards
[23:14:11] <wjp> hm, this rat has a big grey border around it
[23:14:34] <wjp> and so does that first NPC you run into
[23:14:37] <vividos> thats intended, but only in debug mode
[23:14:42] <wjp> ah, ok
[23:14:55] <wjp> they're strangely off-center, though
[23:15:02] <wjp> but I'm sure that has a meaning :-)
[23:15:11] <vividos> the border?
[23:15:14] * wjp nods
[23:15:37] <wjp> the border extends a bit to the right of the critter
[23:15:39] <wjp> (but not to the left)
[23:15:53] <vividos> yes. a single xres and yres is determined for all frames of a critter
[23:15:58] <vividos> and that's the shown border
[23:15:59] <wjp> ah, I see
[23:16:54] <vividos> I'll see how far I get with restoring features from 0.8 next week, then I'll set a new release date
[23:16:54] <wjp> oh, right, I compiled it in debug mode because I got a crash otherwise
[23:17:02] <vividos> hopefully in march
[23:17:26] <vividos> located the crash?
[23:17:40] <vividos> I got one, too, when trying the mingw32 one
[23:17:43] <wjp> well, I compiled it in debug mode to track it down, and then it disappeared :-)
[23:18:00] <vividos> that's bad :)
[23:18:28] <vividos> try to uncomment critters drawing in renderer_impl.cpp if it fixes
[23:18:40] <wjp> I'll do a non-debug build with debugging info
[23:23:50] <wjp> hm, still no crash
[23:24:03] <vividos> hmm that's bad
[23:25:19] <wjp> uwadv is taking up interesting amounts of ram when running in valgrind
[23:25:27] <vividos> heh :)
[23:25:34] <wjp> 630Mb currently
[23:25:48] <vividos> is it the real number of ram it uses? hope no :)
[23:26:14] <wjp> valgrind is probably somewhat confused by the nvidia drivers
[23:26:57] <wjp> 750Mb :-)
[23:27:01] <vividos> phew :)
[23:27:01] <wjp> (and growing)
[23:27:15] <vividos> memory leaks shouldn't be found in uwadv, though
[23:27:27] <wjp> ok, now in-game, and stable at 768Mb
[23:27:40] <wjp> ==24780== Conditional jump or move depends on uninitialised value(s)
[23:27:41] <wjp> ==24780== at 0x8085AFE: ua_ingame_3dview::process_event(SDL_Event&) (ingame_ctrls.cpp:399)
[23:27:49] <wjp> ==24780== by 0x8093CFF: ua_screen::process_event(SDL_Event&) (stl_vector.h:289)
[23:28:43] <wjp> ingame_ctrls.cpp:399 is "if (in_view3d && !in_window(xpos,ypos))"
[23:29:12] <vividos> in_view3d wasn't initialized
[23:29:12] <wjp> I got this error the moment the world showed up
[23:29:20] <wjp> that would explain it, yes
[23:29:25] <vividos> the crash?
[23:29:37] <wjp> no, the valgrind error :-)
[23:29:45] <vividos> oh ok
[23:29:51] <wjp> any idea if it could cause the crash if it was set to the wrong value?
[23:30:14] <wjp> ==24780== Mismatched free() / delete / delete []
[23:30:16] <vividos> don't think, but you can add a
[23:30:19] <wjp> ==24780== by 0x8074D0F: ua_renderer::done() (utils.hpp:132)
[23:30:19] <vividos> in_view3d = false;
[23:30:26] <vividos> to ua_ingame_3dview::init
[23:30:46] <wjp> ==24780== Use of uninitialised value of size 8
[23:30:51] <wjp> ==24780== at 0x8095843: ua_window::calc_mousepos(SDL_Event&, unsigned&, unsigned&) (window.cpp:97)
[23:31:02] <wjp> (got those two when quitting)
[23:32:05] <vividos> the mismatched free() / delete / delete [] shouldn't be there ...
[23:33:40] <vividos> ok should fix the last error
[23:34:09] <vividos> should go to bed no
[23:34:10] <vividos> w
[23:34:36] <wjp> ah, I see
[23:34:39] <vividos> if you find more info about the crash, just post here or send a mail to the vastly-underused mailing list :)
[23:34:47] <wjp> you use 'delete' in ua_smart_ptr
[23:35:05] <wjp> but you make a smart_ptr for a 'new Uint8[maxframes * xres * yres]' in critloader.cpp
[23:35:28] <vividos> hmm that's bad
[23:35:37] <wjp> but I should go to bed too :-)
[23:35:43] <vividos> ua_smart_ptr can't be used for arrays
[23:35:45] <vividos> ok :)
[23:35:55] <vividos> can fix this on monday
[23:36:22] <vividos> g'night!
[23:36:31] <wjp> night
[23:37:03] <vividos> and lurkers, 0.9-test1 is available: http://www.asamnet.de/~finkm/uwadv/uwadv-0.9-test1-win32.exe
[23:37:41] <-- vividos has left IRC ("http://uwadv.sourceforge.net/index.php?page=devlog (now even xhtml 1.0 conformant)")