Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > c3c396e7666072a8effe1cf520ee655d > files > 89

ocp-0.1.20-1.fc14.x86_64.rpm

<html lang="en">
<head>
<title>wap - Open Cubic Player</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Open Cubic Player">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="prev" href="mdz.html#mdz" title="mdz">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This documentiation falls under the GPL license.

Copyright (C) 2005 Stian Skjelstad.

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<a name="wap"></a>
<p>
Previous:&nbsp;<a rel="previous" accesskey="p" href="mdz.html#mdz">mdz</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
<hr>
</div>

<h2 class="chapter">10 WurfelAnimator WAP</h2>

<p>This chapter is written by Felix Domke, the author of WAP.

<h3 class="section">10.1 What is the so called WurfelMode?</h3>

<p>In version 1.0 of the famous Cubic Player, pascal got a nice idea of playing
silly animations inside the Player.

   <p>He invented the <em>WurfelMode</em> (<em>Wurfel</em> is the german word for
cube). The WurfelMode was able to play animations with a resolution of
160x100 pixels in 256 colors in a special tweaked vga-mode. The animation
format was a special one.

<h3 class="section">10.2 How can I create such animations by myself?</h3>

<p>Long time, only the cubic team (or even only pascal?) itself was able to
create such animations. The reason for this was that, as said, the animations
had to be in a very special format, and the only tool that was be able to
create this format were the not-so-famous <em>WurfelTools</em>. Included
there was a tool called <samp><span class="file">makedmp.exe</span></samp>. It  took  various <samp><span class="file">.tga</span></samp>
files, and made a <samp><span class="file">.dat</span></samp> animation out of them. But noone checked how
this tools worked, mainly because it had no command-line-help and the sources
weren't available anymore.

   <p>But times are changing. Today, you don't have to guess how to use a utility
anymore. You just have to read the documentation (yes, even you, Realtime ;). 
Today, you can even use a resolution of 320x200 (wow, THAT's highres).

   <p>For people who didn't guess how pascal's tool worked, I made a new one. 
This time <em>with</em> source available to all interested people. This time
with <samp><span class="file">.pcx</span></samp> images, not <em>.tga</em> one, because <samp><span class="file">.pcx</span></samp> is much
easier to read, and also more widely supported. This time even with some
palette-aligning, so you don't have to care about same palettes anymore.

<h3 class="section">10.3 And how can I use your tool?</h3>

<p>First, you have to render/paint/rip a animation. It HAS to be 320x200, or,
if you want to make an old, $&lt;$ OCP 2.0q, animation, 160x100. 
In case you didn't notice, the OCP 2.0q and higher has a new WurfelMode,
called <em>WurfelMode ][</em> , with support for 320x200 pixels
images, instead of the lowres 160x100 ones.

   <p>Your  animation should be in the form of many, many <samp><span class="file">.pcx</span></samp> files,
called for example <samp><span class="file">PIC000.PCX</span></samp>, <samp><span class="file">PIC001.PCX</span></samp>,
<samp><span class="file">PIC002.PCX</span></samp> and so on. They  must have only 256 colors, and they
should have all the same palette. If  they don't have the same palette, the
palette will be aligned. But my calculation of this isn't very good (but it
works :), so for BEST results you have to do this in your favourite
picture-editing-program. Next,  you have  to create  a <em>script</em>. This
script contains informations about the filenames of your frames, and a some
other stuff.

   <p>The script has the following format:
<pre class="example">     Version
     [SFO] RLECompression
     Title
     NumFrames Delay Filename
     [NumFrames Delay Filename]
     [NumFrames Delay Filename]
     [...                     ]
</pre>
   <p><em>Version</em> is either 0 or 1, 0 for 160x100 animations, 1 for 320x200. 
If you want to create a Version 0-animation, <em>SFO</em> should be set to 1,
if you want to create a Version 1-animtion, <em>SFO</em> has to be left out. 
<a rel="footnote" href="#fn-1" name="fnd-1"><sup>1</sup></a>
<em>RLECompression</em> should be set to 1, it compresses the Animation a little
bit. 
<em>Title</em> is the title of the animation, it shouldn't be longer than 31
chars, it's displayed inside the fileselector of OCP.

   <p>After this <em>header</em>, a random number of section follows (but at least
ONE ;).

   <p>Every section describes a sequence of some PCXs. In the final animation,
all sections are joint together.

   <p><em>NumFrames</em> is the number of frames in this sequence. For example, if
you have PCXs that are named from <samp><span class="file">PIC000.PCX</span></samp> up to
<samp><span class="file">PIC199.PCX</span></samp>, NumFrames should be 200. 
<em>Delay</em> is handled a little bit different in the two versions. If you
want to create a Version 0-animation, a <em>Delay</em> of 1 means a framerate
of about 21.3 frames per second, a <em>Delay</em> of 2 is about 10.65 fps (the
half), a <em>Delay</em> of 3 is about 7.1 (a third) and so on.

   <p>If  you  want  to create a Version 1-animation, <em>Delay</em> is 65536/desired
