source: golgotha/src/render/software/affine_map_unlit_holy_blend_c.cc

Last change on this file was 80, checked in by Sam Hocevar, 12 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 1.5 KB
Line 
1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#include "software/r1_software_globals.hh"
10#include "software/inline_fpu.hh"
11
12void texture_scanline_affine_unlit_holy_blend(w16 *start_pixel,
13                                              sw32 start_x,
14                                              void *_left,//perspective_span *left,
15                                              sw32 width)
16{
17  start_pixel = (w16 *)((w8 *)start_pixel + start_x);
18
19  affine_span *left = (affine_span *)_left;
20   
21  left_s = left->s + cur_grads.s_adjust;
22  left_t = left->t + cur_grads.t_adjust;
23
24  temp_dsdx = qftoi(cur_grads.dsdx);
25  temp_dtdx = qftoi(cur_grads.dtdx);
26
27  width_global = width;
28
29  while (width_global)
30  {
31    w16 texel = *(r1_software_texture_ptr + (left_s>>16) + ((left_t>>16)<<r1_software_twidth_log2));
32   
33    if (texel)
34    {
35      *start_pixel = ((*start_pixel & pre_blend_and)>>1) + ((texel & pre_blend_and)>>1);
36    }
37   
38    start_pixel++;
39
40    left_s += temp_dsdx;
41    left_t += temp_dtdx;
42
43    width_global--;
44  }
45}
Note: See TracBrowser for help on using the repository browser.