From 1eb88d4f5d5cb05d62be1d4a0c88c7399f7c0de0 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sat, 3 Feb 2018 00:55:26 +0800 Subject: Added the GL 3.2+ port. Fixed poor performance of the truetype renderer. (Partially) Fixed texture locking. Minor addition and fixes to the math library. --- smelt/sdl/CxImage/ximaska.cpp | 126 ------------------------------------------ 1 file changed, 126 deletions(-) delete mode 100644 smelt/sdl/CxImage/ximaska.cpp (limited to 'smelt/sdl/CxImage/ximaska.cpp') diff --git a/smelt/sdl/CxImage/ximaska.cpp b/smelt/sdl/CxImage/ximaska.cpp deleted file mode 100644 index 6f1b1c2..0000000 --- a/smelt/sdl/CxImage/ximaska.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* - * File: ximaska.cpp - * Purpose: Platform Independent SKA Image Class Loader and Writer - * 25/Sep/2007 Davide Pizzolato - www.xdp.it - * CxImage version 7.0.0 31/Dec/2010 - */ - -#include "ximaska.h" - -#if CXIMAGE_SUPPORT_SKA - -//////////////////////////////////////////////////////////////////////////////// -#if CXIMAGE_SUPPORT_DECODE -//////////////////////////////////////////////////////////////////////////////// -bool CxImageSKA::Decode(CxFile *hFile) -{ - if (hFile==NULL) - return false; - - // read the header - SKAHEADER ska_header; - hFile->Read(&ska_header,sizeof(SKAHEADER),1); - - ska_header.Width = m_ntohs(ska_header.Width); - ska_header.Height = m_ntohs(ska_header.Height); - ska_header.dwUnknown = m_ntohl(ska_header.dwUnknown); - - // check header - if (ska_header.dwUnknown != 0x01000000 || - ska_header.Width > 0x7FFF || ska_header.Height > 0x7FFF || - ska_header.BppExp != 3) - return false; - - if (info.nEscape == -1){ - head.biWidth = ska_header.Width ; - head.biHeight= ska_header.Height; - info.dwType = CXIMAGE_FORMAT_SKA; - return true; - } - - int32_t bpp = 1<Read(ppal,nColors*sizeof(rgb_color),1); - SetPalette(ppal,nColors); - free(ppal); - - //read the image - hFile->Read(GetBits(),ska_header.Width*ska_header.Height,1); - - //reorder rows - if (GetEffWidth() != ska_header.Width){ - uint8_t *src,*dst; - src = GetBits() + ska_header.Width*(ska_header.Height-1); - dst = GetBits(ska_header.Height-1); - for(int32_t y=0;y 8) { - strcpy(info.szLastError,"SKA Images must be 8 bit or less"); - return false; - } - - SKAHEADER ska_header; - - ska_header.Width = (uint16_t)GetWidth(); - ska_header.Height = (uint16_t)GetHeight(); - ska_header.BppExp = 3; - ska_header.dwUnknown = 0x01000000; - - ska_header.Width = m_ntohs(ska_header.Width); - ska_header.Height = m_ntohs(ska_header.Height); - ska_header.dwUnknown = m_ntohl(ska_header.dwUnknown); - - hFile->Write(&ska_header,sizeof(SKAHEADER),1); - - ska_header.Width = m_ntohs(ska_header.Width); - ska_header.Height = m_ntohs(ska_header.Height); - ska_header.dwUnknown = m_ntohl(ska_header.dwUnknown); - - if (head.biBitCount<8) IncreaseBpp(8); - - rgb_color pal[256]; - for(int32_t idx=0; idx<256; idx++){ - GetPaletteColor(idx,&(pal[idx].r),&(pal[idx].g),&(pal[idx].b)); - } - - hFile->Write(pal,256*sizeof(rgb_color),1); - - uint8_t* src = GetBits(ska_header.Height-1); - for(int32_t y=0;yWrite(src,ska_header.Width,1); - src -= GetEffWidth(); - } - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -#endif // CXIMAGE_SUPPORT_ENCODE -//////////////////////////////////////////////////////////////////////////////// -#endif // CXIMAGE_SUPPORT_SKA - -- cgit v1.2.3