Changeset 15433

Show
Ignore:
Timestamp:
09/06/2008 03:19:05 PM (3 months ago)
Author:
AlTheKiller
Message:

fixed: XBMCTex compile error under linux

Location:
branches/linuxport/XBMC/tools/XBMCTex
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/linuxport/XBMC/tools/XBMCTex/SurfaceSDL.cpp

    r15413 r15433  
    9393} 
    9494 
     95void CSurface::ClampToEdge() 
     96{ 
     97  // fix up the last row and column to simulate clamp_to_edge 
     98  if (!m_info.width || !m_info.height == 0) 
     99    return; // invalid texture 
     100  CSurfaceRect rect; 
     101  if (Lock(&rect)) 
     102  { 
     103    for (unsigned int y = 0; y < m_info.height; y++) 
     104    { 
     105      BYTE *src = rect.pBits + y * rect.Pitch; 
     106      for (unsigned int x = m_info.width; x < m_width; x++) 
     107        memcpy(src + x*m_bpp, src + (m_info.width - 1)*m_bpp, m_bpp); 
     108    } 
     109    BYTE *src = rect.pBits + (m_info.height - 1) * rect.Pitch; 
     110    for (unsigned int y = m_info.height; y < m_height; y++) 
     111    { 
     112      BYTE *dest = rect.pBits + y * rect.Pitch; 
     113      memcpy(dest, src, rect.Pitch); 
     114    } 
     115    Unlock(); 
     116  } 
     117} 
     118 
    95119bool CSurface::Lock(CSurfaceRect *rect) 
    96120{ 
  • branches/linuxport/XBMC/tools/XBMCTex/SurfaceSDL.h

    r14120 r15433  
    5656private: 
    5757  void Clear(); 
     58  void ClampToEdge(); 
    5859  friend class CGraphicsDevice; 
    5960  SDL_Surface *m_surface;