5 Commits

Author SHA1 Message Date
Ethan Lee 391148415c Network: Update to latest Steamworks SDK ABI.
This is mostly to support AArch64.
2026-07-15 10:12:36 -04:00
Ethan Lee 05a5abbfbd CMake: Rework Linux RPATH generation.
This is mostly to fix the AArch64 rpath. i686 will be different after this
change, but I haven't been shipping that architecture for a while now...

Also, took out BIN_LIBROOT which wasn't doing anything, woops!
2026-07-15 10:05:51 -04:00
NyakoFox 8c70c9eb97 Set id and loose_extra fields no matter what
The PR #1278 seems to have introduced a segfault. When an empty music
track is found, it skips past `id` (and `loose_extra`) being set.
Functions which use `id` expect a string, not NULL, causing a crash
whenever `isextra` is called, which happens to be every time the
`music` or `play` commands are invoked.

This fix simply moves the setting of these variables upwards, BEFORE
the valid check, to make sure they're always set.
2026-05-14 18:15:43 -04:00
Dav999 85dae94d2e Avoid compiler warning about signedness mismatch
This warning kept appearing for me:

Script.cpp:350:35: warning: comparison of integer expressions of
different signedness: ‘int’ and
‘std::__cxx11::basic_string<char>::size_type’
{aka ‘long unsigned int’} [-Wsign-compare]

  350 |                 for (int i = 0; i < words[1].size(); i++)
      |                                 ~~^~~~~~~~~~~~~~~~~

So I just made it a size_t instead.
2026-05-14 06:10:52 -04:00
Dav999 08aa7c9087 Remove nuisance Vorbis errors on blank music slots
When vvvvvvmusic.vvv files contain blank slots before the last valid
song, the following error message would be output for all of them:

[ERROR] Unable to create Vorbis handle, error 30

Now, this is very common: many levels, for example, ship a music file
where songs start at slot 16, or alternatively they used slots 0-15 but
didn't need every slot. Or IDs are skipped so that certain songs are
on their own page in the music editor. Either way, I've seen bursts of
this message appear in my console a lot when loading levels lol, so it
became time this was silenced by not bothering to load a <=1 byte song,
and giving a (silenced by default) debug message in that case instead.

(It checks for <= 1 byte, because in all these cases, the empty slots
have a single null byte in them. I looked up why that is again, and it
is because, in 2019, "Rumor goes that 0-byte tracks actually mess
things up in VVVVVV". We could probably verify if that's the case now,
but music files have been made this way for ages, and it's pretty clear
a 1-byte song is not usable.)
2026-05-14 06:10:52 -04:00
4 changed files with 31 additions and 18 deletions
+8 -8
View File
@@ -51,18 +51,18 @@ endif()
# RPATH
if(NOT WIN32)
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(BIN_LIBROOT "Frameworks")
set(BIN_RPATH "@executable_path/Frameworks")
elseif(APPLE)
set(BIN_LIBROOT "osx")
set(BIN_RPATH "@executable_path/osx")
elseif(CMAKE_SIZEOF_VOID_P MATCHES "8")
set(BIN_LIBROOT "lib64")
set(BIN_RPATH "\$ORIGIN/lib64")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--disable-new-dtags")
else()
set(BIN_LIBROOT "lib")
set(BIN_RPATH "\$ORIGIN/lib")
SET(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} "-Wl,--disable-new-dtags")
if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
# Naming quirk for backward compatibility
SET(BIN_RPATH "\$ORIGIN/lib64")
else()
SET(BIN_RPATH "\$ORIGIN/lib${CMAKE_SYSTEM_PROCESSOR}")
endif()
endif()
set(CMAKE_SKIP_BUILD_RPATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
+10 -3
View File
@@ -381,15 +381,22 @@ public:
MusicTrack(SDL_RWops *rw, const char* _id, bool _loose_extra)
{
SDL_zerop(this);
id = SDL_strdup(_id);
loose_extra = _loose_extra;
if (rw->size(rw) <= 1)
{
// Don't bother
vlog_debug("Skipping empty music track");
goto end;
}
read_buf = (Uint8*) SDL_malloc(rw->size(rw));
SDL_RWread(rw, read_buf, rw->size(rw), 1);
int err;
stb_vorbis_info vorbis_info;
stb_vorbis_comment vorbis_comment;
id = SDL_strdup(_id);
loose_extra = _loose_extra;
vorbis = stb_vorbis_open_memory(read_buf, rw->size(rw), &err, NULL);
if (vorbis == NULL)
{
+1 -1
View File
@@ -347,7 +347,7 @@ void scriptclass::run(void)
int current = 0;
// Crawl through the string
for (int i = 0; i < words[1].size(); i++)
for (size_t i = 0; i < words[1].size(); i++)
{
// If the current character is a number, add it to the current version part
if (words[1][i] >= '0' && words[1][i] <= '9')
+12 -6
View File
@@ -10,8 +10,8 @@
/* Steamworks interface versions */
#define VVVVVV_STEAMCLIENT "SteamClient017"
#define VVVVVV_STEAMUSERSTATS "STEAMUSERSTATS_INTERFACE_VERSION011"
#define VVVVVV_STEAMCLIENT "SteamClient023"
#define VVVVVV_STEAMUSERSTATS "STEAMUSERSTATS_INTERFACE_VERSION013"
#define VVVVVV_STEAMSCREENSHOTS "STEAMSCREENSHOTS_INTERFACE_VERSION003"
/* Shared object file name */
@@ -45,8 +45,16 @@ struct SteamAPICallCompleted_t
uint32_t m_cubParam;
};
typedef enum ESteamAPIInitResult
{
k_ESteamAPIInitResult_OK = 0,
k_ESteamAPIInitResult_FailedGeneric = 1,
k_ESteamAPIInitResult_NoSteamClient = 2,
k_ESteamAPIInitResult_VersionMismatch = 3,
} ESteamAPIInitResult;
#define FUNC_LIST \
FOREACH_FUNC(uint8_t, SteamAPI_Init, (void)) \
FOREACH_FUNC(ESteamAPIInitResult, SteamAPI_InitFlat, (void*)) \
FOREACH_FUNC(void, SteamAPI_Shutdown, (void)) \
FOREACH_FUNC(void, SteamAPI_RunCallbacks, (void)) \
FOREACH_FUNC(struct ISteamClient*, SteamInternal_CreateInterface, (const char*)) \
@@ -58,7 +66,6 @@ struct SteamAPICallCompleted_t
int32_t, \
const char* \
)) \
FOREACH_FUNC(uint8_t, SteamAPI_ISteamUserStats_RequestCurrentStats, (struct ISteamUserStats*)) \
FOREACH_FUNC(uint8_t, SteamAPI_ISteamUserStats_StoreStats, (struct ISteamUserStats*)) \
FOREACH_FUNC(uint8_t, SteamAPI_ISteamUserStats_SetAchievement, ( \
struct ISteamUserStats*, \
@@ -177,7 +184,7 @@ int32_t STEAM_init(void)
FUNC_LIST
#undef FOREACH_FUNC
if (!SteamAPI_Init())
if (SteamAPI_InitFlat(NULL) != k_ESteamAPIInitResult_OK)
{
vlog_error("Steamworks not initialized!");
ClearPointers();
@@ -207,7 +214,6 @@ int32_t STEAM_init(void)
ClearPointers();
return 0;
}
SteamAPI_ISteamUserStats_RequestCurrentStats(steamUserStats);
steamScreenshots = SteamAPI_ISteamClient_GetISteamScreenshots(
steamClient,
steamUser,