Subversion Repositories Games.Carmageddon

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. #include "regsupt.h"
  2. #include "CORE/FW/register.h"
  3. #include "CORE/V1DB/dbsetup.h"
  4. #include "CORE/V1DB/prepmap.h"
  5. #include "CORE/V1DB/prepmatl.h"
  6. #include "CORE/V1DB/prepmesh.h"
  7. #include "CORE/V1DB/preptab.h"
  8.  
  9. #include "harness/trace.h"
  10.  
  11. // IDA: br_model* __cdecl BrModelAdd(br_model *model)
  12. br_model* BrModelAdd(br_model* model) {
  13.     LOG_TRACE10("(%p)", model);
  14.  
  15.     BrRegistryAdd(&v1db.reg_models, model);
  16.     BrModelUpdate(model, BR_MODU_ALL);
  17.     return model;
  18. }
  19.  
  20. // IDA: br_model* __cdecl BrModelRemove(br_model *model)
  21. br_model* BrModelRemove(br_model* model) {
  22.     LOG_TRACE("(%p)", model);
  23.  
  24.     BrModelClear(model);
  25.     return BrRegistryRemove(&v1db.reg_models, model);
  26. }
  27.  
  28. // IDA: br_model* __cdecl BrModelFind(char *pattern)
  29. br_model* BrModelFind(char* pattern) {
  30.     LOG_TRACE("(\"%s\")", pattern);
  31.  
  32.     return BrRegistryFind(&v1db.reg_models, pattern);
  33. }
  34.  
  35. // IDA: br_model_find_cbfn* __cdecl BrModelFindHook(br_model_find_cbfn *hook)
  36. br_model_find_cbfn* BrModelFindHook(br_model_find_cbfn* hook) {
  37.     br_model_find_cbfn* old;
  38.     LOG_TRACE("(%p)", hook);
  39.  
  40.     old = (br_model_find_cbfn*)v1db.reg_models.find_failed_hook;
  41.     v1db.reg_models.find_failed_hook = (br_find_failed_cbfn*)hook;
  42.     return old;
  43. }
  44.  
  45. // IDA: br_uint_32 __cdecl BrModelAddMany(br_model **items, int n)
  46. br_uint_32 BrModelAddMany(br_model** items, int n) {
  47.     int i;
  48.     int r;
  49.     LOG_TRACE("(%p, %d)", items, n);
  50.  
  51.     r = 0;
  52.     for (i = 0; i < n; i++) {
  53.         BrRegistryAdd(&v1db.reg_models, items[i]);
  54.         BrModelUpdate(items[i], BR_MODU_ALL);
  55.         if (items[i] != NULL) {
  56.             r++;
  57.         }
  58.     }
  59.     return r;
  60. }
  61.  
  62. // IDA: br_uint_32 __cdecl BrModelRemoveMany(br_model **items, int n)
  63. br_uint_32 BrModelRemoveMany(br_model** items, int n) {
  64.     int i;
  65.     int r;
  66.     LOG_TRACE("(%p, %d)", items, n);
  67.  
  68.     r = 0;
  69.     for (i = 0; i < n; i++) {
  70.         BrModelClear(items[n]);
  71.         if (BrRegistryRemove(&v1db.reg_models, items[n]) != NULL) {
  72.             r++;
  73.         }
  74.     }
  75.     return r;
  76. }
  77.  
  78. // IDA: br_uint_32 __cdecl BrModelFindMany(char *pattern, br_model **items, int max)
  79. br_uint_32 BrModelFindMany(char* pattern, br_model** items, int max) {
  80.     LOG_TRACE("(\"%s\", %p, %d)", pattern, items, max);
  81.  
  82.     return BrRegistryFindMany(&v1db.reg_models, pattern, (void**)items, max);
  83. }
  84.  
  85. // IDA: br_uint_32 __cdecl BrModelCount(char *pattern)
  86. br_uint_32 BrModelCount(char* pattern) {
  87.     LOG_TRACE("(\"%s\")", pattern);
  88.  
  89.     return BrRegistryCount(&v1db.reg_models, pattern);
  90. }
  91.  
  92. // IDA: br_uint_32 __cdecl BrModelEnum(char *pattern, br_model_enum_cbfn *callback, void *arg)
  93. br_uint_32 BrModelEnum(char* pattern, br_model_enum_cbfn* callback, void* arg) {
  94.     LOG_TRACE("(\"%s\", %p, %p)", pattern, callback, arg);
  95.  
  96.     return BrRegistryEnum(&v1db.reg_models, pattern, (br_enum_cbfn*)callback, arg);
  97. }
  98.  
  99. // IDA: br_material* __cdecl BrMaterialAdd(br_material *material)
  100. br_material* BrMaterialAdd(br_material* material) {
  101.     LOG_TRACE10("(%p)", material);
  102.  
  103.     BrRegistryAdd(&v1db.reg_materials, material);
  104.     BrMaterialUpdate(material, BR_MATU_ALL);
  105.     return material;
  106. }
  107.  
  108. // IDA: br_material* __cdecl BrMaterialRemove(br_material *material)
  109. br_material* BrMaterialRemove(br_material* material) {
  110.     LOG_TRACE("(%p)", material);
  111.  
  112.     return (br_material*)BrRegistryRemove(&v1db.reg_materials, material);
  113. }
  114.  
  115. // IDA: br_material* __cdecl BrMaterialFind(char *pattern)
  116. br_material* BrMaterialFind(char* pattern) {
  117.     LOG_TRACE("(\"%s\")", pattern);
  118.  
  119.     return BrRegistryFind(&v1db.reg_materials, pattern);
  120. }
  121.  
  122. // IDA: br_material_find_cbfn* __cdecl BrMaterialFindHook(br_material_find_cbfn *hook)
  123. br_material_find_cbfn* BrMaterialFindHook(br_material_find_cbfn* hook) {
  124.     br_material_find_cbfn* old;
  125.     LOG_TRACE("(%p)", hook);
  126.  
  127.     old = (br_material_find_cbfn*)v1db.reg_materials.find_failed_hook;
  128.     v1db.reg_materials.find_failed_hook = (br_find_failed_cbfn*)hook;
  129.     return old;
  130. }
  131.  
  132. // IDA: br_uint_32 __cdecl BrMaterialAddMany(br_material **items, int n)
  133. br_uint_32 BrMaterialAddMany(br_material** items, int n) {
  134.     int i;
  135.     int r;
  136.     LOG_TRACE10("(%p, %d)", items, n);
  137.  
  138.     r = 0;
  139.     for (i = 0; i < n; i++) {
  140.         BrRegistryAdd(&v1db.reg_materials, items[i]);
  141.         BrMaterialUpdate(items[i], BR_MATU_ALL);
  142.         if (items[i]) {
  143.             r++;
  144.         }
  145.     }
  146.     return r;
  147. }
  148.  
  149. // IDA: br_uint_32 __cdecl BrMaterialRemoveMany(br_material **items, int n)
  150. br_uint_32 BrMaterialRemoveMany(br_material** items, int n) {
  151.     int i;
  152.     int r;
  153.     LOG_TRACE("(%p, %d)", items, n);
  154.  
  155.     r = 0;
  156.     for (i = 0; i < n; i++) {
  157.         BrMaterialClear(items[i]);
  158.         BrRegistryRemove(&v1db.reg_materials, items[i]);
  159.         if (items[i]) {
  160.             r++;
  161.         }
  162.     }
  163.     return r;
  164. }
  165.  
  166. // IDA: br_uint_32 __cdecl BrMaterialFindMany(char *pattern, br_material **items, int max)
  167. br_uint_32 BrMaterialFindMany(char* pattern, br_material** items, int max) {
  168.     LOG_TRACE("(\"%s\", %p, %d)", pattern, items, max);
  169.  
  170.     return BrRegistryFindMany(&v1db.reg_materials, pattern, (void**)items, max);
  171. }
  172.  
  173. // IDA: br_uint_32 __cdecl BrMaterialCount(char *pattern)
  174. br_uint_32 BrMaterialCount(char* pattern) {
  175.     LOG_TRACE("(\"%s\")", pattern);
  176.  
  177.     return BrRegistryCount(&v1db.reg_materials, pattern);
  178. }
  179.  
  180. // IDA: br_uint_32 __cdecl BrMaterialEnum(char *pattern, br_material_enum_cbfn *callback, void *arg)
  181. br_uint_32 BrMaterialEnum(char* pattern, br_material_enum_cbfn* callback, void* arg) {
  182.     LOG_TRACE("(\"%s\", %p, %p)", pattern, callback, arg);
  183.  
  184.     return BrRegistryEnum(&v1db.reg_materials, pattern, (br_enum_cbfn*)callback, arg);
  185. }
  186.  
  187. // IDA: br_pixelmap* __cdecl BrMapAdd(br_pixelmap *pixelmap)
  188. br_pixelmap* BrMapAdd(br_pixelmap* pixelmap) {
  189.     LOG_TRACE10("(%p)", pixelmap);
  190.  
  191.     BrRegistryAdd(&v1db.reg_textures, pixelmap);
  192.     BrMapUpdate(pixelmap, 0xFFFu);
  193.     return pixelmap;
  194. }
  195.  
  196. // IDA: br_pixelmap* __cdecl BrMapRemove(br_pixelmap *pixelmap)
  197. br_pixelmap* BrMapRemove(br_pixelmap* pixelmap) {
  198.     LOG_TRACE("(%p)", pixelmap);
  199.  
  200.     BrBufferClear(pixelmap);
  201.     return BrRegistryRemove(&v1db.reg_textures, pixelmap);
  202. }
  203.  
  204. // IDA: br_pixelmap* __cdecl BrMapFind(char *pattern)
  205. br_pixelmap* BrMapFind(char* pattern) {
  206.     LOG_TRACE("(\"%s\")", pattern);
  207.  
  208.     return BrRegistryFind(&v1db.reg_textures, pattern);
  209. }
  210.  
  211. // IDA: br_map_find_cbfn* __cdecl BrMapFindHook(br_map_find_cbfn *hook)
  212. br_map_find_cbfn* BrMapFindHook(br_map_find_cbfn* hook) {
  213.     br_map_find_cbfn* old;
  214.     LOG_TRACE("(%p)", hook);
  215.  
  216.     old = (br_map_find_cbfn*)v1db.reg_textures.find_failed_hook;
  217.     v1db.reg_textures.find_failed_hook = (br_find_failed_cbfn*)hook;
  218.     return old;
  219. }
  220.  
  221. // IDA: br_uint_32 __cdecl BrMapAddMany(br_pixelmap **items, int n)
  222. br_uint_32 BrMapAddMany(br_pixelmap** items, int n) {
  223.     int i;
  224.     int r;
  225.     LOG_TRACE10("(%p, %d)", items, n);
  226.  
  227.     r = 0;
  228.     for (i = 0; i < n; i++) {
  229.         BrRegistryAdd(&v1db.reg_textures, items[i]);
  230.         BrMapUpdate(items[i], 0xFFF);
  231.         if (items[i]) {
  232.             r++;
  233.         }
  234.     }
  235.     return r++;
  236. }
  237.  
  238. // IDA: br_uint_32 __cdecl BrMapRemoveMany(br_pixelmap **items, int n)
  239. br_uint_32 BrMapRemoveMany(br_pixelmap** items, int n) {
  240.     int i;
  241.     int r;
  242.     LOG_TRACE("(%p, %d)", items, n);
  243.  
  244.     r = 0;
  245.     for (i = 0; i < n; i++) {
  246.         BrBufferClear(items[i]);
  247.         if (BrRegistryRemove(&v1db.reg_textures, items[i]) != NULL) {
  248.             r++;
  249.         }
  250.     }
  251.     return r;
  252. }
  253.  
  254. // IDA: br_uint_32 __cdecl BrMapFindMany(char *pattern, br_pixelmap **items, int max)
  255. br_uint_32 BrMapFindMany(char* pattern, br_pixelmap** items, int max) {
  256.     LOG_TRACE("(\"%s\", %p, %d)", pattern, items, max);
  257.  
  258.     return BrRegistryFindMany(&v1db.reg_textures, pattern, (void**)items, max);
  259. }
  260.  
  261. // IDA: br_uint_32 __cdecl BrMapCount(char *pattern)
  262. br_uint_32 BrMapCount(char* pattern) {
  263.     LOG_TRACE("(\"%s\")", pattern);
  264.  
  265.     return BrRegistryCount(&v1db.reg_textures, pattern);
  266. }
  267.  
  268. // IDA: br_uint_32 __cdecl BrMapEnum(char *pattern, br_map_enum_cbfn *callback, void *arg)
  269. br_uint_32 BrMapEnum(char* pattern, br_map_enum_cbfn* callback, void* arg) {
  270.     LOG_TRACE("(\"%s\", %p, %p)", pattern, callback, arg);
  271.  
  272.     return BrRegistryEnum(&v1db.reg_textures, pattern, (br_enum_cbfn*)callback, arg);
  273. }
  274.  
  275. // IDA: br_pixelmap* __cdecl BrTableAdd(br_pixelmap *pixelmap)
  276. br_pixelmap* BrTableAdd(br_pixelmap* pixelmap) {
  277.     LOG_TRACE("(%p)", pixelmap);
  278.  
  279.     BrRegistryAdd(&v1db.reg_tables, pixelmap);
  280.     BrTableUpdate(pixelmap, BR_TABU_ALL);
  281.     return pixelmap;
  282. }
  283.  
  284. // IDA: br_pixelmap* __cdecl BrTableRemove(br_pixelmap *pixelmap)
  285. br_pixelmap* BrTableRemove(br_pixelmap* pixelmap) {
  286.     LOG_TRACE("(%p)", pixelmap);
  287.  
  288.     BrBufferClear(pixelmap);
  289.     return BrRegistryRemove(&v1db.reg_tables, pixelmap);
  290. }
  291.  
  292. // IDA: br_pixelmap* __cdecl BrTableFind(char *pattern)
  293. br_pixelmap* BrTableFind(char* pattern) {
  294.     LOG_TRACE("(\"%s\")", pattern);
  295.  
  296.     return BrRegistryFind(&v1db.reg_tables, pattern);
  297. }
  298.  
  299. // IDA: br_table_find_cbfn* __cdecl BrTableFindHook(br_table_find_cbfn *hook)
  300. br_table_find_cbfn* BrTableFindHook(br_table_find_cbfn* hook) {
  301.     br_table_find_cbfn* old;
  302.     LOG_TRACE("(%p)", hook);
  303.  
  304.     old = (br_table_find_cbfn*)v1db.reg_tables.find_failed_hook;
  305.     v1db.reg_tables.find_failed_hook = (br_find_failed_cbfn*)hook;
  306.     return old;
  307. }
  308.  
  309. // IDA: br_uint_32 __cdecl BrTableAddMany(br_pixelmap **items, int n)
  310. br_uint_32 BrTableAddMany(br_pixelmap** items, int n) {
  311.     int i;
  312.     int r = 0;
  313.     LOG_TRACE10("(%p, %d)", items, n);
  314.  
  315.     r = 0;
  316.     for (i = 0; i < n; i++) {
  317.         BrRegistryAdd(&v1db.reg_tables, items[i]);
  318.         BrTableUpdate(items[i], BR_TABU_ALL);
  319.         if (items[i]) {
  320.             ++r;
  321.         }
  322.     }
  323.     return r;
  324. }
  325.  
  326. // IDA: br_uint_32 __cdecl BrTableRemoveMany(br_pixelmap **items, int n)
  327. br_uint_32 BrTableRemoveMany(br_pixelmap** items, int n) {
  328.     int i;
  329.     int r;
  330.     LOG_TRACE("(%p, %d)", items, n);
  331.  
  332.     r = 0;
  333.     for (i = 0; i < n; i++) {
  334.         BrBufferClear(items[i]);
  335.         if (BrRegistryRemove(&v1db.reg_tables, items[i]) != NULL) {
  336.             r++;
  337.         }
  338.     }
  339.     return r;
  340. }
  341.  
  342. // IDA: br_uint_32 __cdecl BrTableFindMany(char *pattern, br_pixelmap **items, int max)
  343. br_uint_32 BrTableFindMany(char* pattern, br_pixelmap** items, int max) {
  344.     LOG_TRACE("(\"%s\", %p, %d)", pattern, items, max);
  345.  
  346.     return BrRegistryFindMany(&v1db.reg_tables, pattern, (void**)items, max);
  347. }
  348.  
  349. // IDA: br_uint_32 __cdecl BrTableCount(char *pattern)
  350. br_uint_32 BrTableCount(char* pattern) {
  351.     LOG_TRACE("(\"%s\")", pattern);
  352.  
  353.     return BrRegistryCount(&v1db.reg_tables, pattern);
  354. }
  355.  
  356. // IDA: br_uint_32 __cdecl BrTableEnum(char *pattern, br_table_enum_cbfn *callback, void *arg)
  357. br_uint_32 BrTableEnum(char* pattern, br_table_enum_cbfn* callback, void* arg) {
  358.     LOG_TRACE("(\"%s\", %p, %p)", pattern, callback, arg);
  359.  
  360.     return BrRegistryEnum(&v1db.reg_tables, pattern, (br_enum_cbfn*)callback, arg);
  361. }
  362.