You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: manual.html
+26-26
Original file line number
Diff line number
Diff line change
@@ -34,16 +34,16 @@ <h1>Omgifol manual</h1>
34
34
</div>
35
35
</td></tr></table>
36
36
<aname="Installation"></a><h2>Installation</h2>
37
-
<ol><li> Install Python 3, which can be downloaded from <ahref="http://python.org" class='external'title="http://python.org">http://python.org</a>
37
+
<ol><li> Install Python 3, which can be downloaded from <ahref="http://python.org" class="external"title="http://python.org">http://python.org</a>
38
38
</li><li> Use pip to install Omgifol: <tt>pip install omgifol</tt>
39
39
</li><li> Or, if pip is unavailable, extract the "omg" directory in the Omgifol package into <em>pythondir</em>/Lib/site-packages (replace <em>pythondir</em> with the directory where Python is installed).
40
40
</li></ol>
41
41
<p>Optionally:
42
42
43
43
</p>
44
-
<ol><li> Install the <ahref='https://python-pillow.github.io'class='external'title="https://python-pillow.github.io">Pillow library</a><spanclass='urlexpansion'> (<i>https://python-pillow.github.io</i>)</span>. This is required to import or export images.
44
+
<ol><li> Install the <ahref="https://python-pillow.github.io"class="external"title="https://python-pillow.github.io">Pillow library</a><spanclass="urlexpansion"> (<i>https://python-pillow.github.io</i>)</span>. This is required to import or export images.
45
45
</li>
46
-
<li> Install the <ahref='https://pysoundfile.readthedocs.io'class='external'title="https://pysoundfile.readthedocs.io">PySoundFile library</a><spanclass='urlexpansion'> (<i>https://pysoundfile.readthedocs.io</i>)</span>. This is required to import or export sound files.
46
+
<li> Install the <ahref="https://pysoundfile.readthedocs.io"class="external"title="https://pysoundfile.readthedocs.io">PySoundFile library</a><spanclass="urlexpansion"> (<i>https://pysoundfile.readthedocs.io</i>)</span>. This is required to import or export sound files.
47
47
</li>
48
48
</ol>
49
49
@@ -53,7 +53,7 @@ <h1>Omgifol manual</h1>
53
53
<pre> from omg import *
54
54
</pre>
55
55
<aname="WAD_objects"></a><h2>WAD objects</h2>
56
-
<p>A <tt>WAD</tt> is an abstract representation of a WAD file. A <tt>WAD</tt> object can load content from a WAD file, or save content to a WAD file, but is entirely memory-resident.
56
+
<p>A <tt>WAD</tt> is an abstract representation of a WAD file. A <tt>WAD</tt> object can load content from a WAD file, or save content to a WAD file, but is entirely memory-resident.
57
57
58
58
</p>
59
59
<aname="Loading_from_WAD_files"></a><h3>Loading from WAD files</h3>
@@ -85,20 +85,20 @@ <h1>Omgifol manual</h1>
85
85
with the same name, etc.
86
86
</p>
87
87
<aname="Writing_to_WAD_files"></a><h3>Writing to WAD files</h3>
<p>Lumps are stored in <em>groups</em>. Each <tt>WAD</tt> holds a number of groups, representing different categories of lumps. Each group is an ordered dictionary; that is, it works just like a Python <tt><ahref='http://docs.python.org/tut/node7.html#SECTION007500000000000000000'class='external'title="http://docs.python.org/tut/node7.html#SECTION007500000000000000000">dict</a><spanclass='urlexpansion'> (<i>http://docs.python.org/tut/node7.html#SECTION007500000000000000000</i>)</span></tt> object but remembers in which order lumps were inserted.
95
-
</p><p>All lumps are instances of the <tt>Lump</tt> class; see below for its documentation.
94
+
<p>Lumps are stored in <em>groups</em>. Each <tt>WAD</tt> holds a number of groups, representing different categories of lumps. Each group is an ordered dictionary; that is, it works just like a Python <tt><ahref="https://docs.python.org/3/tutorial/datastructures.html#dictionaries"class="external"title="https://docs.python.org/3/tutorial/datastructures.html#dictionaries">dict</a><spanclass="urlexpansion"> (<i>https://docs.python.org/3/tutorial/datastructures.html#dictionaries</i>)</span></tt> object but remembers in which order lumps were inserted.
95
+
</p><p>All lumps are instances of the <tt>Lump</tt> class; see below for its documentation.
96
96
97
-
</p><p>To retrieve the sprite called <tt>CYBR1A</tt> from the <tt>WAD</tt> object <em>a</em>, do:
97
+
</p><p>To retrieve the sprite called <tt>CYBR1A</tt> from the <tt>WAD</tt> object <em>a</em>, do:
98
98
</p>
99
99
<pre> a.sprites['CYBR1A']
100
100
</pre>
101
-
<p>And to replace it with some other lump object called <tt>some_lump</tt>:
101
+
<p>And to replace it with some other lump object called <tt>some_lump</tt>:
102
102
</p>
103
103
104
104
<pre> a.sprites['CYBR1A'] = some_lump
@@ -127,7 +127,7 @@ <h1>Omgifol manual</h1>
127
127
</pre>
128
128
<p>This scheme can be modified if desired; refer to wad.py for the details.
129
129
130
-
</p><p>The <tt>maps</tt> and <tt>glmaps</tt> are special. These do not contain lumps, but additional groups of lumps, one for each map. So if you access E1M1:
130
+
</p><p>The <tt>maps</tt> and <tt>glmaps</tt> are special. These do not contain lumps, but additional groups of lumps, one for each map. So if you access E1M1:
131
131
</p>
132
132
<pre> a.maps['E1M1']
133
133
</pre>
@@ -140,7 +140,7 @@ <h1>Omgifol manual</h1>
140
140
141
141
</p>
142
142
<aname="Merging"></a><h3>Merging</h3>
143
-
<p>To merge two <tt>WAD</tt>s <em>a</em> and <em>b</em>:
143
+
<p>To merge two <tt>WAD</tt>s <em>a</em> and <em>b</em>:
144
144
</p>
145
145
<pre> c = a + b
146
146
</pre>
@@ -161,27 +161,27 @@ <h1>Omgifol manual</h1>
161
161
<p>Use with care for sections of different types.
162
162
</p><p>Note that some sections do more than just copy over the list of lumps
163
163
when they merge. For example, adding two <em>txdefs</em> sections together
164
-
will automagically merge the <tt>TEXTURE1</tt>, <tt>TEXTURE2</tt> and <tt>PNAMES</tt> lumps. <tt>txdefs</tt>
164
+
will automagically merge the <tt>TEXTURE1</tt>, <tt>TEXTURE2</tt> and <tt>PNAMES</tt> lumps. <tt>txdefs</tt>
165
165
166
-
also get merged this way when two <tt>WAD</tt> objects are merged on the top level.
166
+
also get merged this way when two <tt>WAD</tt> objects are merged on the top level.
167
167
</p>
168
168
<aname="Lumps"></a><h2>Lumps</h2>
169
-
<p>The <tt>Lump</tt> class holds a single lump. The class provides the following data and methods:
169
+
<p>The <tt>Lump</tt> class holds a single lump. The class provides the following data and methods:
170
170
</p>
171
171
<pre> .data The lump's raw data as a string
172
172
.to_file(<em>filename</em>) Save from a file
173
173
.from_file(<em>filename</em>) Load from a file
174
174
.copy() Return a copy
175
175
176
176
</pre>
177
-
<p>Creating a new lump called 'FOOF' containing the text 'Hello!' and inserting it into a <tt>WAD</tt><em>w</em> would be done as follows:
177
+
<p>Creating a new lump called 'FOOF' containing the text 'Hello!' and inserting it into a <tt>WAD</tt><em>w</em> would be done as follows:
178
178
</p>
179
179
<pre> w.data['FOOF'] = Lump('Hello!')
180
180
</pre>
181
181
<aname="Graphic_lumps"></a><h3>Graphic lumps</h3>
182
-
<p>There are subclasses of <tt>Lump</tt> for different types of lumps. Currently, only these provide special functionality: <tt>Graphic</tt>, <tt>Flat</tt>, and <tt>Sound</tt>.
182
+
<p>There are subclasses of <tt>Lump</tt> for different types of lumps. Currently, only these provide special functionality: <tt>Graphic</tt>, <tt>Flat</tt>, and <tt>Sound</tt>.
183
183
184
-
</p><p><tt>Graphic</tt>, used to represent Doom format graphics, provides the following settable attributes:
184
+
</p><p><tt>Graphic</tt>, used to represent Doom format graphics, provides the following settable attributes:
185
185
</p>
186
186
<pre> .offsets (x, y) offsets
187
187
.x_offset x offset
@@ -190,7 +190,7 @@ <h1>Omgifol manual</h1>
190
190
.width width in pixels
191
191
.height height in pixels
192
192
</pre>
193
-
<p><tt>Graphic</tt> defines the following methods in adddition to those defined by <tt>Lump</tt>:
193
+
<p><tt>Graphic</tt> defines the following methods in adddition to those defined by <tt>Lump</tt>:
194
194
</p>
195
195
<pre> .from_raw Load from a raw image
196
196
.to_raw Return the image converted to raw pixels
@@ -199,17 +199,17 @@ <h1>Omgifol manual</h1>
199
199
.translate Translate to another palette
200
200
</pre>
201
201
<p>For the argument lists used by these functions, refer to the code and the inline documenation in lump.py.
202
-
</p><p><tt>Flat</tt> works similarly to <tt>Graphic</tt>, but handles format conversions slightly differently.
202
+
</p><p><tt>Flat</tt> works similarly to <tt>Graphic</tt>, but handles format conversions slightly differently.
203
203
204
-
</p><p><tt>Sound</tt>, used to represent Doom format sounds, provides the following settable attributes:
204
+
</p><p><tt>Sound</tt>, used to represent Doom format sounds, provides the following settable attributes:
205
205
</p>
206
206
<pre> .format Sound effect format (0-3)
207
207
.length Length of sound in samples
208
208
.sample_rate Sample rate for digitized sounds (defaults to 11025)
209
209
.midi_bank MIDI patch bank number (formats 1-2 only)
210
210
.midi_patch MIDI patch number (formats 1-2 only)
211
211
</pre>
212
-
<p><tt>Sound</tt> defines the following methods in adddition to those defined by <tt>Lump</tt>:
212
+
<p><tt>Sound</tt> defines the following methods in adddition to those defined by <tt>Lump</tt>:
213
213
</p>
214
214
<pre> .from_raw Load from a raw sound file
215
215
.to_raw Return the sound file converted to raw samples
@@ -222,11 +222,11 @@ <h1>Omgifol manual</h1>
222
222
<aname="Editors"></a><h2>Editors</h2>
223
223
<p><em>Editors</em> are used to edit lumps or lump groups. They represent lump data with high-level objects and structures, and provide methods to modify the data. The following editors have been implemented so far:
224
224
</p>
225
-
<ul><li><tt>Colormap</tt> for the COLORMAP lump
226
-
</li><li><tt>Playpal</tt> for the PLAYPAL lump
227
-
</li><li><tt>Textures</tt> for TEXTURE1/TEXTURE2/PNAMES
225
+
<ul><li><tt>Colormap</tt> for the COLORMAP lump
226
+
</li><li><tt>Playpal</tt> for the PLAYPAL lump
227
+
</li><li><tt>Textures</tt> for TEXTURE1/TEXTURE2/PNAMES
228
228
229
-
</li><li><tt>MapEditor</tt> for maps
229
+
</li><li><tt>MapEditor</tt> for maps
230
230
</li></ul>
231
231
<p>All editors provide the following methods:
232
232
</p>
@@ -250,4 +250,4 @@ <h1>Omgifol manual</h1>
250
250
</pre>
251
251
<p>Refer to the source code for more information.</p>
0 commit comments