Changeset 101 for oup/rewrite/Global
- Timestamp:
- Feb 20, 2007, 9:43:29 PM (18 years ago)
- Location:
- oup/rewrite/Global
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/rewrite/Global/OniImgClass.pas
r97 r101 700 700 var 701 701 data: TByteData; 702 streampos: Integer; 702 703 begin 703 704 GetAsBMP(data); 705 streampos := Target.Position; 704 706 Target.Write(data[0], Length(data)); 707 Target.Seek(streampos, soFromBeginning); 705 708 end; 706 709 -
oup/rewrite/Global/RawList.pas
r97 r101 3 3 interface 4 4 5 uses TypeDefs , ConnectionManager;5 uses TypeDefs; 6 6 7 7 type 8 8 THandler = function(ConnectionID, FileID: Integer): TRawDataList; 9 TRawListHandler s= record9 TRawListHandler = record 10 10 Ext: String[4]; 11 11 needed: Boolean; 12 12 Handler: THandler; 13 13 end; 14 TRawListHandlers = array of TRawListHandler; 14 15 15 16 TRawLists = class … … 25 26 var 26 27 RawLists: TRawLists; 27 28 28 29 29 30 implementation 30 31 31 32 uses 32 Template ;33 Template, ConnectionManager, Access_OniArchive, Classes, SysUtils; 33 34 34 35 … … 39 40 i: Integer; 40 41 begin 41 if not connection.OSisMac then 42 begin 43 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $1C, 4, @links); 44 links := links * 2; 45 SetLength(Result, links); 46 for i := 0 to links - 1 do 47 begin 48 Result[i].src_offset := $20 + i * 4; 49 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $20 + i * 4, 4, @link); 50 Result[i].raw_addr := link; 51 Result[i].raw_size := 32; 52 Result[i].loc_sep := False; 53 end; 42 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $1C, 4, @links); 43 links := links * 2; 44 SetLength(Result, links); 45 for i := 0 to links - 1 do 46 begin 47 Result[i].SrcOffset := $20 + i * 4; 48 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $20 + i * 4, 4, @link); 49 Result[i].RawAddr := link; 50 Result[i].RawSize := 32; 51 Result[i].LocSep := False; 54 52 end; 55 53 end; … … 64 62 i: Integer; 65 63 begin 66 if not connection.OSisMac then 67 begin 68 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $1C, 4, @links); 69 SetLength(Result, links); 70 for i := 0 to links - 1 do 71 begin 72 Result[i].src_offset := $20 + i * $74 + $24; 73 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $20 + i * $74 + $24, 4, @link); 74 Result[i].raw_addr := link; 75 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $20 + i * $74 + $28, 4, @link); 76 Result[i].raw_size := link; 77 Result[i].loc_sep := False; 78 end; 64 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $1C, 4, @links); 65 SetLength(Result, links); 66 for i := 0 to links - 1 do 67 begin 68 Result[i].SrcOffset := $20 + i * $74 + $24; 69 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $20 + i * $74 + $24, 4, @link); 70 Result[i].RawAddr := link; 71 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $20 + i * $74 + $28, 4, @link); 72 Result[i].RawSize := link; 73 Result[i].LocSep := False; 79 74 end; 80 75 end; … … 91 86 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $08, 4, @datasize); 92 87 SetLength(Result, 1); 93 Result[0]. src_offset := $0C;94 Result[0]. raw_addr := link;95 Result[0]. raw_size := datasize;96 Result[0]. loc_sep := connection.OSisMac;88 Result[0].SrcOffset := $0C; 89 Result[0].RawAddr := link; 90 Result[0].RawSize := datasize; 91 Result[0].LocSep := not (ConManager.Connection[ConnectionID].DataOS = DOS_WIN); 97 92 end; 98 93 … … 108 103 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $0C, 4, @link); 109 104 SetLength(Result, 1); 110 Result[0]. src_offset := $0C;111 Result[0]. raw_addr := link;112 Result[0]. raw_size := datasize;113 Result[0]. loc_sep := connection.OSisMac;105 Result[0].SrcOffset := $0C; 106 Result[0].RawAddr := link; 107 Result[0].RawSize := datasize; 108 Result[0].LocSep := not (ConManager.Connection[ConnectionID].DataOS = DOS_WIN); 114 109 end; 115 110 … … 123 118 begin 124 119 SetLength(Result, 1); 125 if not connection.OSisMac then 120 if ConManager.Connection[ConnectionID].DataOS = DOS_MAC then 121 begin 122 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $10, 4, @datasize); 123 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $14, 4, @link); 124 Result[0].SrcOffset := $14; 125 end 126 else 126 127 begin 127 128 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $40, 4, @datasize); 128 129 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $44, 4, @link); 129 Result[0].src_offset := $44; 130 end 131 else 132 begin 133 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $10, 4, @datasize); 134 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $14, 4, @link); 135 Result[0].src_offset := $14; 136 end; 137 Result[0].raw_addr := link; 138 Result[0].raw_size := datasize; 139 Result[0].loc_sep := False; 130 Result[0].SrcOffset := $44; 131 end; 132 Result[0].RawAddr := link; 133 Result[0].RawSize := datasize; 134 Result[0].LocSep := False; 140 135 end; 141 136 … … 148 143 links: Integer; 149 144 j, k: Integer; 150 Data: TByteData; 145 // Data: TByteData; 146 Data: TStream; 151 147 begin 152 148 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $18, 4, @baselink); … … 155 151 begin 156 152 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $20 + (links - 1) * 4, 4, @lastlink); 157 SetLength(Data, lastlink + 1024); 158 TOniDataDat(connection).LoadRawOffset(False, 159 baselink, lastlink + 1024, Data); 153 // SetLength(Data, lastlink + 1024); 154 Data := nil; 155 TAccess_OniArchive(ConManager.Connection[ConnectionID]).LoadRawOffset( 156 False, baselink, lastlink + 1024, Data); 157 // TOniDataDat(connection).LoadRawOffset(False, baselink, lastlink + 1024, Data); 160 158 // connection.LoadRawFile(fileid,$1C,baselink,lastlink+1024,False,@data[0]); 159 raise ENotImplemented.Create('RawList.SUBT'); 160 end; 161 { 161 162 k := 0; 162 163 for j := 0 to 1024 do … … 182 183 end; 183 184 end; 185 } 184 186 end; 185 187 … … 203 205 {y-pos} 204 206 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $0C, 4, @link); 205 Result[0]. src_offset := $0C;206 Result[0]. raw_addr := link;207 Result[0]. raw_size := frames * 4;207 Result[0].SrcOffset := $0C; 208 Result[0].RawAddr := link; 209 Result[0].RawSize := frames * 4; 208 210 {x-z-pos} 209 211 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $10, 4, @link); 210 Result[1]. src_offset := $10;211 Result[1]. raw_addr := link;212 Result[1]. raw_size := frames * 8;212 Result[1].SrcOffset := $10; 213 Result[1].RawAddr := link; 214 Result[1].RawSize := frames * 8; 213 215 {attacks} 214 216 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $182, 1, @tempb); 215 217 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $14, 4, @link); 216 Result[2]. src_offset := $14;217 Result[2]. raw_addr := link;218 Result[2]. raw_size := tempb * 32;218 Result[2].SrcOffset := $14; 219 Result[2].RawAddr := link; 220 Result[2].RawSize := tempb * 32; 219 221 {damage} 220 222 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $183, 1, @tempb); 221 223 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $18, 4, @link); 222 Result[3]. src_offset := $18;223 Result[3]. raw_addr := link;224 Result[3]. raw_size := tempb * 8;224 Result[3].SrcOffset := $18; 225 Result[3].RawAddr := link; 226 Result[3].RawSize := tempb * 8; 225 227 {motionblur} 226 228 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $184, 1, @tempb); 227 229 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $1C, 4, @link); 228 Result[4]. src_offset := $1C;229 Result[4]. raw_addr := link;230 Result[4]. raw_size := tempb * 8;230 Result[4].SrcOffset := $1C; 231 Result[4].RawAddr := link; 232 Result[4].RawSize := tempb * 8; 231 233 {shortcut} 232 234 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $185, 1, @tempb); 233 235 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $20, 4, @link); 234 Result[5]. src_offset := $20;235 Result[5]. raw_addr := link;236 Result[5]. raw_size := tempb * 8;236 Result[5].SrcOffset := $20; 237 Result[5].RawAddr := link; 238 Result[5].RawSize := tempb * 8; 237 239 {throw} 238 240 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $24, 4, @link); 239 Result[6]. src_offset := $24;240 Result[6]. raw_addr := link;241 Result[6].SrcOffset := $24; 242 Result[6].RawAddr := link; 241 243 if link > 0 then 242 Result[6]. raw_size := 24244 Result[6].RawSize := 24 243 245 else 244 Result[6]. raw_size := 0;246 Result[6].RawSize := 0; 245 247 {footstep} 246 248 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $186, 1, @tempb); 247 249 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $28, 4, @link); 248 Result[7]. src_offset := $28;249 Result[7]. raw_addr := link;250 Result[7]. raw_size := tempb * 4;250 Result[7].SrcOffset := $28; 251 Result[7].RawAddr := link; 252 Result[7].RawSize := tempb * 4; 251 253 {particle} 252 254 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $187, 1, @tempb); 253 255 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $2C, 4, @link); 254 Result[8]. src_offset := $2C;255 Result[8]. raw_addr := link;256 Result[8]. raw_size := tempb * 24;256 Result[8].SrcOffset := $2C; 257 Result[8].RawAddr := link; 258 Result[8].RawSize := tempb * 24; 257 259 {position} 258 260 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $30, 4, @link); 259 Result[9]. src_offset := $30;260 Result[9]. raw_addr := link;261 Result[9]. raw_size := frames * 8;261 Result[9].SrcOffset := $30; 262 Result[9].RawAddr := link; 263 Result[9].RawSize := frames * 8; 262 264 {particle} 263 265 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $154, 2, @tempw); 264 266 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $38, 4, @link); 265 Result[11]. src_offset := $38;266 Result[11]. raw_addr := link;267 Result[11]. raw_size := tempw * 34;267 Result[11].SrcOffset := $38; 268 Result[11].RawAddr := link; 269 Result[11].RawSize := tempw * 34; 268 270 {extent} 269 271 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $138, 4, @templ); 270 272 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $13C, 4, @link); 271 Result[12]. src_offset := $13C;272 Result[12]. raw_addr := link;273 Result[12]. raw_size := templ * 12;273 Result[12].SrcOffset := $13C; 274 Result[12].RawAddr := link; 275 Result[12].RawSize := templ * 12; 274 276 275 277 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $34, 4, @link); … … 280 282 i := 0; 281 283 SetLength(Data, $FFFF); 282 TOniDataDat(connection).LoadRawOffset(False, link, $FFFF, Data); 284 TAccess_OniArchive(ConManager.Connection[ConnectionID]).LoadRawOffset( 285 False, link, $FFFF, Data); 283 286 offset := Data[$24] + Data[$25] * 256; 284 287 while (offset + i < Length(Data)) and (frame_count < frames - 1) do … … 291 294 begin 292 295 Inc(i, tempw); 293 Result[10]. raw_size := offset + i;296 Result[10].RawSize := offset + i; 294 297 end 295 298 else 296 299 begin 297 Result[10]. raw_size := 0;300 Result[10].RawSize := 0; 298 301 end; 299 302 end; 300 Result[10]. src_offset := $34;301 Result[10]. raw_addr := link;303 Result[10].SrcOffset := $34; 304 Result[10].RawAddr := link; 302 305 end; 303 306 … … 327 330 end; 328 331 SetLength(Result, 1); 329 if not connection.OSisMacthen330 begin 331 Result[0]. src_offset := $9C;332 Result[0]. raw_addr := link_pc;332 if ConManager.Connection[ConnectionID].DataOS = DOS_WIN then 333 begin 334 Result[0].SrcOffset := $9C; 335 Result[0].RawAddr := link_pc; 333 336 end 334 337 else 335 338 begin 336 Result[0]. src_offset := $A0;337 Result[0]. raw_addr := link_mac;338 end; 339 Result[0]. raw_size := datasize;340 Result[0]. loc_sep := connection.OSisMac;339 Result[0].SrcOffset := $A0; 340 Result[0].RawAddr := link_mac; 341 end; 342 Result[0].RawSize := datasize; 343 Result[0].LocSep := not (ConManager.Connection[ConnectionID].DataOS = DOS_WIN); 341 344 end; 342 345 -
oup/rewrite/Global/TypeDefs.pas
r97 r101 9 9 10 10 TDataBackend = (DB_ONI, DB_ADB); 11 TDataOS = (DOS_WIN, DOS_ MAC);11 TDataOS = (DOS_WIN, DOS_WINDEMO, DOS_MAC, DOS_MACBETA); 12 12 13 TChangeRights = set of (CR_EditDat, CR_EditRaw, CR_ResizeDat, CR_ResizeRaw );13 TChangeRights = set of (CR_EditDat, CR_EditRaw, CR_ResizeDat, CR_ResizeRaw, CR_AppendRaw); 14 14 15 15 TStatusMessages = ( … … 19 19 SM_UnknownExtension, 20 20 SM_IncompatibleFile, 21 SM_IncompatibleDBVersion, 21 22 SM_UnknownError 22 23 ); 24 25 TExtensionsMap = array of packed record 26 Ident: array[0..$7] of Byte; 27 Extension: array[0..$3] of Char; 28 ExtCount: LongWord; 29 end; 23 30 24 31 TFileInfo = packed record … … 30 37 DatAddr: Integer; 31 38 end; 39 TFiles = array of TFileInfo; 32 40 33 41 TRawDataInfo = record
Note:
See TracChangeset
for help on using the changeset viewer.