Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
EDuke32
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
92
Issues
92
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Richard Gobeille
EDuke32
Commits
6b752a57
Commit
6b752a57
authored
Nov 08, 2020
by
Richard Gobeille
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
engine: switch a few things over to xxh3
parent
3ef484c4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
23 deletions
+11
-23
source/build/src/palette.cpp
source/build/src/palette.cpp
+3
-3
source/build/src/polymer.cpp
source/build/src/polymer.cpp
+1
-1
source/duke3d/src/astub.cpp
source/duke3d/src/astub.cpp
+0
-1
source/duke3d/src/m32common.cpp
source/duke3d/src/m32common.cpp
+4
-15
source/duke3d/src/menus.cpp
source/duke3d/src/menus.cpp
+3
-3
No files found.
source/build/src/palette.cpp
View file @
6b752a57
...
...
@@ -14,7 +14,7 @@
#include "cache1d.h"
#include "palette.h"
#include "a.h"
#include "xxh
ash
.h"
#include "xxh
3
.h"
#include "vfs.h"
...
...
@@ -708,7 +708,7 @@ void videoSetPalette(char dabrightness, uint8_t dapalid, uint8_t flags)
paletteSetFade
(
palfadedelta
>>
2
);
static
uint32_t
lastpalettesum
=
0
;
uint32_t
newpalettesum
=
XXH3
2
((
uint8_t
*
)
curpalettefaded
,
sizeof
(
curpalettefaded
)
,
sizeof
(
curpalettefaded
));
uint32_t
newpalettesum
=
XXH3
_64bits
((
uint8_t
*
)
curpalettefaded
,
sizeof
(
curpalettefaded
));
palsumdidchange
=
(
newpalettesum
!=
lastpalettesum
);
...
...
@@ -793,7 +793,7 @@ 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
2
((
uint8_t
*
)
curpalettefaded
,
sizeof
(
curpalettefaded
)
,
sizeof
(
curpalettefaded
));
uint32_t
newpalettesum
=
XXH3
_64bits
((
uint8_t
*
)
curpalettefaded
,
sizeof
(
curpalettefaded
));
if
(
newpalettesum
!=
lastpalettesum
||
newpalettesum
!=
g_lastpalettesum
)
{
...
...
source/build/src/polymer.cpp
View file @
6b752a57
...
...
@@ -3907,7 +3907,7 @@ void polymer_updatesprite(int32_t snum)
if
(
tspr
->
cstat
&
48
&&
searchit
!=
2
)
{
uint32_t
const
changed
=
XXH3
2
((
uint8_t
*
)
tspr
,
offsetof
(
spritetype
,
owner
),
0xDEADBEEF
);
uint32_t
const
changed
=
XXH3
_64bits
((
uint8_t
*
)
tspr
,
offsetof
(
spritetype
,
owner
)
);
if
(
changed
==
s
->
hash
)
return
;
...
...
source/duke3d/src/astub.cpp
View file @
6b752a57
...
...
@@ -43,7 +43,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "keyboard.h"
#include "scriptfile.h"
#include "xxhash.h"
#include "sounds_mapster32.h"
#include "fx_man.h"
...
...
source/duke3d/src/m32common.cpp
View file @
6b752a57
...
...
@@ -14,7 +14,7 @@
#include "m32def.h"
#include "lz4.h"
#include "xxh
ash
.h"
#include "xxh
3
.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"
...
...
@@ -451,24 +451,14 @@ void create_map_snapshot(void)
if
(
numsectors
)
{
#if !defined UINTPTR_MAX
# error Need UINTPTR_MAX define to select between 32- and 64-bit functions
#endif
#if UINTPTR_MAX == 0xffffffff
/* 32-bit */
#define XXH__ XXH32
#else
/* 64-bit */
#define XXH__ XXH64
#endif
uintptr_t
temphash
=
XXH__
((
uint8_t
*
)
sector
,
numsectors
*
sizeof
(
sectortype
),
numsectors
*
sizeof
(
sectortype
));
uintptr_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
);
if
(
numwalls
)
{
temphash
=
XXH
__
((
uint8_t
*
)
wall
,
numwalls
*
sizeof
(
walltype
)
,
numwalls
*
sizeof
(
walltype
));
temphash
=
XXH
3_64bits
((
uint8_t
*
)
wall
,
numwalls
*
sizeof
(
walltype
));
if
(
!
try_match_with_prev
(
1
,
numwalls
,
temphash
))
create_compressed_block
(
1
,
wall
,
numwalls
*
sizeof
(
walltype
),
temphash
);
...
...
@@ -476,7 +466,7 @@ void create_map_snapshot(void)
if
(
Numsprites
)
{
temphash
=
XXH
__
((
uint8_t
*
)
sprite
,
MAXSPRITES
*
sizeof
(
spritetype
)
,
MAXSPRITES
*
sizeof
(
spritetype
));
temphash
=
XXH
3_64bits
((
uint8_t
*
)
sprite
,
MAXSPRITES
*
sizeof
(
spritetype
));
if
(
!
try_match_with_prev
(
2
,
Numsprites
,
temphash
))
{
...
...
@@ -495,7 +485,6 @@ void create_map_snapshot(void)
Xfree
(
uspri
);
}
}
#undef XXH__
}
CheckMapCorruption
(
5
,
0
);
...
...
source/duke3d/src/menus.cpp
View file @
6b752a57
...
...
@@ -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
ash
.h"
#include "xxh
3
.h"
#include "music.h"
#include "sbar.h"
...
...
@@ -3827,7 +3827,7 @@ static void Menu_EntryStringActivate(/*MenuEntry_t *entry*/)
{
savebrief_t
&
sv
=
g_menusaves
[
M_SAVE
.
currentEntry
-
1
].
brief
;
if
(
!
save_xxh
)
save_xxh
=
XXH3
2
((
uint8_t
*
)
sv
.
name
,
MAXSAVEGAMENAME
,
0xDEADBEEF
);
save_xxh
=
XXH3
_64bits_withSeed
((
uint8_t
*
)
sv
.
name
,
MAXSAVEGAMENAME
,
0xDEADBEEF
);
if
(
sv
.
isValid
())
Menu_Change
(
MENU_SAVEVERIFY
);
}
...
...
@@ -3859,7 +3859,7 @@ static int32_t Menu_EntryStringSubmit(/*MenuEntry_t *entry, */char *input)
#else
if
(
input
[
0
]
==
0
||
(
sv
.
name
[
MAXSAVEGAMENAME
]
==
127
&&
strncmp
(
sv
.
name
,
input
,
MAXSAVEGAMENAME
)
==
0
&&
save_xxh
==
XXH3
2
((
uint8_t
*
)
sv
.
name
,
MAXSAVEGAMENAME
,
0xDEADBEEF
)))
save_xxh
==
XXH3
_64bits_withSeed
((
uint8_t
*
)
sv
.
name
,
MAXSAVEGAMENAME
,
0xDEADBEEF
)))
#endif
{
strncpy
(
sv
.
name
,
g_mapInfo
[
ud
.
volume_number
*
MAXLEVELS
+
ud
.
level_number
].
name
,
MAXSAVEGAMENAME
);
...
...
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