#gemrb@irc.freenode.net logs for 25 Sep 2011 (GMT)

Archive Today Yesterday Tomorrow
GemRB homepage

[00:06:03] <brad_a> ah. wonderful.
[00:18:35] <-- brad_a has left IRC (Quit: brad_a)
[00:20:18] --> barra_away has joined #gemrb
[00:23:43] <-- barra_home has left IRC (Ping timeout: 248 seconds)
[00:41:10] <tomprince> If you have any questions about plugins, ping me, as I am responsible for the current iteration of the design.
[01:48:53] --> joneirik has joined #gemrb
[01:59:25] <-- jschall has left IRC (Read error: Connection reset by peer)
[02:58:56] <-- barra_away has left IRC (Quit: Verlassend)
[03:10:43] <-- joneirik has left IRC (Remote host closed the connection)
[08:07:11] --> test32894789234u has joined #gemrb
[08:34:26] --> Maighstir has joined #gemrb
[08:36:36] --> Yoshimo has joined #gemrb
[11:47:09] --> barra_home has joined #gemrb
[11:49:48] --> PixelScum has joined #gemrb
[11:52:16] <-- Drakkar has left IRC (Ping timeout: 248 seconds)
[12:20:10] --- pupnik is now known as pup_afk
[13:06:43] <xrogaan> err
[13:06:50] <xrogaan> months since I last pull
[13:33:12] <xrogaan> So, I've got this error again : WARNING: Invalid dualclass combination, treating as a single class!
[13:33:15] <xrogaan> 8 2 0 32 [1, 32]
[13:33:52] <xrogaan> I have a 'custom' character made by the community
[13:36:00] <xrogaan> this one : http://www.shsforums.net/topic/17141-ariena-version-22-released/
[13:39:09] <xrogaan> I belive the author made something weird and gemrb doesn't recognize it.
[13:39:18] <xrogaan> That was fixed in a previous release
[13:43:59] <xrogaan> and the game doesn't pause while i'm in the inventory
[15:03:19] <-- test32894789234u has left #gemrb
[15:17:10] <-- pup_afk has left IRC (Ping timeout: 276 seconds)
[15:18:43] --> pup_afk has joined #gemrb
[15:41:14] --> kettuz has joined #gemrb
[15:59:21] <-- |Cable| has left IRC (Remote host closed the connection)
[16:01:09] --> |Cable| has joined #gemrb
[16:12:35] <-- |Cable| has left IRC (Remote host closed the connection)
[16:13:58] --> |Cable| has joined #gemrb
[17:17:14] --> brad_a has joined #gemrb
[18:41:09] <brad_a> tomprince: i see that i can register a plugin associated to a file type with RegisterResource, but i'm unable to see a way to ask the plugin manager to give me a plugin based on a type. is that possible? i see that i can use register driver if i want, but im wondering what the prescribed method would be.
[18:42:30] <brad_a> also yesterday you mentioned using plugin_resourse instead of lugin_ie_resourse, but no such thing exists.
[18:48:34] <tomprince> plugin_resource certainly exits, see includes/plugindefs.h
[18:49:14] <brad_a> hmmm. i must have misspelled it when i searched earlier
[18:49:27] <tomprince> There are three types of things plugins can provide.
[18:52:46] <tomprince> PLUGIN_CLASS, which is where you need/want a specfic subclass of a given interface. This is most usefull for things like writers. Or where one filetype contains a instance of a specific other file type.
[18:54:09] <tomprince> PLUGIN_DRIVER, where you want to access an instance by string, for things that are chosen based on the config file.
[18:56:32] <tomprince> and what you probably want PLUGIN_RESOURCE, which is for things that can be provided in more than one different file format, particuarly where the code that uses it doesn't care about what the actuall format is. This is for things like sound and graphics.
[18:57:42] <brad_a> yeah but i want to be able to supply in the config what font format to use so i need a way of getting the right font subclas by a given string, and driver method is the only way i can see to do that.
[18:59:08] <tomprince> Are you planning to use the native font system to get the font, or are you planning to specify a file?
[19:02:10] <brad_a> int interface.cpp where the core loads the fonts i am using the supplied config value to open a 2da table for the given value
[19:03:14] <brad_a> so if bam is supplied in the config it opens fontsbam.2da and i ask the plugin manager for the bam plugin (hich houses the bamfont subclass) and i construct the fonts and push them back
[19:04:06] <brad_a> the problem is that i need to be aple to ask the plugin manager to give me the plugin dynamically instead of my test case of hardcoding it to give me the bam plugin
[19:05:37] <tomprince> Well, the current code just uses bams. Are you planning to extend it to other formats? You were talking ttf the other day. Do you plan in that case to open the ttf directly from the filesystem?
[19:06:00] <brad_a> yes ttf_sdl expects a path to the ttf
[19:06:07] <brad_a> which i have in the 2da
[19:06:36] <brad_a> everything is working great except my inabillity to ask the plugin manager to give me a plugin to handle a file format
[19:07:08] <tomprince> Well, the design behind PLUGIN_RESOURCE should is that the core should care what format the resource is on disc.
[19:07:42] <tomprince> So you would say, I need a font with a given name, and then it goes and finds some resource plugin that has such a resource.
[19:08:44] <brad_a> im not sure i follow
[19:08:55] <brad_a> is there an example somewhere?
[19:10:20] <tomprince> Well, you can go and compress all the wav files as ogg, and gemrb well still open them just fine, entirely transparently.
[19:11:26] <tomprince> The idea is that you *don't* specify what file format you want.
[19:12:37] <tomprince> You just specify that you want a font, and if there are bamfont and ttf plugins, then it just goes and looks through the search path for a ttf or bam matching that name and use thee right plugin to open the first it finds.
[19:14:18] <brad_a> im not sure thats the most desirable in this scenario. id like the ability to switch between the 2 with just a config option.
[19:14:40] <brad_a> it sounds like using plugin_driver would give me the result im loking for
[19:15:26] <tomprince> Yes, perhaps. The other question is, are the files going to have the same names (ignoring the extensions)?
[19:16:09] <brad_a> not the way i currently have it.
[19:16:30] <brad_a> i figure the fonts are going to have to be user supplied in most cases
[19:16:31] <Maighstir> they very well may, if there's a normal.bam for ansi characters, then normal.ttf for asian
[19:16:45] <brad_a> but i guess they could copy and rename etc
[19:16:57] <tomprince> Also, the plugin code has grown as needed, to support the different bits of variablity that have actually been used. So if you ended up needing differnt functionality, it can always be added.
[19:17:37] <brad_a> well for now ill use plugin_driver. i see no reason that wont wokr
[19:17:50] <tomprince> My thought was that if the bam and ttf have different names, then you can still switch based on config, just by switching name looked for.
[19:18:15] <brad_a> oh i see
[19:18:15] <tomprince> If you have normal.bam and fancy_font.ttf ...
[19:18:49] <tomprince> Get<Font>("normal") and Get<Font>("fancy_font") will both do the right thing.
[19:19:03] <brad_a> makes sense
[19:20:16] <brad_a> so pluginMgr->Get<Font>("whatever") is waht i want?
[19:20:20] <tomprince> There currently isn't any way to prefer one plugin over another (if there is both normal.bam and normal.ttf), but that could also be added.
[19:21:01] <brad_a> const char* strFontTable = strcat(FontType, "fonts");
[19:21:02] <brad_a> AutoTable tab(strFontTable);
[19:21:37] <brad_a> that will give me bamfonts.2da if bam is the fonttype in the config
[19:21:54] <tomprince> Probably ResourceHolder<FontClass> font("name");
[19:23:02] <brad_a> ok
[19:23:18] <brad_a> so that should work and still give me the ability to tell what font type i want
[19:23:32] <brad_a> i just need to register with plugin_resourse for that then?
[19:23:38] <tomprince> Yep.
[19:23:51] <brad_a> most excelent. you have been very helpful
[19:24:14] <tomprince> But I would suggest not naming your 2das after the file format of the fonts, but something describing the fonts themseleves.
[19:24:22] <brad_a> how do you mean?
[19:24:33] <brad_a> i was thinking fontsbam.2da and fontsttf.2da
[19:25:04] <tomprince> bonus points: write up this discussion so that the next person can just read the docs.
[19:25:05] <fuzzie> i think this whole thing may not work as discussed here
[19:25:16] <fuzzie> because font names are hard-coded?
[19:25:48] <fuzzie> or does everything really get directed via Interface?
[19:26:08] <tomprince> I think this is about un-hard-codin them.
[19:26:31] <fuzzie> i mean, hardcoded in the UI files
[19:26:40] <brad_a> oh in the python scripts?
[19:26:52] --> yyz_ has joined #gemrb
[19:27:11] <brad_a> dont they just ask for "ButtonFont" or such
[19:27:15] <fuzzie> i guess it all goes via Interface::GetFont()
[19:27:23] <brad_a> yes
[19:28:23] <fuzzie> so you're just going to have a mapping?
[19:28:25] <tomprince> I was thinking something like original_fonts.2da and font_family_name_fonts.2da
[19:29:15] <brad_a> well i have more than 1 font family in my 2da ;-)
[19:29:33] <brad_a> i was going to use diffrent fonts for diffrent things
[19:30:33] <brad_a> fuzzie: i may not usnderstand how fonts are asked for.
[19:30:38] <tomprince> brad_a_fonts? :)
[19:30:44] <brad_a> i guess by resref
[19:31:06] <fuzzie> brad_a: yes, for game data, always resref, like GetFont("NORMAL")
[19:31:50] <brad_a> i see a bunch of GetFont( ButtonFont ) etc so it seems like i should be able to set ButtonFont at font load time
[19:32:08] <fuzzie> yes
[19:32:30] <fuzzie> but that is only a subset of users
[19:32:46] --> jschall has joined #gemrb
[19:33:12] <fuzzie> it looks like only text fields have fonts specified in the CHU though
[19:34:31] <fuzzie> but the GUIScripts do indeed override it by calling Button.SetFont in various places
[19:34:51] <brad_a> well i may just have to combat that as it comes up
[19:34:57] <fuzzie> sure
[19:35:14] <fuzzie> i don't think it will be a big obsctacle, since it seems everything goes via the 2da list :)
[19:57:04] <brad_a> does this work in c++ or not:
[19:57:08] <brad_a> BAMFont(const char* resourceName, unsigned short /*ptSize*/)
[19:57:08] <brad_a> {
[19:57:08] <brad_a> /*
[19:57:09] <brad_a> You cannot change the size of a BAM. ptSize is unused.
[19:57:09] <brad_a> */
[19:57:10] <brad_a> DataStream* stream = NULL;
[19:57:10] <brad_a> Font* font = NULL;
[19:57:11] <brad_a> stream = gamedata->GetResource( resourceName, IE_BAM_CLASS_ID );
[19:57:11] <brad_a>
[19:57:11] <brad_a> BAMImporter bamimp();
[19:57:12] <brad_a> BAMFont* oldMe = this;
[19:57:12] <brad_a>
[19:57:12] <brad_a> if( bamimp.Open(stream) )
[19:57:13] <brad_a> {
[19:57:13] <brad_a> this = bamimp.GetFont();
[19:57:13] <brad_a> }
[19:57:26] <brad_a> bah
[19:57:35] <brad_a> that was ugly and unintended
[19:57:49] <brad_a> i guess you cant send multi-line messages in irc...
[20:03:15] <Yoshimo> looks ok for me, just prefixed with time and your name
[20:05:06] <brad_a> basically i want to know if it is valid in c++ to delete the object in a constructor and reassign this to another instance
[20:06:13] <fuzzie> nope.
[20:07:48] <brad_a> bah
[20:08:30] <brad_a> i miss objective-c now...
[20:09:45] <tomprince> IF you need to do something like that, you don't do it in the constructor.
[20:10:42] <brad_a> oh how do you do that in c++?
[20:12:01] <tomprince> You do it in a free or static member function, that returns a new object of a given type.
[20:27:42] --> lynxlynxlynx has joined #gemrb
[20:27:42] <-- lynxlynxlynx has left IRC (Changing host)
[20:27:42] --> lynxlynxlynx has joined #gemrb
[20:27:42] --- ChanServ gives channel operator status to lynxlynxlynx
[21:03:15] <-- lynxlynxlynx has left IRC (Remote host closed the connection)
[21:23:48] <-- Yoshimo has left IRC (Quit: Yoshimo)
[21:49:23] <-- kettuz has left IRC (Quit: Leaving)
[21:57:28] <pup_afk> schluppatubbpta
[22:07:10] --- pup_afk is now known as pupnik
[22:18:04] <-- yyz_ has left IRC (Read error: Connection reset by peer)
[22:18:55] --> yyz_ has joined #gemrb