ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/crossedit/Edit.c
(Generate patch)

Comparing deliantra/server/crossedit/Edit.c (file contents):
Revision 1.2 by pippijn, Sun May 7 08:19:29 2006 UTC vs.
Revision 1.3 by pippijn, Sun May 7 13:24:54 2006 UTC

50 * after this function has been called. 50 * after this function has been called.
51 * (What happened to this function? It no longer copies the pointers! -Frank) 51 * (What happened to this function? It no longer copies the pointers! -Frank)
52 * moved to Edit.c from common/map.c since Edit.c is the only file that uses it. 52 * moved to Edit.c from common/map.c since Edit.c is the only file that uses it.
53 */ 53 */
54 54
55static void copy_map(mapstruct *m1, mapstruct *m2) { 55void copy_map(mapstruct *m1, mapstruct *m2) {
56 int x,y; 56 int x,y;
57 57
58 memcpy(m2, m1, sizeof(mapstruct)); 58 memcpy(m2, m1, sizeof(mapstruct));
59 59
60 for(x=0;x<MAP_WIDTH(m1)&&x<MAP_WIDTH(m2);x++) 60 for(x=0;x<MAP_WIDTH(m1)&&x<MAP_WIDTH(m2);x++)
71 * width : width of target map 71 * width : width of target map
72 * height: height of target map 72 * height: height of target map
73 * dx : positive translate to right 73 * dx : positive translate to right
74 * dy : positive translate to down 74 * dy : positive translate to down
75 */ 75 */
76static mapstruct *MapMoveScrollResize(mapstruct *source, 76mapstruct *MapMoveScrollResize(mapstruct *source,
77 int width, int height, int dx, int dy) 77 int width, int height, int dx, int dy)
78{ 78{
79 mapstruct *target; 79 mapstruct *target;
80 object *obj,*prt; /* PaRT of obj */ 80 object *obj,*prt; /* PaRT of obj */
81 int x,y,sx = MAP_WIDTH(source), sy = MAP_HEIGHT(source); 81 int x,y,sx = MAP_WIDTH(source), sy = MAP_HEIGHT(source);
160 delete_map (source); 160 delete_map (source);
161 return target; 161 return target;
162} 162}
163 163
164 164
165static object * MapGetRealObject (mapstruct * emap, int x, int y, int z) 165object * MapGetRealObject (mapstruct * emap, int x, int y, int z)
166{ 166{
167 object *tmp = MapGetObjectZ (emap, x, y, z); 167 object *tmp = MapGetObjectZ (emap, x, y, z);
168 return tmp ? (tmp->head ? tmp->head : tmp) : tmp; 168 return tmp ? (tmp->head ? tmp->head : tmp) : tmp;
169} 169}
170 170
171static int MapInsertObjectZ(mapstruct *emap,object *o,int x, int y, int z) 171int MapInsertObjectZ(mapstruct *emap,object *o,int x, int y, int z)
172{ 172{
173 object *op, *above, *below; 173 object *op, *above, *below;
174 174
175 if (o->more) 175 if (o->more)
176 MapInsertObjectZ (emap,o->more, x, y, z); 176 MapInsertObjectZ (emap,o->more, x, y, z);
209 set_map_ob (emap, o->x, o->y, o); 209 set_map_ob (emap, o->x, o->y, o);
210 210
211 return (0); 211 return (0);
212} 212}
213 213
214static int MapObjectOut (mapstruct *target, object *obj, int x, int y) { 214int MapObjectOut (mapstruct *target, object *obj, int x, int y) {
215 object *tmp; 215 object *tmp;
216 for(tmp = obj; tmp; tmp = tmp->more) 216 for(tmp = obj; tmp; tmp = tmp->more)
217 if(OUT_OF_REAL_MAP(target,x + tmp->x,y + tmp->y)) return 1; 217 if(OUT_OF_REAL_MAP(target,x + tmp->x,y + tmp->y)) return 1;
218 return 0; 218 return 0;
219} 219}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines