home *** CD-ROM | disk | FTP | other *** search
/ hobbes.nmsu.edu 2008 / 2008-06-02_hobbes.nmsu.edu.zip / new / scummc-0.2.0-os2.zip / ScummC / src / scc_box.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-12-17  |  1.6 KB  |  63 lines

  1. /* ScummC
  2.  * Copyright (C) 2004-2007  Alban Bedel
  3.  *
  4.  * This program is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU General Public License
  6.  * as published by the Free Software Foundation; either version 2
  7.  * of the License, or (at your option) any later version.
  8.  
  9.  * This program is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.  * GNU General Public License for more details.
  13.  
  14.  * You should have received a copy of the GNU General Public License
  15.  * along with this program; if not, write to the Free Software
  16.  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  17.  *
  18.  */
  19.  
  20. /**
  21.  * @file scc_box.h
  22.  * @brief Common box stuff
  23.  */
  24.  
  25. typedef struct scc_box_pts_st {
  26.   int x,y;
  27.   int selected;
  28. } scc_box_pts_t;
  29.  
  30. typedef struct scc_scale_slot_st {
  31.   int s1,y1;
  32.   int s2,y2;
  33. } scc_scale_slot_t;
  34.  
  35. #define SCC_BOX_INVISIBLE 0x80
  36.  
  37. typedef struct scc_box_st scc_box_t;
  38. struct scc_box_st {
  39.   scc_box_t* next;
  40.  
  41.   unsigned id;
  42.   int npts,nsel;
  43.   scc_box_pts_t pts[4];
  44.   uint8_t mask;
  45.   uint8_t flags;
  46.   uint16_t scale;
  47.   char* name;
  48. };
  49.  
  50. void scc_box_list_free(scc_box_t* box);
  51.  
  52. int scc_box_add_pts(scc_box_t* box,int x,int y);
  53.  
  54. int scc_box_are_neighbors(scc_box_t* box,int n1,int n2);
  55.  
  56. int scc_box_get_matrix(scc_box_t* box,uint8_t** ret);
  57.  
  58. scc_box_t* scc_boxes_adjust_point(scc_box_t* box,int x, int y,
  59.                                   int* dst_x, int* dst_y);
  60.  
  61. long long scc_box_adjust_point(scc_box_t* b,int x, int y,
  62.                                int* dst_x, int* dst_y);
  63.