Can't add any drawings to gui_osd_draw() - why? - General Discussion and Assistance - CHDK Forum

Can't add any drawings to gui_osd_draw() - why?

  • 2 Replies
  • 2638 Views
Can't add any drawings to gui_osd_draw() - why?
« on: 12 / November / 2011, 18:38:43 »
Advertisements
I'm trying to add something to the OSD and reading the source I supose I have to add my drawings to gui_osd_draw() in core/gui_osd.c. So What I did:

- I've changed gui_osd_draw() function as follows:

Code: [Select]
void gui_osd_draw() {
    if (osd_to_draw) {
        int i;
        draw_restore();
        gui_draw_something(); // <-- here's my function
        gui_osd_draw_histo();
        gui_osd_draw_dof();
        gui_batt_draw_osd();
        gui_space_draw_osd();
        gui_osd_draw_state();
        gui_osd_draw_raw_info();
        ...
        ... and so on ...

- I've added apropriate drawing at the end of the same file:

Code: [Select]
void gui_draw_something() {
    draw_line(1,1,100,100,conf.osd_color);
}

- also exported in gui_osd.h:
Code: [Select]
extern void gui_draw_something();

The whole code compiles without any errors and warnings but seems to be not working. There's no new line on the screen.

Testing the drawings before I tried to add a lua function for drawing a line just by calling "draw_line" function from luascript.c (of course with all includes and so on) and it worked very well. So I am pretty sure that I 'can' draw, but I'm doing something wrong while I try to draw from gui_osd()...

What's wrong?!
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Can't add any drawings to gui_osd_draw() - why?
« Reply #1 on: 12 / November / 2011, 18:51:23 »
Welcome to the confusion that is CHDK :)

'gui_osd_draw' is used by the 'OSD layout editor' in the 'OSD Parameters' menu.

You need to modify 'gui_draw_osd' in gui.c

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: Can't add any drawings to gui_osd_draw() - why?
« Reply #2 on: 12 / November / 2011, 18:56:39 »
Ahhh:D That's the case! After your post I trief to go into lyout editor and I found there my sweet line:) The code might by better commented, but with all these goodies that CHDK provides this little confusion is not the problem!

Thank you so much!
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

 

Related Topics


SimplePortal © 2008-2014, SimplePortal