mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-03 12:28:01 +03:00
Add asset_cg_exists function
This commit is contained in:
@@ -42,6 +42,7 @@ struct archive_data *asset_get(enum asset_type type, int no);
|
||||
// FIXME: CG code should be refactored to read from buffer only, not archive,
|
||||
// then caller can just use asset_get and cg_load
|
||||
struct cg *asset_cg_load(int no);
|
||||
bool asset_cg_exists(int no);
|
||||
bool asset_cg_get_metrics(int no, struct cg_metrics *metrics);
|
||||
void asset_cg_index_init(void);
|
||||
|
||||
|
||||
@@ -279,6 +279,15 @@ struct cg *asset_cg_load(int no)
|
||||
return cg_load(archives[ASSET_CG], no - 1);
|
||||
}
|
||||
|
||||
bool asset_cg_exists(int no)
|
||||
{
|
||||
if (!archives[ASSET_CG])
|
||||
return false;
|
||||
if (!(no = cg_translate_index(no)))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool asset_cg_get_metrics(int no, struct cg_metrics *metrics)
|
||||
{
|
||||
if (!archives[ASSET_CG])
|
||||
|
||||
+1
-1
@@ -688,7 +688,7 @@ int sact_Key_IsDown(int keycode)
|
||||
|
||||
int sact_CG_IsExist(int cg_no)
|
||||
{
|
||||
return asset_exists(ASSET_CG, cg_no - 1);
|
||||
return asset_cg_exists(cg_no);
|
||||
}
|
||||
|
||||
//int SACT2_CSV_Load(struct string *filename);
|
||||
|
||||
Reference in New Issue
Block a user