Ticket #1310: glteapot.patch

File glteapot.patch, 1.0 KB (added by korli, 17 years ago)

uses a 5 bit key value to be usable on all colorspaces

  • src/apps/glteapot/ObjectView.cpp

     
    9898{
    9999    ObjectView* ov = (ObjectView*)cookie;
    100100
    101     int noPause = 0;
    102     while (acquire_sem_etc(ov->quittingSem,1,B_TIMEOUT,0) == B_NO_ERROR) {
     101    int noPause = 0;
     102    while (acquire_sem_etc(ov->quittingSem, 1, B_TIMEOUT, 0) == B_NO_ERROR) {
    103103        if (ov->SpinIt()) {
    104104            ov->DrawFrame(noPause);
    105105            release_sem(ov->quittingSem);
     
    373373    float f[3];
    374374    f[1] = f[2] = 0;
    375375    for (int i = 0; i < fObjects.CountItems(); i++) {
    376         f[0] = (255 - i) / 255.0;
     376        f[0] = (255 - 8 * i) / 255.0;
    377377        ((GLObject*)fObjects.ItemAt(i))->Draw(true, f);
    378378    }
    379379    glReadBuffer(GL_BACK);
     
    381381    glReadPixels((GLint)p.x, (GLint)(Bounds().bottom - p.y), 1, 1,
    382382        GL_RGB, GL_UNSIGNED_BYTE, pixel);
    383383    int objNum = pixel[0];
    384     objNum = 255 - objNum;
     384    objNum = (255 - objNum) / 8;
    385385
    386386    EnforceState();
    387387    UnlockGL();