Author Topic: draw line not working  (Read 3591 times)

qqluqq

  • New to the forum
  • *
  • Posts: 7
draw line not working
« on: April 02, 2014, 12:23:39 AM »
I'm trying to make a little game
I started with arkanoid and threw out most of what I didn't need


when I try something like
draw_line(10,10,50,50,0);
it doesn't seem to do anything, the screen just stays black


I tried writing text with bmp_printf and that ran fine, so I'm sure it reaches that line of code
are there any things I might have done wrong?

the stuff based on draw_line like rectangles and circles don't work eighter.




Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3556
  • Blunt and to the point
Re: draw line not working
« Reply #1 on: April 02, 2014, 05:38:46 AM »
I found these in mlv_rec.c

Code: [Select]
            for(int32_t k = 0; k < scale; k++)
            {
                draw_line(x, y+5, x, y+17, color);
                x++;
            }

Code: [Select]
        if (prev_x && (prev_x < x))
        {
            if(prev_fill_y)
            {
                draw_line(prev_x, prev_fill_y, x, y_fill, COLOR_GREEN1);
            }
            if(prev_rate_0_y && y_rate_0 != ymax)
            {
                draw_line(prev_x, prev_rate_0_y, x, y_rate_0, COLOR_RED);
            }
            if(card_spanning && prev_rate_1_y && y_rate_1 != ymax)
            {
                draw_line(prev_x, prev_rate_1_y, x, y_rate_1, COLOR_BLUE);
            }
        }

Hope it helps.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12183
  • Maintenance mode
Re: draw line not working
« Reply #2 on: April 02, 2014, 08:28:22 AM »
it doesn't seem to do anything, the screen just stays black

Try a different color.

qqluqq

  • New to the forum
  • *
  • Posts: 7
Re: draw line not working
« Reply #3 on: April 02, 2014, 10:52:08 AM »
Try a different color.


yeah that was it, looked over it because it's the first digit in draw_rect_chamfer, and the last one in draw_line