]> git.sesse.net Git - vlc/blob - modules/video_filter/puzzle.h
decoder: fix data race in input_DecoderChangePause()
[vlc] / modules / video_filter / puzzle.h
1 /*****************************************************************************
2  * puzzle.h : Puzzle game
3  *****************************************************************************
4  * Copyright (C) 2005-2009 VLC authors and VideoLAN
5  * Copyright (C) 2013      Vianney Boyer
6  * $Id$
7  *
8  * Authors: Vianney Boyer <vlcvboyer -at- gmail -dot- com>
9  *
10  * This program is free software; you can redistribute it and/or modify it
11  * under the terms of the GNU Lesser General Public License as published by
12  * the Free Software Foundation; either version 2.1 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with this program; if not, write to the Free Software Foundation,
22  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 #ifndef VLC_PUZZLE_H
26 #define VLC_PUZZLE_H 1
27
28 #include "puzzle_mgt.h"
29
30 struct filter_sys_t {
31     bool b_init;
32     bool b_bake_request;
33     bool b_shape_init;
34     bool b_change_param;
35     bool b_finished;
36     bool b_shuffle_rqst;
37     bool b_mouse_drag;
38     bool b_mouse_mvt;
39
40     param_t s_allocated;
41     param_t s_current_param;
42     param_t s_new_param;
43
44     uint32_t i_done_count, i_tmp_done_count;
45
46     int32_t i_mouse_drag_pce;
47     int32_t i_mouse_x, i_mouse_y;
48     int16_t i_pointed_pce;
49     int8_t  i_mouse_action;
50
51     uint32_t i_solve_acc_loop, i_solve_grp_loop, i_calc_corn_loop;
52     int32_t i_magnet_accuracy;
53     int32_t *pi_group_qty;
54
55     int32_t *pi_order;                 /* array which contains final pieces location (used in BASIC GAME MODE)                              */
56     puzzle_array_t ***ps_puzzle_array; /* array [row][col][plane] preset of location & size of each piece in the original image             */
57     piece_shape_t **ps_pieces_shapes;  /* array [each piece type (PCE_TYPE_NBR * negative * 4: top...)][each plane] of piece definition     */
58     piece_t *ps_pieces;                /* list [piece] of pieces data.                                                                      */
59     piece_t *ps_pieces_tmp;            /* used when sorting layers                                                                          */
60
61     puzzle_plane_t *ps_desk_planes;
62     puzzle_plane_t *ps_pict_planes;
63
64     uint8_t i_preview_pos;
65     int32_t i_selected;
66
67     vlc_mutex_t lock, pce_lock;
68
69     int32_t i_auto_shuffle_countdown_val, i_auto_solve_countdown_val;
70
71     point_t **ps_bezier_pts_H;
72 };
73
74 picture_t *Filter( filter_t *, picture_t * );
75 int puzzle_Callback( vlc_object_t *, char const *, vlc_value_t, vlc_value_t, void * );
76 int puzzle_mouse( filter_t *, vlc_mouse_t *, const vlc_mouse_t *, const vlc_mouse_t * );
77
78 #endif