original 1.0.1 release
[xwelltris.git] / src / geometry.cxx
blob8f1f124a5de99dab8ab88b60a0c15ddf3bc18c42
1 // docm_prefix(///)
2 /****************************************************************************
3 * Copyright (C) 2002 by Leo Khramov
4 * email: leo@xnc.dubna.su
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 ****************************************************************************/
16 // $Id: geometry.cxx,v 1.1.1.1 2003/01/04 11:37:22 leo Exp $
18 #include "globals.h"
19 #include "geometry.h"
22 //imNone means simple clear this area with background image :)
24 Geo top_key_exit[]= {
25 // image srcx srcy dstx dsty len hei
26 { imNone, 0, 0, 734, 550, 57, 40 }, //Normal view
27 { imCuts, 0, 365, 734, 550, 57, 39 }, //Highlighted
28 { imNone, 0, 0, 734, 550, 57, 40 }, //Pressed
31 Geo intro_key_exit[]= {
32 // image srcx srcy dstx dsty len hei
33 { imNone, 0, 0, 734, 550, 57, 40 }, //Normal view
34 { imCuts, 0, 365, 734, 550, 57, 40 }, //Highlighted
35 { imNone, 0, 0, 734, 550, 57, 40 }, //Pressed
38 Geo intro_key_new_game[]= {
39 // image srcx srcy dstx dsty len hei
40 { imNone, 0, 0, 332, 500, 130, 40 }, //Normal view
41 { imCuts, 0, 215, 332, 500, 130, 40 }, //Highlighted
42 { imNone, 0, 0, 332, 500, 130, 40 }, //Pressed
45 Geo intro_key_top_nine[]= {
46 // image srcx srcy dstx dsty len hei
47 { imNone, 0, 0, 333, 544, 123, 41 }, //Normal view
48 { imCuts, 0, 255, 333, 544, 123, 41 }, //Highlighted
49 { imNone, 0, 0, 333, 544, 123, 41 }, //Pressed
52 Geo intro_key_plus[]= {
53 // image srcx srcy dstx dsty len hei
54 { imNone, 0, 0, 720, 400, 25, 25 }, //Normal view
55 { imNone, 0, 0, 720, 400, 25, 25 }, //Highlighted
56 { imNone, 0, 0, 720, 400, 25, 25 }, //Pressed
59 Geo intro_key_minus[]= {
60 // image srcx srcy dstx dsty len hei
61 { imNone, 0, 0, 640, 405, 25, 17 }, //Normal view
62 { imNone, 0, 0, 640, 405, 25, 17 }, //Highlighted
63 { imNone, 0, 0, 640, 405, 25, 17 }, //Pressed
66 Geo game_elements[]= {
67 // image srcx srcy dstx dsty len hei
68 { imCuts, 160, 0, 130, 120, 296, 215 }, //Pause image
69 { imCuts, 120, 0, 603, 469, 30, 26 }, //Rotation image
70 { imCuts, 120, 38, 608, 509, 26, 16 }, //Next piece image
71 { imCuts, 120, 76, 610, 539, 22, 24 }, //Mixed image
74 Geo top_nine_elements[]= {
75 // image srcx srcy dstx dsty len hei
76 { imCuts, 90, 365, 704, 119, 25, 26 }, //Rotation image
77 { imCuts, 115, 365, 729, 119, 33, 26 }, //Next piece image
78 { imCuts, 148, 365, 762, 119, 18, 26 }, //Mixed image
81 Geo intro_sw_rotation[]= {
82 // image srcx srcy dstx dsty len hei
83 { imNone, 0, 0, 640, 225, 93, 34 }, //Normal view
84 { imCuts, 0, 298, 640, 225, 93, 34 }, //Highlighted
85 { imCuts, 120, 296, 739, 228, 25, 25 }, //Pressed
88 Geo intro_sw_next_piece[]= {
89 // image srcx srcy dstx dsty len hei
90 { imNone, 0, 0, 616, 268, 116, 35 }, //Normal view
91 { imCuts, 0, 330, 616, 268, 116, 35 }, //Highlighted
92 { imCuts, 120, 330, 739, 270, 25, 25 }, //Pressed
95 Geo intro_sw_mixed[]= {
96 // image srcx srcy dstx dsty len hei
97 { imNone, 0, 0, 65, 379, 71, 35 }, //Normal view
98 { imCuts, 0, 180, 65, 379, 71, 35 }, //Highlighted
99 { imCuts, 90, 180, 35, 385, 25, 25 }, //Pressed
102 Geo intro_sw_square0[]= {
103 // image srcx srcy dstx dsty len hei
104 { imNone, 0, 0, 65, 115, 75, 38 }, //Normal view
105 { imCuts, 0, 0, 65, 115, 75, 38 }, //Highlighted
106 { imCuts, 90, 0, 35, 122, 25, 25 }, //Pressed
109 Geo intro_sw_square1[]= {
110 // image srcx srcy dstx dsty len hei
111 { imNone, 0, 0, 65, 158, 77, 38 }, //Normal view
112 { imCuts, 0, 38, 65, 158, 77, 38 }, //Highlighted
113 { imCuts, 90, 38, 35, 167, 25, 25 }, //Pressed
116 Geo intro_sw_square2[]= {
117 // image srcx srcy dstx dsty len hei
118 { imNone, 0, 0, 65, 205, 70, 34 }, //Normal view
119 { imCuts, 0, 76, 65, 205, 70, 34 }, //Highlighted
120 { imCuts, 90, 76, 35, 209, 25, 25 }, //Pressed
123 Geo intro_sw_square3[]= {
124 // image srcx srcy dstx dsty len hei
125 { imNone, 0, 0, 65, 248, 89, 35 }, //Normal view
126 { imCuts, 0, 109, 65, 248, 89, 35 }, //Highlighted
127 { imCuts, 90, 109, 35, 254, 25, 25 }, //Pressed
130 Geo intro_sw_square4[]= {
131 // image srcx srcy dstx dsty len hei
132 { imNone, 0, 0, 65, 292, 78, 35 }, //Normal view
133 { imCuts, 0, 145, 65, 292, 78, 35 }, //Highlighted
134 { imCuts, 90, 145, 35, 296, 25, 25 }, //Pressed
137 Geo intro_sw_square5[]= {
138 // image srcx srcy dstx dsty len hei
139 { imNone, 0, 0, 65, 392, 78, 35 }, //Normal view
140 { imCuts, 0, 145, 65, 392, 78, 35 }, //Highlighted
141 { imCuts, 90, 145, 35, 396, 25, 25 }, //Pressed
144 Geo intro_inp_player_name[]= {
145 // image srcx srcy dstx dsty len hei
146 { imCuts, 170, 215, 211, 205, 357, 154 }, //full view
147 { imCuts, 0, 0, 240, 297, 299, 30 }, //input area
148 { imCuts, 90, 145, 35, 296, 25, 25 }, //Pressed
153 // Array of all objects geometry
154 GeoObject all_objects[]= {
155 { "top_key_exit" , top_key_exit },
156 { "intro_key_exit" , intro_key_exit },
157 { "intro_key_new_game", intro_key_new_game },
158 { "intro_key_top_nine", intro_key_top_nine },
159 { "intro_key_minus" , intro_key_minus },
160 { "intro_key_plus" , intro_key_plus },
161 { "the_game" , game_elements },
162 { "top_nine_elements" , top_nine_elements },
163 { "intro_sw_rotation" , intro_sw_rotation },
164 { "intro_sw_next" , intro_sw_next_piece },
165 { "intro_sw_mixed" , intro_sw_mixed },
166 { "intro_sw_square0" , intro_sw_square0 },
167 { "intro_sw_square1" , intro_sw_square1 },
168 { "intro_sw_square2" , intro_sw_square2 },
169 { "intro_sw_square3" , intro_sw_square3 },
170 { "intro_sw_square4" , intro_sw_square4 },
171 { "intro_sw_square5" , intro_sw_square5 },
172 { "intro_inp_player" , intro_inp_player_name },
173 { "empty", 0}
178 //===========================================================================
179 /// global get_geo_by_name(char* fname)
180 /// find geometry structures for object by given name
181 /// tags geometry
182 Geo* get_geo_by_name(char* name)
184 int i=0;
185 while(all_objects[i].geo)
187 if(!strcmp(all_objects[i].name,name))
188 return all_objects[i].geo;
189 i++;
191 return 0;