![]() |
|
My modifications |
Victor Williams Stafusa da Silva
Member #4,212
January 2004
![]() |
I've made some modifications to allegro 4.1.17 sources and I'm posting them here. I've not yet tried it in 4.1.18, but I will do that soon, probably it will work OK. Just get the Attached file! If someone wants a example code, I will provide it. [The attack of the space bugs - Speedhack 2005] [Rambananas - Speedhack 2006] [Make clean - Speedhack 2009] [The source god - TINS 2010] |
Richard Phipps
Member #1,632
November 2001
![]() |
Can you at least explain what you changed and why? |
Victor Williams Stafusa da Silva
Member #4,212
January 2004
![]() |
From the ChangeLog, inside the attached file: I've made modifications in allegro to eliminate the power-of-two-sized DRAW_MODE_SPRITE_PATTERN - It's the fusion of DRAW_MODE_COPY_PATTERN and DRAW_MODE_AND - It's like the DRAW_MODE_XOR drawing mode, but instead of DRAW_MODE_OR - It's like the DRAW_MODE_XOR drawing mode too, but instead of Changed files: \include\draw.h -> Slightly modified (three lines) to define the new drawing \src\c\cdefs8.h -> Modified the PATTERN_LINE() and GET_PATTERN_PIXEL() \src\c\cdefs15.h -> Modified the PATTERN_LINE() and GET_PATTERN_PIXEL() \src\c\cdefs16.h -> Modified the PATTERN_LINE() and GET_PATTERN_PIXEL() \src\c\cdefs24.h -> Modified the PATTERN_LINE() and GET_PATTERN_PIXEL() \src\c\cdefs32.h -> Modified the PATTERN_LINE() and GET_PATTERN_PIXEL() \src\c\cgfx.h -> Modified the behavior of the FUNC_LINEAR_PUTPIXEL() and \src\i386\igfx8.s -> Modified the behavior of _linear_putpixel8() and \src\i386\igfx15.s -> Modified the behavior of _linear_putpixel15() and \src\i386\igfx16.s -> Modified the behavior of _linear_putpixel16() and \src\i386\igfx24.s -> Modified the behavior of _linear_putpixel24() and \src\i386\igfx32.s -> Modified the behavior of _linear_putpixel32() and \src\misc\modexgfx.s -> Modified the behavior of _x_putpixel() and \src\gfx.c -> Modified the behavior of the drawing_mode() function to \src\i386\asmdefs.inc -> Modified the LOOKUP_PATTERN_POS() macro to \src\misc\asmdef.c -> Slightly modified (three lines) to understand the new \src\spline.c -> Slightly modified (two lines) the _soft_spline() function \src\scene3d.c -> Slightly modified (one line) the init_poly() function to I could change the \tests\test.c, but i think that it's still too soon for Compatibility issues: The behavior of the drawing_mode() function has changed, it doesn't anymore Performance issues: Since the code can't just do a simple AND anymore to get the position in a The macro DO_PATTERN_MOD() is used twice by the macro LOOKUP_PATTERN_POS(), The macros PATTERN_LINE() and GET_PATTERN_PIXEL() in the \src\c\cdefs*.h By Victor Williams Stafusa da Silva - vwss1984 at yahoo dot com dot br [The attack of the space bugs - Speedhack 2005] [Rambananas - Speedhack 2006] [Make clean - Speedhack 2009] [The source god - TINS 2010] |
kazzmir
Member #1,786
December 2001
![]() |
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 clicking here and filling out the relevant information. I will notify the list of this thread. |
Elias
Member #358
May 2000
|
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 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't need them as well - but the power-of-2 restrictions also are in Bob's gfx api design, so dunno. 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. 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 -- |
Evert
Member #794
November 2000
![]() |
The power-of-two size restriction is probably there for the very reason that it is faster. I'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. 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'd be fine adding these for 4.2. 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. Oh, and before I forget, thanks |
|