Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Richard Gobeille
EDuke32
Commits
6f67bd5f
Commit
6f67bd5f
authored
Dec 18, 2020
by
Richard Gobeille
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
engine: include xxhash.h instead of xxh3.h and update data types to account for 64-bit hash values
parent
334bbeab
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
13 deletions
+14
-13
source/build/include/palette.h
source/build/include/palette.h
+2
-1
source/build/src/palette.cpp
source/build/src/palette.cpp
+6
-6
source/duke3d/src/m32common.cpp
source/duke3d/src/m32common.cpp
+4
-4
source/duke3d/src/menus.cpp
source/duke3d/src/menus.cpp
+2
-2
No files found.
source/build/include/palette.h
View file @
6f67bd5f
...
...
@@ -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
);
...
...
source/build/src/palette.cpp
View file @
6f67bd5f
...
...
@@ -14,7 +14,7 @@
#include "cache1d.h"
#include "palette.h"
#include "a.h"
#include "xxh
3
.h"
#include "xxh
ash
.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
)
{
...
...
source/duke3d/src/m32common.cpp
View file @
6f67bd5f
...
...
@@ -14,7 +14,7 @@
#include "m32def.h"
#include "lz4.h"
#include "xxh
3
.h"
#include "xxh
ash
.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
);
...
...
source/duke3d/src/menus.cpp
View file @
6f67bd5f
...
...
@@ -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 "xxh
3
.h"
#include "xxh
ash
.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*/
)
{
...
...
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