From a075516b2ad38d0a96748b7570ea90f7dda57ff0 Mon Sep 17 00:00:00 2001 From: Khral Steelforge Date: Tue, 7 Jan 2014 16:59:11 +0700 Subject: [PATCH] Completely remove AtexAsm. Signed-off-by: Khral Steelforge --- prj/Gw2Browser.vcxproj | 1 - prj/Gw2Browser.vcxproj.filters | 3 --- src/Imported/AtexAsm.h | 20 -------------------- src/Readers/ImageReader.cpp | 33 ++++++++++----------------------- 4 files changed, 10 insertions(+), 47 deletions(-) delete mode 100644 src/Imported/AtexAsm.h diff --git a/prj/Gw2Browser.vcxproj b/prj/Gw2Browser.vcxproj index 753a6b5c..ef4f819b 100644 --- a/prj/Gw2Browser.vcxproj +++ b/prj/Gw2Browser.vcxproj @@ -32,7 +32,6 @@ - diff --git a/prj/Gw2Browser.vcxproj.filters b/prj/Gw2Browser.vcxproj.filters index f358c738..b007634d 100644 --- a/prj/Gw2Browser.vcxproj.filters +++ b/prj/Gw2Browser.vcxproj.filters @@ -180,9 +180,6 @@ Header Files - - Header Files\Imported - diff --git a/src/Imported/AtexAsm.h b/src/Imported/AtexAsm.h deleted file mode 100644 index 91e9bd6c..00000000 --- a/src/Imported/AtexAsm.h +++ /dev/null @@ -1,20 +0,0 @@ -// File: AtexAsm.h -// Author: Xtridence -// Origin: http://forum.xentax.com/viewtopic.php?f=10&t=8499&start=120 - -#pragma once - -#ifndef IMPORTED_ATEXASM_H_INCLUDED -#define IMPORTED_ATEXASM_H_INCLUDED - -struct SImageDescriptor { - int xres, yres; - const unsigned char *Data; - int a; - int b; - unsigned char *image; - int imageformat; - int c; -}; - -#endif // IMPORTED_ATEXASM_H_INCLUDED diff --git a/src/Readers/ImageReader.cpp b/src/Readers/ImageReader.cpp index 03f1975e..8b581a97 100644 --- a/src/Readers/ImageReader.cpp +++ b/src/Readers/ImageReader.cpp @@ -4,8 +4,8 @@ */ /* -Copyright (C) 2012 Rhoot Copyright (C) 2014 Khral Steelforge +Copyright (C) 2012 Rhoot This file is part of Gw2Browser. @@ -26,11 +26,10 @@ along with this program. If not, see . #include "stdafx.h" #include -#include "Imported/AtexAsm.h" #include "ImageReader.h" #ifdef RGB -# undef RGB +#undef RGB #endif namespace gw2b { @@ -268,51 +267,39 @@ namespace gw2b { return false; } - // Create and init - ::SImageDescriptor descriptor; - descriptor.xres = atex->width; - descriptor.yres = atex->height; - descriptor.Data = m_data.GetPointer( ); - descriptor.imageformat = 0xf; - descriptor.a = m_data.GetSize( ); - descriptor.b = 6; - descriptor.c = 0; - // Init some fields - //auto data = reinterpret_cast( m_data.GetPointer( ) ); + auto data = reinterpret_cast( m_data.GetPointer( ) ); po_colors = nullptr; po_alphas = nullptr; // Allocate output auto output = allocate( atex->width * atex->height ); - descriptor.image = reinterpret_cast( output ); - // Fix me - uint32_t aOutBufferSize = 1024 * 1024 * 30; // We make the assumption that no file is bigger than 30 Mb + uint32_t outputBufferSize = 1024 * 1024 * 30; // We make the assumption that no file is bigger than 30 Mb // Uncompress switch ( atex->formatInteger ) { case FCC_DXT1: - gw2dt::compression::inflateTextureFileBuffer( m_data.GetSize( ), descriptor.Data, aOutBufferSize, descriptor.image ); + gw2dt::compression::inflateTextureFileBuffer( m_data.GetSize( ), data, outputBufferSize, reinterpret_cast( output ) ); this->processDXT1( output, atex->width, atex->height, po_colors, po_alphas ); break; case FCC_DXT2: case FCC_DXT3: case FCC_DXTN: - gw2dt::compression::inflateTextureFileBuffer( m_data.GetSize( ), descriptor.Data, aOutBufferSize, descriptor.image ); + gw2dt::compression::inflateTextureFileBuffer( m_data.GetSize( ), data, outputBufferSize, reinterpret_cast( output ) ); this->processDXT3( output, atex->width, atex->height, po_colors, po_alphas ); break; case FCC_DXT4: case FCC_DXT5: - gw2dt::compression::inflateTextureFileBuffer( m_data.GetSize( ), descriptor.Data, aOutBufferSize, descriptor.image ); + gw2dt::compression::inflateTextureFileBuffer( m_data.GetSize( ), data, outputBufferSize, reinterpret_cast( output ) ); this->processDXT5( output, atex->width, atex->height, po_colors, po_alphas ); break; case FCC_DXTA: - gw2dt::compression::inflateTextureFileBuffer( m_data.GetSize( ), descriptor.Data, aOutBufferSize, descriptor.image ); + gw2dt::compression::inflateTextureFileBuffer( m_data.GetSize( ), data, outputBufferSize, reinterpret_cast( output ) ); this->processDXTA( reinterpret_cast( output ), atex->width, atex->height, po_colors ); break; case FCC_DXTL: - gw2dt::compression::inflateTextureFileBuffer( m_data.GetSize( ), descriptor.Data, aOutBufferSize, descriptor.image ); + gw2dt::compression::inflateTextureFileBuffer( m_data.GetSize( ), data, outputBufferSize, reinterpret_cast( output ) ); this->processDXT5( output, atex->width, atex->height, po_colors, po_alphas ); for ( uint i = 0; i < ( static_cast( atex->width ) * static_cast( atex->height ) ); i++ ) { @@ -322,7 +309,7 @@ namespace gw2b { } break; case FCC_3DCX: - gw2dt::compression::inflateTextureFileBuffer( m_data.GetSize( ), descriptor.Data, aOutBufferSize, descriptor.image ); + gw2dt::compression::inflateTextureFileBuffer( m_data.GetSize( ), data, outputBufferSize, reinterpret_cast( output ) ); this->process3DCX( reinterpret_cast( output ), atex->width, atex->height, po_colors, po_alphas ); break; default: