#gemrb@irc.freenode.net logs for 5 Oct 2011 (GMT)

Archive Today Yesterday Tomorrow
GemRB homepage


[00:03:52] <brad_a> i wish c++ had supported variable-length template arguments before c++0x
[00:05:13] <tomprince> I agree whole heartedly.
[00:12:47] <tomprince> brad_a: Are you planning on adding something that uses SetSize?
[00:13:33] <brad_a> interface sets both style and size.
[00:14:06] <tomprince> Or is that just so you pass initialization data to the TTF plugin?
[00:14:23] <tomprince> i.e., is it only at load time that that is ever going to be called?
[00:14:47] <brad_a> yes, and i would have preferred a constructor to do what initialize is doing
[00:17:04] <brad_a> i have some ideas to make this better
[00:18:12] <brad_a> but i dont want to add a fontresourse class into the mix. id rather just make init public and once its sprite is created not let initialize happen again.
[00:18:36] <brad_a> unless you have a better idea that isnt going to make me redo a bunch of stuff :)
[00:20:31] <tomprince> Any particular reason you don't want a font resource class?
[00:22:20] <tomprince> It seems the natural way to do things: open the resource, set size/style, get the font.
[00:23:00] <tomprince> Also, I am curious why you didn't like having a BAMImporter member?
[00:23:01] <brad_a> ok i see your point.
[00:23:24] <brad_a> well if i do a fontresourse class then my resons are moot i guess
[00:25:22] <tomprince> One of the things you can do is have a wider interface in BAMImporter, than is exposed to the core, or even just make things public inside the plugin.
[00:26:06] <tomprince> Which isn't a huge break in the abstraction, since it isn't unreasonable for parts of the smae plugin to be tightly coupled.
[00:26:13] <brad_a> how can i have a wider interface than the core has? I thought of making it a friend class to BAMFont
[00:28:40] <tomprince> Well, the only thing that gets exposed to core is what is in the base clase, so even if you make everything public in BAMImporter, that doesn't change the interface the core sees
[00:29:02] <brad_a> the way i see it i can just get rid of the animationManager::getfont business too
[00:30:56] <tomprince> Yep, once you are loading via FontMgr or whatever, that can go.
[00:31:29] <brad_a> ok I think im ready for round 2 now
[00:31:53] <brad_a> thanks for the input
[00:31:56] <tomprince> So, I think you probably don't need to touch Font at all.
[00:32:28] <brad_a> how so? i still need to subclass it
[00:33:18] <brad_a> or i guess fontmanager would be a friend of font so it could set its private members?
[00:34:13] <tomprince> Actually, my thought was just changing the constructor to take all the relevant bits.
[00:34:45] <brad_a> well yeah but the constructor woult then do what initialize is doing which is very diffrent for ttf vs bam
[00:36:39] <tomprince> Isn't the output of both versions of initialize a sprite, and some bookkeeping data?
[00:37:28] <brad_a> yes a sprite and the size array mostly
[00:37:55] <tomprince> Then, the end of Initialise, which would now be FontMgr::GetFont, would just call Font::Font with that data.
[00:40:43] <brad_a> so font manager is waht has the subclassing?
[00:40:49] <tomprince> Yes.
[00:40:55] <brad_a> oh ok
[00:41:07] <brad_a> but i still ould need to change font
[00:41:21] <tomprince> Since the only difference between the two font types is how you get the sprite.
[00:41:57] <tomprince> Yes, but just the constructor and removing init helpers
[00:42:06] <brad_a> yes
[00:42:54] <tomprince> Also, I'd be inclined to just create the Sprite2D directly in SDLTTF, rather than calling CreateSprite and mucking with the vptr (with a big FIXME on it).
[00:45:50] <tomprince> I think I would organize like:
[00:46:38] <tomprince> 1) move AddChar/FinalseSprite to BAMImporter and change the constructor of Font.
[00:47:48] <tomprince> 2) Add FontMgr/BAMFont (which just calls BAMImporter::GetFont, and change Interface to use that.
[00:49:14] <tomprince> 3) Add SetStyle/SetSize (no need for the gets, probably)
[00:49:34] <tomprince> 4) Add SDLTTF plugin
[00:50:20] <tomprince> 5) Add the fontsource
[00:50:32] <tomprince> perhaps swapping 4/5
[00:54:57] <brad_a> how would creating the sprite2D directly be any better/different than what im doing?
[00:55:27] <brad_a> the real fix there is probably in SDLVideo
[00:55:46] <brad_a> but i dont personally think its a big deal
[00:56:06] <tomprince> Well, it avoids creating a surface, just to destroy it.
[00:56:42] <brad_a> yeah but its not like its a huge performance hit and pixels is null so there is virtually no memory ussage and what little there is gets freed right after
[00:56:52] <brad_a> its a 1 time thing per font
[00:57:04] <tomprince> The problem is we don't have any way for one plugin to call in to the internals of another.
[01:00:27] <brad_a> Id put the fix me in there even if e created the sprite there since thats not how it should be done. i should be able to get a valid sprite from the video driver the way i see it.
[01:01:16] <brad_a> it the video driver crosses me one more time then i will go into the SDLVideo code and try to actually figure out what its doing wrong.
[01:02:27] <tomprince> I don't have a concrete reason, it just feels inelegant to create an extra surface, and then destroy it
[01:03:28] <brad_a> if you think about it like that i guess. i think of it as a clever hack ;-)
[01:03:39] <brad_a> makes me feel better about it
[01:10:47] <brad_a> tomprince: can i put FontManager in the same file as font or no?
[01:11:17] <brad_a> separate files for every class?
[01:15:09] <tomprince> Separte files for those, I think.
[01:15:37] <tomprince> Part of the reason is that FontManger pulls in FS/Plugin code, which most users of Font won't need.
[01:17:26] <tomprince> Also, that is the style of all the other pairs.
[01:17:55] <tomprince> It might make sense to merge some things, at some point, but there is reasonable resitance to mving code around to much.
[01:26:32] <brad_a> can you help me with the cmake bit when im done?
[01:28:46] <tomprince> Should be able to do that.
[01:29:26] <brad_a> ah now i feel better about having to redo this :-P
[01:37:56] <tomprince> Does the new design make sense? I'm not deliberately trying to make more work for you.
[01:38:55] <brad_a> i know. it will be better and thats whats important.
[01:39:06] <brad_a> im not a c++ programmer after all
[03:36:27] <-- brad_a has left IRC (Quit: brad_a)
[06:08:09] --> pugvader has joined #gemrb
[06:59:26] --> lynxlynxlynx has joined #gemrb
[06:59:26] <-- lynxlynxlynx has left IRC (Changing host)
[06:59:26] --> lynxlynxlynx has joined #gemrb
[06:59:26] --- ChanServ gives channel operator status to lynxlynxlynx
[07:14:26] --> edheldil_ has joined #gemrb
[07:21:48] <-- edheldil_ has left IRC (Ping timeout: 240 seconds)
[07:57:27] <edheldil> One day, we will have to tackle RTL text as well :)
[08:00:40] <pugvader> ?
[08:01:42] <lynxlynxlynx> tfel-ot-thgir
[08:02:26] <edheldil> sounds like welsh :)
[08:25:44] --> lubos has joined #gemrb
[08:32:15] <-- lynxlynxlynx has left IRC (Ping timeout: 248 seconds)
[08:49:27] --> lynxlynxlynx has joined #gemrb
[08:49:28] <-- lynxlynxlynx has left IRC (Changing host)
[08:49:28] --> lynxlynxlynx has joined #gemrb
[08:49:28] --- ChanServ gives channel operator status to lynxlynxlynx
[09:18:28] <-- Beh0lder has left #gemrb
[09:41:48] <-- edheldil has left IRC (Ping timeout: 240 seconds)
[09:42:29] --> edheldil has joined #gemrb
[09:42:29] --- ChanServ gives channel operator status to edheldil
[09:59:48] <-- edheldil has left IRC (Ping timeout: 240 seconds)
[10:00:15] --> edheldil has joined #gemrb
[10:00:16] --- ChanServ gives channel operator status to edheldil
[11:20:03] <pugvader> go away, internet!
[11:39:05] --> Beh0lder has joined #gemrb
[12:30:01] <-- Beh0lder has left IRC (Quit: Beh0lder)
[13:20:12] <-- lynxlynxlynx has left IRC (Ping timeout: 240 seconds)
[13:24:01] --> lynxlynxlynx has joined #gemrb
[13:24:02] <-- lynxlynxlynx has left IRC (Changing host)
[13:24:02] --> lynxlynxlynx has joined #gemrb
[13:24:02] --- ChanServ gives channel operator status to lynxlynxlynx
[13:47:16] <CIA-26> GemRB: 03tom.prince * r01259184f73b 10gemrb/gemrb/ (3 files in 2 dirs): Sprite2D: Factor common initialization into constructor.
[13:48:19] <tomprince> brad_a: ^---- that should make it much clearer to just create the sprite directly in SDLTTF.
[14:00:36] <-- lynxlynxlynx has left IRC (Ping timeout: 240 seconds)
[14:11:51] --> lynxlynxlynx has joined #gemrb
[14:11:51] <-- lynxlynxlynx has left IRC (Changing host)
[14:11:51] --> lynxlynxlynx has joined #gemrb
[14:11:51] --- ChanServ gives channel operator status to lynxlynxlynx
[14:41:15] --> brad_a has joined #gemrb
[15:11:26] <-- brad_a has left IRC (Quit: brad_a)
[15:32:55] <-- lubos has left IRC (Quit: Leaving.)
[15:41:47] --> brad_a has joined #gemrb
[16:28:26] --> Yoshimo has joined #gemrb
[17:40:30] --> pugvader_ has joined #gemrb
[17:43:53] <-- pugvader has left IRC (Ping timeout: 258 seconds)
[18:50:56] --> edheldil_ has joined #gemrb
[20:23:04] --> demitar has joined #gemrb
[20:24:08] <-- brad_a has left IRC (Ping timeout: 245 seconds)
[20:27:15] <-- edheldil_ has left IRC (Ping timeout: 255 seconds)
[20:54:26] <-- Yoshimo has left IRC (Quit: Yoshimo)
[22:01:27] <-- lynxlynxlynx has left IRC (Remote host closed the connection)
[22:09:57] --> Stefan80 has joined #gemrb
[22:10:17] <-- Kiranos has left IRC (Ping timeout: 244 seconds)
[22:34:57] --- pugvader_ is now known as pugVader
[22:35:56] --> edheldil_ has joined #gemrb
[22:42:08] --> brad_a has joined #gemrb
[22:50:18] <-- brad_a has left IRC (Ping timeout: 256 seconds)