1. RE: Exotica problem
- Posted by bensler at mail.com Mar 16, 2002
- 361 views
This is a problem in the dll. It only happens when stretch blitting a bitmap to another bitmap. And then only when clipping occurs. A way around it, is to use a temp bitmap, so you can blit the stretched bitmap without clipping. Then you would blitfast the temp to your buffer bitmap. That means double blitting everytime you need to blit a stretched bitmap though. Here is the modified code: <CODE> set_app_title("BLIT_BMP Demo for ExotixaXv1.2") report_mode("E_Report",1) constant sw = 800, sh = 600 exotica_init() -- Set up Direct Draw if ddraw_init(sw,sh,16) then exotica_abort(1) end if constant screen = create_bitmap( sw, sh, 1 ) constant buffer = create_bitmap( sw, sh, 1 ) constant PIC= load_bitmap("planet1.bmp",1) if not PIC then exotica_abort(1) end if constant size = bitmap_width( PIC ) atom x x = sw-1 atom y y = sh-1 integer vx,vy vx = 1 vy= 1 while 1 do if aActive() then if clear_bitmap( buffer, 0 ) then exotica_abort(1) end if if bitmap_blit_bitmap(PIC,{0,0,sw,sh},screen,0) then exotica_abort(1) end if if trans_bitmap_blit_bitmap(PIC,{0,0,x,y},buffer,0) then exotica_abort(1) end if if trans_bitmap_rect_blitfast(buffer,{0,0,x,y},screen,sw-x,sh-y) then exotica_abort(1) end if --bitmap_draw_line( screen, {{1,1}, {1,y}, {x,y}, {x,1}, {1,1}}, {200,200,000}) --bitmap_draw_line( screen, {{1,1}, {1,sh}, {sw,sh}, {sw,1}, {1,1}}, {200,200,000}) if blitfast( screen, 0,0 ) then exotica_abort(1) end if --draw_line( {{sw,sh}, {sw,y}, {x,y}, {x,sh}, {sw,sh}}, {200,200,000}) if surface_flip() then exotica_abort(1) end if x -= vx y -= vy if x >= sw-1 or x <= 1 then vx *= -1 end if if y >= sh-1 or y <= 1 then vy *= -1 end if end if if exotica_error() then exotica_abort(1) end if end while <END OF CODE> Chris Lewis Townsend wrote: > Hello All, > > I haven't posted in a while but I still recieve the list and read > anything > that looks interesting. Since exotica and exotica x has been updated > recently I retried a program I was writing that I was having a problem > on > some time back. I downloaded the newest exoticax to see if the new > version > would fix my problem. It did not. I am posting a demonstration program > for > the problem and see if Chris, Todd, or anyone else can help. I'm pretty > sure > it is a problem in the Exotica DLL. a simple switching of variables or > something. > > Basically, it only occurs when rect-blitting and only then when the > destination size is smaller than the original. and only then when the > destination location is near the bottom of the destination image. > Studying > this code and running the program should show what is happening better > than > I can in words. > > Note that the "planet1.bmp" is a 300 x 300 image of a round object that > comes right to the edges of the image. Okay, without further ado, here > is > the code: > > later, > Lewis Townsend