Beispiel #1
0
        bool check_screens_block(int _block_id, tiles_data _data)
        {
            int block_n;
            int scr_n;
            int scr_block_n;

            screen_data scr;

            // check duplicate(s)
            for (block_n = 0; block_n < _block_id; block_n++)
            {
                if (_data.cmp_blocks(_block_id, block_n))
                {
                    for (scr_n = 0; scr_n < _data.screen_data_cnt(); scr_n++)
                    {
                        scr = _data.get_screen_data(scr_n);

                        for (scr_block_n = 0; scr_block_n < scr.length; scr_block_n++)
                        {
                            if (scr.get_tile(scr_block_n) == _block_id)
                            {
                                // replace _block_id with block_n
                                scr.set_tile(scr_block_n, ( ushort )block_n);
                            }
                        }
                    }
                }
            }

            for (scr_n = 0; scr_n < _data.screen_data_cnt(); scr_n++)
            {
                scr = _data.get_screen_data(scr_n);

                for (scr_block_n = 0; scr_block_n < scr.length; scr_block_n++)
                {
                    if (scr.get_tile(scr_block_n) == _block_id)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }