Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
fa2d5b91
Commit
fa2d5b91
authored
Apr 09, 2017
by
Rémi Verschelde
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
squish: Update to upstream version 1.15
Also fix clang-format pre-commit hook to ignore thirdparty files.
parent
3fd10ff6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
9 deletions
+31
-9
pre-commit-clang-format
misc/hooks/pre-commit-clang-format
+5
-0
README.md
thirdparty/README.md
+1
-1
squish.cpp
thirdparty/squish/squish.cpp
+16
-8
squish.h
thirdparty/squish/squish.h
+9
-0
No files found.
misc/hooks/pre-commit-clang-format
View file @
fa2d5b91
...
...
@@ -82,6 +82,11 @@ $DELETE_OLD_PATCHES && rm -f /tmp/$prefix*.patch
# create one patch containing all changes to the files
git diff-index
--cached
--diff-filter
=
ACMR
--name-only
$against
--
|
while
read
file
;
do
# ignore thirdparty files
if
grep
-q
"thirdparty"
<<<
$file
;
then
continue
;
fi
# ignore file if we do check for file extensions and the file
# does not match any of the extensions specified in $FILE_EXTS
if
$PARSE_EXTS
&&
!
matches_extension
"
$file
"
;
then
...
...
thirdparty/README.md
View file @
fa2d5b91
...
...
@@ -204,7 +204,7 @@ Files extracted from upstream source:
## squish
-
Upstream: https://sourceforge.net/projects/libsquish
-
Version: 1.1
4
-
Version: 1.1
5
-
License: MIT
Files extracted from upstream source:
...
...
thirdparty/squish/squish.cpp
View file @
fa2d5b91
...
...
@@ -177,13 +177,17 @@ void CompressImage( u8 const* rgba, int width, int height, int pitch, void* bloc
// fix any bad flags
flags
=
FixFlags
(
flags
);
// initialise the block output
u8
*
targetBlock
=
reinterpret_cast
<
u8
*
>
(
blocks
);
int
bytesPerBlock
=
(
(
flags
&
(
kDxt1
|
kBc4
)
)
!=
0
)
?
8
:
16
;
// loop over blocks
#ifdef SQUISH_USE_OPENMP
# pragma omp parallel for
#endif
for
(
int
y
=
0
;
y
<
height
;
y
+=
4
)
{
// initialise the block output
u8
*
targetBlock
=
reinterpret_cast
<
u8
*
>
(
blocks
);
int
bytesPerBlock
=
(
(
flags
&
(
kDxt1
|
kBc4
)
)
!=
0
)
?
8
:
16
;
targetBlock
+=
(
(
y
/
4
)
*
(
(
width
+
3
)
/
4
)
)
*
bytesPerBlock
;
for
(
int
x
=
0
;
x
<
width
;
x
+=
4
)
{
// build the 4x4 block of pixels
...
...
@@ -232,13 +236,17 @@ void DecompressImage( u8* rgba, int width, int height, int pitch, void const* bl
// fix any bad flags
flags
=
FixFlags
(
flags
);
// initialise the block input
u8
const
*
sourceBlock
=
reinterpret_cast
<
u8
const
*
>
(
blocks
);
int
bytesPerBlock
=
(
(
flags
&
(
kDxt1
|
kBc4
)
)
!=
0
)
?
8
:
16
;
// loop over blocks
#ifdef SQUISH_USE_OPENMP
# pragma omp parallel for
#endif
for
(
int
y
=
0
;
y
<
height
;
y
+=
4
)
{
// initialise the block input
u8
const
*
sourceBlock
=
reinterpret_cast
<
u8
const
*
>
(
blocks
);
int
bytesPerBlock
=
(
(
flags
&
(
kDxt1
|
kBc4
)
)
!=
0
)
?
8
:
16
;
sourceBlock
+=
(
(
y
/
4
)
*
(
(
width
+
3
)
/
4
)
)
*
bytesPerBlock
;
for
(
int
x
=
0
;
x
<
width
;
x
+=
4
)
{
// decompress the block
...
...
thirdparty/squish/squish.h
View file @
fa2d5b91
...
...
@@ -239,6 +239,15 @@ int GetStorageRequirements( int width, int height, int flags );
allows for pixels outside the image to take arbitrary values. The function
squish::GetStorageRequirements can be called to compute the amount of memory
to allocate for the compressed output.
Note on compression quality: When compressing textures with
libsquish it is recommended to apply a gamma-correction
beforehand. This will reduce the blockiness in dark areas. The
level of necessary gamma-correction is platform dependent. For
example, a gamma correction with gamma = 0.5 before compression
and gamma = 2.0 after decompression yields good results on the
Windows platform but for other platforms like MacOS X a different
gamma value may be more suitable.
*/
void
CompressImage
(
u8
const
*
rgba
,
int
width
,
int
height
,
int
pitch
,
void
*
blocks
,
int
flags
,
float
*
metric
=
0
);
void
CompressImage
(
u8
const
*
rgba
,
int
width
,
int
height
,
void
*
blocks
,
int
flags
,
float
*
metric
=
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment