1 #ifndef LEVEL_EDITOR_H_
2 #define LEVEL_EDITOR_H_
4 #include "game/level/level_editor/layer.h"
5 #include "game/level/level_editor/layer_picker.h"
6 #include "game/level/level_editor/undo_history.h"
7 #include "ui/wiggly_text.h"
10 typedef struct LevelEditor LevelEditor;
11 typedef struct RectLayer RectLayer;
12 typedef struct PointLayer PointLayer;
13 typedef struct LabelLayer LabelLayer;
14 typedef struct Sound_samples Sound_samples;
17 LEVEL_EDITOR_IDLE = 0,
24 LevelEditorState state;
25 Vec2f camera_position;
27 Edit_field edit_field_filename;
28 LayerPicker layer_picker;
29 FadingWigglyText notice;
31 RectLayer *boxes_layer;
32 RectLayer *platforms_layer;
33 RectLayer *back_platforms_layer;
34 PointLayer *goals_layer;
35 PlayerLayer player_layer;
36 RectLayer *lava_layer;
37 RectLayer *regions_layer;
38 BackgroundLayer background_layer;
39 LabelLayer *label_layer;
41 LayerPtr layers[LAYER_PICKER_N];
43 UndoHistory undo_history;
50 const char *file_name;
53 LevelEditor *create_level_editor(Cursor *cursor);
54 LevelEditor *create_level_editor_from_file(const char *file_name, Cursor *cursor);
55 void destroy_level_editor(LevelEditor *level_editor);
57 int level_editor_render(const LevelEditor *level_editor,
58 const Camera *camera);
59 int level_editor_event(LevelEditor *level_editor,
60 const SDL_Event *event,
62 int level_editor_focus_camera(LevelEditor *level_editor,
64 int level_editor_update(LevelEditor *level_editor, float delta_time);
65 void level_editor_sound(LevelEditor *level_editor, Sound_samples *sound_samples);
67 #endif // LEVEL_EDITOR_H_