Commit 8be35ae74ae8cbf5aee986ad3bbbe7b87c1f63e5
- Diff rendering mode:
- inline
- side by side
champlain/map.c
(19 / 2)
|   | |||
| 105 | 105 | gboolean | |
| 106 | 106 | map_zoom_out (Map* map) | |
| 107 | 107 | { | |
| 108 | if(map->current_level->level - 1 >= 0) | ||
| 108 | gint new_level = map->current_level->level - 1; | ||
| 109 | if(new_level >= 0) | ||
| 109 | 110 | { | |
| 110 | map_load_level(map, map->current_level->level - 1); | ||
| 111 | gboolean exist = FALSE; | ||
| 112 | int i; | ||
| 113 | for (i = 0; i < map->current_level->tiles->len && !exist; i++) | ||
| 114 | { | ||
| 115 | ZoomLevel* level = g_ptr_array_index(map->levels, i); | ||
| 116 | if ( level->level == new_level) | ||
| 117 | { | ||
| 118 | exist = TRUE; | ||
| 119 | map->current_level = level; | ||
| 120 | g_print("Found!"); | ||
| 121 | } | ||
| 122 | } | ||
| 123 | |||
| 124 | if(!exist) | ||
| 125 | { | ||
| 126 | map_load_level(map, map->current_level->level - 1); | ||
| 127 | } | ||
| 111 | 128 | return TRUE; | |
| 112 | 129 | } | |
| 113 | 130 | return FALSE; |
champlain/zoomlevel.c
(2 / 0)
|   | |||
| 34 | 34 | level->tiles = g_ptr_array_sized_new (row * column); | |
| 35 | 35 | level->group = clutter_group_new (); | |
| 36 | 36 | ||
| 37 | g_object_ref(level->group); // so that the group isn't destroyed when removed from the viewport | ||
| 38 | |||
| 37 | 39 | return level; | |
| 38 | 40 | } | |
| 39 | 41 |
Comments
Add your comment
Please log in to comment



Add a new comment:
Login or create an account to post a comment