#gemrb@irc.freenode.net logs for 19 Nov 2010 (GMT)

Archive Today Yesterday Tomorrow
GemRB homepage


[00:30:56] <-- edheldil_ has left IRC (Ping timeout: 240 seconds)
[01:11:20] --- barraAway is now known as barra_home
[01:41:04] <-- Bo_Thomsen has left IRC (Quit: Leaving.)
[01:41:49] <-- Maighstir has left IRC (Quit: ~ Trillian Astra - www.trillian.im ~)
[03:55:00] <-- barra_home has left IRC (Quit: Verlassend)
[07:55:36] --> lubos has joined #GemRb
[08:03:51] --> lynxlynxlynx has joined #GemRb
[08:03:52] --- ChanServ gives channel operator status to lynxlynxlynx
[08:38:03] <edheldil> Hi all
[08:38:14] <edheldil> wjp, are you here?
[08:54:15] --> pupnik_ has joined #GemRb
[08:57:10] <-- pupnik has left IRC (Ping timeout: 245 seconds)
[09:03:15] <wjp> edheldil: hi
[09:05:24] --> SiENcE has joined #GemRb
[09:09:15] <-- |Cable| has left IRC (Remote host closed the connection)
[09:11:40] <edheldil> wjp, is there any reason to keep distinction between BAM and non BAM sprites? i.e. sprite->BAM
[09:12:48] <fuzzie> we don't have any code for doing special blits on non-BAM sprites
[09:13:54] <edheldil> but we need it :). And if they were the same, it would be just another branch
[09:14:12] <fuzzie> right, but someone would have to write it :)
[09:14:34] <wjp> and the RLE encoding in the BAM format makes things more efficient in theory
[09:14:49] <wjp> (haven't actually done any recent profiling though)
[09:15:10] <edheldil> but not all spr->BAM sprites have rle, do they?
[09:15:21] <wjp> true
[09:15:41] <wjp> you want to use the non-RLE BAM code for non-BAM sprites?
[09:16:01] <fuzzie> well, the important bit about the 'BAM' flag is just 'this is 8bpp data', i think
[09:16:28] <edheldil> then why not kill the !spr->BAM special case and let all sprites have the same structure, differing by blend/blit algo only?
[09:16:30] <wjp> hm, I need to look up what I already changed about this last time
[09:16:52] <fuzzie> you could convert Sprite2D_BAM_Internal to an 8bpp-specific Sprite2D_8bpp_Internal
[09:16:58] <wjp> the BAM sprite's data is part of the BAM plugin too
[09:17:00] <fuzzie> but i'm not sure how that would help, in reality :)
[09:17:04] <edheldil> I want to use blending for rendering fonts
[09:17:22] <fuzzie> the font data comes from BAMs anyway, i thought
[09:17:43] <edheldil> yes, BAM->GetFont()
[09:18:26] <fuzzie> so, what you want is just not requiring there actually be a BAM? which sounds like it should be easy
[09:18:58] <wjp> the blending code currently accepts BAM sprites and 32bpp non-BAM sprites
[09:19:15] <wjp> where by 'blending code' I mean BlitGameSprite
[09:19:24] <fuzzie> you could just hack CreateSpriteBAM8 to handle a NULL datasrc?
[09:19:52] <wjp> what kind of blending do you want to do with fonts?
[09:20:09] <wjp> and could it maybe be handled by just changing the palette?
[09:20:35] <edheldil> fuzzie: that was the approach I started to look into last. Or better provide dummy AnimationFactory
[09:20:45] <edheldil> wjp: nope
[09:21:20] <edheldil> or rather, the Blit function would have to take alpha from palette
[09:21:23] <fuzzie> i think edheldil is trying to fix our font rendering; i had no luck with trying to fiddle with the palette the other day, but i didn't look at *why*, it should surely be possible by tweaking the alpha
[09:21:34] <fuzzie> oh, ed is ahead of me :)
[09:21:48] <fuzzie> you want this PALETTE_ALPHA then?
[09:22:07] <edheldil> wjp: http://www.eowyn.cz/gemrb/aa.png <- it's clear it needs blending
[09:22:29] <wjp> hm, right
[09:22:37] <fuzzie> Ah, only BlitGameSprite does PALETTE_ALPHA for non-BAMs.
[09:22:50] <fuzzie> But then it wants 24bpp images anyway.
[09:22:57] <wjp> BlitSprite does too
[09:23:02] <wjp> or it should, anyway
[09:23:10] <edheldil> not only, because right now we do some ugly things with the palette, I think
[09:23:25] <fuzzie> BlitSprite just calls SDL_BlitSurface
[09:23:31] <edheldil> I look at BlitSpriteRegion
[09:24:14] <fuzzie> and i guess we don't set SDL_SRCALPHA anywhere
[09:24:30] <wjp> ah, SDL's palettes don't have alpha values, right
[09:24:32] <wjp> ugh
[09:25:10] <edheldil> actually, the alpha is encoded in the pixel data
[09:26:30] <wjp> it is?
[09:27:39] <edheldil> well, I have not studied other fonts, so I can't be sure. But at LEAST in FONTDLG in ps:t the palette offset sould more or less work as alpha
[09:27:54] <edheldil> offset-> index, i.e. the 8 bit color
[09:28:00] <fuzzie> if the original engine really recolours this stuff, that would make sense
[09:28:39] <wjp> ah, you mean it's _only_ an alpha channel?
[09:28:47] <edheldil> yep
[09:29:40] <edheldil> I will check ...
[09:31:08] <wjp> it might be easiest to just turn it into a 32bpp sprite
[09:31:12] <edheldil> hmmm, actually it maybe uses 1st byte of palette as alpha.. at least color 1 is 0xffffff00
[09:31:36] <edheldil> but that would prevent color mapping, would not it
[09:31:56] <wjp> right, not awake yet
[09:31:57] <fuzzie> our palette creation also sets alpha, i thought
[09:32:18] <fuzzie> yes, it does
[09:32:42] <wjp> stupid question: why does GetFont work the way it does?
[09:32:54] <wjp> (i.e., why the new sprite?)
[09:33:21] <fuzzie> problems with palettes?
[09:33:54] <fuzzie> hm, no, Sprite2D_BAM_Internal has an internal palette
[09:33:59] <fuzzie> it does seem really weird :)
[09:34:23] <edheldil> I was thinking about it ... perhaps to keep the fonts in one surface to facilitate cache affinity or perhaps for uploading textures? I know it's a common technique
[09:34:59] <edheldil> but it looks to me a bit like cargo cult programming :)
[09:35:39] <wjp> hm, does a BAM file contain a single font, or multiple?
[09:36:00] <wjp> I guess a single, judging by GetFont's lack of parameters
[09:36:24] <wjp> so the bitmap data will be stored in a single memory block already anyway
[09:36:42] <wjp> (but admittedly that wasn't the case when GetFont was written ages ago)
[09:37:56] <edheldil> so we could get rid of Font::AddChar() ?
[09:38:30] <edheldil> or at least of the bitmap flattening?
[09:38:50] <wjp> maybe we can get rid of BlitSpriteRegion too then :-)
[09:39:24] <wjp> but I haven't really thought this approach through yet, and I'm not particularly awake right now...
[09:40:02] <fuzzie> well, i am also not awake, but not being known to think things through, it sounds good to me :)
[09:41:21] <wjp> it will mean the creation of a bunch of extra Sprite2D objects per font, but I doubt that'll be that significant
[09:41:38] <fuzzie> well
[09:41:51] <fuzzie> it is bad for opengl land, where i want things to be textures
[09:41:57] <wjp> yes
[09:42:21] <fuzzie> but i thought that is best dealt with by just adding some flag to store whole BAMs as one texture, which an opengl backend can deal with itself
[09:42:29] <wjp> sounds sensible
[09:43:07] * fuzzie offers a big pot of coffee
[09:43:49] * wjp has one of those too :-)
[09:43:52] <fuzzie> although i don't suppose you're near enough for that to be convenient :)
[09:43:55] <fuzzie> oh, well, ideal :-)
[09:44:13] <wjp> it just doesn't seem to be working...
[09:44:13] <fuzzie> i have an integation exam in a couple of hours, very exciting
[09:44:35] <wjp> good luck
[09:44:55] <wjp> oh, the mathematical type or the nationality type? :-)
[09:45:03] <fuzzie> nationality type, alas :)
[09:45:55] <edheldil> I thought that after loading a bam, we could call Flatten() which would try to fit the sprites to 255x255 texture or multitude of them and init sprite's array of { rect, surface } structs
[09:46:38] <fuzzie> edheldil: i think for when it matters, they are going to have to be copied into a texture anyway, so it is not so important to do it outside the video driver
[09:46:46] <wjp> I'd worry about that when the design of an opengl backend is clearer
[09:46:49] <fuzzie> but i would also worry about making it work now :)
[09:47:06] <fuzzie> "Make it work, then make it right, then make it fast"
[09:47:19] <wjp> yup :-)
[09:47:37] <wjp> one thing to consider (although it might Just Work(tm)) is refcounting / bam memory management
[09:47:54] <fuzzie> i was worried about that, but it seems like it should just work
[09:48:29] <wjp> yes, it should
[09:49:15] <fuzzie> ok, famous last words :)
[09:49:31] <wjp> quite :-)
[09:49:38] <fuzzie> but i think everyone would much-appreciate the fonts being fixed
[09:49:51] <edheldil> fuzzie: st. like Strite2D::GetFrameRect(int cycle, int seq, Rect& r, void* surface) ? :)
[09:50:23] <fuzzie> i was thinking you could handle it before the Sprite2D stage
[09:50:29] <edheldil> void** of course
[09:50:40] <wjp> let's try to avoid void*'s :-)
[09:50:42] <fuzzie> just have a flag when you create the sprite
[09:51:56] <edheldil> I mean: if the sprite's are loaded into a big texture or sdl_surface, you will then need a rect and the surface to blit them or use them
[09:51:58] <fuzzie> but, really, not something worth worrying about yet :)
[09:52:03] <edheldil> sure
[09:52:25] <wjp> maybe an opengl-specific 'subsprite' or something, but it'll likely be clearer if there's a first basic opengl framework in place already :-)
[09:52:28] <fuzzie> well, i thought we could just hide that all as an implementation detail
[09:52:59] <fuzzie> but, yes
[09:53:07] <wjp> it would be good if the font code wouldn't have to do anything other than mark the BAM as 'contains lots of small sprites'
[09:53:09] <edheldil> since we have software blitter, we can't, do we?
[09:53:12] <fuzzie> i had a play with it, but got distracted
[09:53:31] <edheldil> s/blitter/blender/
[09:54:03] <fuzzie> edheldil: the theory being that you should be able to do all the blending with opengl instead, in an opengl driver :) and there's no need for flattening with a software blitter
[09:54:16] <fuzzie> well, i have no idea if there is, but i hope not.
[09:54:45] <edheldil> BlitSpriteRegion does exactly that, does not it? :)
[09:55:06] <fuzzie> yes, but if we agree it is unnecessary :)
[09:55:13] <fuzzie> it is only called for this Font code
[09:56:02] <edheldil> ??? there's real pixel mungling if spr->BAM
[09:56:25] <fuzzie> ok, now i am confused :)
[09:56:37] <edheldil> moi aussi :)
[09:56:44] <wjp> edheldil: I'm not sure what you're talking about
[09:57:04] <edheldil> ok
[09:57:23] <wjp> I think the current proposal is: make a Font basically wrap an AnimationFactory, and use BlitSprite or BlitGameSprite to blit the font characters directly
[09:58:18] <wjp> when opengl becomes relevant, add a flag to AnimationFactory and/or BAMImporter and/or Sprite2D to turn a BAM into a single large texture entirely behind the scenes without affecting the rest of the videodriver interface
[10:01:29] <edheldil> I thought that: regardless of the rendering path, we will need for each sprite know it's surface/texture and its rectangle in it. If we do not "flatten" the BAM (because we have only SDL which does not presumably care), the surface ptrs will be different for each frame and the rectangles will be all 0:0-based, but we could still handle it with the generic code for the cost of +- 20 bytes per frame
[10:02:21] <wjp> I was thinking we don't want to flatten the BAM in the software renderer at all
[10:02:43] <wjp> so we can just use the regular Blit(Game)Sprite functions
[10:02:45] <fuzzie> so handling it with the generic code sounds fine
[10:02:52] <edheldil> ok
[10:03:10] <edheldil> I have to leave for an English lesson
[10:03:19] <fuzzie> see you :)
[10:03:37] <wjp> have fun
[10:03:57] <edheldil> wrapping AnimFactory means making it spr->BAM ?
[10:04:06] <wjp> yes
[10:04:43] <fuzzie> i.e. just store the BAM and pull sprites out of it
[10:05:10] <edheldil> sounds ok to me
[10:05:34] * wjp will not be sad to see BlitSpriteRegion go :-)
[10:06:02] <CIA-28> GemRB: 03fuzzie * r5b1050f61d63 10gemrb/gemrb/core/ (Map.cpp Scriptable/Actor.cpp Scriptable/Actor.h): split out animation/misc updates in Actor
[10:06:13] <edheldil> later ...
[10:06:30] <fuzzie> that should fix off-screen combat, i hope
[10:06:57] <fuzzie> although i can't remember if it does, it was in a branch marked 'WORKS' from a few days ago which i forgot about
[10:07:26] <fuzzie> lynxlynxlynx: you have a test case?
[10:08:20] <lynxlynxlynx> sure, summon a few allies and send them in the enemy zone
[10:08:52] <lynxlynxlynx> still reading the backlog, brb
[10:17:04] <lynxlynxlynx> you have non-math integration exams? oO
[10:18:24] <fuzzie> hehe. the netherlands has this crazy 'integration' scheme for foreigners, where immigrants have to demonstrate that they've integrated into the Dutch culture
[10:19:46] <lynxlynxlynx> borgish
[10:22:38] <fuzzie> it is very silly. i am taking the 'exemption exam', which is more of a Dutch language exam than anything else. 45 minutes, 30 multiple-choice questions on a computer. and a 30% pass rate, which is scary. :)
[10:29:31] <lynxlynxlynx> that's the rate of success or needed success?
[10:29:39] <fuzzie> rate of success
[10:30:26] <fuzzie> doesn't mean much i think, probably just people who can't read/understand Dutch well
[10:30:32] <lynxlynxlynx> exactly
[10:30:52] <lynxlynxlynx> nothing to worry about
[10:43:34] --> Bo_Thomsen has joined #GemRb
[11:25:02] --> edheldil_ has joined #GemRb
[12:08:19] <-- Bo_Thomsen has left IRC (Quit: Leaving.)
[12:23:18] --> Bo_Thomsen has joined #GemRb
[12:31:52] --> Maighstir has joined #GemRb
[13:27:31] <-- SiENcE has left IRC (Quit: @all: cya)
[14:10:17] <-- Maighstir has left IRC (Quit: ~ Trillian Astra - www.trillian.im ~)
[14:37:17] --> SiENcE has joined #GemRb
[15:01:27] <-- Bo_Thomsen has left IRC (Quit: Leaving.)
[15:21:58] --> Bo_Thomsen has joined #GemRb
[15:30:57] <-- Bo_Thomsen has left IRC (Quit: Leaving.)
[16:24:13] --> |Cable| has joined #GemRb
[16:30:16] <-- edheldil has left IRC (Quit: Really?)
[16:52:07] <-- lubos has left IRC (Quit: Leaving.)
[17:01:02] <-- SiENcE has left IRC (Quit: @all: cya)
[17:02:42] --- pupnik_ is now known as pupnik
[18:24:22] <-- edheldil_ has left IRC (Ping timeout: 272 seconds)
[18:50:00] --> Bo_Thomsen has joined #GemRb
[19:33:19] <-- Bo_Thomsen has left IRC (Ping timeout: 250 seconds)
[19:40:46] --> Bo_Thomsen has joined #GemRb
[19:57:47] --> partizan[ua] has joined #GemRb
[19:57:56] <partizan[ua]> hello
[19:59:02] <partizan[ua]> maybe someone can help me.. how i can add hotkeys to planescape: torment?
[19:59:55] --> edheldil_ has joined #GemRb
[20:00:20] --> Maighstir has joined #GemRb
[20:00:28] --> Avenger has joined #GemRb
[20:00:28] --- ChanServ gives channel operator status to Avenger
[20:00:36] <Avenger> hello
[20:00:43] <partizan[ua]> hey :)
[20:01:18] <partizan[ua]> i want to add hotkeys to planescape) can you help me?
[20:03:36] <Avenger> there is no finalized framework for hotkeys, but we already got some hardcoded
[20:04:01] <-- Maighstir has left IRC (Client Quit)
[20:04:30] <partizan[ua]> maybe here is way to add hardcoded keys?
[20:04:54] <Avenger> see guicontrol line 978
[20:05:11] <Avenger> err gamecontrol :)
[20:05:56] <partizan[ua]> hmm, thanks :)
[20:06:08] <Avenger> reverse engineering showed that the original has almost the same thing, with an additional layer of translating keyboard code to letters
[20:06:43] <Avenger> so when you redefine quicksave, it is still a 'q' internally
[20:08:03] --> Maighstir has joined #GemRb
[20:09:39] <-- Bo_Thomsen has left IRC (Quit: Leaving.)
[20:16:40] <partizan[ua]> mm, ok) now, how i can bind 'a' to Attack?)
[20:33:33] <fuzzie> evening
[20:33:42] <partizan[ua]> good
[20:37:30] <fuzzie> hmm, no trivial way to do that
[20:37:45] <partizan[ua]> bad(
[20:38:35] <fuzzie> well, what, what does 'a' do?
[20:38:42] <fuzzie> just goes into attack mode?
[20:39:22] <partizan[ua]> 'a' changes cursor to pointer in combat mode, then i click and actor attcks target
[20:39:25] <fuzzie> you could just add a 'SetTargetMode(TARGET_MODE_ATTACK); break;' to do that
[20:39:49] <fuzzie> it's not really perfect but i don't know off the top of my head how to restrict to enemies only
[20:40:21] <partizan[ua]> hmm, thanks) i try it
[20:40:31] <fuzzie> we should really fix that whole thing
[20:40:42] <partizan[ua]> :)
[20:40:56] <partizan[ua]> another question, how i can bind 'escape'?
[20:40:58] <fuzzie> but, i say that a lot
[20:43:22] <partizan[ua]> hmm, i found GEM_ESCAPE. trying to bind it to show options.
[20:43:46] <partizan[ua]> core->GetGUIScriptEngine()->RunFunction("GUIOPT","OpenOptionsWindow"); something like this?
[20:46:17] <partizan[ua]> i just try it :)
[20:49:03] --> SiENcE has joined #GemRb
[20:57:08] <partizan[ua]> oh..)
[20:57:39] <partizan[ua]> fuzzie, 'SetTargetMode' was not declared in this scope
[20:57:58] <fuzzie> ah, old gemrb?
[20:58:54] <partizan[ua]> 0.6.2
[21:03:00] <partizan[ua]> fuzzie, here is TryToAttack function, maybe i can use it?
[21:03:57] <partizan[ua]> but here no SelectTargetToAttack :)
[21:05:19] <Avenger> or just target_mode = TARGET_MODE_ATTACK; break;
[21:06:13] <Avenger> hmm actually SetTargetMode is better, as fuzzie said. If you don't have it, get the newest source from git
[21:07:42] <partizan[ua]> where is git repo?
[21:11:00] <Avenger> git://gemrb.git.sourceforge.net/gitroot/gemrb/gemrb
[21:22:37] <edheldil_> Avenger: so the original engine only uses 'q' as an identificator of Quicksave action? Or do they use 'q' if they are resetting keys as well?
[21:24:12] <Avenger> i guess resetting the keys makes q=q :)
[21:26:42] <partizan[ua]> hm, seems like my hack with GEM_ESC for options window don't work(
[21:28:50] <partizan[ua]> or running gemrb from build dir is wrong
[21:46:57] <partizan[ua]> cool :) attack working
[21:47:24] <partizan[ua]> now, what's wrong with my attemt to bind 'escape' to options?
[21:50:36] <fuzzie> it is already handled
[21:50:51] <fuzzie> line 2128 of GameControl.cpp
[21:50:53] --> barraAway has joined #GemRb
[21:54:43] <pupnik> so hows it goin
[21:59:36] <partizan[ua]> hmm
[22:01:44] <partizan[ua]> seems like pst has no EmptyControls function, so, i can redefine in to show options window?
[22:04:58] <partizan[ua]> here must be some user-friendly way to define keybindings :) or, way to define keys for each game separately
[22:05:05] --> Bo_Thomsen has joined #GemRb
[22:05:52] <pupnik> good idea partizan[ua]
[22:07:07] <partizan[ua]> but is a just idea :)
[22:07:10] <Avenger> yes, that you can do.
[22:08:25] <Avenger> i don't know why we call EmptyControls, though. ToB doesn't have anything for the escape key
[22:09:34] <fuzzie> it doesn't?
[22:20:00] <-- SiENcE has left IRC (Quit: cya @all)
[22:20:30] <partizan[ua]> hmm, in switch(Key)... we handle global keybindings, like map or so. and be great if after this we call something like RunFunction("GUIKEYS", "HandleKey", Key)
[22:21:10] <partizan[ua]> i have no time, and my knowlege of cpp is not too good :(
[22:21:54] <partizan[ua]> and i don't know gemrb code :)
[22:24:46] <partizan[ua]> cool) my hotkeys working :)
[22:25:12] <partizan[ua]> thanks for help
[22:25:21] <partizan[ua]> and goodnight :)
[22:26:23] --> SiENcE has joined #GemRb
[22:45:42] <-- SiENcE has left IRC (Quit: cya @all)
[22:49:42] <-- lynxlynxlynx has left IRC (Remote host closed the connection)
[22:50:02] <-- Bo_Thomsen has left IRC (Read error: Connection reset by peer)
[23:08:02] <-- Avenger has left IRC (Quit: ChatZilla 0.9.86 [Firefox 3.6.12/20101026210630])
[23:13:14] <pupnik> http://www.youtube.com/watch?v=av7geCKSGuc [ Ar.Drone autonomous navigation using image recognition ]
[23:22:50] <Lightkey> The Witcher 2 on GOG.com right at the start o_O