Skip to content
This repository was archived by the owner on Dec 10, 2022. It is now read-only.

Commit 68807e6

Browse files
committed
- remove libsquish and glm
1 parent 206244c commit 68807e6

File tree

5 files changed

+1
-63
lines changed

5 files changed

+1
-63
lines changed

CMakeLists.txt

-10
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,10 @@ set(PHYSFS_BUILD_SHARED OFF)
1010

1111
set(CMAKE_CXX_STANDARD 14)
1212

13-
# Mute annoying MSVC-Warnings
14-
if(MSVC)
15-
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
16-
add_definitions(-DNOMINMAX)
17-
endif()
18-
1913
# 3rd-party dependencies
20-
add_subdirectory(lib/libsquish)
21-
2214
set(PHYSFS_BUILD_TEST OFF CACHE STRING "" FORCE)
2315
add_subdirectory(lib/physfs)
2416

25-
include_directories(lib/glm/glm)
26-
include_directories(lib/libsquish)
2717
include_directories(lib/physfs/src)
2818
include_directories(.)
2919

lib/libsquish

Submodule libsquish deleted from f5e44a3

zenload/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ file(GLOB SRC
88

99

1010
add_library(zenload STATIC ${SRC})
11-
target_link_libraries(zenload utils vdfs squish)
11+
target_link_libraries(zenload utils vdfs)
1212
set_target_properties(zenload PROPERTIES LINKER_LANGUAGE C)
1313
target_include_directories(zenload PUBLIC ..)

zenload/ztex2dds.cpp

-46
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <assert.h>
1010
#include <inttypes.h>
1111
#include <math.h>
12-
#include <squish.h>
1312
#include <string.h>
1413
#include "utils/logger.h"
1514

@@ -468,50 +467,5 @@ namespace ZenLoad
468467

469468
return desc;
470469
}
471-
472-
/**
473-
* @brief Convert dds to RGBA8
474-
*/
475-
void convertDDSToRGBA8(const std::vector<uint8_t>& ddsData, std::vector<uint8_t>& rgba8Data, int mip)
476-
{
477-
size_t seek = 0;
478-
seek += sizeof(uint32_t); // Skip magic number
479-
const DDSURFACEDESC2* desc = reinterpret_cast<const DDSURFACEDESC2*>(&ddsData[seek]);
480-
seek += sizeof(DDSURFACEDESC2);
481-
482-
mip = std::min((int)mip, (int)desc->dwMipMapCount);
483-
484-
DXTLevel dxtLevel = getDXTLevelFromDDS(ddsData);
485-
int squishDxtLevel;
486-
switch (dxtLevel)
487-
{
488-
case DXTLevel::DXT1:
489-
squishDxtLevel = squish::kDxt1;
490-
break;
491-
492-
case DXTLevel::DXT3:
493-
squishDxtLevel = squish::kDxt3;
494-
break;
495-
496-
case DXTLevel::DXT5:
497-
squishDxtLevel = squish::kDxt5;
498-
break;
499-
500-
case DXTLevel::Unknown:
501-
assert(false);
502-
return;
503-
}
504-
505-
for (int i = 0; i < mip; i++)
506-
{
507-
seek += ComputeSizeInBytes(i, desc->dwWidth, desc->dwHeight, squishDxtLevel == squish::kDxt1);
508-
}
509-
510-
int px = (int)std::max(1.0f, (float)floor(desc->dwWidth / pow(2.0f, mip)));
511-
int py = (int)std::max(1.0f, (float)floor(desc->dwHeight / pow(2.0f, mip)));
512-
rgba8Data.resize(px * py * sizeof(uint32_t));
513-
514-
squish::DecompressImage(rgba8Data.data(), px, py, &ddsData[seek], squishDxtLevel);
515-
}
516470
} // namespace ZenLoad
517471
/* THE END */

zenload/ztex2dds.h

-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ namespace ZenLoad
1111
*/
1212
int convertZTEX2DDS(const std::vector<uint8_t>& ztexData, std::vector<uint8_t>& ddsData, bool optionForceARGB = false, int* pOutWidth = nullptr, int* pOutHeight = nullptr);
1313

14-
/**
15-
* @brief Convert dds to RGBA8
16-
*/
17-
void convertDDSToRGBA8(const std::vector<uint8_t>& ddsData, std::vector<uint8_t>& rgba8Data, int mip = 0);
18-
1914
/**
2015
* @return Total offset (including header) of where the given mip-level starts inside ddsData
2116
*/

0 commit comments

Comments
 (0)