![]() |
|
Fladimir's alpha blending routines |
Paul whoknows
Member #5,081
September 2004
![]() |
Please excuse my lack of experience but I just don't know how to use Fladimir's alpha blender, here is an example using allegro's alpha blender functions, but I can't figure out how to replace them with Fladimir's alpha blender routines. Example
Fladimir's routines
____ "The unlimited potential has been replaced by the concrete reality of what I programmed today." - Jordan Mechner. |
Milan Mimica
Member #3,877
September 2003
![]() |
BlendColorsNoEmms() is used to blend only two colors: dst and src, with factor factor. Format of the colors is RGB32, factor is [0, 255]. If you want to blend a whole bitmap you have to do it pixel by pixel.
-- |
Paul whoknows
Member #5,081
September 2004
![]() |
Does that mean that I have to write my own draw_trans_sprite and set_write_alpha_blender?:'( Quote: If you want to blend a whole bitmap you have to do it pixel by pixel. Would that be faster than allegro´s blender? ____ "The unlimited potential has been replaced by the concrete reality of what I programmed today." - Jordan Mechner. |
Neil Walker
Member #210
April 2000
![]() |
I'm probably completely wrong here, not really using ol that much, but what you need to do is not use magic pink bitmaps, instead use graphic files with an alpha channel then call Blenders::Set( ALPHA_BLENDER ); Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
Fladimir da Gorf
Member #1,565
October 2001
![]() |
Don't worry, I've also written the function for you. Here it is: (slightly edited, I hope it still works
Quote: How much faster are they? IIRC it's 300-570% faster than Allegro's alpha blender, when compiled with -O3. OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori) |
Paul whoknows
Member #5,081
September 2004
![]() |
Wow! thank you very very much!:D ____ "The unlimited potential has been replaced by the concrete reality of what I programmed today." - Jordan Mechner. |
HoHo
Member #4,534
April 2004
![]() |
He uses gcc style for ASM (I can't remember the correct name). To make it work with MSVC you would have to rewrite the whole ASM stuff with Intel syntax. In other words, if you don't know ASM then use GCC __________ |
Fladimir da Gorf
Member #1,565
October 2001
![]() |
Maybe switching the opcode parameters would be sufficient? For example, "movd %2, %%mm1\n" becomes "movd %%mm1, %2\n" Though I also think that you'll also need to remove one % from them. Is it possible to compile the source with GCC and then import the object file in a MSVC project? OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori) |
Milan Mimica
Member #3,877
September 2003
![]() |
Quote: Is it possible to compile the source with GCC and then import the object file in a MSVC project? Allegro does something like that in the build process.
-- |
Neil Walker
Member #210
April 2000
![]() |
ah, I've just realised what you wanted There's also FBlend. Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
Edward Sheets
Member #4,734
June 2004
![]() |
Any chance Flad's blender could be incorporated into Allegro? Seems like a speed increase of that magnitude would be well worth it. Fblend is sweet but I don't think it's been worked on in a while and it has some bugs. I seem to remember there being a problem with running it on 64-bit processors...? --- Note: carving a pentagram on the top of a container of spoiled yogurt does not summon a yogurt demon. -Kikaru |
Paul whoknows
Member #5,081
September 2004
![]() |
Quote: Maybe switching the opcode parameters would be sufficient?
I tried that, but it didn't work, I'll try to download GCC later and compile your routines to obtain the .obj as you said, I really want to include your routines in my game, but right now I am really busy trying to solve a lot of problems with the game programming itself. Quote: There's also FBlend. Fblend doesn't support alpha blending. ____ "The unlimited potential has been replaced by the concrete reality of what I programmed today." - Jordan Mechner. |
Neil Walker
Member #210
April 2000
![]() |
I know it doesn't support alpha blending, but I said it as just another library to help with blending in general. Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
Paul whoknows
Member #5,081
September 2004
![]() |
Quote: Is it possible to compile the source with GCC and then import the object file in a MSVC project?
Can someone compile Fladimir's alpha blend routines and give me the .obj so I can use them in MSVC6? ____ "The unlimited potential has been replaced by the concrete reality of what I programmed today." - Jordan Mechner. |
HoHo
Member #4,534
April 2004
![]() |
http://www.bloodshed.net/dev/devcpp.html Dev-cpp with GCC 3.4.2 is around 9.2MiB or half an hour with good dial-up connection. If noone else has time or willing to compile it for you then that might help you. I might help you myself but unfortunately I don't have Windows. __________ |
Neil Walker
Member #210
April 2000
![]() |
The best minds in the world have tried to compile OL with MSVC but it fails due to MSVC's support of the STL and other related issues. As hoho, get devcpp, or the free msvc8 (negating the need to have msvc6), mingw, code:blocks, etc. Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
tobing
Member #5,213
November 2004
![]() |
Quote: The best minds in the world have tried to compile OL with MSVC but it fails due to MSVC's support of the STL and other related issues. Not true. At least since MSVC 7.1 support of STL 'and other related issues' are good enough to compile OpenLayer. Version 6.0 of MSVC does not work well though. |
HoHo
Member #4,534
April 2004
![]() |
MSVC is irrelevant since he is trying to compile AT&T ASM routines, not OL itself. __________ |
Neil Walker
Member #210
April 2000
![]() |
Quote: Not true. At least since MSVC 7.1 support of ST Yes True Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
tobing
Member #5,213
November 2004
![]() |
Ah. I thought from your post that you were talking about MSVC in general... |
Fladimir da Gorf
Member #1,565
October 2001
![]() |
I actually found my old sources from my hard drive, here's the complete source:
I've attached the .o file, the source file and the bitmap which the test program uses. OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori) |
Paul whoknows
Member #5,081
September 2004
![]() |
Quote: I've attached the .o file, the source file and the bitmap which the test program uses. I can't download your attachment, I can't see it, can you check your attachment please?, and thanks again for all your help I really appreciate it! Quote: Dev-cpp with GCC 3.4.2 is around 9.2MiB or half an hour with good dial-up connection What! only 9MB?, I only knew the official GCC site and it was very intimidating, I did not know about the link you posted, I'll download it right now! [EDIT] I followed Hoho's advice, Devcpp makes everything so nice and easy, specially after a long time using MSVC6! ____ "The unlimited potential has been replaced by the concrete reality of what I programmed today." - Jordan Mechner. |
Fladimir da Gorf
Member #1,565
October 2001
![]() |
OK, I had forgot to press the "Upload" -button... But great that it works! OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori) |
|