state.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #ifndef ERUTA_STATE_H
  2. #define ERUTA_STATE_H
  3. /** The data struct contains all global state and other data of the application.
  4. */
  5. typedef struct State_ State;
  6. #include "eruta.h"
  7. #include "tilemap.h"
  8. #include "mode.h"
  9. #include "rh.h"
  10. #include "sprite.h"
  11. #include "spritelist.h"
  12. #include "zori.h"
  13. #define STATE_COLORS 16
  14. #define STATE_BLACK 0
  15. #define STATE_WHITE 1
  16. /** Amount of samples that can be played at the same time. */
  17. #define STATE_SAMPLES 16
  18. State * state_get(void);
  19. State * state_set (State * state );
  20. Tilemap * state_nowmap (State * state );
  21. Tilemap * state_loadmap (State * state );
  22. State * state_alloc(void);
  23. void state_free (State * self );
  24. State * state_errmsg_ (State * state , char * mesg );
  25. char * state_errmsg (State * state );
  26. State * state_eventsource (State * state , ALLEGRO_EVENT_SOURCE * src);
  27. ALLEGRO_COLOR state_color (State * state , int color );
  28. ALLEGRO_COLOR
  29. state_color_f(State * state , int color ,
  30. float r , float g , float b , float a );
  31. Ruby * state_ruby (State * state );
  32. struct zori_console * state_console (State * state );
  33. int state_initjoystick (State * self );
  34. State * state_init (State * self , BOOL fullscreen );
  35. BOOL state_done (State * state );
  36. BOOL state_busy (State * self );
  37. int state_poll (State * state , ALLEGRO_EVENT * event );
  38. ALLEGRO_EVENT * state_pollnew (State * state );
  39. ALLEGRO_FONT * state_font (State * state );
  40. void state_frames_update (State * state );
  41. int state_frames (State * state );
  42. double state_fps (State * state );
  43. double state_frametime (State * state );
  44. Camera * state_camera (State * state );
  45. Sprite * state_sprite(State * state, int index);
  46. Sprite * state_new_sprite(State * state);
  47. int state_new_sprite_id(State * state);
  48. int state_sprite_load_builtin
  49. (State * state, int sprite_index, int layer_index, char * vpath, int layout);
  50. int state_sprite_tintlayer
  51. (State * state, int sprite_index, int layer_index, int, int g, int b, int a);
  52. Area * state_area(State * state);
  53. SpriteList * state_sprites(State * state);
  54. Thing * state_thing(State * state, int index);
  55. Thing * state_newthing(State * state, int kind,
  56. int x, int y, int z, int w, int h);
  57. int state_newthingindex(State * state, int kind,
  58. int x, int y, int z, int w, int h);
  59. int state_thing_tint_layer
  60. (State * state, int thing_index, int layer_index, int r, int g, int b, int a);
  61. int state_camera_track_(State * state, int thing_index);
  62. int state_lockin_maplayer(State * state, int layer);
  63. int state_loadtilemap_vpath(State * self, char * vpath);
  64. void state_draw(State * self);
  65. void state_flip_display(State * self);
  66. void state_update(State * self);
  67. int state_thing_sprite_(State * state, int thing_index, int sprite_index);
  68. int state_thing_pose_(State * state, int thing_index, int pose);
  69. int state_thing_direction_(State * state, int thing_index, int direction);
  70. int state_actorindex_(State * self, int thing_index);
  71. Thing * state_actor(State * self);
  72. int state_active_map_id(State * state);
  73. int state_active_map_id_(State * state, int index);
  74. int state_image_mask_to_alpha(State * state, int store_index, int r, int g, int b);
  75. int state_image_average_to_alpha(State * state, int store_index, int r, int g, int b);
  76. int global_state_show_fps();
  77. int global_state_show_fps_(int show);
  78. int global_state_show_graph();
  79. int global_state_show_graph_(int show);
  80. int global_state_show_area();
  81. int global_state_show_area_(int show);
  82. int global_state_show_physics();
  83. int global_state_show_physics_(int show);
  84. int state_get_unused_thing_id();
  85. int state_get_unused_sprite_id();
  86. int state_delete_sprite(int index);
  87. int state_delete_thing(int index);
  88. #endif