51 |
|
fadingbyte, depthbyte, storebyte: Byte; |
52 |
|
begin |
53 |
|
fileid := fileinfo.ID; |
54 |
< |
OniDataConnection.LoadDatFilePart(fileid, $88, SizeOf(fadingbyte), @fadingbyte); |
55 |
< |
OniDataConnection.LoadDatFilePart(fileid, $89, SizeOf(depthbyte), @depthbyte); |
56 |
< |
OniDataConnection.LoadDatFilePart(fileid, $90, SizeOf(storebyte), @storebyte); |
54 |
> |
Connection.LoadDatFilePart(fileid, $88, SizeOf(fadingbyte), @fadingbyte); |
55 |
> |
Connection.LoadDatFilePart(fileid, $89, SizeOf(depthbyte), @depthbyte); |
56 |
> |
Connection.LoadDatFilePart(fileid, $90, SizeOf(storebyte), @storebyte); |
57 |
|
check_fading.Checked := (fadingbyte and $01) > 0; |
58 |
|
check_transparency.Checked := (depthbyte and $04) > 0; |
59 |
|
|
102 |
|
begin |
103 |
|
if filelist.ItemIndex >= 0 then |
104 |
|
begin |
105 |
< |
OniDataConnection.LoadDatFilePart(fileid, $88, 1, @oldfading); |
106 |
< |
if OniDataConnection.OSisMac then |
107 |
< |
OniDataConnection.UpdateDatFilePart(fileid, $A0, 4, @old_rawaddr) |
105 |
> |
Connection.LoadDatFilePart(fileid, $88, 1, @oldfading); |
106 |
> |
if Connection.OSisMac then |
107 |
> |
Connection.UpdateDatFilePart(fileid, $A0, 4, @old_rawaddr) |
108 |
|
else |
109 |
< |
OniDataConnection.LoadDatFilePart(fileid, $9C, 4, @old_rawaddr); |
109 |
> |
Connection.LoadDatFilePart(fileid, $9C, 4, @old_rawaddr); |
110 |
|
|
111 |
|
if (OniImage_Old.Width <> OniImage_New.Width) or |
112 |
|
(OniImage_Old.Height <> OniImage_New.Height) then |
137 |
|
|
138 |
|
newsize := OniImage_New.GetImageDataSize(check_fading.Checked); |
139 |
|
|
140 |
< |
if (newsize > old_size) and (OniDataConnection.Backend = ODB_Dat) then |
141 |
< |
new_rawaddr := OniDataConnection.AppendRawFile( |
142 |
< |
OniDataConnection.OSisMac, Length(tempd), tempd) |
140 |
> |
if (newsize > old_size) and (Connection.Backend = ODB_Dat) then |
141 |
> |
new_rawaddr := Connection.AppendRawFile( |
142 |
> |
Connection.OSisMac, Length(tempd), tempd) |
143 |
|
else |
144 |
|
begin |
145 |
|
new_rawaddr := old_rawaddr; |
146 |
< |
OniDataConnection.UpdateRawFile(fileid, $9C, Length(tempd), tempd); |
146 |
> |
Connection.UpdateRawFile(fileid, $9C, Length(tempd), tempd); |
147 |
|
end; |
148 |
|
|
149 |
|
datbyte := $00; |
150 |
|
if check_fading.Checked then |
151 |
|
datbyte := datbyte or $01; |
152 |
< |
OniDataConnection.UpdateDatFilePart(fileid, $88, 1, @datbyte); |
152 |
> |
Connection.UpdateDatFilePart(fileid, $88, 1, @datbyte); |
153 |
|
datbyte := $10; |
154 |
|
if check_transparency.Checked then |
155 |
|
datbyte := datbyte or $04; |
156 |
< |
OniDataConnection.UpdateDatFilePart(fileid, $89, 1, @datbyte); |
157 |
< |
OniDataConnection.UpdateDatFilePart(fileid, $8C, 2, @OniImage_New.Width); |
158 |
< |
OniDataConnection.UpdateDatFilePart(fileid, $8E, 2, @OniImage_New.Height); |
156 |
> |
Connection.UpdateDatFilePart(fileid, $89, 1, @datbyte); |
157 |
> |
Connection.UpdateDatFilePart(fileid, $8C, 2, @OniImage_New.Width); |
158 |
> |
Connection.UpdateDatFilePart(fileid, $8E, 2, @OniImage_New.Height); |
159 |
|
datbyte := $08; |
160 |
< |
OniDataConnection.UpdateDatFilePart(fileid, $90, 1, @datbyte); |
161 |
< |
if OniDataConnection.OSisMac then |
162 |
< |
OniDataConnection.UpdateDatFilePart(fileid, $A0, 4, @new_rawaddr) |
160 |
> |
Connection.UpdateDatFilePart(fileid, $90, 1, @datbyte); |
161 |
> |
if Connection.OSisMac then |
162 |
> |
Connection.UpdateDatFilePart(fileid, $A0, 4, @new_rawaddr) |
163 |
|
else |
164 |
< |
OniDataConnection.UpdateDatFilePart(fileid, $9C, 4, @new_rawaddr); |
164 |
> |
Connection.UpdateDatFilePart(fileid, $9C, 4, @new_rawaddr); |
165 |
|
|
166 |
|
ShowMessage('TXMP-image replaced'); |
167 |
|
end; |