#pentagram@irc.freenode.net logs for 1 Nov 2009 (GMT)

Archive Today Yesterday Tomorrow
Pentagram homepage


[10:53:30] <Dominus> wjp, I'd be ready today for some debugging :)
[12:00:25] --> Hythlodaeus has joined #pentagram
[12:00:29] <Hythlodaeus> yo
[12:09:55] <Dominus> hi
[12:17:04] <-- Colourless has left IRC ("casts improved invisibility")
[12:29:55] <wjp> Dominus: ok, let's see if we can figure this out :-)
[12:30:06] <Dominus> woot woot!
[12:30:25] <wjp> first I think we should 'synchronize' our displays so we're looking at the same thing
[12:30:41] <wjp> I suggest unscaled 320x200
[12:32:14] <Dominus> k, done, still looks like this
[12:32:20] <wjp> and let's look at the situation directly when starting a new game
[12:32:39] <wjp> if you press t, avatar pos should be 3,(14527,5887,8)
[12:33:53] <Dominus> done
[12:36:04] <wjp> is your bpp 16 or 32?
[12:36:24] <Dominus> the default, I commented it out
[12:36:34] <Dominus> http://img511.imageshack.us/i/46743376.png/
[12:37:05] <Dominus> I'll try now if it changes anything
[12:39:14] <Dominus> nope no obvious change
[12:39:47] <wjp> ok, can you keep it at 32?
[12:40:01] <Dominus> yes
[12:41:14] <wjp> in graphics/BaseSoftRenderSurface is a function BaseSoftRenderSurface::EndPainting
[12:41:32] <wjp> below the line 'if (sdl_surf) {' in that function, add:
[12:41:36] <wjp> printf("%08X %d rl:%d gl:%d bl:%d al:%d rs:%d gs:%d bs:%d as:%d\n rm %08X gm:%08X bm:%08X am:%08X\n", *((Uint32*)pixels00), sdl_surf->format->BitsPerPixel, sdl_surf->format->Rloss,sdl_surf->format->Gloss,sdl_surf->format->Bloss,sdl_surf->format->Aloss, sdl_surf->format->Rshift,sdl_surf->format->Gshift,sdl_surf->format->Bshift,sdl_surf->format->Ashift, sdl_surf->format->Rmask,sdl_surf->format->Gmask,sdl_surf->format->Bmask,sdl_surf->format->Amask);
[12:42:48] <Dominus> k, all?
[12:43:13] <wjp> yes
[12:43:25] <wjp> after that, recompile and run
[12:43:38] <wjp> it should start dumping lots of output to the console
[12:43:45] <Dominus> compiling...
[12:44:46] <wjp> after startup, for me it looks like this:
[12:44:51] <wjp> 00402008 32 rl:0 gl:0 bl:0 al:8 rs:16 gs:8 bs:0 as:0
[12:44:51] <wjp> rm 00FF0000 gm:0000FF00 bm:000000FF am:00000000
[12:45:06] <wjp> then when opening the diary, it turns to:
[12:45:11] <wjp> 00201004 32 rl:0 gl:0 bl:0 al:8 rs:16 gs:8 bs:0 as:0
[12:45:11] <wjp> rm 00FF0000 gm:0000FF00 bm:000000FF am:00000000
[12:45:55] <Dominus> grr, it's doing a full compile atm… I didn't tell it to!!! :)
[12:47:22] <Dominus> 08204000 32 rl:0 gl:0 bl:0 al:8 rs:8 gs:16 bs:24 as:0
[12:47:22] <Dominus> rm 0000FF00 gm:00FF0000 bm:FF000000 am:00000000
[12:47:46] <Dominus> diary open
[12:47:47] <Dominus> 0820BF00 32 rl:0 gl:0 bl:0 al:8 rs:8 gs:16 bs:24 as:0
[12:47:47] <Dominus> rm 0000FF00 gm:00FF0000 bm:FF000000 am:00000000
[12:47:56] <wjp> aha
[12:48:29] <wjp> that doesn't look quite right
[12:49:05] <Dominus> and when I hit quit the starting number changes again to
[12:49:07] <Dominus> 08213E00 32 rl:0 gl:0 bl:0 al:8 rs:8 gs:16 bs:24 as:0
[12:49:07] <Dominus> rm 0000FF00 gm:00FF0000 bm:FF000000 am:00000000
[12:49:37] <Dominus> but I guess the starting number is not the culprit...
[12:50:10] <wjp> the first number is the colour of the top-left pixel
[12:50:38] <wjp> if you look at mine, you see each block of two digits is halved when the diary is open
[12:50:48] <wjp> (40 -> 20, 20 -> 10, 08 -> 04)
[12:51:16] <wjp> i.e., it's half as bright as before
[12:51:40] <wjp> yours are a bit weirder... 08 -> 08, 20 -> 20, 40 -> BF
[12:51:57] <wjp> and that 40 -> BF is the red component
[12:52:06] <Dominus> ok, I see what you mean
[12:58:23] <Dominus> and gs: bs:? these are a bit higher than your settings as well
[12:58:56] <Dominus> gmask, bmask - what is that?
[13:03:51] <wjp> those indicate in which order the colour components are stored
[13:05:17] <wjp> so since rmask is 0000FF00, the third block of two digits ('40', 'BF', '3E' in your output) are the red channel
[13:05:32] <wjp> (and since bmask is FF000000, the first block is blue, etc...)
[13:06:13] <wjp> those numbers are different for me because the colours are stored in a different order
[13:06:25] <Dominus> ok, understand, kind of...
[13:14:32] <wjp> below the previous printf, add:
[13:14:34] <wjp> printf("%d rl:%d gl:%d bl:%d al:%d rs:%d gs:%d bs:%d as:%d\n rm %08X gm:%08X bm:%08X am:%08X\n", format.s_bpp, format.r_loss,format.g_loss,format.b_loss,format.a_loss, format.r_shift,format.g_shift,format.b_shift,format.a_shift, format.r_mask,format.g_mask,format.b_mask,format.a_mask);
[13:15:49] <wjp> (and recompile and run)
[13:16:07] <Dominus> 08204000 32 rl:0 gl:0 bl:0 al:8 rs:8 gs:16 bs:24 as:0
[13:16:07] <Dominus> rm 0000FF00 gm:00FF0000 bm:FF000000 am:00000000
[13:16:07] <Dominus> 32 rl:0 gl:0 bl:0 al:0 rs:8 gs:16 bs:24 as:0
[13:16:07] <Dominus> rm 0000FF00 gm:00FF0000 bm:FF000000 am:000000FF
[13:16:33] <wjp> hm, looks sane
[13:16:37] <Dominus> diary:
[13:16:38] <Dominus> 0820BF00 32 rl:0 gl:0 bl:0 al:8 rs:8 gs:16 bs:24 as:0
[13:16:39] <Dominus> rm 0000FF00 gm:00FF0000 bm:FF000000 am:00000000
[13:16:39] <Dominus> 32 rl:0 gl:0 bl:0 al:0 rs:8 gs:16 bs:24 as:0
[13:16:39] <Dominus> rm 0000FF00 gm:00FF0000 bm:FF000000 am:000000FF
[13:17:19] <Dominus> quit:
[13:17:20] <Dominus> 08213E00 32 rl:0 gl:0 bl:0 al:8 rs:8 gs:16 bs:24 as:0
[13:17:20] <Dominus> rm 0000FF00 gm:00FF0000 bm:FF000000 am:00000000
[13:17:20] <Dominus> 32 rl:0 gl:0 bl:0 al:0 rs:8 gs:16 bs:24 as:0
[13:17:20] <Dominus> rm 0000FF00 gm:00FF0000 bm:FF000000 am:000000FF
[13:20:48] <wjp> ah, found something suspicious
[13:22:28] <Dominus> ?
[13:23:35] <wjp> in graphics/SoftRenderSurface.cpp, in FillBlended, there's a line
[13:23:40] <wjp> rgba = PACK_RGBA16(TEX32_R(rgba)*alpha, TEX32_G(rgba)*alpha, TEX32_B(rgba)*alpha,255*alpha);
[13:23:55] <wjp> replace that with
[13:24:02] <wjp> rgba = TEX32_PACK_RGBA((TEX32_R(rgba)*alpha)>>8, (TEX32_G(rgba)*alpha)>>8, (TEX32_B(rgba)*alpha)>>8,(255*alpha)>>8);
[13:25:21] <-- Kirben has left IRC (Read error: 110 (Connection timed out))
[13:25:56] <Dominus> tada
[13:25:59] <Dominus> looks fine now
[13:26:06] <wjp> great :-)
[13:26:25] <Dominus> 08204000 32 rl:0 gl:0 bl:0 al:8 rs:8 gs:16 bs:24 as:0
[13:26:25] <Dominus> rm 0000FF00 gm:00FF0000 bm:FF000000 am:00000000
[13:26:25] <Dominus> 32 rl:0 gl:0 bl:0 al:0 rs:8 gs:16 bs:24 as:0
[13:26:25] <Dominus> rm 0000FF00 gm:00FF0000 bm:FF000000 am:000000FF
[13:26:41] <Dominus> 04102000 32 rl:0 gl:0 bl:0 al:8 rs:8 gs:16 bs:24 as:0
[13:26:41] <Dominus> rm 0000FF00 gm:00FF0000 bm:FF000000 am:00000000
[13:26:41] <Dominus> 32 rl:0 gl:0 bl:0 al:0 rs:8 gs:16 bs:24 as:0
[13:26:41] <Dominus> rm 0000FF00 gm:00FF0000 bm:FF000000 am:000000FF
[13:27:01] <wjp> yup, that looks good
[13:27:16] <Dominus> hoorray!!!
[13:27:32] <wjp> I'll clean this up a bit and commit it
[13:27:39] <Dominus> thanks
[13:28:22] <Dominus> if you have more time and want to switch over to the exult channel to debug the fullscreen-not-working thingy…. :)
[13:32:24] <wjp> right, committed. Please check if I didn't break anything again :-)
[13:39:52] <Dominus> compiled and seems to run fine
[13:42:24] <wjp> excellent
[13:42:27] <wjp> thanks for the help
[17:10:33] <-- Lord_Nightmare has left IRC ("Leaving")
[17:17:09] --> Lord_Nightmare has joined #pentagram
[19:43:45] <-- exultbot has left IRC (signing off...)
[19:44:58] --> exultbot has joined #pentagram
[19:44:58] --- Topic for #pentagram is: http://pentagram.sf.net/
[19:44:58] --- Topic for #pentagram set by wjp at Sat Apr 4 21:12:00 2009
[19:53:01] --- ChanServ gives channel operator status to Dominus
[20:24:37] <-- Hythlodaeus has left IRC ()
[21:57:55] --> Colourless has joined #Pentagram
[21:57:55] --- ChanServ gives channel operator status to Colourless
[22:54:03] --> Kirben has joined #pentagram
[22:54:03] --- ChanServ gives channel operator status to Kirben