Commit 6f67bd5f authored by Richard Gobeille's avatar Richard Gobeille

engine: include xxhash.h instead of xxh3.h and update data types to account for 64-bit hash values

parent 334bbeab
......@@ -13,6 +13,7 @@
#include "cache1d.h"
#include "vfs.h"
#include "xxhash.h"
#ifdef __cplusplus
extern "C" {
......@@ -62,7 +63,7 @@ extern float frealmaxshade;
extern int32_t globalpal;
extern int32_t globalblend;
extern uint32_t g_lastpalettesum;
extern XXH64_hash_t g_lastpalettesum;
extern palette_t paletteGetColor(int32_t col);
extern void paletteLoadFromDisk(void);
extern void palettePostLoadTables(void);
......
......@@ -14,7 +14,7 @@
#include "cache1d.h"
#include "palette.h"
#include "a.h"
#include "xxh3.h"
#include "xxhash.h"
#include "vfs.h"
......@@ -23,7 +23,7 @@ uint8_t basepalreset=1;
uint8_t curbasepal;
int32_t globalblend;
uint32_t g_lastpalettesum = 0;
XXH64_hash_t g_lastpalettesum = 0;
palette_t curpalette[256]; // the current palette, unadjusted for brightness or tint
palette_t curpalettefaded[256]; // the current palette, adjusted for brightness and tint (ie. what gets sent to the card)
palette_t palfadergb = { 0, 0, 0, 0 };
......@@ -707,8 +707,8 @@ void videoSetPalette(char dabrightness, uint8_t dapalid, uint8_t flags)
if ((flags&16) && palfadedelta) // keep the fade
paletteSetFade(palfadedelta>>2);
static uint32_t lastpalettesum=0;
uint32_t newpalettesum = XXH3_64bits((uint8_t *) curpalettefaded, sizeof(curpalettefaded));
static XXH64_hash_t lastpalettesum=0;
XXH64_hash_t newpalettesum = XXH3_64bits((uint8_t *) curpalettefaded, sizeof(curpalettefaded));
palsumdidchange = (newpalettesum != lastpalettesum);
......@@ -792,8 +792,8 @@ void videoFadePalette(uint8_t r, uint8_t g, uint8_t b, uint8_t offset)
paletteSetFade(offset);
static uint32_t lastpalettesum=0;
uint32_t newpalettesum = XXH3_64bits((uint8_t *) curpalettefaded, sizeof(curpalettefaded));
static XXH64_hash_t lastpalettesum=0;
XXH64_hash_t newpalettesum = XXH3_64bits((uint8_t *) curpalettefaded, sizeof(curpalettefaded));
if (newpalettesum != lastpalettesum || newpalettesum != g_lastpalettesum)
{
......
......@@ -14,7 +14,7 @@
#include "m32def.h"
#include "lz4.h"
#include "xxh3.h"
#include "xxhash.h"
// XXX: This breaks editors for games other than Duke. The OSD needs a way to specify colors in abstract instead of concatenating palswap escape sequences.
#include "common_game.h"
......@@ -345,7 +345,7 @@ mapundo_t *mapstate = NULL;
int32_t map_revision = 1;
static int32_t try_match_with_prev(int32_t idx, int32_t numsthgs, uintptr_t crc)
static int32_t try_match_with_prev(int32_t idx, int32_t numsthgs, XXH64_hash_t crc)
{
if (mapstate->prev && mapstate->prev->num[idx]==numsthgs && mapstate->prev->crc[idx]==crc)
{
......@@ -360,7 +360,7 @@ static int32_t try_match_with_prev(int32_t idx, int32_t numsthgs, uintptr_t crc)
return 0;
}
static void create_compressed_block(int32_t idx, const void *srcdata, uint32_t size, uintptr_t crc)
static void create_compressed_block(int32_t idx, const void *srcdata, uint32_t size, XXH64_hash_t crc)
{
// allocate
int const compressed_size = LZ4_compressBound(size);
......@@ -451,7 +451,7 @@ void create_map_snapshot(void)
if (numsectors)
{
uintptr_t temphash = XXH3_64bits((uint8_t *)sector, numsectors*sizeof(sectortype));
XXH64_hash_t temphash = XXH3_64bits((uint8_t *)sector, numsectors*sizeof(sectortype));
if (!try_match_with_prev(0, numsectors, temphash))
create_compressed_block(0, sector, numsectors*sizeof(sectortype), temphash);
......
......@@ -32,7 +32,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "input.h"
#include "osdcmds.h"
#include "savegame.h"
#include "xxh3.h"
#include "xxhash.h"
#include "music.h"
#include "sbar.h"
......@@ -3816,7 +3816,7 @@ static int32_t Menu_EntryRangeDoubleModify(void /*MenuEntry_t *entry, double new
}
#endif
static uint32_t save_xxh = 0;
static XXH64_hash_t save_xxh = 0;
static void Menu_EntryStringActivate(/*MenuEntry_t *entry*/)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment