m0j0hn / editor-on-fire

Automatically exported from code.google.com/p/editor-on-fire
Other
0 stars 0 forks source link

3D preview is broken #210

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm not sure which revision first caused this, but drum notes don't display at 
all and guitar type notes display erratically.  I didn't immediately find 
what's causing this, but at least for the drum note issue, I find that the 
clipping logic in eof_note_tail_draw_3d() is causing the rendering loop to 
break before it can render any drum notes.

Original issue reported on code.google.com by raynebc on 27 Nov 2010 at 9:19

GoogleCodeExporter commented 9 years ago
It seems that if I change the length variable in the EOF_NOTE structure 
definition back to long instead of unsigned long, the preview works again.  
However, it might be best to ensure that lengths are unsigned because 
logically, they cannot be negative.

Original comment by raynebc on 29 Nov 2010 at 5:30

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
The problem ends up being in this line:
if(npos + np->length / eof_zoom_3d < -100)

In this case, npos is a signed integer type, and np->length is an unsigned 
integer type.  The resulting unsigned value is compared against -100, which is 
a very large number when interpreted as unsigned, causing the statement to 
register as TRUE.

Original comment by raynebc on 29 Nov 2010 at 5:39

GoogleCodeExporter commented 9 years ago
Fixed in r602.  For now, it looks like the note length will have to remain a 
signed value.  The only way to change that would be to redesign the screen 
coordinate mapping logic, which is designed to use signed numbers.  That may 
not be a worthwhile endeavor.

Original comment by raynebc on 29 Nov 2010 at 5:53