|
1 | 1 | /* |
2 | 2 | Input used to generate the Python module "glmodule.c". |
3 | | -The stub generator is a Python script called "cgen". |
| 3 | +The stub generator is a Python script called "cgen.py". |
4 | 4 |
|
5 | 5 | Each definition must be contained on one line: |
6 | 6 |
|
@@ -491,6 +491,8 @@ static object *gl_endselect(self, args) object *self, *args; { |
491 | 491 | } |
492 | 492 |
|
493 | 493 |
|
| 494 | +/* XXX The generator botches this one. Here's a quick hack to fix it. */ |
| 495 | + |
494 | 496 | /* XXX The generator botches this one. Here's a quick hack to fix it. */ |
495 | 497 |
|
496 | 498 | % getmatrix float r[16] |
@@ -519,6 +521,46 @@ gl_getmatrix(self, args) |
519 | 521 | return v; |
520 | 522 | } |
521 | 523 |
|
| 524 | +/* Here's an alternate version that returns a 4x4 matrix instead of |
| 525 | + a vector. Unfortunately it is incompatible with loadmatrix and |
| 526 | + multmatrix... */ |
| 527 | + |
| 528 | +% altgetmatrix float r[4][4] |
| 529 | + |
| 530 | +static object * |
| 531 | +gl_altgetmatrix(self, args) |
| 532 | + object *self; |
| 533 | + object *args; |
| 534 | +{ |
| 535 | + float arg1 [ 4 ] [ 4 ] ; |
| 536 | + object *v, *w; |
| 537 | + int i, j; |
| 538 | + getmatrix( arg1 ); |
| 539 | + v = newlistobject(4); |
| 540 | + if (v == NULL) { |
| 541 | + return NULL; |
| 542 | + } |
| 543 | + for (i = 0; i < 4; i++) { |
| 544 | + w = newlistobject(4); |
| 545 | + if (w == NULL) { |
| 546 | + DECREF(v); |
| 547 | + return NULL; |
| 548 | + } |
| 549 | + setlistitem(v, i, w); |
| 550 | + } |
| 551 | + for (i = 0; i < 4; i++) { |
| 552 | + for (j = 0; j < 4; j++) { |
| 553 | + w = mknewfloatobject(arg1[i][j]); |
| 554 | + if (w == NULL) { |
| 555 | + DECREF(v); |
| 556 | + return NULL; |
| 557 | + } |
| 558 | + setlistitem(getlistitem(v, i), j, w); |
| 559 | + } |
| 560 | + } |
| 561 | + return v; |
| 562 | +} |
| 563 | + |
522 | 564 | /* End of manually written stubs */ |
523 | 565 |
|
524 | 566 | %% |
@@ -680,9 +722,13 @@ void rpmv2 float s float s |
680 | 722 | void xfpt2 float s float s |
681 | 723 | # |
682 | 724 | void loadmatrix float s[16] |
| 725 | +# Really [4][4] |
683 | 726 | void multmatrix float s[16] |
684 | | -void crv float s[16] |
| 727 | +# Really [4][4] |
| 728 | +void crv float s[12] |
| 729 | +# Really [4][3] |
685 | 730 | void rcrv float s[16] |
| 731 | +# Really [4][4] |
686 | 732 | # |
687 | 733 | # Methods that have strings. |
688 | 734 | # |
@@ -712,8 +758,10 @@ void polfs long s short s[3*arg1] |
712 | 758 | void polys long s short s[3*arg1] |
713 | 759 | void poly2s long s short s[2*arg1] |
714 | 760 | # |
715 | | -void defcursor short s short s[16] |
| 761 | +void defcursor short s short s[128] |
| 762 | +# Is this useful? |
716 | 763 | void writepixels short s short s[arg1] |
| 764 | +# Should be unsigned short... |
717 | 765 | void defbasis long s float s[16] |
718 | 766 | void gewrite short s short s[arg1] |
719 | 767 | # |
|
0 commit comments