Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
1c9ddbc
vtfpp: change maximum mip count on pc to the same algorithm used for …
craftablescience Oct 23, 2025
4700b97
vtfpp: enable non-po2 textures to have mips to 1x1, compressed textur…
craftablescience Oct 23, 2025
a3577c9
vtfpp: document ImageFormats.h
craftablescience Oct 23, 2025
109d06e
vtfpp: add accessor methods to get unpadded width/height
craftablescience Oct 24, 2025
be07953
vtfpp: minor fix for the fix for pc -> xbox conversion
craftablescience Oct 29, 2025
3dc2c55
vtfpp: minor code cleanup
craftablescience Nov 1, 2025
f3d8855
kvpp: add creation from string literal operators
craftablescience Nov 1, 2025
68d387e
cmake: update homepage url
craftablescience Nov 2, 2025
c18bc01
bsppp: use BufferStream::pad utility method
craftablescience Nov 2, 2025
1faece4
sndpp: update future plans
craftablescience Nov 2, 2025
7de2b2a
vtfpp: fix VTF::computeThumbnail for XBOX platform
craftablescience Nov 2, 2025
ba9f5ef
vtfpp: fix VTF::setFormat and VTF::setImage trying to resize dimensio…
craftablescience Nov 2, 2025
e3aa089
vtfpp: cubemaps have 6 faces, not 5, fortunately this codepath seems …
craftablescience Nov 2, 2025
37f7b0c
vtfpp: fix hopefully last bug where XBOX platform was assumed to have…
craftablescience Nov 2, 2025
1360775
vtfpp: create ImageConversion::padImageData
craftablescience Nov 2, 2025
8136242
vtfpp: pad image data to multiple of 4 dimensions if compressing
craftablescience Nov 2, 2025
627939a
vtfpp: crop image data if it has padding after decompression (also fi…
craftablescience Nov 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.28 FATAL_ERROR)
# Create project
project(sourcepp
DESCRIPTION "Several modern C++20 libraries for sanely parsing Valve formats."
HOMEPAGE_URL "https://craftablescience.info/sourcepp")
HOMEPAGE_URL "https://sourcepp.org")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Expand Down
2 changes: 2 additions & 0 deletions FUTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@
- Make something to construct StudioModel objects from a given model file like obj/glTF?
- Parse animations/sequences
- `sndpp`
- HL2X XWV read/write support
- WAV write support
- XWV write support
- Conversion support between all formats
- `toolpp`
- Perhaps add the ability to parse TeamSpen's additions to the FGD format?
- `vpkpp`
Expand Down
12 changes: 12 additions & 0 deletions include/kvpp/KV1.h
Original file line number Diff line number Diff line change
Expand Up @@ -431,4 +431,16 @@ class KV1Writer : public KV1ElementWritable<S> {
bool useEscapeSequences;
};

namespace literals {

inline KV1<> operator""_kv1(const char* str, const std::size_t len) {
return KV1{std::string_view{str, len}};
}

inline KV1Writer<> operator""_kv1w(const char* str, const std::size_t len) {
return KV1Writer{std::string_view{str, len}};
}

} // namespace literals

} // namespace kvpp
1 change: 0 additions & 1 deletion include/sndpp/XWV.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once

#include <array>
#include <cstddef>
#include <memory>
#include <span>
Expand Down
3 changes: 3 additions & 0 deletions include/vtfpp/ImageConversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,9 @@ void setResizedDims(uint16_t& width, ResizeMethod widthResize, uint16_t& height,
/// Crops the given image to the new dimensions. If the image format is compressed it will be converted to its container format before the crop, and converted back before returning
[[nodiscard]] std::vector<std::byte> cropImageData(std::span<const std::byte> imageData, ImageFormat format, uint16_t width, uint16_t newWidth, uint16_t xOffset, uint16_t height, uint16_t newHeight, uint16_t yOffset);

/// Pad the given image with pixels that are the same color as the edge. Padding is applied to the right and bottom of the image.
[[nodiscard]] std::vector<std::byte> padImageData(std::span<const std::byte> imageData, ImageFormat format, uint16_t width, uint16_t widthPad, uint16_t height, uint16_t heightPad);

/// Perform gamma correction on the given image data. Will not perform gamma correction if the input image format is large, console, P8, A8, UV88, UVLX8888, or UVWQ8888
[[nodiscard]] std::vector<std::byte> gammaCorrectImageData(std::span<const std::byte> imageData, ImageFormat format, uint16_t width, uint16_t height, float gamma);

Expand Down
Loading