Skip to content

Commit 92c6298

Browse files
author
Caerind
committed
Fix Hash + add minor things in UberScript
1 parent 1373b8c commit 92c6298

File tree

2 files changed

+51
-10
lines changed

2 files changed

+51
-10
lines changed

UberScript.sh

+49-8
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ BuildEnlivengine()
133133

134134
Tests()
135135
{
136+
# Ensures they are both up to date
137+
cmake --build build --target EnlivengineTests --config $config
138+
cmake --build build --target PlatformExample --config $config
139+
136140
if [[ "$platform" == "windows" ]]; then
137141
./build/examples/$config/PlatformExample.exe # default path for Visual Studio users
138142
./build/tests/$config/EnlivengineTests.exe # default path for Visual Studio users
@@ -182,19 +186,46 @@ build=false
182186
tests=false
183187
visual=false
184188

189+
default=true
190+
185191
# Options parsing
186192
while getopts c:higsbtva option
187193
do
188194
case $option in
189-
c) config=$OPTARG;;
190-
h) help=true;;
191-
i) install=true;;
192-
g) generate=true;;
193-
s) shaders=true;;
194-
b) build=true;;
195-
t) tests=true;;
196-
v) visual=true;;
195+
c)
196+
default=false
197+
config=$OPTARG
198+
;;
199+
h)
200+
default=false
201+
help=true
202+
;;
203+
i)
204+
default=false
205+
install=true
206+
;;
207+
g)
208+
default=false
209+
generate=true
210+
;;
211+
s)
212+
default=false
213+
shaders=true
214+
;;
215+
b)
216+
default=false
217+
build=true
218+
;;
219+
t)
220+
default=false
221+
tests=true
222+
;;
223+
v)
224+
default=false
225+
visual=true
226+
;;
197227
a)
228+
default=false
198229
install=true
199230
generate=true
200231
shaders=true
@@ -205,6 +236,16 @@ do
205236
done
206237
#echo "=> $config"
207238

239+
# If no arguments, consider it as -a
240+
if $default; then
241+
install=true
242+
generate=true
243+
shaders=true
244+
build=true
245+
tests=true
246+
fi
247+
248+
# Handle options
208249
if $help; then
209250
Help
210251
fi

src/Enlivengine/Utils/Hash.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ class Hash
4444
const U32 length = static_cast<U32>(str.size());
4545
if (length > 0)
4646
{
47-
U32 h = 89;
47+
U32 h = 5381;
4848
for (U32 i = 0; i < length; ++i)
4949
{
50-
h = h * 33 + static_cast<U32>(str[i]);
50+
h = h * 5 + static_cast<U32>(str[i]);
5151
}
5252
return h;
5353
}

0 commit comments

Comments
 (0)