state.h 3.6 KB

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