1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00

Axe NETWORK_[set/get]AchievementProgress()

These are unused.

Ethan originally added them in case Terry wanted achievement
percentages. But he didn't add them, and I don't think the achievements
are changing anytime soon, so it's safe to remove this dead code.
This commit is contained in:
Misa 2021-09-19 21:49:54 -07:00
parent e13d3af2eb
commit 4eb7f973ef
3 changed files with 2 additions and 80 deletions

View file

@ -23,13 +23,4 @@ void GOG_unlockAchievement(const char *name)
{
}
int32_t GOG_getAchievementProgress(const char *name)
{
return 0;
}
void GOG_setAchievementProgress(const char *name, int32_t stat)
{
}
#endif /* MAKEANDPLAY */

View file

@ -28,9 +28,7 @@
int32_t name##_init(void); \
void name##_shutdown(void); \
void name##_update(void); \
void name##_unlockAchievement(const char *name); \
int32_t name##_getAchievementProgress(const char *name); \
void name##_setAchievementProgress(const char *name, int32_t stat);
void name##_unlockAchievement(const char *name);
#ifdef STEAM_NETWORK
DECLARE_BACKEND(STEAM)
#endif
@ -46,8 +44,6 @@ typedef struct NetworkBackend
void (*Shutdown)(void);
void (*Update)(void);
void (*UnlockAchievement)(const char*);
int32_t (*GetAchievementProgress)(const char*);
void (*SetAchievementProgress)(const char*, int32_t);
} NetworkBackend;
#if NUM_BACKENDS > 0
@ -61,9 +57,7 @@ int NETWORK_init(void)
backends[index].Init = name##_init; \
backends[index].Shutdown = name##_shutdown; \
backends[index].Update = name##_update; \
backends[index].UnlockAchievement = name##_unlockAchievement; \
backends[index].GetAchievementProgress = name##_getAchievementProgress; \
backends[index].SetAchievementProgress = name##_setAchievementProgress;
backends[index].UnlockAchievement = name##_unlockAchievement;
#ifdef STEAM_NETWORK
ASSIGN_BACKEND(STEAM, 0)
#endif
@ -120,39 +114,3 @@ void NETWORK_unlockAchievement(const char *name)
UNUSED(name);
#endif
}
int32_t NETWORK_getAchievementProgress(const char *name)
{
/* The highest stat gets priority, will eventually pass to the others */
int32_t max = 0;
#if NUM_BACKENDS > 0
int32_t i, stat;
for (i = 0; i < NUM_BACKENDS; i += 1)
if (backends[i].IsInit)
{
stat = backends[i].GetAchievementProgress(name);
if (stat > max)
{
max = stat;
}
}
#else
UNUSED(name);
#endif
return max;
}
void NETWORK_setAchievementProgress(const char *name, int32_t stat)
{
#if NUM_BACKENDS > 0
int32_t i;
for (i = 0; i < NUM_BACKENDS; i += 1)
if (backends[i].IsInit)
{
backends[i].SetAchievementProgress(name, stat);
}
#else
UNUSED(name);
UNUSED(stat);
#endif
}

View file

@ -168,31 +168,4 @@ void STEAM_unlockAchievement(const char *name)
}
}
int32_t STEAM_getAchievementProgress(const char *name)
{
int32_t result = -1;
if (libHandle)
{
SteamAPI_ISteamUserStats_GetStat(
steamUserStats,
name,
&result
);
}
return result;
}
void STEAM_setAchievementProgress(const char *name, int32_t stat)
{
if (libHandle)
{
SteamAPI_ISteamUserStats_SetStat(
steamUserStats,
name,
stat
);
SteamAPI_ISteamUserStats_StoreStats(steamUserStats);
}
}
#endif /* MAKEANDPLAY */