}
// apply special settings to pointer-style animations
- if (part->control_info.class == get_hash_from_key("pointer"))
+ if (part->control_info.class == get_hash_from_string("pointer"))
{
// force pointer-style animations to be checked for clicks first
part->control_info.draw_order = 1000000;
boolean changed = FALSE;
if (part->last_anim_status == global.anim_status &&
- part->control_info.class != get_hash_from_key("pointer"))
+ part->control_info.class != get_hash_from_string("pointer"))
return FALSE;
part->last_anim_status = global.anim_status;
part->class_playfield_or_door = FALSE;
- if (part->control_info.class == get_hash_from_key("window") ||
- part->control_info.class == get_hash_from_key("border"))
+ if (part->control_info.class == get_hash_from_string("window") ||
+ part->control_info.class == get_hash_from_string("border"))
{
viewport_x = 0;
viewport_y = 0;
part->drawing_stage = DRAW_GLOBAL_ANIM_STAGE_2;
}
- else if (part->control_info.class == get_hash_from_key("pointer"))
+ else if (part->control_info.class == get_hash_from_string("pointer"))
{
int mx = MIN(MAX(0, gfx.mouse_x), WIN_XSIZE - 1);
int my = MIN(MAX(0, gfx.mouse_y), WIN_YSIZE - 1);
if (global.anim_status != GAME_MODE_LOADING)
gfx.cursor_mode_override = CURSOR_NONE;
}
- else if (part->control_info.class == get_hash_from_key("door_1"))
+ else if (part->control_info.class == get_hash_from_string("door_1"))
{
viewport_x = DX;
viewport_y = DY;
part->class_playfield_or_door = TRUE;
}
- else if (part->control_info.class == get_hash_from_key("door_2"))
+ else if (part->control_info.class == get_hash_from_string("door_2"))
{
if (part->mode_nr == GAME_MODE_EDITOR)
{
part->viewport_width = viewport_width;
part->viewport_height = viewport_height;
- if (part->control_info.class != get_hash_from_key("pointer"))
+ if (part->control_info.class != get_hash_from_string("pointer"))
changed = TRUE;
}
part->step_yoffset = 0;
}
- if (part->control_info.class != get_hash_from_key("pointer"))
+ if (part->control_info.class != get_hash_from_string("pointer"))
{
if (c->x != ARG_UNDEFINED_VALUE)
part->x = c->x;
// if request dialog is active, only handle pointer-style animations
if (game.request_active &&
- part->control_info.class != get_hash_from_key("pointer"))
+ part->control_info.class != get_hash_from_string("pointer"))
continue;
if (clicked_event == ANIM_CLICKED_RESET)
{
if (isURL(token))
{
- result = get_hash_from_key(token); // unsigned int => int
+ result = get_hash_from_string(token); // unsigned int => int
result = ABS(result); // may be negative now
result += (result < MAX_IMAGE_FILES ? MAX_IMAGE_FILES : 0);
else if (strEqual(suffix, ".class"))
{
result = (strEqual(value, ARG_UNDEFINED) ? ARG_UNDEFINED_VALUE :
- get_hash_from_key(value));
+ get_hash_from_string(value));
}
else if (strEqual(suffix, ".style"))
{
if (PANEL_DEACTIVATED(pos))
continue;
- if (pos->class == get_hash_from_key("extra_panel_items") &&
+ if (pos->class == get_hash_from_string("extra_panel_items") &&
!setup.prefer_extra_panel_items)
continue;
int width, height;
int dst_x = PANEL_XPOS(pos);
int dst_y = PANEL_YPOS(pos);
- boolean skip = (pos->class == get_hash_from_key("mm_engine_only") &&
+ boolean skip = (pos->class == get_hash_from_string("mm_engine_only") &&
level.game_engine_type != GAME_ENGINE_TYPE_MM);
if (graphic != IMG_UNDEFINED && !skip)
sprintf(timestamp, "%s", getCurrentTimestamp());
sprintf(basename_raw, "%s-%s", timestamp, name);
- sprintf(basename, "%s-%08x", timestamp, get_hash_from_key(basename_raw));
+ sprintf(basename, "%s-%08x", timestamp, get_hash_from_string(basename_raw));
return basename;
}
#define remove_hash_entry hashtable_remove
#endif
-unsigned int get_hash_from_key(void *key)
+unsigned int get_hash_from_string(void *key)
{
/*
djb2
return hash;
}
-int hash_keys_are_equal(void *key1, void *key2)
+int hash_key_strings_are_equal(void *key1, void *key2)
{
return (strEqual((char *)key1, (char *)key2));
}
SetupFileHash *newSetupFileHash(void)
{
SetupFileHash *new_hash =
- create_hashtable(16, 0.75, get_hash_from_key, hash_keys_are_equal);
+ create_hashtable(16, 0.75, get_hash_from_string, hash_key_strings_are_equal);
if (new_hash == NULL)
Fail("create_hashtable() failed -- out of memory");
char *getSetupValue(int, void *);
char *getSetupLine(struct TokenInfo *, char *, int);
-unsigned int get_hash_from_key(void *);
-int hash_keys_are_equal(void *, void *);
+unsigned int get_hash_from_string(void *);
+int hash_key_strings_are_equal(void *, void *);
int GetZipFileTreeType(char *);
char *ExtractZipFileIntoDirectory(char *, char *, int);
static void TestGeneratingUUIDs_RunTest(int nr, int always_seed, int num_uuids)
{
struct hashtable *hash_seeds =
- create_hashtable(16, 0.75, get_hash_from_key, hash_keys_are_equal);
+ create_hashtable(16, 0.75, get_hash_from_string, hash_key_strings_are_equal);
struct hashtable *hash_uuids =
- create_hashtable(16, 0.75, get_hash_from_key, hash_keys_are_equal);
+ create_hashtable(16, 0.75, get_hash_from_string, hash_key_strings_are_equal);
static char message[100];
int i;