add backy to IMG, update cmm/lib/collection.h

git-svn-id: svn://kolibrios.org@7885 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2020-05-07 10:05:01 +00:00
parent f2f9a45881
commit eb33af59d1
2 changed files with 27 additions and 15 deletions

View File

@ -28,6 +28,7 @@ img_files = {
{"UNIMG", PROGS .. "/fs/unimg/unimg"}, {"UNIMG", PROGS .. "/fs/unimg/unimg"},
{"VMODE", "common/vmode"}, {"VMODE", "common/vmode"},
{"3D/HOUSE.3DS", "common/3d/house.3ds"}, {"3D/HOUSE.3DS", "common/3d/house.3ds"},
{"DEVELOP/BACKY", PROGS .. "/develop/backy/Backy"},
{"DEVELOP/T_EDIT.INI", PROGS .. "/other/t_edit/t_edit.ini"}, {"DEVELOP/T_EDIT.INI", PROGS .. "/other/t_edit/t_edit.ini"},
{"File Managers/ICONS.INI", "common/File Managers/icons.ini"}, {"File Managers/ICONS.INI", "common/File Managers/icons.ini"},
{"File Managers/KFM.INI", "common/File Managers/kfm.ini"}, {"File Managers/KFM.INI", "common/File Managers/kfm.ini"},
@ -625,12 +626,12 @@ tup.append_table(img_files, {
{"NETWORK/WEBVIEW", PROGS .. "/cmm/browser/WebView.com"}, {"NETWORK/WEBVIEW", PROGS .. "/cmm/browser/WebView.com"},
}) })
tup.append_table(extra_files, { tup.append_table(extra_files, {
{"kolibrios/develop/utils/codeview", PROGS .. "/cmm/codeview/codeview.com"},
{"kolibrios/drivers/drvinst.kex", PROGS .. "/cmm/drvinst/drvinst.com"}, {"kolibrios/drivers/drvinst.kex", PROGS .. "/cmm/drvinst/drvinst.com"},
{"kolibrios/games/pig/pigex", PROGS .. "/cmm/examples/pigex.com"}, {"kolibrios/games/pig/pigex", PROGS .. "/cmm/examples/pigex.com"},
{"kolibrios/games/the_bus/the_bus", PROGS .. "/cmm/the_bus/the_bus.com"}, {"kolibrios/games/the_bus/the_bus", PROGS .. "/cmm/the_bus/the_bus.com"},
{"kolibrios/KolibriNext/install.kex", PROGS .. "/cmm/installer/install.com"}, {"kolibrios/KolibriNext/install.kex", PROGS .. "/cmm/installer/install.com"},
{"kolibrios/utils/appearance", PROGS .. "/cmm/appearance/appearance.com"}, {"kolibrios/utils/appearance", PROGS .. "/cmm/appearance/appearance.com"},
{"kolibrios/utils/codeview", PROGS .. "/cmm/codeview/codeview.com"},
{"kolibrios/utils/dicty.kex", PROGS .. "/cmm/dicty/dicty.com"}, {"kolibrios/utils/dicty.kex", PROGS .. "/cmm/dicty/dicty.com"},
{"kolibrios/utils/netcheck", PROGS .. "/cmm/examples/netcheck.com"}, {"kolibrios/utils/netcheck", PROGS .. "/cmm/examples/netcheck.com"},
{"kolibrios/utils/notes", PROGS .. "/cmm/notes/notes.com"}, {"kolibrios/utils/notes", PROGS .. "/cmm/notes/notes.com"},

View File

@ -21,7 +21,7 @@ struct collection
void drop(); void drop();
void increase_data_size(); void increase_data_size();
dword get_last(); dword get_last();
bool delete_last(); bool pop();
}; };
:void collection::increase_data_size() { :void collection::increase_data_size() {
@ -82,8 +82,8 @@ struct collection
count = 0; count = 0;
} }
:bool collection::delete_last() { :bool collection::pop() {
count--; if (count>0) count--;
} }
/*======================================================== /*========================================================
@ -94,29 +94,41 @@ struct collection
struct collection_int struct collection_int
{ {
int count; dword buf;
dword element[4096*3]; dword buf_size;
int add(); unsigned count;
void alloc();
void add();
dword get(); dword get();
dword get_last(); dword get_last();
void pop(); void pop();
void drop(); void drop();
}; };
:int collection_int::add(dword in) { :void collection_int::alloc() {
if (count >= 4096*3) return 0; if (!buf) {
element[count] = in; buf_size = 4096;
buf = malloc(4096);
} else {
buf_size += 4096;
buf = realloc(buf, buf_size);
}
}
:void collection_int::add(dword _in) {
if (!buf) || (count * sizeof(dword) >= buf_size) alloc();
EAX = count * sizeof(dword) + buf;
ESDWORD[EAX] = _in;
count++; count++;
return 1;
} }
:dword collection_int::get(dword pos) { :dword collection_int::get(dword pos) {
if (pos<0) || (pos>=count) return 0; if (pos<0) || (pos>=count) return 0;
return element[pos]; return ESDWORD[pos * sizeof(dword) + buf];
} }
:dword collection_int::get_last() { :dword collection_int::get_last() {
return element[count]; return get(count-1);
} }
:void collection_int::pop() { :void collection_int::pop() {
@ -124,8 +136,7 @@ struct collection_int
} }
:void collection_int::drop() { :void collection_int::drop() {
element[0] = element[0] = count = 0;
count = 0;
} }
#endif #endif