~ubuntu-branches/ubuntu/wily/swell-foop/wily

« back to all changes in this revision

Viewing changes to src/game-view.c

  • Committer: Package Import Robot
  • Author(s): Andreas Henriksson
  • Date: 2015-05-19 14:54:40 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20150519145440-5gvlqn2aijuq2xzw
Tags: 1:3.16.1-1
* New upstream release.
* Switch build-dependency from appdata-tools to appstream-util

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* game-view.c generated by valac 0.25.4.4-19ea, the Vala compiler
 
1
/* game-view.c generated by valac 0.26.1, the Vala compiler
2
2
 * generated from game-view.vala, do not modify */
3
3
 
4
4
/*
251
251
gboolean game_remove_connected_tiles (Game* self, Tile* tile);
252
252
gboolean game_view_board_left_cb (GameView* self);
253
253
void game_reset_visit (Game* self);
 
254
static TileActor* game_view_find_tile_at_position (GameView* self, gint position_x, gint position_y);
254
255
void game_view_cursor_move (GameView* self, gint x, gint y);
255
256
gint game_view_get_cursor_x (GameView* self);
256
257
gint game_view_get_cursor_y (GameView* self);
1036
1037
}
1037
1038
 
1038
1039
 
 
1040
static TileActor* game_view_find_tile_at_position (GameView* self, gint position_x, gint position_y) {
 
1041
        TileActor* result = NULL;
 
1042
        TileActor** _tmp0_ = NULL;
 
1043
        gint _tmp0__length1 = 0;
 
1044
        gint _tmp0__length2 = 0;
 
1045
        g_return_val_if_fail (self != NULL, NULL);
 
1046
        _tmp0_ = self->priv->tiles;
 
1047
        _tmp0__length1 = self->priv->tiles_length1;
 
1048
        _tmp0__length2 = self->priv->tiles_length2;
 
1049
        {
 
1050
                TileActor** actor_collection = NULL;
 
1051
                gint actor_collection_length1 = 0;
 
1052
                gint actor_collection_length2 = 0;
 
1053
                gint actor_it = 0;
 
1054
                actor_collection = _tmp0_;
 
1055
                actor_collection_length1 = _tmp0__length1 * _tmp0__length2;
 
1056
                for (actor_it = 0; actor_it < (_tmp0__length1 * _tmp0__length2); actor_it = actor_it + 1) {
 
1057
                        TileActor* _tmp1_ = NULL;
 
1058
                        TileActor* actor = NULL;
 
1059
                        _tmp1_ = _g_object_ref0 (actor_collection[actor_it]);
 
1060
                        actor = _tmp1_;
 
1061
                        {
 
1062
                                gboolean _tmp2_ = FALSE;
 
1063
                                TileActor* _tmp3_ = NULL;
 
1064
                                Tile* _tmp4_ = NULL;
 
1065
                                gint _tmp5_ = 0;
 
1066
                                gint _tmp6_ = 0;
 
1067
                                _tmp3_ = actor;
 
1068
                                _tmp4_ = _tmp3_->tile;
 
1069
                                _tmp5_ = _tmp4_->grid_x;
 
1070
                                _tmp6_ = position_x;
 
1071
                                if (_tmp5_ == _tmp6_) {
 
1072
                                        TileActor* _tmp7_ = NULL;
 
1073
                                        Tile* _tmp8_ = NULL;
 
1074
                                        gint _tmp9_ = 0;
 
1075
                                        gint _tmp10_ = 0;
 
1076
                                        _tmp7_ = actor;
 
1077
                                        _tmp8_ = _tmp7_->tile;
 
1078
                                        _tmp9_ = _tmp8_->grid_y;
 
1079
                                        _tmp10_ = position_y;
 
1080
                                        _tmp2_ = _tmp9_ == _tmp10_;
 
1081
                                } else {
 
1082
                                        _tmp2_ = FALSE;
 
1083
                                }
 
1084
                                if (_tmp2_) {
 
1085
                                        result = actor;
 
1086
                                        return result;
 
1087
                                }
 
1088
                                _g_object_unref0 (actor);
 
1089
                        }
 
1090
                }
 
1091
        }
 
1092
        result = NULL;
 
1093
        return result;
 
1094
}
 
1095
 
 
1096
 
1039
1097
void game_view_cursor_move (GameView* self, gint x, gint y) {
1040
1098
        TileActor* _tmp0_ = NULL;
1041
1099
        gint _tmp1_ = 0;
1044
1102
        gint _tmp4_ = 0;
1045
1103
        gint _tmp5_ = 0;
1046
1104
        gint _tmp6_ = 0;
1047
 
        TileActor** _tmp7_ = NULL;
1048
 
        gint _tmp7__length1 = 0;
1049
 
        gint _tmp7__length2 = 0;
 
1105
        gint _tmp7_ = 0;
1050
1106
        gint _tmp8_ = 0;
1051
1107
        gint _tmp9_ = 0;
1052
1108
        gint _tmp10_ = 0;
1053
 
        gint _tmp11_ = 0;
 
1109
        TileActor* _tmp11_ = NULL;
1054
1110
        TileActor* _tmp12_ = NULL;
1055
 
        TileActor* _tmp13_ = NULL;
1056
 
        TileActor* _tmp14_ = NULL;
1057
1111
        gfloat xx = 0.0F;
1058
1112
        gfloat yy = 0.0F;
 
1113
        gint _tmp14_ = 0;
1059
1114
        gint _tmp15_ = 0;
1060
1115
        gint _tmp16_ = 0;
1061
 
        gint _tmp17_ = 0;
 
1116
        Game* _tmp17_ = NULL;
1062
1117
        Game* _tmp18_ = NULL;
1063
 
        Game* _tmp19_ = NULL;
 
1118
        gint _tmp19_ = 0;
1064
1119
        gint _tmp20_ = 0;
1065
1120
        gint _tmp21_ = 0;
1066
1121
        gint _tmp22_ = 0;
1067
1122
        gint _tmp23_ = 0;
1068
 
        gint _tmp24_ = 0;
 
1123
        CursorActor* _tmp24_ = NULL;
1069
1124
        CursorActor* _tmp25_ = NULL;
1070
 
        CursorActor* _tmp26_ = NULL;
1071
1125
        g_return_if_fail (self != NULL);
1072
1126
        self->priv->cursor_active = TRUE;
1073
1127
        _tmp0_ = self->priv->highlighted;
1080
1134
        _tmp5_ = _tmp4_;
1081
1135
        _tmp6_ = y;
1082
1136
        game_view_set_cursor_y (self, _tmp5_ + _tmp6_);
1083
 
        _tmp7_ = self->priv->tiles;
1084
 
        _tmp7__length1 = self->priv->tiles_length1;
1085
 
        _tmp7__length2 = self->priv->tiles_length2;
1086
 
        _tmp8_ = game_view_get_cursor_x (self);
1087
 
        _tmp9_ = _tmp8_;
1088
 
        _tmp10_ = game_view_get_cursor_y (self);
1089
 
        _tmp11_ = _tmp10_;
1090
 
        _tmp12_ = _tmp7_[(_tmp9_ * _tmp7__length2) + _tmp11_];
1091
 
        _tmp13_ = _g_object_ref0 (_tmp12_);
 
1137
        _tmp7_ = game_view_get_cursor_x (self);
 
1138
        _tmp8_ = _tmp7_;
 
1139
        _tmp9_ = game_view_get_cursor_y (self);
 
1140
        _tmp10_ = _tmp9_;
 
1141
        _tmp11_ = game_view_find_tile_at_position (self, _tmp8_, _tmp10_);
1092
1142
        _g_object_unref0 (self->priv->highlighted);
1093
 
        self->priv->highlighted = _tmp13_;
1094
 
        _tmp14_ = self->priv->highlighted;
1095
 
        game_view_opacity_for_connected_tiles (self, _tmp14_, 255);
1096
 
        _tmp15_ = game_view_get_cursor_x (self);
1097
 
        _tmp16_ = _tmp15_;
1098
 
        _tmp17_ = self->priv->tile_size;
1099
 
        xx = (gfloat) (_tmp16_ * _tmp17_);
1100
 
        _tmp18_ = game_view_get_game (self);
1101
 
        _tmp19_ = _tmp18_;
1102
 
        _tmp20_ = game_get_rows (_tmp19_);
1103
 
        _tmp21_ = _tmp20_;
1104
 
        _tmp22_ = game_view_get_cursor_y (self);
1105
 
        _tmp23_ = _tmp22_;
1106
 
        _tmp24_ = self->priv->tile_size;
1107
 
        yy = (gfloat) (((_tmp21_ - 1) - _tmp23_) * _tmp24_);
 
1143
        self->priv->highlighted = _tmp11_;
 
1144
        _tmp12_ = self->priv->highlighted;
 
1145
        if (_tmp12_ != NULL) {
 
1146
                TileActor* _tmp13_ = NULL;
 
1147
                _tmp13_ = self->priv->highlighted;
 
1148
                game_view_opacity_for_connected_tiles (self, _tmp13_, 255);
 
1149
        }
 
1150
        _tmp14_ = game_view_get_cursor_x (self);
 
1151
        _tmp15_ = _tmp14_;
 
1152
        _tmp16_ = self->priv->tile_size;
 
1153
        xx = (gfloat) (_tmp15_ * _tmp16_);
 
1154
        _tmp17_ = game_view_get_game (self);
 
1155
        _tmp18_ = _tmp17_;
 
1156
        _tmp19_ = game_get_rows (_tmp18_);
 
1157
        _tmp20_ = _tmp19_;
 
1158
        _tmp21_ = game_view_get_cursor_y (self);
 
1159
        _tmp22_ = _tmp21_;
 
1160
        _tmp23_ = self->priv->tile_size;
 
1161
        yy = (gfloat) (((_tmp20_ - 1) - _tmp22_) * _tmp23_);
 
1162
        _tmp24_ = self->priv->cursor;
 
1163
        clutter_actor_set_position ((ClutterActor*) _tmp24_, xx, yy);
1108
1164
        _tmp25_ = self->priv->cursor;
1109
 
        clutter_actor_set_position ((ClutterActor*) _tmp25_, xx, yy);
1110
 
        _tmp26_ = self->priv->cursor;
1111
 
        clutter_actor_show ((ClutterActor*) _tmp26_);
 
1165
        clutter_actor_show ((ClutterActor*) _tmp25_);
1112
1166
}
1113
1167
 
1114
1168
 
1758
1812
                _inner_error_ = NULL;
1759
1813
                _tmp49_ = e;
1760
1814
                _tmp50_ = _tmp49_->message;
1761
 
                g_warning ("game-view.vala:341: Failed to load textures: %s", _tmp50_);
 
1815
                g_warning ("game-view.vala:352: Failed to load textures: %s", _tmp50_);
1762
1816
                _g_error_free0 (e);
1763
1817
        }
1764
1818
        goto __finally0;
1771
1825
                _inner_error_ = NULL;
1772
1826
                _tmp51_ = e;
1773
1827
                _tmp52_ = _tmp51_->message;
1774
 
                g_warning ("game-view.vala:345: Failed to load textures: %s", _tmp52_);
 
1828
                g_warning ("game-view.vala:356: Failed to load textures: %s", _tmp52_);
1775
1829
                _g_error_free0 (e);
1776
1830
        }
1777
1831
        __finally0: