00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifdef HAVE_CONFIG_H
00026 # include <config.h>
00027 #endif
00028
00029
00030 #include "u7drag.h"
00031 #include "utils.h"
00032
00033
00034
00035
00036
00037
00038
00039 int Store_u7_shapeid
00040 (
00041 unsigned char *data,
00042 int file,
00043 int shape,
00044 int frame
00045 )
00046 {
00047 unsigned char *ptr = data;
00048 *ptr++ = file;
00049 Write2(ptr, shape);
00050 *ptr++ = frame;
00051 return (ptr - data);
00052 }
00053
00054
00055
00056
00057
00058 void Get_u7_shapeid
00059 (
00060 unsigned char *data,
00061 int& file,
00062 int& shape,
00063 int& frame
00064 )
00065 {
00066 unsigned char *ptr = data;
00067 file = *ptr++;
00068 shape = Read2(ptr);
00069 frame = *ptr;
00070 }
00071
00072
00073
00074
00075
00076
00077
00078 int Store_u7_chunkid
00079 (
00080 unsigned char *data,
00081 int cnum
00082 )
00083 {
00084 unsigned char *ptr = data;
00085 Write2(ptr, cnum);
00086 return (ptr - data);
00087 }
00088
00089
00090
00091
00092
00093 void Get_u7_chunkid
00094 (
00095 unsigned char *data,
00096 int& cnum
00097 )
00098 {
00099 unsigned char *ptr = data;
00100 cnum = Read2(ptr);
00101 }
00102
00103
00104
00105
00106
00107
00108
00109 int Store_u7_comboid
00110 (
00111 unsigned char *data,
00112 int xtiles, int ytiles,
00113 int tiles_right,
00114 int tiles_below,
00115 int cnt,
00116 U7_combo_data *ents
00117
00118 )
00119 {
00120 unsigned char *ptr = data;
00121 Write2(ptr, xtiles);
00122 Write2(ptr, ytiles);
00123 Write2(ptr, tiles_right);
00124 Write2(ptr, tiles_below);
00125 Write2(ptr, cnt);
00126 for (int i = 0; i < cnt; i++)
00127 {
00128 Write2(ptr, ents[i].tx);
00129 Write2(ptr, ents[i].ty);
00130 Write2(ptr, ents[i].tz);
00131 Write2(ptr, ents[i].shape);
00132 *ptr++ = (unsigned char) ents[i].frame;
00133 }
00134 return (ptr - data);
00135 }
00136
00137
00138
00139
00140
00141
00142
00143
00144 void Get_u7_comboid
00145 (
00146 unsigned char *data,
00147 int& xtiles, int& ytiles,
00148 int& tiles_right,
00149 int& tiles_below,
00150 int& cnt,
00151 U7_combo_data *& ents
00152 )
00153 {
00154 unsigned char *ptr = data;
00155 xtiles = Read2(ptr);
00156 ytiles = Read2(ptr);
00157 tiles_right = Read2(ptr);
00158 tiles_below = Read2(ptr);
00159 cnt = Read2(ptr);
00160 ents = new U7_combo_data[cnt];
00161 for (int i = 0; i < cnt; i++)
00162 {
00163 ents[i].tx = (int) (short) Read2(ptr);
00164 ents[i].ty = (int) (short) Read2(ptr);
00165 ents[i].tz = (int) (short) Read2(ptr);
00166 ents[i].shape = Read2(ptr);
00167 ents[i].frame = *ptr++;
00168 }
00169 }