<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>My modifications</title>
		<link>http://www.allegro.cc/forums/view/459874</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sat, 12 Feb 2005 18:55:25 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ve made some modifications to allegro 4.1.17 sources and I&#39;m posting them here. I&#39;ve not yet tried it in 4.1.18, but I will do that soon, probably it will work OK.</p><p>Just get the Attached file!</p><p>If someone wants a example code, I will provide it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Victor Williams Stafusa da Silva)</author>
		<pubDate>Fri, 11 Feb 2005 22:16:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Can you at least explain what you changed and why?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Fri, 11 Feb 2005 22:47:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>From the ChangeLog, inside the attached file:<br />*****************************************************</p><p>I&#39;ve made modifications in allegro to eliminate the power-of-two-sized<br />restriction to patterned drawing modes. I&#39;ve also created new drawing modes:</p><p>DRAW_MODE_SPRITE_PATTERN - It&#39;s the fusion of DRAW_MODE_COPY_PATTERN and <br />  DRAW_MODE_MASKED_PATTERN modes, if the pixel of the pattern is the mask, it<br />  will be skiped, like DRAW_MODE_MASKED_PATTERN, but if it isn&#39;t, the pixel<br />  from the pattern will be ploted, like DRAW_MODE_COPY_PATTERN.</p><p>DRAW_MODE_AND - It&#39;s like the DRAW_MODE_XOR drawing mode, but instead of<br />  XOR&#39;ing the pixel, this will AND the pixel.</p><p>DRAW_MODE_OR - It&#39;s like the DRAW_MODE_XOR drawing mode too, but instead of<br />  XOR&#39;ing the pixel, this will OR the pixel.</p><p>Changed files:</p><p>  \include\draw.h -&gt; Slightly modified (three lines) to define the new drawing<br />      modes.</p><p>  \src\c\cdefs8.h -&gt; Modified the PATTERN_LINE() and GET_PATTERN_PIXEL()<br />      macros to eliminate the power-of-two-sized restriction.</p><p>  \src\c\cdefs15.h -&gt; Modified the PATTERN_LINE() and GET_PATTERN_PIXEL()<br />      macros to eliminate the power-of-two-sized restriction.</p><p>  \src\c\cdefs16.h -&gt; Modified the PATTERN_LINE() and GET_PATTERN_PIXEL()<br />      macros to eliminate the power-of-two-sized restriction.</p><p>  \src\c\cdefs24.h -&gt; Modified the PATTERN_LINE() and GET_PATTERN_PIXEL()<br />      macros to eliminate the power-of-two-sized restriction.</p><p>  \src\c\cdefs32.h -&gt; Modified the PATTERN_LINE() and GET_PATTERN_PIXEL()<br />      macros to eliminate the power-of-two-sized restriction.</p><p>  \src\c\cgfx.h -&gt; Modified the behavior of the FUNC_LINEAR_PUTPIXEL() and<br />      FUNC_LINEAR_HLINE() functions (or maybe macros :-) to understand the new<br />      drawing modes and eliminate the power-of-two-sized restriction.</p><p>  \src\i386\igfx8.s -&gt; Modified the behavior of _linear_putpixel8() and<br />      _linear_hline8() functions to understand the new drawing modes and<br />      eliminate the power-of-two-sized restriction.</p><p>  \src\i386\igfx15.s -&gt; Modified the behavior of _linear_putpixel15() and<br />      _linear_hline15() functions to understand the new drawing modes and<br />      eliminate the power-of-two-sized restriction.</p><p>  \src\i386\igfx16.s -&gt; Modified the behavior of _linear_putpixel16() and<br />      _linear_hline16() functions to understand the new drawing modes and<br />      eliminate the power-of-two-sized restriction.</p><p>  \src\i386\igfx24.s -&gt; Modified the behavior of _linear_putpixel24() and<br />      _linear_hline24() functions to understand the new drawing modes and<br />      eliminate the power-of-two-sized restriction.</p><p>  \src\i386\igfx32.s -&gt; Modified the behavior of _linear_putpixel32() and<br />      _linear_hline32() functions to understand the new drawing modes and<br />      eliminate the power-of-two-sized restriction.</p><p>  \src\misc\modexgfx.s -&gt; Modified the behavior of _x_putpixel() and<br />      _x_hline() functions to understand the new drawing modes and eliminate<br />      the power-of-two-sized restriction.</p><p>  \src\gfx.c -&gt; Modified the behavior of the drawing_mode() function to<br />      eliminate the power-of-two-sized restriction.</p><p>  \src\i386\asmdefs.inc -&gt; Modified the LOOKUP_PATTERN_POS() macro to<br />      eliminate the power-of-two-sized restriction. I&#39;ve needed to create the<br />      DO_PATTERN_MOD() and INC_PATTERN_MOD() macros too for this work.</p><p>  \src\misc\asmdef.c -&gt; Slightly modified (three lines) to understand the new<br />      drawing modes.</p><p>  \src\spline.c -&gt; Slightly modified (two lines) the _soft_spline() function<br />      to understand the new DRAW_MODE_OR and DRAW_MODE_AND modes.</p><p>  \src\scene3d.c -&gt; Slightly modified (one line) the init_poly() function to<br />      understand the DRAW_MODE_SPRITE_PATTERN mode.</p><p>  I could change the \tests\test.c, but i think that it&#39;s still too soon for<br />  that.</p><p>Compatibility issues:</p><p>  The behavior of the drawing_mode() function has changed, it doesn&#39;t anymore<br />  round the size of the pattern to a power of two. Maybe this function should<br />  be called drawing_mode_ex() and the old one should be deprecated? Or not?</p><p>Performance issues:</p><p>  Since the code can&#39;t just do a simple AND anymore to get the position in a<br />  patterned drawing mode, the code to keep the position inside the pattern is<br />  a bit more complex, but notably slower for putpixels. For hlines it&#39;s just a<br />  bit slower. Otimizations would be welcome. (Sorry i&#39;m just a begginer in<br />  assembler :-)</p><p>  The macro DO_PATTERN_MOD() is used twice by the macro LOOKUP_PATTERN_POS(),<br />  (both in \src\i386\asmdefs.inc), and it is a good target to otimizations.<br />  The macro LOOKUP_PATTERN_POS() is used for each putpixel and hline-like<br />  functions implemented in assembler. So for each one, DO_PATTERN_MOD() is<br />  used twice too. The hline-like functions uses the macro INC_PATTERN_MOD()<br />  for each pixel in patterned modes, so it would be a nice place to otimize,<br />  but i really think that it isn&#39;t anymore otimizable.</p><p>  The macros PATTERN_LINE() and GET_PATTERN_PIXEL() in the \src\c\cdefs*.h<br />  files should be otimized too, if possible.</p><p>By Victor Williams Stafusa da Silva - vwss1984 at yahoo dot com dot br
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Victor Williams Stafusa da Silva)</author>
		<pubDate>Fri, 11 Feb 2005 22:53:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Please send future code changes about allegro to alleg-developers@lists.sourceforge.net, and you should probably also sign up for the mailing list by <a href="http://lists.sourceforge.net/lists/listinfo/alleg-developers/">clicking here</a> and filling out the relevant information.</p><p>I will notify the list of this thread.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (kazzmir)</author>
		<pubDate>Sat, 12 Feb 2005 05:27:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Please, in the future, create a patch in unified diff format. Google should tell you why, and how it works. If not, just ask here. (Even AJ found out how it works by now <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> )</p><p>About the changes - removing the power-of-2 certainly sounds useful - but decreasing performance for it.. not sure what to do. Does OpenGL still have restrictions on texture sizes? If they do not have them anymore, Allegro probably shouldn&#39;t need them as well - but the power-of-2 restrictions also are in Bob&#39;s gfx api design, so dunno.</p><p>The DRAW_MODE_SPRITE_PATTERN, OR and AND modes sound all like they should be there (I actually always believed the DRAW_MODE_MASKED_PATTERN was your DRAW_MODE_SPRITE_PATTERN). I guess they simply are missing because nobody ever needed them.</p><p>And then, 4.2.0 sort of is in feature freeze, so Evert must decide what/if can be applied now, or later in the new gfx API <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Sat, 12 Feb 2005 06:26:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The power-of-two size restriction is probably there for the very reason that it is faster. I&#39;m a bit hesitant to change the original part of the design here. Not that it should give too much of a performance penalty, we can always special-case the situation where we do have power-of-two sizes.<br />This introduces quite a bit of changes in many different source files and needs a relatively great deal of testing, in particular as it might break things that assume that patterns are a power of two but are not immediately obvious.<br />I think that&#39;s appropriate between WIP releases, but not if the next release is supposed to be a release candidate for a stable version - so I&#39;d want to push the elimination of size restrictions for patterns (with power-of-two sizes as a special case) over to the 4.3 branch.</p><p>The drawing modes DRAW_MODE_SPRITE_PATTERN, DRAW_MODE_AND and DRAW_MODE_OR sound like they should indeed have been there already, so I&#39;d be fine adding these for 4.2.</p><p>Victor: could you split your modifications in two parts, one for adding these three drawing modes (and documentation, if possible) and one for removing the power-of-two size restriction (if possible with power-of-two as a special case) and create a diff for them? This will make it significantly easier for us to apply it.<br />It&#39;s ok if your second patch prerequires the first one.</p><p>Oh, and before I forget, thanks <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Sat, 12 Feb 2005 18:55:25 +0000</pubDate>
	</item>
</rss>