fps, so if you want to have 15fps, "Delay" should be 4369. This value has to
be BELOW 65536 (and above 0, of course :)
<em>Filename</em> is the filename of your sequence. Because most animations
have more than 1 frame, you can use %d (and other C-printf placeholders). 
For people whose native language is not C, here some short examples:

   <p><table summary=""><tr align="left"><td valign="top" width="34%"><b>filename</b>
</td><td valign="top" width="33%">
<b>framenumber</b>
</td><td valign="top" width="33%">
<b>real filename</b>
<br></td></tr><tr align="left"><td valign="top" width="34%">pic%d.pcx
</td><td valign="top" width="33%">
0
</td><td valign="top" width="33%">
pic0.pcx
<br></td></tr><tr align="left"><td valign="top" width="34%"></td><td valign="top" width="33%">
1
</td><td valign="top" width="33%">
pic1.pcx
<br></td></tr><tr align="left"><td valign="top" width="34%"></td><td valign="top" width="33%">
2
</td><td valign="top" width="33%">
pic2.pcx
<br></td></tr><tr align="left"><td valign="top" width="34%"></td><td valign="top" width="33%">
3
</td><td valign="top" width="33%">
pic3.pcx
<br></td></tr><tr align="left"><td valign="top" width="34%"></td><td valign="top" width="33%">
9
</td><td valign="top" width="33%">
pic9.pcx
<br></td></tr><tr align="left"><td valign="top" width="34%"></td><td valign="top" width="33%">
10
</td><td valign="top" width="33%">
pic10.pcx
<br></td></tr><tr align="left"><td valign="top" width="34%"></td><td valign="top" width="33%">
11
</td><td valign="top" width="33%">
pic11.pcx
<br></td></tr><tr align="left"><td valign="top" width="34%">pic%03d.pcx
</td><td valign="top" width="33%">
0
</td><td valign="top" width="33%">
pic000.pcx
<br></td></tr><tr align="left"><td valign="top" width="34%"></td><td valign="top" width="33%">
1
</td><td valign="top" width="33%">
pic001.pcx
<br></td></tr><tr align="left"><td valign="top" width="34%"></td><td valign="top" width="33%">
2
</td><td valign="top" width="33%">
pic002.pcx
<br></td></tr><tr align="left"><td valign="top" width="34%"></td><td valign="top" width="33%">
3
</td><td valign="top" width="33%">
pic003.pcx
<br></td></tr><tr align="left"><td valign="top" width="34%"></td><td valign="top" width="33%">
9
</td><td valign="top" width="33%">
pic009.pcx
<br></td></tr><tr align="left"><td valign="top" width="34%"></td><td valign="top" width="33%">
10
</td><td valign="top" width="33%">
pic010.pcx
<br></td></tr><tr align="left"><td valign="top" width="34%"></td><td valign="top" width="33%">
11
</td><td valign="top" width="33%">
pic011.pcx
   <br></td></tr></table>
The framenumber always starts with 0, not with 1, keep this in mind!

   <p>Here is an example script: (version 0)
<pre class="example">     0
     1 1
     a basic cubic-player animation
     11 2 intro%d.pcx
     200 1 ani%03d.pcx
</pre>
   <p>This animation would have 211 frames (<samp><span class="file">intro0.pcx</span></samp> to
<samp><span class="file">intro10.pcx</span></samp>, then <samp><span class="file">ani000.pcx</span></samp> to <samp><span class="file">ani199.pcx</span></samp>).

   <p>And here again one for version 1:
<pre class="example">     1
     1
     an enhanced OpenCP animation
     11 3072 intro%x.pcx
     200 1000 ani%03d.pcx
</pre>
   <p>To create the animation, just type in
<pre class="example">     wap &lt;scriptfilename.scr&gt; &lt;outputfilename.dat&gt;
</pre>
   <p>and hit &lt;Enter&gt;.

   <p>The WurfelAnimator will now try to make the animation. 
To view the animation inside OCP, rename the created <samp><span class="file">.DAT</span></samp>-file
to <samp><span class="file">CPANU001.DAT</span></samp> (or <samp><span class="file">CPANI002.DAT</span></samp> and so on...) and press
&lt;w&gt; inside the player.

<h3 class="section">10.4 This tool doesn't work!</h3>

<p>No problem,I have always an open ear for your problems. Just write your
problems to <a href="mailto:tmbinc@gmx.net">mailto:tmbinc@gmx.net</a>.

   <p>Maybe you have luck and meet me on IRC, usually I am in <a href="irc://#coders.ger">irc://#coders.ger</a>
and some other channels, but if you don't know those, well, maybe you're
not welcome on them ;)

   <p>Anyway, maybe you have some fun with this tool.

   <div class="footnote">
<hr>
<h4>Footnotes</h4><p class="footnote"><small>[<a name="fn-1" href="#fnd-1">1</a>]</small> If  you're interested what  this value means, well, just get the
original documentation for professionals, it's described there</p>

   <hr></div>

</body></html>