var ini_read_var(STRING *filename, char* section, STRING *entry, var defaultValue) { STRING *tmp = "#64"; STRING *def = "#64"; ini_read(tmp, filename, section, entry, str_for_num(def, defaultValue)); return str_to_num(tmp); }
void gui_update_a4() { if (panA4Cube != NULL) { set(panA4Cube, SHOW); if (player != NULL) { if (txtA4Cube != NULL) { set(txtA4Cube, SHOW); str_for_num((txtA4Cube.pstring)[0], player.PL_A4_COUNT); } } } }
/* -------------------------------------------------- void mpPlay(STRING *songName) Desc: Returns: - -------------------------------------------------- */ void mpPlay(STRING *songName) { WriteLog("[ ] Now playing: "); if(media_playing(mpHandle)) media_stop(mpHandle); if(mpCount > mpSongs - 1 || mpCount < 0) return; str_cpy(_mpSongTemp,songName); str_trunc(_mpSongTemp, str_len(EXT_MUSIC)-1 ); // because our four chars are: .ogg WriteLog(_mpSongTemp); NewLine(); str_cpy(mpSongTemp,PATH_MUSIC); str_cat(mpSongTemp,songName); str_for_num(_mpCount, mpCount); // strcpy is unnecessary here mpHandle = media_play(mpSongTemp,NULL,VOL_MUSIC); while(media_playing(mpHandle)) wait(1); mpNext(); }
void gui_update_hearts() { if (player != NULL) { if (player.PL_HEALTH > 0) { set(panHeart3, SHOW); } else { reset(panHeart3, SHOW); } if (player.PL_HEALTH > 1) { set(panHeart2, SHOW); } else { reset(panHeart2, SHOW); } if (player.PL_HEALTH > 2) { set(panHeart1, SHOW); } else { reset(panHeart1, SHOW); } if (txtLifes != NULL) { str_for_num((txtLifes.pstring)[0], nPlayerLifes); } } }
void ini_write_var(STRING *filename, char* section, STRING *entry, var value) { ini_write(filename, section, entry, str_for_num(NULL, value)); }
// Logging of doubles void log_print(char* _info, double _in) { str_for_num(strLogTemp, _in); log_print(_info, strLogTemp.chars); }