Previous 199869 Revisions Next

r28766 Thursday 20th March, 2014 at 21:30:40 UTC by David Haywood
fix crash with -gamma (nw)

I think this is correct.. or at least more correct than it was, there's no way the existing code could work.
[src/emu]render.c

trunk/src/emu/render.c
r28765r28766
559559         // otherwise, ensure we have memory allocated and compute the adjusted result ourself
560560         numentries = m_bitmap->palette()->num_colors() * m_bitmap->palette()->num_groups();
561561         m_bcglookup.resize(numentries);
562
563         adjusted = m_bitmap->palette()->entry_list_adjusted();
562564         for (int index = 0; index < numentries; index++)
563565         {
564566            UINT8 r = container.apply_brightness_contrast_gamma(adjusted[index].r());
r28765r28766
566568            UINT8 b = container.apply_brightness_contrast_gamma(adjusted[index].b());
567569            m_bcglookup[index] = rgb_t(adjusted[index].a(), r, g, b);
568570         }
571
569572         return m_bcglookup;
570573
571574      case TEXFORMAT_RGB32:
r28765r28766
751754   {
752755      case TEXFORMAT_PALETTE16:
753756      case TEXFORMAT_PALETTEA16:
754         return (palette != NULL && palette == &m_palclient->palette()) ? m_bcglookup : NULL;
757         return (m_palclient != NULL && palette != NULL && palette == &m_palclient->palette()) ? m_bcglookup : NULL;
755758
756759      case TEXFORMAT_RGB32:
757760      case TEXFORMAT_ARGB32:

Previous 199869 Revisions Next


© 1997-2024 The MAME Team