[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 264: mysqli_fetch_assoc(): Couldn't fetch mysqli_result
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 326: mysqli_free_result(): Couldn't fetch mysqli_result
Pete's QBASIC Site Discuss QBasic, Freebasic, QB64 and more 2007-12-01T00:49:31-05:00 http://www.petesqbsite.com/phpBB3/app.php/feed/topic/2508 2007-12-01T00:49:31-05:00 2007-12-01T00:49:31-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=15753#p15753 <![CDATA[My spiffy screen 13 palette fader...]]> So pretty much, with just a couple more lines of code, this routine
could be used for palette to palette fades also.
Anyways, here's the final fading routine that I'll be using in my gfx lib...

Code:

'DEFINT A-Z'TYPE PALdata Red AS INTEGER Grn AS INTEGER Blu AS INTEGEREND TYPE'DIM SHARED PAL(255) AS PALdata'SCREEN 13'OUT &H3C7, 0'FOR x = 0 TO 255 PAL(x).Red = INP(&H3C9) PAL(x).Grn = INP(&H3C9) PAL(x).Blu = INP(&H3C9)NEXT'FOR y = 0 TO 199 FOR x = 0 TO 319  PSET (x, y), INT(RND(1) * 254 + 1) NEXTNEXT'COLOR 15: LOCATE 13, 12: PRINT "...Press a key..."'DO: LOOP UNTIL INKEY$ <> INKEY$'c = 1 'Color of fade.'OUT &H3C8, 0'FOR y = 1 TO 64 FOR x = 0 TO 255  r = PAL(x).Red - (y * ((PAL(x).Red - PAL(c).Red) / 64))  g = PAL(x).Grn - (y * ((PAL(x).Grn - PAL(c).Grn) / 64))  b = PAL(x).Blu - (y * ((PAL(x).Blu - PAL(c).Blu) / 64))  OUT &H3C9, r  OUT &H3C9, g  OUT &H3C9, b NEXT t! = TIMER: DO: LOOP UNTIL TIMER <> t!NEXT'DO: LOOP UNTIL INKEY$ <> INKEY$'FOR y = 1 TO 64 FOR x = 0 TO 255  r = PAL(c).Red + (y * ((PAL(x).Red - PAL(c).Red) / 64))  g = PAL(c).Grn + (y * ((PAL(x).Grn - PAL(c).Grn) / 64))  b = PAL(c).Blu + (y * ((PAL(x).Blu - PAL(c).Blu) / 64))  OUT &H3C9, r  OUT &H3C9, g  OUT &H3C9, b NEXT t! = TIMER: DO: LOOP UNTIL TIMER <> t!NEXT'SYSTEM'
(Change the variable c for different colors of fade.)

Cya, Nemesis

Statistics: Posted by Nemesis — Sat Dec 01, 2007 12:49 am


]]>
2007-11-30T10:22:15-05:00 2007-11-30T10:22:15-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=15749#p15749 <![CDATA[My spiffy screen 13 palette fader...]]>
Mine also pregenerates each inner loop (x in your case) to a temporary array, then puts that out to the video card in a separate inner loop. The result: a flickerless fade. (Your code would probably cause some flicker in the top quarter of the screen on my PIII 500mhz.)

Statistics: Posted by BDZ — Fri Nov 30, 2007 10:22 am


]]>
2007-11-30T05:47:30-05:00 2007-11-30T05:47:30-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=15745#p15745 <![CDATA[My spiffy screen 13 palette fader...]]> What I did was instead of decreasing a colors rgb intensity every cycle,
like most other fading routines, I decreased the colors rgb intensity more
gradually. (This fading effect looks much cleaner!)

Code:

'DEFINT A-Z'TYPE PALdata Red AS INTEGER Grn AS INTEGER Blu AS INTEGEREND TYPE'DIM SHARED PAL(255) AS PALdata'SCREEN 13'OUT &H3C7, 0'FOR x = 0 TO 255 PAL(x).Red = INP(&H3C9) PAL(x).Grn = INP(&H3C9) PAL(x).Blu = INP(&H3C9)NEXT'FOR y = 0 TO 199 FOR x = 0 TO 319  PSET (x, y), INT(RND(1) * 254 + 1) NEXTNEXT'COLOR 15: LOCATE 13, 12: PRINT "...Press a key..."'DO: LOOP UNTIL INKEY$ <> INKEY$'OUT &H3C8, 0'FOR y = 1 TO 64 FOR x = 0 TO 255  r = PAL(x).Red - (y * (PAL(x).Red / 64))  g = PAL(x).Grn - (y * (PAL(x).Grn / 64))  b = PAL(x).Blu - (y * (PAL(x).Blu / 64))  OUT &H3C9, r  OUT &H3C9, g  OUT &H3C9, b NEXT WAIT &H3DA, 8NEXT'FOR y = 1 TO 64 FOR x = 0 TO 255  r = y * (PAL(x).Red / 64)  g = y * (PAL(x).Grn / 64)  b = y * (PAL(x).Blu / 64)  OUT &H3C9, r  OUT &H3C9, g  OUT &H3C9, b NEXT WAIT &H3DA, 8NEXT'SYSTEM'
Cya, Nemesis.

p.s..I was thinking maybe writing a tutorial or something to explain the code in detail, step by step. What do you guys think?

Statistics: Posted by Nemesis — Fri Nov 30, 2007 5:47 am


]]>