#gemrb@irc.freenode.net logs for 8 Apr 2010 (GMT)

Archive Today Yesterday Tomorrow
GemRB homepage

[00:00:16] <fuzzie> Was wondering how on earth that code could work, but of course it doesn't, the animated paperdolls use other code.
[00:01:42] <tomprince> Well, the reason I did that is that I didn't want to create an AnimationFactory, just to grab two frames from it.
[00:02:02] <tomprince> And, even if I did, we have nowhere to store it, so that it gets destroyed later.
[00:02:56] <fuzzie> I'm wondering why we are doing BAMs at all in SetButtonPLT.
[00:03:35] <fuzzie> Meh, something for tomorrow.
[00:03:35] <tomprince> Cause BG2 uses them interchangably I think.
[00:04:43] <tomprince> I remember discussion on Spellhold about how they use both.
[00:05:19] <tomprince> And I think there is a mod that replaces one with the other, because they think the images from PLT in BG1 look better. Or something.
[00:06:22] <tomprince> *************************************************************************************
[00:06:50] <tomprince> Does anybody care about the old svn import branches at or.cz. If not, I'll get rid of them in a couple of days.
[00:24:46] <-- edheldil_ has left IRC (Ping timeout: 252 seconds)
[00:32:53] <-- raevol has left IRC (Quit: Leaving.)
[03:33:17] <tomprince> We should just have PathJoin handle resolving path names, assuming that the first path has already been resolved.
[03:50:26] <-- wjp has left IRC (Ping timeout: 264 seconds)
[03:50:39] --> wjp has joined #GemRb
[04:25:03] <-- nomad__ has left IRC (Ping timeout: 260 seconds)
[04:48:02] --- ChanServ gives channel operator status to wjp
[05:07:28] --> nomad__ has joined #GemRb
[05:18:17] <tomprince> Something like or.cz/cleanup, but saner.
[05:45:48] <tomprince> fuzzie: You won't be stepping on my toes if you take that WIP patch and clean it up. For some reason me and it aren't getting along. ;)
[06:23:29] <-- nomad__ has left IRC (Ping timeout: 258 seconds)
[06:26:18] --> raevol has joined #GemRb
[07:27:40] --> lynxlynxlynx has joined #GemRb
[07:27:40] --- ChanServ gives channel operator status to lynxlynxlynx
[08:08:17] <Edheldil> tomprince: you just call FindInDir when adding the path segments, right?
[08:37:46] <raevol> hey can i just ask a code syntax question? i am learning C++
[08:37:48] <raevol> class GEM_EXPORT Game : public Scriptable {
[08:38:00] <raevol> in that line, the class Game inherits from the class Scriptable
[08:38:07] <raevol> but what is GEM_EXPORT there for?
[08:39:09] <Edheldil> it's macro, which does some export magic on windows
[08:39:36] <raevol> ugh i don't know what that means... i'll google
[08:39:45] <Edheldil> if you grep includes in gemrb/includes/*.h, you will find it
[08:40:39] <lynxlynxlynx> macros are just shortcuts that don't even make it to the compiler
[08:40:49] <Edheldil> well, you know what cpp macro is, don't you? #define GEM_EXPORT __dllexport__ or st. like that
[08:41:07] <raevol> i don't know macros
[08:41:42] <Edheldil> #include <...> is a macro as well
[08:42:08] <Edheldil> if you do not know those, no need to bother with function qualifiers ;-)
[08:44:08] <raevol> yea... ugh
[08:46:22] <Edheldil> it's defined in gemrb/includes/exports.h
[08:47:59] <Edheldil> the reult is that on unix, the class line expands to "class Game : public Scriptable {" , while on windows, it expands to "class __declspec(dllexport) Game : public Scriptable {"
[08:48:52] <Edheldil> __declspec() being a ?qualifier?/?attribute? just like "static", "volatile", "inline" etc
[08:50:45] <raevol> ah ok
[08:52:44] <wjp> actually it turns into a gcc ELF visibility attribute on linux too nowadays
[08:53:06] <wjp> (not that that's really relevant to the discussion, but still :-) )
[08:53:44] <raevol> hmm my git pull just told me this: error: Entry 'gemrb/GUIScripts/bg1/GUIWORLD.py' not uptodate. Cannot merge.
[08:56:11] <raevol> google says i can git stash? but what ifi don't want to stash
[08:56:17] <raevol> let's try just deleting the file :D
[08:57:10] <raevol> lul
[08:57:22] <-- |Cable| has left IRC (Remote host closed the connection)
[08:58:43] <wjp> 'git checkout filename' undoes your local changes
[08:58:43] <lynxlynxlynx> you had local changes
[08:59:00] <raevol> cool i just did git stash git pull git stash clear
[08:59:01] <lynxlynxlynx> it is wierd that pull didn't want to merge though
[08:59:19] <raevol> yea
[09:06:46] <Edheldil> wjp: really? in exports.h it's defined for 'doze only
[09:09:27] <Edheldil> raevol: https://git.wiki.kernel.org/index.php/GitFaq#.22needs_update.22_and_.22not_uptodate.22
[09:09:58] <fuzzie> Edheldil: Windows and gcc only.
[09:11:26] --> ratpor has joined #GemRb
[09:14:19] <-- raevol has left IRC (Ping timeout: 246 seconds)
[09:18:26] <-- ratpor has left IRC (Quit: Get used to disappointment.)
[09:28:19] --> edheldil_ has joined #GemRb
[09:32:26] <-- edheldil_ has left IRC (Client Quit)
[09:50:22] --- Edheldil is now known as Ed_away
[09:52:27] <wjp> Ed_away: http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=blob;f=gemrb/includes/exports.h;h=1d09d8ca161855a36b5e2befe7fe3bf3be32a88d;hb=HEAD
[09:52:49] <fuzzie> poor Edheldil :)
[09:53:47] <wjp> lynxlynxlynx: 'weird' :-)
[10:55:15] --> raevol has joined #GemRb
[10:58:53] <Ed_away> right, I was blind
[10:58:58] --- Ed_away is now known as Edheldil
[12:09:23] <CIA-43> GemRB: 03fuzzie * re93864c83bad 10gemrb/gemrb/plugins/Core/Game.cpp: deselect PCs before deleting them
[12:13:57] <fuzzie> Keep finding new segfault bugs, meh.
[12:24:40] <CIA-43> GemRB: 03fuzzie * r6f637571e056 10gemrb/gemrb/plugins/Core/Interface.cpp: fix erroring out on missing rules data, and check for not-iwd2 data
[12:26:16] <Edheldil> the less files it requires, the better
[12:27:29] <fuzzie> yes, but someone needs to actually make that work
[12:30:18] <fuzzie> (i think the other two functions there actually always return 'true' nowadays, because the files are optional)
[12:35:00] <fuzzie> if you want to make the files optional, i guess the best method would be to move the malloc() into ReadAbilityTable, make sure they're all NULL by default, and then check for NULL in the functions.
[12:39:57] <fuzzie> (feel free to revert that commit if you do have other plans)
[12:40:27] <fuzzie> I'm just trying to hunt down some bugs and random corrupt data isn't helping much.
[12:45:57] <Edheldil> no, so far creating an empty file worked just as well
[12:46:12] <CIA-43> GemRB: 03fuzzie * rdbb490b674c8 10gemrb/gemrb/plugins/Core/Interface.cpp: damage type table isn't required
[12:56:53] <fuzzie> I guess you could make almost everything optional, with a bit of work.
[12:58:16] <fuzzie> All you really *need* is a gemrb.ini, the files it references (eg, cursor sprite) and some GUIScript?
[12:59:44] <Edheldil> do you mean nonempty?
[13:02:37] <fuzzie> I mean, you shouldn't need to have any other files around.
[13:03:28] <fuzzie> Does that make sense?
[13:08:33] <Edheldil> at least dialog.tlk and chitin.key too, no?
[13:08:44] <fuzzie> I don't think you need chitin.key for anything?
[13:12:10] <fuzzie> I guess you would need the strings too, though.
[13:12:12] <Edheldil> you are right, override is enough
[13:15:56] <tomprince> Edheldil: except the components passed to PathJoin aren't necessarily single segements.
[13:16:43] <fuzzie> I will certainly take a look at it if you don't finish it now.
[13:17:15] <tomprince> I'd appreciate that.
[13:18:00] <Edheldil> tomprince: yes, I saw you break them on slash
[13:18:45] <fuzzie> Before I patched it up, gemrb was checking every individual path component every time it searched for something, which is what I'd like to avoid.
[13:19:16] <tomprince> What I have may actually work, but I don't have the patience to check everything right now.
[13:19:31] <fuzzie> A familiar feeling :)
[13:19:45] <tomprince> My idea was the the first component would be assumed to have been resolved, so that it doesn't get checked again.
[13:20:03] <tomprince> Hence the gymnastics in the refactore ResolveFilePath.
[13:21:03] <fuzzie> Unfortunately I have lectures now and then a busy evening, today. If Avenger comes by, someone should ask him how we should stop DestroyAllEquipment() etc from destroying the fist slot via DestroyItem, please. :)
[13:22:08] <tomprince> Well, I think I will leave it for now, and have a go at cleaning up the Image stuff.
[13:28:33] <tomprince> Edheldil: I had read your comment as a suggestion rather than a question. :)
[13:30:01] <tomprince> Just woke up and all...
[13:37:23] <Edheldil> which one?
[14:10:15] <-- raevol has left IRC (Quit: Leaving.)
[14:25:33] <tomprince> The first one.
[14:38:31] --> nomad__ has joined #GemRb
[16:57:00] --> |Cable| has joined #GemRb
[20:23:17] --> Edheldil_ has joined #GemRb
[20:23:46] <Edheldil_> hi
[20:24:00] <fuzzie> (hi)
[20:25:06] <Edheldil_> or hi() ? :)
[21:01:04] <tomprince_loki> Hello.
[21:11:57] <fuzzie> anyone in contact with njw? gemrb-gameinstallers is *still* removing keymap.ini.
[21:20:59] --> cfchris6_ has joined #GemRb
[21:21:58] <fuzzie> tomprince_loki: that "Make GetPalette non-virtual" commit is not very truthful.
[21:22:30] <-- cfchris6 has left IRC (Read error: Operation timed out)
[21:23:07] <tomprince_loki> I guess the message could be improved.
[21:23:30] <tomprince_loki> The PNG implementation is broken wrt the expection of ImageMgr.
[21:23:56] <fuzzie> In truth, the commit is removing all GetPalette functionality and switching to one branch of the BMPImporter version which is really more like a MakePalette.
[21:27:06] <tomprince_loki> I guess I must have been blind when I first wrote that commit, since I thought both branches of the BMPImporter were doing the same thing.
[21:31:09] <fuzzie> At a glance I thought that was okay, but no, some of the palette files are 1x1 paletted images.
[21:31:58] <fuzzie> I would suggest moving the non-palette functionality to a function like MakePalette, as the PNGImporter comment sort of suggests. I can do that, if you want.
[21:32:51] <fuzzie> That assumes they are indeed two different functions, which seems true at a glance..
[21:34:21] <fuzzie> That stupid BMPImporter code is broken anyway, pixels is not padded, so PaddedRowLength is no good. I don't understand how it works as-is. I have been avoiding fixing it because this rewrite is pending.
[21:37:40] <tomprince_loki> From the point of view of external interface, are they two different functions, or do we just need to special case the BMP case of GetPalette, because bioware is insane, and used two different formats to share the stoye the same data.
[21:38:49] <tomprince_loki> Another question, do you know if all the palettes that care about the palette in the image, rather than being a strip are 1x1?
[21:38:53] <fuzzie> Only MPALETTE.BMP and MPAL256.BMP appear to do the weird 24-bit first-column thing, and they are used only for loading those global palettes for re-colouring.
[21:39:29] <fuzzie> All the other paletted files I have looked at from Bioware are 1x1x8, but I don't think that is true for third-party content, from memory.
[21:40:53] <fuzzie> I don't see a problem with changing your ImageMgr version to be 'MakePalette' and changing the others to be GetPalette. They can always be modified to call MakePalette in the future if necessary.
[21:41:00] <tomprince_loki> I guess I was thrown off by those files, since they are the only obvious uses ...
[21:41:05] <fuzzie> But I don't have the time to actually work out if they're sane.
[21:41:23] <fuzzie> Try 'SHWATER1.BMP' for an example bg2 general palette, I think?
[21:42:57] <tomprince_loki> Well, in that case the patch is definitely broken.
[21:43:21] <fuzzie> I was also thrown off by those, hence my "At a glance I thought that was okay"!
[21:43:30] <tomprince_loki> :)
[21:43:39] <fuzzie> Just that one extra call lurking in GameData::GetPalette, doing something completely different.
[21:46:04] <tomprince_loki> Well, I was wondering if we should just treat 8bit bmp as a special case.
[21:46:54] <tomprince_loki> I thought it would even make sense to treat only 1x1 8bit bmps as a special case, but if mods down do that...
[21:48:16] <fuzzie> Well, it seems more like they're really different functionality, but I can see the temptation to do that too. I have no idea which way is right, honestly. Mass-checking the game data might be a good start.
[21:51:43] <tomprince_loki> How about for now, using the current code for 8bit PNG/BMP, and the new code for everyrthing else, with a note to go back and look at it.
[22:03:39] <fuzzie> well, that TODO in PNGImporter seems to have been simply ignored by everyone
[22:04:53] <fuzzie> this is why i was thinking of a MakePalette (when constructing one from pixels) / GetPalette (actually retrieving a palette) split: you could put appropriate printf()s in both locations and see if anyone complains. :) But as I said, I honestly don't know, and you are coding it.
[22:06:44] <tomprince_loki> Something like this?
[22:06:56] <tomprince_loki> With printfs, yes.
[22:13:49] <tomprince_loki> Like so.
[22:14:19] <fuzzie> does that work?
[22:14:32] <fuzzie> seems like you just spam the console for every case
[22:15:51] <tomprince_loki> Well I haven't tested it yet.
[22:16:00] <tomprince_loki> I'll test it after I am back from supper.
[22:16:03] * tomprince_loki goes to eat.
[22:16:21] <fuzzie> I mean, that is useful to test with; but it doesn't provide any clear "we understand this case" vs "we don't understand this case".
[22:17:52] <fuzzie> Was thinking if you split them in a way which identifies the callers, you could commit it that way.
[22:18:57] <fuzzie> Plus you wouldn't have to ignore the index parameter for the common case..
[22:19:18] <fuzzie> Maybe it'll be clearer to me tomorrow, anyway, ninight!
[22:23:41] <lynxlynxlynx> nite
[22:39:07] <tomprince_loki> Hmmm....
[22:40:04] <tomprince_loki> There are exaclty 4 callers of ImageMgr::GetPalette. (5 if you count the one in GUIScript, but that is completely unrelated and fixed by the PLT patch)
[22:40:36] <tomprince_loki> Three in Interface.cpp, and one in GameData.cpp (checked by commenting out the function)
[22:42:45] <-- lynxlynxlynx has left IRC (Remote host closed the connection)
[22:44:01] <fuzzie> Rushing back by a moment, since people seem determined not to let me sleep: The Interface ones all seem to use 24-bit, and the GameData one seems to want the actual palette. Do what you think is best, anyway. Really night now!
[22:50:27] <tomprince_loki> :)
[22:50:47] <tomprince_loki> I just figured I would leave it for you in the morning. :)
[22:50:51] <tomprince_loki> Night.
[23:22:29] <-- Gekz has left IRC (Read error: Connection reset by peer)
[23:22:33] --> Gekz_ has joined #GemRb
[23:26:33] <Edheldil_> night
[23:26:37] <-- Edheldil_ has left IRC (Quit: Really?)
[23:59:57] --> raevol has joined #GemRb