Berusky_universal.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /*
  2. Universalni definice pro berusky - do editoru a do hry
  3. Kofola:
  4. -------
  5. adas_ -> sound system
  6. gl_ -> logika
  7. lsi_ -> load/save/init
  8. gi_ -> game init
  9. ko_ -> kofolovy fce v editoru
  10. Komat:
  11. ------
  12. be_ -> berusky editor
  13. ber_ -> berusky hra
  14. */
  15. #ifndef __BERUSKY_UNIVERSAL
  16. #define __BERUSKY_UNIVERSAL
  17. #define VERZE_KOMAT "MASTER 1.2"
  18. #ifdef _DEBUG
  19. #define DEBUG_MOD // sbiraji se citlive informace
  20. //#define DEBUG_MOD_OBALKY // sbiraji se citlive informace
  21. #endif
  22. #define MAX_VZDAL_KAMERY 70
  23. #define MIN_VZDAL_KAMERY 10
  24. #define MAX_UHEL_KAMERY DEG2RAD(85.0f) //max uhel 85 stupnu
  25. #define MIN_UHEL_KAMERY DEG2RAD(30.0f) //min uhel 35 stupnu
  26. #define MAX_CELKEM_MATERIALU 1000
  27. #define MAX_CELKEM_TEXTUR 500
  28. #define MAX_RAY_TEXTUR 1000
  29. #define MAX_BERUSKY_KONTEJNERU 2000
  30. #define MAX_TOP_KONTEJNERU 100
  31. #define MAX_BERUSKY_DATABAZE 100
  32. #define MAX_PRVKU_DATABAZE 1000
  33. #define MAX_PRVKU_LEVEL 1000
  34. #define MAX_PRVKU_LEVEL_TOP 100
  35. #define MAX_PRVKU_LEVEL_LOW 200
  36. #define MAX_PATER 100
  37. #define MAX_FLARE_SVETEL 100
  38. #define MAX_STATE_BLOKU 100 // celkovy pocet state bloku
  39. #define MAX_PRHL_OBJEKTU 1000
  40. #define X_ZACATEK (p_bnf->x_start)
  41. #define Y_ZACATEK (p_bnf->y_start)
  42. #define Z_ZACATEK (p_bnf->z_start)
  43. #define X_PRVEK 2
  44. #define Y_PRVEK 2
  45. #define Z_PRVEK 2
  46. #define X_PRVEK2 (X_PRVEK>>1)
  47. #define Y_PRVEK2 (Y_PRVEK>>1)
  48. #define Z_PRVEK2 (Z_PRVEK>>1)
  49. typedef struct _LEVEL_HEADER
  50. {
  51. int magic; // magicke cislo
  52. int x, z, y; // rozmery levelu
  53. // LV 6
  54. int prvku; // pocet prvku v levelu
  55. float x_start, // starty levelu
  56. y_start, z_start;
  57. int rezerved[97]; // rezervovano
  58. } LEVEL_HEADER;
  59. typedef struct _BUNKA_LEVELU_DISK
  60. {
  61. int guid;
  62. int Vazba1;
  63. int Vazba2;
  64. int Rotace;
  65. int mesh; // provazani se scenou
  66. int rez[10]; // rezerva
  67. } BUNKA_LEVELU_DISK;
  68. typedef int MeshHandle; // handle meshe/prvku pri loadu
  69. typedef int ExMeshHandle; // handle extra-mesh (neni to prvek ale jen mesh)
  70. typedef int DataHandle; // handle meshe/prvku v datazazi
  71. typedef int AnimHandle; // handle simple animace (polotovaru animace)
  72. typedef int RunHandle; // handle bezici animace
  73. typedef int MatrixHandle; // handle matice
  74. typedef int MatHandle; // handle animovaneho materialu
  75. typedef int LightHandle; // handle bezneho dynamickeho svetla
  76. typedef int ExtraLightHandle; // handle extra-dynamickeho svetla
  77. typedef int FlekHandle; // handle na fleky
  78. typedef int ParHandle; // handle na casticovac
  79. typedef int FlareHandle; // handle na flare
  80. typedef int HnizdoHandle; // handle na hnizdo
  81. typedef int TextHandle; // handle na texturovou animaci
  82. typedef int VodaHandle; // handle na vodni system
  83. typedef int VodnikHandle; // handle na vodnika ve vodnim systemu
  84. typedef int ChapadelnikHandle; // handle na chapadelnika s chapadlama
  85. typedef int ChapadloHandle; // handle na chapadlo
  86. #define FRAMU_PER_SEC 20
  87. #define DELKA_SEC 1000
  88. #define KONCOVKA_LEVELU ".lv6"
  89. #define MASKA_LEVELU "*.lv6"
  90. #define KONCOVKA_SCENY_OLD ".sc2"
  91. #define KONCOVKA_SCENY ".bpr"
  92. #define MASKA_SCENY "*.bpr"
  93. #define KONCOVKA_MESH_OLD ".out"
  94. #define MASKA_MESH_OLD "*.out"
  95. #define KONCOVKA_MESH ".b2m"
  96. #define MASKA_MESH "*.b2m"
  97. #define KONCOVKA_MATERIAL_OLD ".mnt"
  98. #define MASKA_MATERIAL_OLD "*.mnt"
  99. #define KONCOVKA_MATERIAL ".b2t"
  100. #define MASKA_MATERIAL "*.b2t"
  101. #define KONCOVKA_LIGHTMAPY ".b2l"
  102. #define MASKA_LIGHTMAPY "*.b2l"
  103. #define LIST_PRVKU "prvky.txt"
  104. #define DEFAULT_LEVEL "a.lv6"
  105. #define GUID_PRAZDNA_STENA 21000 // guid neviditelne steny (bez modelu)
  106. #define KONT_NEVID_STENA 0
  107. #define KONT_NEVID_PRVEK 1
  108. #define MAX_TRID 30
  109. #define MAX_PODTRID 30
  110. #define MAX_TRID_JMENO 50
  111. #define DELICKA_CASU 1
  112. // pokud je objekt s guid staticky vraci 1
  113. //
  114. inline int ber_je_objekt_staticky(int guid)
  115. {
  116. int trida = guid / 1000;
  117. return (trida == 2 || trida == 4 || trida == 9 || trida == 17 ||
  118. trida == 19 || trida == 20 || trida == 12);
  119. }
  120. inline int ber_je_objekt_beruska(int guid)
  121. {
  122. int trida = guid / 1000;
  123. return (trida == 1);
  124. }
  125. inline int ber_je_objekt_staticky_bez_exitu(int guid)
  126. {
  127. int trida = guid / 1000;
  128. return (trida == 2 || trida == 9 || trida == 17 ||
  129. trida == 19 || trida == 20 || trida == 12);
  130. }
  131. #endif