Author Topic: D-Bug 100(A) - in progress  (Read 2991 times)

0 Members and 1 Guest are viewing this topic.

Offline KrazyK

  • Amiga 1200
  • ****
  • Posts: 390
  • Karma: 131
    • View Profile
    • KrazyK Remakes
D-Bug 100(A) - in progress
« on: August 18, 2011 »
I thought I would post this project so far to see how it runs as i've had to use Usebuffer DX7 command again as I have 2 transparent images that both need a colour applied to them every frame then grabbed again.
Using DisplaySolidSprite along with GrabSprite was too slow again.
Unfortunataly jace's trick of drawing a sprite on my image doesn't work in this instance as I use DrawRGBFilter to create a fast 'wash' of colour of the sprite before setting the transparency again to the new washed out background.
I don't know of any other way faster way of creating this effect - perhaps someone does?
You'll see what I mean when you run the exe.

See below for an example:

Code: [Select]
;- RGBFilter() filter test

InitSprite():InitKeyboard()

OpenWindow(1,0,0,640,480,"",#PB_Window_ScreenCentered|#PB_Window_WindowCentered|#PB_Window_BorderLess)
OpenWindowedScreen(WindowID(1),0,0,640,480,0,0,0)

;-create a blank image and draw a box on it
CreateImage(1,640,480)
StartDrawing(ImageOutput(1))
Box(200,200,200,200,RGB(234,99,12))
StopDrawing()

;-create a blank sprite and draw our image on it
CreateSprite(1,640,480,#PB_Sprite_Memory) ;-create a blank sprite to draw on
StartDrawing(SpriteOutput(1))
DrawImage(ImageID(1),0,0) ;-dump our image on it
DisplayRGBFilter(0,0,640,480,123,55,12) ;-wash our screen with colour - doesn't work on a sprite as this is a sprite command ?
StopDrawing()

;TransparentSpriteColor(1,RGB(123,55,12))

DisplaySprite(1,0,0) ;-show the drawn over sprite
FlipBuffers()

Repeat:Delay(1):ExamineKeyboard():Until KeyboardPushed(#PB_Key_All)
Challenge Trophies Won:

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 990
  • Karma: 260
    • View Profile
Re: D-Bug 100(A) - in progress
« Reply #1 on: August 18, 2011 »
I have to admit I've not completely understood what you are doing (or how you are doing it) since the example just gives me an orange box no matter if an RGB filter is applied or not.  :-\  And in general DX7 isn't a good thing to use anymore, since it disables Aero on Vista in windowed mode for example...

But why do you have to do this every frame? I mean do all the color magic before the main loop and then just display the newly grabbed sprites in the main loop? Or am I completely missing something here.  :xmas:



Challenge Trophies Won:

Offline KrazyK

  • Amiga 1200
  • ****
  • Posts: 390
  • Karma: 131
    • View Profile
    • KrazyK Remakes
Re: D-Bug 100(A) - in progress
« Reply #2 on: August 22, 2011 »
I think i'll rest this one for while as I can't seem to acheive a fast enough result using DX9.  It might come backto me if I leave it for a whie.
In the meantime i've just finished remaking a couple of Automation intros.  One of them was one of my favourite menus back in the day.
Challenge Trophies Won: