leileilol wrote:I wanted to do scrolling textures (ab)using FTE's scrapped "bulleten" code) for Engoo once in my Nov 2010 featurecreepcodingrush. I never got it to work properly, and how would we define scrolling texture standards? Another prefix to parse in the texture name? like &su8vortex to scroll up 8 texels a sec, &sd3&sr7cheese to scroll down 3 texels and right 7 texels a second, or so...
I've been thinking about that a little and of all things I actually might have a solution. That avoids the question entirely.
Both Travail has a waterfall. It is just a sequenced texture. Warpspasm has a "lava column" that flows down. Again it is just an animated texture.
Here is a possible solution:
1) Look at the WAD texture for sequence 1. +lava0
2) Look at the WAD texture for sequence 2. +lava1
3) Take the first row of the texture 1 and the first row of texture 2. Do a memcmp
4) --- If they are different ...
5) --- sum the value of the bytes
6) ------ if they match
7) -------- shift texture 2 one byte at time (x number of pixels in row)
---------- do memcpy compare ... if match ... we have a strong candidate for a shifting texture (check a couple more random rows with this same shift to validate)
9) ------------- Shift the entire texture 2 (every row) by amount from #8
10) -------------- Do a memory compare of texture1 and shifted texture2
11) ----------------- if they match ...
12) -------------------- Take the amount of the shift and divide by 10 frames per second (R_TextureAnimation frame rate is 10 per second)
13) -------------------------- and that is the shift rate
Now ... at rendering time, don't use R_TextureAnimation for any texture marked above. Instead use the texture 1 all the time by an interpolated shift amount.
This is
A) Backwards compatible to Quake (no special engine required)
B) Requires no special texture names
C) The shift speed is derived from the textures
D) In an engine using the above formula, these texture animations are interpolated as scrolling textures (and rendered smooth as hell)
E) The move amount can be customized by the mapper.