projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
improved startup speed by optimizing parsing of parameter values
[rocksndiamonds.git]
/
src
/
files.c
diff --git
a/src/files.c
b/src/files.c
index 32fbf32b9ee3618c0a154dfc80ab781dd1a48c6a..49813391c63e0e7a733a23447cb5e09862ee8eb2 100644
(file)
--- a/
src/files.c
+++ b/
src/files.c
@@
-6596,7
+6596,7
@@
static void LoadLevel_InitPlayfield(struct LevelInfo *level)
// copy elements to runtime playfield array
for (x = 0; x < MAX_LEV_FIELDX; x++)
for (y = 0; y < MAX_LEV_FIELDY; y++)
// copy elements to runtime playfield array
for (x = 0; x < MAX_LEV_FIELDX; x++)
for (y = 0; y < MAX_LEV_FIELDY; y++)
-
Feld
[x][y] = level->field[x][y];
+
Tile
[x][y] = level->field[x][y];
// initialize level size variables for faster access
lev_fieldx = level->fieldx;
// initialize level size variables for faster access
lev_fieldx = level->fieldx;
@@
-10246,6
+10246,10
@@
static int get_anim_parameter_values(char *s)
static int get_anim_action_parameter_value(char *token)
{
static int get_anim_action_parameter_value(char *token)
{
+ // check most common default case first to massively speed things up
+ if (strEqual(token, ARG_UNDEFINED))
+ return ANIM_EVENT_ACTION_NONE;
+
int result = getImageIDFromToken(token);
if (result == -1)
int result = getImageIDFromToken(token);
if (result == -1)