Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Allegro 5.0.0rc1 released!

This thread is locked; no one can reply to it. rss feed Print
Allegro 5.0.0rc1 released!
Evert
Member #794
November 2000
avatar

I do believe that the loaders will load 8 bit bitmaps, but up convert on load (not entirely sure).

Yes, they do.

If I were to add 8 bit bitmaps to Allegro 5, I would probably make the palette a property of each bitmap (you'd be drawing them to a higher-colour depth display anyway) and do on-the-fly conversions when needed (so you don't get penalised more than once if the palette doesn't change).

Elias
Member #358
May 2000

8-bit doesn't necessaily mean palette. I think it would make sense to support something like GL_LUMINANCE in OpenGL ES 2.0:

Quote:

Each element is a single luminance value.
The GL converts it to floating point,
then assembles it into an RGBA element by replicating the luminance value
three times for red, green, and blue and attaching 1 for alpha.
Each component is then clamped to the range [0,1].

It could save a lot of texture space for e.g. fonts. Saving texture space reminds me, we should add an example how to use texture compression (OpenGL only - unless someone wants to make an addon which wraps around D3D as well).

--
"Either help out or stop whining" - Evert

Trezker
Member #1,739
December 2001
avatar

Just installed this version. I have a problem with the native filechooser. It freezes the program.

I'm on Ubuntu 10.04.

Peter Wang
Member #23
April 2000

There were no changes to the native dialogs addon from 4.9.22 :P

Can you get a backtrace by running under gdb?

Trezker
Member #1,739
December 2001
avatar

Hmm, I've never tried getting a backtrace for a program that freezes, only for crashes. How would I go about doing that?

Testing ex_native_filechooser.
It starts 5 threads, and when I click open it starts another thread then the log window goes grey and it's all frozen. It starts a thread and freezes no matter where I click actually.
Even if I don't click at all it freezes in less than 30 seconds.

Peter Wang
Member #23
April 2000

When it hangs, press ^C in the gdb window and you will get the usual gdb prompt. You can get a backtrace of all threads with: thread apply all bt

Thomas Fjellstrom
Member #476
June 2000
avatar

Trezker said:

Hmm, I've never tried getting a backtrace for a program that freezes, only for crashes. How would I go about doing that?

Most debuggers can attach to running programs. With gdb on unix you hand it the program's pid.

With threaded applications you want to run this in gdb: "thread apply all bt full" confusing, but it tells gdb to output a full backtrace for ALL threads.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Trezker
Member #1,739
December 2001
avatar

#0  0x0012d422 in __kernel_vsyscall ()
#1  0x00ae2015 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/tls/i686/cmov/libpthread.so.0
#2  0x00197478 in _al_cond_wait (cond=0x834511c, mutex=0x8345100)
    at /home/anders/allegro/allegro-5.0.0rc1/include/allegro5/platform/aintuthr.h:81
#3  0x00193594 in al_wait_for_event (queue=0x83450d8, ret_event=0xbffff070)
    at /home/anders/allegro/allegro-5.0.0rc1/src/events.c:354
#4  0x0804a0f1 in main ()
    at /home/anders/allegro/allegro-5.0.0rc1/examples/ex_native_filechooser.c:228

Seems to be stuck in al_wait_for_event.

Oh, perhaps all threads is a good idea.

#SelectExpand
1Thread 7 (Thread 0xb53feb70 (LWP 18260)): 2#0 0x0012d422 in __kernel_vsyscall () 3No symbol table info available. 4#1 0x00ae4af9 in __lll_lock_wait () from /lib/tls/i686/cmov/libpthread.so.0 5No symbol table info available. 6#2 0x00ae013b in _L_lock_748 () from /lib/tls/i686/cmov/libpthread.so.0 7No symbol table info available. 8#3 0x00adff61 in pthread_mutex_lock () from /lib/tls/i686/cmov/libpthread.so.0 9No symbol table info available. 10#4 0x00650096 in ?? () from /usr/lib/libgdk-x11-2.0.so.0 11No symbol table info available. 12#5 0x00650020 in gdk_threads_enter () from /usr/lib/libgdk-x11-2.0.so.0 13No symbol table info available. 14#6 0x00130ff3 in gtk_start_and_lock (fd=0x8383f60) 15 at /home/anders/allegro/allegro-5.0.0rc1/addons/native_dialog/gtk_dialog.c:80 16 argc = 0 17 argv = 0x0 18 __func__ = "gtk_start_and_lock" 19#7 0x00131504 in _al_show_native_file_dialog (display=0x8160810, fd=0x8383f60) 20 at /home/anders/allegro/allegro-5.0.0rc1/addons/native_dialog/gtk_dialog.c:194 21---Type <return> to continue, or q <return> to quit--- 22 window = 0x1314e6 23#8 0x001306f1 in al_show_native_file_dialog (display=0x8160810, 24 dialog=0x8383f60) 25 at /home/anders/allegro/allegro-5.0.0rc1/addons/native_dialog/dialog.c:40 26 fd = 0x8383f60 27#9 0x08049b05 in async_file_dialog_thread_func (thread=0x8384048, 28 arg=0x8383ed0) 29 at /home/anders/allegro/allegro-5.0.0rc1/examples/ex_native_filechooser.c:54 30 data = 0x8383ed0 31 event = {type = 11403047, any = {type = 11403047, source = 0x0, 32 timestamp = 5.6363764798007543e-317}, display = {type = 11403047, 33 source = 0x0, timestamp = 5.6363764798007543e-317, x = 0, y = 0, 34 width = 18260, height = 2469876, orientation = -1254102160}, 35 joystick = {type = 11403047, source = 0x0, 36 timestamp = 5.6363764798007543e-317, id = 0x0, stick = 0, 37 axis = 18260, pos = 3.46103345e-39, button = -1254102160}, 38 keyboard = {type = 11403047, source = 0x0, 39 timestamp = 5.6363764798007543e-317, display = 0x0, keycode = 0, 40 unichar = 18260, modifiers = 2469876}, mouse = {type = 11403047, 41 source = 0x0, timestamp = 5.6363764798007543e-317, display = 0x0, 42 x = 0, y = 18260, z = 2469876, w = -1254102160, dx = 4001536, 43 dy = -1254104680, dz = 1668093, dw = 137904244, button = 0, 44---Type <return> to continue, or q <return> to quit--- 45 pressure = 0}, timer = {type = 11403047, source = 0x0, 46 timestamp = 5.6363764798007543e-317, count = 0, 47 error = 6.0319852354159264e-308}, user = {type = 11403047, 48 source = 0x0, timestamp = 5.6363764798007543e-317, 49 __internal__descr = 0x0, data1 = 0, data2 = 18260, 50 data3 = 2469876, data4 = -1254102160}} 51#10 0x0019f352 in thread_func_trampoline (inner=0x8384048, _outer=0x8384048) 52 at /home/anders/allegro/allegro-5.0.0rc1/src/threads.c:80 53 outer = 0x8384048 54 system = 0x807d4b8 55#11 0x001e6120 in thread_proc_trampoline (data=0x8384048) 56 at /home/anders/allegro/allegro-5.0.0rc1/src/unix/uxthread.c:36 57 thread = 0x8384048 58#12 0x00add96e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0 59No symbol table info available. 60#13 0x00e70a4e in clone () from /lib/tls/i686/cmov/libc.so.6 61No symbol table info available. 62 63Thread 6 (Thread 0xb5bffb70 (LWP 18258)): 64#0 0x0012d422 in __kernel_vsyscall () 65No symbol table info available. 66#1 0x00ae5736 in nanosleep () from /lib/tls/i686/cmov/libpthread.so.0 67No symbol table info available. 68---Type <return> to continue, or q <return> to quit--- 69#2 0x001e5f93 in al_rest (seconds=0.032767999999999999) 70 at /home/anders/allegro/allegro-5.0.0rc1/src/unix/utime.c:68 71 timeout = {tv_sec = 0, tv_nsec = 32767999} 72 fsecs = 0 73#3 0x0019ff0c in timer_thread_proc (self=0x25e8c0, unused=0x0) 74 at /home/anders/allegro/allegro-5.0.0rc1/src/timernu.c:99 75 old_time = 10.353538 76 new_time = 10.353538 77 interval = 0.032767999999999999 78#4 0x001e6120 in thread_proc_trampoline (data=0x25e8c0) 79 at /home/anders/allegro/allegro-5.0.0rc1/src/unix/uxthread.c:36 80 thread = 0x25e8c0 81#5 0x00add96e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0 82No symbol table info available. 83#6 0x00e70a4e in clone () from /lib/tls/i686/cmov/libc.so.6 84No symbol table info available. 85 86Thread 5 (Thread 0xb64dcb70 (LWP 18257)): 87#0 0x0012d422 in __kernel_vsyscall () 88No symbol table info available. 89#1 0x00e62b86 in poll () from /lib/tls/i686/cmov/libc.so.6 90No symbol table info available. 91#2 0x009d94eb in g_poll () from /lib/libglib-2.0.so.0 92---Type <return> to continue, or q <return> to quit--- 93No symbol table info available. 94#3 0x009cc0ac in ?? () from /lib/libglib-2.0.so.0 95No symbol table info available. 96#4 0x009cc817 in g_main_loop_run () from /lib/libglib-2.0.so.0 97No symbol table info available. 98#5 0x029ed400 in ?? () from /usr/lib/libORBit-2.so.0 99No symbol table info available. 100#6 0x009f2def in ?? () from /lib/libglib-2.0.so.0 101No symbol table info available. 102#7 0x00add96e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0 103No symbol table info available. 104#8 0x00e70a4e in clone () from /lib/tls/i686/cmov/libc.so.6 105No symbol table info available. 106 107Thread 4 (Thread 0xb6e72b70 (LWP 18256)): 108#0 0x0012d422 in __kernel_vsyscall () 109No symbol table info available. 110#1 0x00ae2015 in pthread_cond_wait@@GLIBC_2.3.2 () 111 from /lib/tls/i686/cmov/libpthread.so.0 112No symbol table info available. 113#2 0x029cf88d in giop_recv_buffer_get () from /usr/lib/libORBit-2.so.0 114No symbol table info available. 115#3 0x029d467b in ORBit_small_invoke_stub () from /usr/lib/libORBit-2.so.0 116---Type <return> to continue, or q <return> to quit--- 117No symbol table info available. 118#4 0x029d48a6 in ORBit_small_invoke_stub_n () from /usr/lib/libORBit-2.so.0 119No symbol table info available. 120#5 0x029e1227 in ORBit_c_stub_invoke () from /usr/lib/libORBit-2.so.0 121No symbol table info available. 122#6 0x02911ae4 in Accessibility_EventListener_notifyEvent () 123 from /usr/lib/libspi.so.0 124No symbol table info available. 125#7 0x028ec3cc in ?? () from /usr/lib/gtk-2.0/modules/libatk-bridge.so 126No symbol table info available. 127#8 0x028ecb57 in ?? () from /usr/lib/gtk-2.0/modules/libatk-bridge.so 128No symbol table info available. 129#9 0x009593b0 in ?? () from /usr/lib/libgobject-2.0.so.0 130No symbol table info available. 131#10 0x0095adb4 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0 132No symbol table info available. 133#11 0x0095b256 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0 134No symbol table info available. 135#12 0x028d5e97 in ?? () from /usr/lib/gtk-2.0/modules/libgail.so 136No symbol table info available. 137#13 0x003a2424 in ?? () from /usr/lib/libgtk-x11-2.0.so.0 138No symbol table info available. 139#14 0x00945252 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0 140---Type <return> to continue, or q <return> to quit--- 141No symbol table info available. 142#15 0x0095999d in ?? () from /usr/lib/libgobject-2.0.so.0 143No symbol table info available. 144#16 0x0095ac33 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0 145No symbol table info available. 146#17 0x0095b256 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0 147No symbol table info available. 148#18 0x004cf636 in ?? () from /usr/lib/libgtk-x11-2.0.so.0 149No symbol table info available. 150#19 0x0039bf3c in gtk_main_do_event () from /usr/lib/libgtk-x11-2.0.so.0 151No symbol table info available. 152#20 0x0069039a in ?? () from /usr/lib/libgdk-x11-2.0.so.0 153No symbol table info available. 154#21 0x009c85e5 in g_main_context_dispatch () from /lib/libglib-2.0.so.0 155No symbol table info available. 156#22 0x009cc2d8 in ?? () from /lib/libglib-2.0.so.0 157No symbol table info available. 158#23 0x009cc817 in g_main_loop_run () from /lib/libglib-2.0.so.0 159No symbol table info available. 160#24 0x0039c3c9 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0 161No symbol table info available. 162#25 0x00130d84 in gtk_thread_func (data=0x0) 163 at /home/anders/allegro/allegro-5.0.0rc1/addons/native_dialog/gtk_dialog.c:4---Type <return> to continue, or q <return> to quit--- 1648 165 __func__ = "gtk_thread_func" 166#26 0x009f2def in ?? () from /lib/libglib-2.0.so.0 167No symbol table info available. 168#27 0x00add96e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0 169No symbol table info available. 170#28 0x00e70a4e in clone () from /lib/tls/i686/cmov/libc.so.6 171No symbol table info available. 172 173Thread 3 (Thread 0xb77d0b70 (LWP 18255)): 174#0 0x0012d422 in __kernel_vsyscall () 175No symbol table info available. 176#1 0x00ae2015 in pthread_cond_wait@@GLIBC_2.3.2 () 177 from /lib/tls/i686/cmov/libpthread.so.0 178No symbol table info available. 179#2 0x00131083 in gtk_unlock_and_wait (nd=0x807db48) 180 at /home/anders/allegro/allegro-5.0.0rc1/addons/native_dialog/gtk_dialog.c:90 181No locals. 182#3 0x00131f1c in _al_open_native_text_log (textlog=0x807db48) 183 at /home/anders/allegro/allegro-5.0.0rc1/addons/native_dialog/gtk_dialog.c:375 184 top = 0x80f2040 185---Type <return> to continue, or q <return> to quit--- 186 scroll = 0x80ecc78 187 view = 0x80c4818 188#4 0x00130977 in textlog_thread_proc (thread=0x807dc18, arg=0x807db48) 189 at /home/anders/allegro/allegro-5.0.0rc1/addons/native_dialog/textlog.c:22 190 textlog = 0x807db48 191#5 0x0019f352 in thread_func_trampoline (inner=0x807dc18, _outer=0x807dc18) 192 at /home/anders/allegro/allegro-5.0.0rc1/src/threads.c:80 193 outer = 0x807dc18 194 system = 0x807d4b8 195#6 0x001e6120 in thread_proc_trampoline (data=0x807dc18) 196 at /home/anders/allegro/allegro-5.0.0rc1/src/unix/uxthread.c:36 197 thread = 0x807dc18 198#7 0x00add96e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0 199No symbol table info available. 200#8 0x00e70a4e in clone () from /lib/tls/i686/cmov/libc.so.6 201No symbol table info available. 202 203Thread 2 (Thread 0xb7fd1b70 (LWP 18254)): 204#0 0x0012d422 in __kernel_vsyscall () 205No symbol table info available. 206#1 0x00e69971 in select () from /lib/tls/i686/cmov/libc.so.6 207No symbol table info available. 208#2 0x001f129d in xglx_background_thread (self=0x807d4e8, arg=0x807d4b8) 209---Type <return> to continue, or q <return> to quit--- 210 at /home/anders/allegro/allegro-5.0.0rc1/src/x/xsystem.c:164 211 x11_fd = 5 212 fdset = {__fds_bits = {32, 0 <repeats 31 times>}} 213 small_time = {tv_sec = 0, tv_usec = 30436} 214 s = 0x807d4b8 215 event = {type = 10, xany = {type = 10, serial = 35, send_event = 0, 216 display = 0x8065eb0, window = 171966466}, xkey = {type = 10, 217 serial = 35, send_event = 0, display = 0x8065eb0, 218 window = 171966466, root = 0, subwindow = 3, time = 1634831459, 219 x = 117, y = -2, x_root = 753, y_root = 513, state = 0, 220 keycode = 3, same_screen = 1}, xbutton = {type = 10, serial = 35, 221 send_event = 0, display = 0x8065eb0, window = 171966466, root = 0, 222 subwindow = 3, time = 1634831459, x = 117, y = -2, x_root = 753, 223 y_root = 513, state = 0, button = 3, same_screen = 1}, xmotion = { 224 type = 10, serial = 35, send_event = 0, display = 0x8065eb0, 225 window = 171966466, root = 0, subwindow = 3, time = 1634831459, 226 x = 117, y = -2, x_root = 753, y_root = 513, state = 0, 227 is_hint = 3 '\003', same_screen = 1}, xcrossing = {type = 10, 228 serial = 35, send_event = 0, display = 0x8065eb0, 229 window = 171966466, root = 0, subwindow = 3, time = 1634831459, 230 x = 117, y = -2, x_root = 753, y_root = 513, mode = 0, detail = 3, 231 same_screen = 1, focus = 1, state = 16}, xfocus = {type = 10, 232 serial = 35, send_event = 0, display = 0x8065eb0, 233---Type <return> to continue, or q <return> to quit--- 234 window = 171966466, mode = 0, detail = 3}, xexpose = {type = 10, 235 serial = 35, send_event = 0, display = 0x8065eb0, 236 window = 171966466, x = 0, y = 3, width = 1634831459, 237 height = 117, count = -2}, xgraphicsexpose = {type = 10, 238 serial = 35, send_event = 0, display = 0x8065eb0, 239 drawable = 171966466, x = 0, y = 3, width = 1634831459, 240 height = 117, count = -2, major_code = 753, minor_code = 513}, 241 xnoexpose = {type = 10, serial = 35, send_event = 0, 242 display = 0x8065eb0, drawable = 171966466, major_code = 0, 243 minor_code = 3}, xvisibility = {type = 10, serial = 35, 244 send_event = 0, display = 0x8065eb0, window = 171966466, 245 state = 0}, xcreatewindow = {type = 10, serial = 35, 246 send_event = 0, display = 0x8065eb0, parent = 171966466, 247 window = 0, x = 3, y = 1634831459, width = 117, height = -2, 248 border_width = 753, override_redirect = 513}, xdestroywindow = { 249 type = 10, serial = 35, send_event = 0, display = 0x8065eb0, 250 event = 171966466, window = 0}, xunmap = {type = 10, serial = 35, 251 send_event = 0, display = 0x8065eb0, event = 171966466, 252 window = 0, from_configure = 3}, xmap = {type = 10, serial = 35, 253 send_event = 0, display = 0x8065eb0, event = 171966466, 254 window = 0, override_redirect = 3}, xmaprequest = {type = 10, 255 serial = 35, send_event = 0, display = 0x8065eb0, 256 parent = 171966466, window = 0}, xreparent = {type = 10, 257---Type <return> to continue, or q <return> to quit--- 258 serial = 35, send_event = 0, display = 0x8065eb0, 259 event = 171966466, window = 0, parent = 3, x = 1634831459, 260 y = 117, override_redirect = -2}, xconfigure = {type = 10, 261 serial = 35, send_event = 0, display = 0x8065eb0, 262 event = 171966466, window = 0, x = 3, y = 1634831459, width = 117, 263 height = -2, border_width = 753, above = 513, 264 override_redirect = 0}, xgravity = {type = 10, serial = 35, 265 send_event = 0, display = 0x8065eb0, event = 171966466, 266 window = 0, x = 3, y = 1634831459}, xresizerequest = {type = 10, 267 serial = 35, send_event = 0, display = 0x8065eb0, 268 window = 171966466, width = 0, height = 3}, xconfigurerequest = { 269 type = 10, serial = 35, send_event = 0, display = 0x8065eb0, 270 parent = 171966466, window = 0, x = 3, y = 1634831459, 271 width = 117, height = -2, border_width = 753, above = 513, 272 detail = 0, value_mask = 3}, xcirculate = {type = 10, serial = 35, 273 send_event = 0, display = 0x8065eb0, event = 171966466, 274 window = 0, place = 3}, xcirculaterequest = {type = 10, 275 serial = 35, send_event = 0, display = 0x8065eb0, 276 parent = 171966466, window = 0, place = 3}, xproperty = { 277 type = 10, serial = 35, send_event = 0, display = 0x8065eb0, 278 window = 171966466, atom = 0, time = 3, state = 1634831459}, 279 xselectionclear = {type = 10, serial = 35, send_event = 0, 280 display = 0x8065eb0, window = 171966466, selection = 0, time = 3}, 281---Type <return> to continue, or q <return> to quit--- 282 xselectionrequest = {type = 10, serial = 35, send_event = 0, 283 display = 0x8065eb0, owner = 171966466, requestor = 0, 284 selection = 3, target = 1634831459, property = 117, 285 time = 4294967294}, xselection = {type = 10, serial = 35, 286 send_event = 0, display = 0x8065eb0, requestor = 171966466, 287 selection = 0, target = 3, property = 1634831459, time = 117}, 288 xcolormap = {type = 10, serial = 35, send_event = 0, 289 display = 0x8065eb0, window = 171966466, colormap = 0, new = 3, 290 state = 1634831459}, xclient = {type = 10, serial = 35, 291 send_event = 0, display = 0x8065eb0, window = 171966466, 292 message_type = 0, format = 3, data = { 293 b = "c\214qau\000\000\000\376\377\377\377\361\002\000\000\001\002\000", s = {-29597, 24945, 117, 0, -2, -1, 753, 0, 513, 0}, l = {1634831459, 294 117, -2, 753, 513}}}, xmapping = {type = 10, serial = 35, 295 send_event = 0, display = 0x8065eb0, window = 171966466, 296 request = 0, first_keycode = 3, count = 1634831459}, xerror = { 297 type = 10, display = 0x23, resourceid = 0, serial = 134635184, 298 error_code = 2 '\002', request_code = 0 '\000', 299 minor_code = 64 '@'}, xkeymap = {type = 10, serial = 35, 300 send_event = 0, display = 0x8065eb0, window = 171966466, 301 key_vector = "\000\000\000\000\003\000\000\000c\214qau\000\000\000\376\377\377\377\361\002\000\000\001\002\000\000\000\000\000"}, xgeneric = { 302 type = 10, serial = 35, send_event = 0, display = 0x8065eb0, 303---Type <return> to continue, or q <return> to quit--- 304 extension = 171966466, evtype = 0}, xcookie = {type = 10, 305 serial = 35, send_event = 0, display = 0x8065eb0, 306 extension = 171966466, evtype = 0, cookie = 3, data = 0x61718c63}, 307 pad = {10, 35, 0, 134635184, 171966466, 0, 3, 1634831459, 117, -2, 308 753, 513, 0, 3, 1, 1, 16, 0, 0, 0, 0, 0, 0, 0}} 309 last_reset_screensaver_time = 0 310#3 0x001e6120 in thread_proc_trampoline (data=0x807d4e8) 311 at /home/anders/allegro/allegro-5.0.0rc1/src/unix/uxthread.c:36 312 thread = 0x807d4e8 313#4 0x00add96e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0 314No symbol table info available. 315#5 0x00e70a4e in clone () from /lib/tls/i686/cmov/libc.so.6 316No symbol table info available. 317 318Thread 1 (Thread 0xb7fd2a90 (LWP 18253)): 319#0 0x0012d422 in __kernel_vsyscall () 320No symbol table info available. 321#1 0x00ae2015 in pthread_cond_wait@@GLIBC_2.3.2 () 322 from /lib/tls/i686/cmov/libpthread.so.0 323No symbol table info available. 324#2 0x00197478 in _al_cond_wait (cond=0x8319f44, mutex=0x8319f28) 325 at /home/anders/allegro/allegro-5.0.0rc1/include/allegro5/platform/aintuthr.h:81 326---Type <return> to continue, or q <return> to quit--- 327No locals. 328#3 0x00193594 in al_wait_for_event (queue=0x8319f00, ret_event=0xbffff070) 329 at /home/anders/allegro/allegro-5.0.0rc1/src/events.c:354 330 next_event = 0x0 331 __PRETTY_FUNCTION__ = "al_wait_for_event" 332#4 0x0804a0f1 in main () 333 at /home/anders/allegro/allegro-5.0.0rc1/examples/ex_native_filechooser.c:228 334 h = 480 335 event = {type = 30, any = {type = 30, source = 0x831a248, 336 timestamp = 10.353541999999999}, display = {type = 30, 337 source = 0x831a248, timestamp = 10.353541999999999, x = 282, 338 y = 0, width = 1372777472, height = 1058235918, 339 orientation = 1434544}, joystick = {type = 30, source = 0x831a248, 340 timestamp = 10.353541999999999, id = 0x11a, stick = 0, 341 axis = 1372777472, pos = 0.575775981, button = 1434544}, 342 keyboard = {type = 30, source = 0x831a248, 343 timestamp = 10.353541999999999, display = 0x11a, keycode = 0, 344 unichar = 1372777472, modifiers = 1058235918}, mouse = {type = 30, 345 source = 0x831a248, timestamp = 10.353541999999999, 346 display = 0x11a, x = 0, y = 1372777472, z = 1058235918, 347 w = 1434544, dx = 1119288, dy = 1984974, dz = 11376804, 348 dw = 2469876, button = 3049257840, pressure = 5.60734625e-39}, 349---Type <return> to continue, or q <return> to quit--- 350 timer = {type = 30, source = 0x831a248, 351 timestamp = 10.353541999999999, count = 282, 352 error = 7.4000000000504218e-05}, user = {type = 30, 353 source = 0x831a248, timestamp = 10.353541999999999, 354 __internal__descr = 0x11a, data1 = 0, data2 = 1372777472, 355 data3 = 1058235918, data4 = 1434544}} 356 display = 0x8160810 357 timer = 0x831a248 358 queue = 0x8319f00 359 font = 0x8319fb0 360 background = {r = 1, g = 1, b = 1, a = 1} 361 active = {r = 0, g = 0, b = 0, a = 1} 362 inactive = {r = 0.501960814, g = 0.501960814, b = 0.501960814, a = 1} 363 info = {r = 1, g = 0, b = 0, a = 1} 364 old_dialog = 0x0 365 cur_dialog = 0x8383ed0 366 message_box = 0x0 367 redraw = false 368 close_log = false 369 button = 134517828 370 message_log = true

Peter Wang
Member #23
April 2000

Can you also post the contents of allegro.log?

Trezker
Member #1,739
December 2001
avatar

Attached

EDIT: So A.cc doesn't finish uploading after pressing submit post.

Peter Wang
Member #23
April 2000

I think it will be a bit easier to debug with more logging. Please post the allegro.log again after applying this patch.

Trezker
Member #1,739
December 2001
avatar

Here you go.

Peter Wang
Member #23
April 2000

Thanks. Does this help?

Trezker
Member #1,739
December 2001
avatar

No it did not.
Attached new log and backtrace.
New behaviour though, when running in gdb I only get the log window and it freezes there.

Peter Wang
Member #23
April 2000

I'm not sure what the problem is, but it could be a GTK bug. The implementation was bugging me anyway so I changed it a simpler, message-passing type structure, instead of trying to find the bug.

Trezker
Member #1,739
December 2001
avatar

And it works!
I like the humor when I click anywhere.

Peter Wang
Member #23
April 2000

Great. I've committed a more complete version of the patch.

Trezker
Member #1,739
December 2001
avatar

The native filechooser in A5 returns absolute paths, but I want relative paths.

What's the simplest method for removing current directory from the path?

I noticed that al_get_current_directory returns a string that must be freed. Why? I would prefer to have freeing that off my hands when I need the cwd.

Trent Gamblin
Member #261
April 2000
avatar

On a slightly related note, I don't know if this is a big problem (probably not), but al_get_current_directory returns a path without a trailing / (or \). My colleague wrote some code that turned out to be messing up because he assumed there was going to be a / at the end. So I had to create a temporary string and add the / then add the rest of the path.

Evert
Member #794
November 2000
avatar

Trezker said:

The native filechooser in A5 returns absolute paths, but I want relative paths.

Just out of curiosity: why?
I can't think of a use case where absolute paths would be bad. Arguably you want to base things off the current directory with the idea that you can still find the file if you move the whole directory tree, but that only works for files under the tree...

Quote:

What's the simplest method for removing current directory from the path?

Probably using al_remove_path_component (by the way, it'd be neat if Acc's markup started recognising A5 functions).

EDIT: could someone clarify the distinction between al_join_path() and al_rebase_path()? From the description it seems that they do more or less the same thing, except one modifies the first argument and one modifies the second argument...? The example at al_rebase_path() does what I'd expect al_join_path() to do (which doesn't have an example an dprobably needs it) while I would expect al_rebase_path() to more-or-less allow you to do what the OP wants here.
I'm confused now...

Trezker
Member #1,739
December 2001
avatar

I want to save the paths in a level file so they can be loaded no matter where the game is installed.

If a file is not under the tree, I'm considering importing it by copying the selected file to a folder where the game would want those files to be.

Perhaps I should just get the filename part from the path, prepend expected folder and check file existence. If it's not where it's supposed to be then I copy the file selected in filechooser.

Thomas Fjellstrom
Member #476
June 2000
avatar

Yeah, I think we should add an `al_path_make_relative(ALLEGRO_PATH *working, ALLEGRO_PATH *path)` or something along those lines. This would take path, and remove "working"'s path components from "path".

Its not that hard to do yourself though.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Elias
Member #358
May 2000

Trezker said:

I noticed that al_get_current_directory returns a string that must be freed. Why? I would prefer to have freeing that off my hands when I need the cwd.

That's not how things work in C. Look at this:

al_change_directory("blah1");
str1 = al_get_current_directory();
al_change_directory("blah2");
str2 = al_get_current_directory();
printf("%s %s", str1, str2);

If you do this in a loop a few 1000 times it would mean a lot of strings which have to be kept... only way around that is to free them. What we could do is have you pass in a buffer and length where the string gets written to though, but that would be awkward as you now have to deal with arbitrary buffer lengths. More annoying than adding a free call I think.

Yeah, I think we should add an `al_path_make_relative(ALLEGRO_PATH *working, ALLEGRO_PATH *path)` or something along those lines.

The name would be confusing. For example if I'm in "/home/blah1" then want the relative path to "/home/blah2", I would expect to get "../blah2".

--
"Either help out or stop whining" - Evert

Trezker
Member #1,739
December 2001
avatar

Other A5 functions that return strings don't require the user to free.

http://alleg.sourceforge.net/a5docs/refman/path.html#al_path_cstr
"The returned pointer is valid only until the path is modified in any way, or until the path is destroyed."

http://alleg.sourceforge.net/a5docs/refman/utf8.html#al_cstr
"This pointer will only be valid while the underlying string is not modified and not destroyed."

Thomas Fjellstrom
Member #476
June 2000
avatar

Trezker said:

"The returned pointer is valid only until the path is modified in any way, or until the path is destroyed."

Thats a bit of a special case, the ALLEGRO_PATH structure stores a cache of the c-string so it doesn't have to keep re-making the full string each time al_path_cstr is called, and thats what it returns.

I assume al_cstr is the same. Most times with a current dir string, you wan't to keep it around, not have it disappear just because you changed dirs and called al_current_dir again.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730



Go to: