Changeset 672
 Timestamp:
 May 16, 2011, 2:37:35 AM (11 years ago)
 Location:
 abuse/trunk
 Files:

 6 edited
Legend:
 Unmodified
 Added
 Removed

abuse/trunk/TODO
r670 r672 63 63 Jwindow::_x1 _x2 64 64 65 console::draw_char : vec2i66 65 VolumeWindow::draw_vol plus grand !! 67 66 68 67 x, y in game_object? 69 68 snap_x() snap_y() 70 scatter_line, ascatter_line71 69 xstart() / xend() etc. 72 70 jwindow::area 
abuse/trunk/src/clisp.cpp
r668 r672 86 86 uint8_t chatting_enabled=0; 87 87 88 extern void scatter_line(int x1, int y1, int x2, int y2, int c, int s);89 extern void ascatter_line(int x1, int y1, int x2, int y2, int c1, int c2, int s);90 88 extern void show_end(); 91 89 … … 1970 1968 vec2i pos1 = the_game>GameToMouse(vec2i(x1, y1), current_view); 1971 1969 vec2i pos2 = the_game>GameToMouse(vec2i(x2, y2), current_view); 1972 scatter_line(pos1.x, pos1.y, pos2.x, pos2.y, c, s);1970 ScatterLine(pos1, pos2, c, s); 1973 1971 return 1; 1974 1972 … … 2023 2021 vec2i pos1 = the_game>GameToMouse(vec2i(x1, y1), current_view); 2024 2022 vec2i pos2 = the_game>GameToMouse(vec2i(x2, y2), current_view); 2025 ascatter_line(pos1.x, pos1.y, pos2.x, pos2.y, c1, c2, s);2023 AScatterLine(pos1, pos2, c1, c2, s); 2026 2024 return 1; 2027 2025 
abuse/trunk/src/console.cpp
r671 r672 103 103 104 104 105 void console:: draw_char(int x, int y, char ch)105 void console::DrawChar(vec2i pos, char ch) 106 106 { 107 107 if (!con_win) … … 109 109 110 110 vec2i fs = fnt>Size(); 111 vec2i pos = vec2i(wx(), wy()) + vec2i(x, y)* fs;111 pos = vec2i(wx(), wy()) + pos * fs; 112 112 con_win>m_surf>Bar(pos, pos + fs  vec2i(1), wm>black()); 113 113 fnt>PutChar(con_win>m_surf, pos, ch); … … 116 116 void console::do_cr() 117 117 { 118 if (cx<w && cy<h) draw_char(cx,cy,screen[cy*w+cx]);118 if (cx<w && cy<h) DrawChar(vec2i(cx, cy), screen[cy*w+cx]); 119 119 cx=0; 120 120 cy++; … … 143 143 { 144 144 if (con_win) 145 draw_char(cx,cy,screen[cy*w+cx]);145 DrawChar(vec2i(cx, cy), screen[cy*w+cx]); 146 146 cx; 147 147 if (con_win) … … 158 158 screen[cy*w+cx]=ch; 159 159 if (con_win) 160 draw_char(cx,cy,ch);160 DrawChar(vec2i(cx, cy), ch); 161 161 cx++; 162 162 if (cx>=w) do_cr(); else 
abuse/trunk/src/console.h
r668 r672 36 36 void draw_cursor(); 37 37 void put_string(char const *st); 38 void draw_char(int x, int y, char ch);38 void DrawChar(vec2i pos, char ch); 39 39 void toggle() { if (con_win) hide(); else show(); } 40 40 void print_f(char const *format, ...); 
abuse/trunk/src/particle.cpp
r665 r672 209 209 } 210 210 211 void scatter_line(int x1, int y1, int x2, int y2, int c, int s)211 void ScatterLine(vec2i p1, vec2i p2, int c, int s) 212 212 { 213 213 vec2i caa, cbb; 214 214 main_screen>GetClip(caa, cbb); 215 215 216 int t = abs( x2  x1 ) > abs( y2  y1 ) ? abs( x2  x1 ) + 1 : abs( y2  y1 ) + 1; 217 long xo = x1 << 16, yo = y1 << 16, dx = ( ( x2  x1 ) << 16 ) / t, dy = ( ( y2  y1 ) << 16 ) / t, x, y; 218 219 int xm = ( 1 << s ); 220 int ym = ( 1 << s ); 221 s = ( 15  s ); 216 int t = 1 + Max(abs(p2.x  p1.x), abs(p2.y  p1.y)); 217 int xo = p1.x << 16, 218 yo = p1.y << 16, 219 dx = ((p2.x  p1.x) << 16) / t, 220 dy = ((p2.y  p1.y) << 16) / t; 221 222 int xm = (1 << s); 223 int ym = (1 << s); 224 s = (15  s); 222 225 223 226 main_screen>Lock(); 224 while( t)225 { 226 x = ( xo >> 16 ) + ( jrand() >> s)  xm;227 y = ( yo >> 16 ) + ( jrand() >> s)  ym;228 if( !( x < caa.x  y < caa.y  x >= cbb.x  y >= cbb.y ))227 while(t) 228 { 229 int x = (xo >> 16) + (jrand() >> s)  xm; 230 int y = (yo >> 16) + (jrand() >> s)  ym; 231 if(!(x < caa.x  y < caa.y  x >= cbb.x  y >= cbb.y)) 229 232 { 230 *(main_screen>scan_line( y ) + x) = c;233 *(main_screen>scan_line(y) + x) = c; 231 234 } 232 235 xo += dx; … … 236 239 } 237 240 238 239 240 void ascatter_line(int x1, int y1, int x2, int y2, int c1, int c2, int s) 241 void AScatterLine(vec2i p1, vec2i p2, int c1, int c2, int s) 241 242 { 242 243 vec2i caa, cbb; 243 244 main_screen>GetClip(caa, cbb); 244 245 245 int t = abs( x2  x1 ) > abs( y2  y1 ) ? abs( x2  x1 ) + 1 : abs( y2  y1 ) + 1; 246 long xo = x1 << 16, yo = y1 << 16, dx = ( ( x2  x1 ) << 16 ) / t, dy = ( ( y2  y1 ) <<16 ) / t, x, y; 247 248 int xm = ( 1 << s ); 249 int ym = ( 1 << s ); 250 s = ( 15  s ); 246 int t = 1 + Max(abs(p2.x  p1.x), abs(p2.y  p1.y)); 247 int xo = p1.x << 16, 248 yo = p1.y << 16, 249 dx = ((p2.x  p1.x) << 16) / t, 250 dy = ((p2.y  p1.y) << 16) / t; 251 252 int xm = (1 << s); 253 int ym = (1 << s); 254 s = (15  s); 251 255 252 256 main_screen>Lock(); … … 255 259 uint8_t *addr; 256 260 257 while( t)258 { 259 x = ( xo >> 16 ) + ( jrand() >> s)  xm;260 y = ( yo >> 16 ) + ( jrand() >> s)  ym;261 while(t) 262 { 263 int x = (xo >> 16) + (jrand() >> s)  xm; 264 int y = (yo >> 16) + (jrand() >> s)  ym; 261 265 // FIXME: these clip values seemed wrong to me before the GetClip 262 266 // refactoring. 263 if( !( x <= caa.x  y <= caa.y  x >= cbb.x  1  y >= cbb.y  1))267 if(!(x <= caa.x  y <= caa.y  x >= cbb.x  1  y >= cbb.y  1)) 264 268 { 265 addr = main_screen>scan_line( y) + x;269 addr = main_screen>scan_line(y) + x; 266 270 *addr = c1; 267 271 *(addr + w) = c2; 
abuse/trunk/src/particle.h
r555 r672 23 23 void tick_panims(); 24 24 void free_pframes(); 25 void ScatterLine(vec2i p1, vec2i p2, int c, int s); 26 void AScatterLine(vec2i p1, vec2i p2, int c1, int c2, int s); 25 27 26 28 struct part … … 60 62 } ; 61 63 62 63 64 #endif 64 65 65
Note: See TracChangeset
for help on using the changeset viewer.