mirror of
https://github.com/yuzu-emu/FasTC.git
synced 2025-01-09 15:15:38 +00:00
Get rid of evil tabs once and forever (from cpp/h files)
This commit is contained in:
parent
af2318027b
commit
03a7934644
|
@ -771,7 +771,7 @@ double BC7CompressionModeSIMD::CompressCluster(const RGBAClusterSIMD &cluster, R
|
||||||
|
|
||||||
ClampEndpointsToGrid(p1, p2, bestPbitCombo);
|
ClampEndpointsToGrid(p1, p2, bestPbitCombo);
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
int pBitCombo = bestPbitCombo;
|
int pBitCombo = bestPbitCombo;
|
||||||
RGBAVectorSIMD tp1 = p1, tp2 = p2;
|
RGBAVectorSIMD tp1 = p1, tp2 = p2;
|
||||||
ClampEndpointsToGrid(tp1, tp2, pBitCombo);
|
ClampEndpointsToGrid(tp1, tp2, pBitCombo);
|
||||||
|
@ -779,7 +779,7 @@ double BC7CompressionModeSIMD::CompressCluster(const RGBAClusterSIMD &cluster, R
|
||||||
assert(p1 == tp1);
|
assert(p1 == tp1);
|
||||||
assert(p2 == tp2);
|
assert(p2 == tp2);
|
||||||
assert(pBitCombo == bestPbitCombo);
|
assert(pBitCombo == bestPbitCombo);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
assert(bestPbitCombo >= 0);
|
assert(bestPbitCombo >= 0);
|
||||||
|
|
||||||
|
@ -1024,10 +1024,8 @@ namespace BC7C
|
||||||
|
|
||||||
BC7CompressionModeSIMD::MaxAnnealingIterations = GetQualityLevel();
|
BC7CompressionModeSIMD::MaxAnnealingIterations = GetQualityLevel();
|
||||||
|
|
||||||
for(int j = 0; j < height; j += 4)
|
for(int j = 0; j < height; j += 4) {
|
||||||
{
|
for(int i = 0; i < width; i += 4) {
|
||||||
for(int i = 0; i < width; i += 4)
|
|
||||||
{
|
|
||||||
CompressBC7Block((const uint32 *)inBuf, outBuf);
|
CompressBC7Block((const uint32 *)inBuf, outBuf);
|
||||||
|
|
||||||
outBuf += 16;
|
outBuf += 16;
|
||||||
|
@ -1217,8 +1215,7 @@ namespace BC7C
|
||||||
int bestShapeIdx[2] = { -1, -1 };
|
int bestShapeIdx[2] = { -1, -1 };
|
||||||
RGBAClusterSIMD bestClusters[2][3];
|
RGBAClusterSIMD bestClusters[2][3];
|
||||||
|
|
||||||
for(int i = 0; i < kNumShapes2; i++)
|
for(int i = 0; i < kNumShapes2; i++) {
|
||||||
{
|
|
||||||
RGBAClusterSIMD clusters[2];
|
RGBAClusterSIMD clusters[2];
|
||||||
PopulateTwoClustersForShape(blockCluster, i, clusters);
|
PopulateTwoClustersForShape(blockCluster, i, clusters);
|
||||||
|
|
||||||
|
|
|
@ -588,10 +588,9 @@ uint32 GetPrincipalAxis(uint32 nPts, const RGBAVector *pts, RGBADir &axis, doubl
|
||||||
if(uptsIdx == 1) {
|
if(uptsIdx == 1) {
|
||||||
axis.r = axis.g = axis.b = axis.a = 0.0f;
|
axis.r = axis.g = axis.b = axis.a = 0.0f;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
// Collinear?
|
|
||||||
else {
|
|
||||||
|
|
||||||
|
// Collinear?
|
||||||
|
} else {
|
||||||
RGBADir dir (upts[1] - upts[0]);
|
RGBADir dir (upts[1] - upts[0]);
|
||||||
bool collinear = true;
|
bool collinear = true;
|
||||||
for(uint32 i = 2; i < nPts; i++) {
|
for(uint32 i = 2; i < nPts; i++) {
|
||||||
|
|
|
@ -75,11 +75,11 @@ CompressedImage::CompressedImage(
|
||||||
const ECompressionFormat format,
|
const ECompressionFormat format,
|
||||||
const unsigned char *data
|
const unsigned char *data
|
||||||
)
|
)
|
||||||
: m_Width(width)
|
: m_Width(width)
|
||||||
, m_Height(height)
|
, m_Height(height)
|
||||||
, m_Format(format)
|
, m_Format(format)
|
||||||
, m_Data(0)
|
, m_Data(0)
|
||||||
, m_DataSz(0)
|
, m_DataSz(0)
|
||||||
{
|
{
|
||||||
InitData(data);
|
InitData(data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,8 +81,7 @@ void WorkerThread::operator()() {
|
||||||
bool quitFlag = false;
|
bool quitFlag = false;
|
||||||
while(!quitFlag) {
|
while(!quitFlag) {
|
||||||
|
|
||||||
switch(m_Parent->AcceptThreadData(m_ThreadIdx))
|
switch(m_Parent->AcceptThreadData(m_ThreadIdx)) {
|
||||||
{
|
|
||||||
|
|
||||||
case eAction_Quit:
|
case eAction_Quit:
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,3 +1,55 @@
|
||||||
|
/* FasTC
|
||||||
|
* Copyright (c) 2012 University of North Carolina at Chapel Hill.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this software and its
|
||||||
|
* documentation for educational, research, and non-profit purposes, without
|
||||||
|
* fee, and without a written agreement is hereby granted, provided that the
|
||||||
|
* above copyright notice, this paragraph, and the following four paragraphs
|
||||||
|
* appear in all copies.
|
||||||
|
*
|
||||||
|
* Permission to incorporate this software into commercial products may be
|
||||||
|
* obtained by contacting the authors or the Office of Technology Development
|
||||||
|
* at the University of North Carolina at Chapel Hill <otd@unc.edu>.
|
||||||
|
*
|
||||||
|
* This software program and documentation are copyrighted by the University of
|
||||||
|
* North Carolina at Chapel Hill. The software program and documentation are
|
||||||
|
* supplied "as is," without any accompanying services from the University of
|
||||||
|
* North Carolina at Chapel Hill or the authors. The University of North
|
||||||
|
* Carolina at Chapel Hill and the authors do not warrant that the operation of
|
||||||
|
* the program will be uninterrupted or error-free. The end-user understands
|
||||||
|
* that the program was developed for research purposes and is advised not to
|
||||||
|
* rely exclusively on the program for any reason.
|
||||||
|
*
|
||||||
|
* IN NO EVENT SHALL THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL OR THE
|
||||||
|
* AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL,
|
||||||
|
* OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF
|
||||||
|
* THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF NORTH CAROLINA
|
||||||
|
* AT CHAPEL HILL OR THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||||
|
* DAMAGE.
|
||||||
|
*
|
||||||
|
* THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL AND THE AUTHORS SPECIFICALLY
|
||||||
|
* DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY
|
||||||
|
* STATUTORY WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE PROVIDED HEREUNDER IS ON
|
||||||
|
* AN "AS IS" BASIS, AND THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL AND
|
||||||
|
* THE AUTHORS HAVE NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
|
||||||
|
* ENHANCEMENTS, OR MODIFICATIONS.
|
||||||
|
*
|
||||||
|
* Please send all BUG REPORTS to <pavel@cs.unc.edu>.
|
||||||
|
*
|
||||||
|
* The authors may be contacted via:
|
||||||
|
*
|
||||||
|
* Pavel Krajcevski
|
||||||
|
* Dept of Computer Science
|
||||||
|
* 201 S Columbia St
|
||||||
|
* Frederick P. Brooks, Jr. Computer Science Bldg
|
||||||
|
* Chapel Hill, NC 27599-3175
|
||||||
|
* USA
|
||||||
|
*
|
||||||
|
* <http://gamma.cs.unc.edu/FasTC/>
|
||||||
|
*/
|
||||||
|
|
||||||
#include "FileStream.h"
|
#include "FileStream.h"
|
||||||
|
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
@ -145,8 +197,7 @@ FileStream::~FileStream() {
|
||||||
|
|
||||||
int32 FileStream::Read(uint8 *buf, uint32 bufSz) {
|
int32 FileStream::Read(uint8 *buf, uint32 bufSz) {
|
||||||
|
|
||||||
if(
|
if(m_Mode == eFileMode_Write ||
|
||||||
m_Mode == eFileMode_Write ||
|
|
||||||
m_Mode == eFileMode_WriteBinary ||
|
m_Mode == eFileMode_WriteBinary ||
|
||||||
m_Mode == eFileMode_WriteAppend ||
|
m_Mode == eFileMode_WriteAppend ||
|
||||||
m_Mode == eFileMode_WriteBinaryAppend
|
m_Mode == eFileMode_WriteBinaryAppend
|
||||||
|
|
|
@ -54,10 +54,8 @@ static void ReportError(const char *msg) {
|
||||||
|
|
||||||
class PNGStreamReader {
|
class PNGStreamReader {
|
||||||
public:
|
public:
|
||||||
static void ReadDataFromStream(
|
static void ReadDataFromStream(png_structp png_ptr,
|
||||||
png_structp png_ptr,
|
png_bytep outBytes, png_size_t byteCountToRead
|
||||||
png_bytep outBytes,
|
|
||||||
png_size_t byteCountToRead
|
|
||||||
) {
|
) {
|
||||||
png_voidp io_ptr = png_get_io_ptr( png_ptr );
|
png_voidp io_ptr = png_get_io_ptr( png_ptr );
|
||||||
if( io_ptr == NULL ) {
|
if( io_ptr == NULL ) {
|
||||||
|
|
Loading…
Reference in a new issue