Previous 15994 Revisions Next

r1248 Friday 9th November, 2007 at 05:48:11 UTC by R. Belmont
[SDLMESS] Sync with SDLMAME 0.120u3.
[src/osd/sdl]drawsdl.c input.c sdlsync.c

src/osd/sdl/input.c
r1247r1248
247247   KTT_ENTRY0(  STOP,          PERIOD,       0xbe,   '.',   "STOP"  ),
248248   KTT_ENTRY0(  SLASH,       SLASH,            0xbf,   '/',   "SLASH" ),
249249   KTT_ENTRY2(  RSHIFT,       RSHIFT ),
250   KTT_ENTRY0(  ASTERISK,       KP_MULTIPLY,    '*',   '*',   "ASTERISK" ),
250   KTT_ENTRY0(  ASTERISK,       KP_MULTIPLY,    '*',   '*',   "ASTERIX" ),
251251   KTT_ENTRY2(  LALT,          LALT ),
252252   KTT_ENTRY0(  SPACE,       SPACE,          ' ',   ' ',   "SPACE" ),
253253   KTT_ENTRY2(  CAPSLOCK,       CAPSLOCK ),
src/osd/sdl/drawsdl.c
r1247r1248
14941494}
14951495
14961496static void texture_compute_size_subroutine(sdl_info *sdl, texture_info *texture, UINT32 flags,
1497                                            int width, int height,
1497                                            UINT32 width, UINT32 height,
14981498                                            int* p_width, int* p_height, int* p_width_create, int* p_height_create)
14991499{
1500        int width_create = width;
1501        int height_create= height;
1500        int width_create;
1501        int height_create;
15021502
1503   width_create  = get_valid_pow2_value (width,  texture->texpow2);
1504   height_create = get_valid_pow2_value (height, texture->texpow2);
1503   if ( texture->texpow2 )
1504        {
1505                width_create  = gl_round_to_pow2 (width);
1506                height_create = gl_round_to_pow2 (height);
1507        } else if ( texture->type==TEXTURE_TYPE_SHADER )
1508        {
1509                /**
1510                 * at least use a multiple of 8 for shader .. just in case
1511                 */
1512                width_create  = ( width  & ~0x07 ) + ( (width  & 0x07)? 8 : 0 ) ;
1513                height_create = ( height & ~0x07 ) + ( (height & 0x07)? 8 : 0 ) ;
1514        } else {
1515                width_create  = width  ;
1516                height_create = height ;
1517        }
15051518
15061519   // don't prescale above max texture size
15071520   while (texture->xprescale > 1 && width_create * texture->xprescale > sdl->texture_max_width)
r1247r1248
17391752   lut_texture_width  = sqrt((double)(texture->lut_table_width));
17401753   lut_texture_width  = get_valid_pow2_value (lut_texture_width, 1);
17411754
1742   if ( lut_texture_width*lut_texture_width < texture->lut_table_width )
1755   texture->lut_table_height = texture->lut_table_width / lut_texture_width;
1756
1757   if ( lut_texture_width*texture->lut_table_height < texture->lut_table_width )
17431758   {
1744      texture->lut_table_height  = 1;
1745   } else {
1746      texture->lut_table_height  = 0;
1759      texture->lut_table_height  += 1;
17471760   }
17481761
1749   texture->lut_table_height += texture->lut_table_width / lut_texture_width;
17501762   texture->lut_table_width   = lut_texture_width;
17511763
17521764   /**
r1247r1248
19661978                  texture->texProperties[SDL_TEXFORMAT_TYPE],
19671979                  &_width, &_height, 1) )
19681980      {
1969         mame_printf_error("cannot create lut table texture, req: %dx%d, avail: %dx%d - bail out\n",
1970            lut_table_width_pow2, lut_table_height_pow2, (int)_width, (int)_height);
1981         mame_printf_error("cannot create bitmap texture, req: %dx%d, avail: %dx%d - bail out\n",
1982            texture->rawwidth_create, texture->rawheight_create, (int)_width, (int)_height);
19711983         return -1;
19721984      }
19731985
src/osd/sdl/sdlsync.c
r1247r1248
351351   {
352352      struct timespec   ts;
353353      struct timeval    tp;
354      osd_ticks_t t;
355      osd_ticks_t msec = timeout * 1000 / osd_ticks_per_second();
356
354      UINT64 t;
355      UINT64 msec = timeout * 1000 / osd_ticks_per_second();
356      UINT64 nsec;
357     
357358      gettimeofday(&tp, NULL);
358359
359360      ts.tv_sec  = tp.tv_sec;
360      ts.tv_nsec = tp.tv_usec * 1000 + (msec * 1000000);
361      t = ts.tv_nsec / 1000000000;
362      ts.tv_nsec = t % 1000000000;
361      nsec = (UINT64) tp.tv_usec * (UINT64) 1000 + (msec * (UINT64) 1000000);
362      t = nsec / (UINT64) 1000000000;
363      ts.tv_nsec = t % (UINT64) 1000000000;
363364      ts.tv_sec += t;
364365
365366      if (!event->signalled)
r1247r1248
379380            if (ret == 0)
380381               break;
381382            if ( ret != EINTR)
382               printf("Error %d while waiting for pthread_cond_timedwait\n", ret);
383            {
384               printf("Error %d while waiting for pthread_cond_timedwait: %d - %s\n", ret, (int) t, strerror(ret));
385            }
386               
383387         } while (TRUE);
384388      }
385389   }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team