view plugins/crazychat/draw.c @ 13664:4132d997ccec

[gaim-migrate @ 16066] Fix Coverity CID 45: Check to make sure a channel 2 ICBM actually contains an IP address TLV before attempting to use it. This avoids a crash when the server sends us an abnormal channel 2 ICBM. I'm not sure if that ever happens. Fix Coverity CID 204: Don't attempt to send data over a FLAP BOS connection that doesn't exist. This should never happen because the account should get disconnected first. Fix Coverity CID 205: Don't check that a variable 'od' which we know is valid is not equal to NULL in aim_search_address() in family_userlookup.c Fix Coverity CID 206: Don't check that the variable 'od' which we know is valid is not equal to NULL in aim_chat_join() in family_oservice.c Fix Coverity CID 207: I neglected to remove a "return;" line from aim_admin_setnick() in family_admin.c which caused setting your AIM screen name formatting to not work. Fix Coverity CID 208: Remove a duplicate call to gaim_connection_get_account() in peer_connection_propose() in peer.c. Fix Coverity CID 209: Remove the unused variable "username" from incomingim_chan2() in oscar.c. Fix Coverity CID 210: Remove the unused variable "account" from peer_connection_listen_cb() in peer.c. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 20 Apr 2006 04:45:06 +0000
parents ed017b9c532d
children
line wrap: on
line source

#include "righteye10.h"

typedef struct _point{
  GLshort x;
  GLshort y;
} Point;

typedef struct Packet{
  Point mouthLeft;
  Point mouthRight;
  Point mouthTop;
  Point mouthBottom;
  Point eyeLeft;
  Point eyeRight;
} Packet;

#define NUM_EYE_FRAMES 10

GLint rightEyes[NUM_EYE_FRAMES];

void CalculateMouthPoints(GLshort[][][] ctrlpoints, struct Packet* p)
{
    GLshort points[4][3];
    points[0][0]=p->mouthLeft.x;
    points[0][1]=p->mouthLeft.y;
    points[0][2]=front;

    points[1][0]=p->mouthBottom.x;
    points[1][1]=p->mouthTop.y;
    points[1][2]=front;

    points[2][0]=p->mouthRight.x;
    points[2][1]=p->mouthRight.y;
    points[2][2]=front;

    points[3][0]=p->mouthTop.x;
    points[3][1]=p->mouthTop.y;
    points[3][2]=front;

    ctrlpoints[0][0][0]=points[0][0];
    ctrlpoints[0][0][1]=points[0][1];
    ctrlpoints[0][0][2]=points[0][2];
    
    ctrlpoints[0][1][0]=points[1][0];
    ctrlpoints[0][1][1]=points[1][1];
    ctrlpoints[0][1][2]=points[1][2];
    
    ctrlpoints[0][2][0]=points[2][0];
    ctrlpoints[0][2][1]=points[2][1];
    ctrlpoints[0][2][2]=points[2][2];
    
    ctrlpoints[1][0][0]=points[0][0];
    ctrlpoints[1][0][1]=points[0][1];
    ctrlpoints[1][0][2]=points[0][2];
    
    ctrlpoints[1][1][0]=0;
    ctrlpoints[1][1][1]=0;
    ctrlpoints[1][1][2]=back;
    
    ctrlpoints[1][2][0]=points[2][0];
    ctrlpoints[1][2][1]=points[2][1];
    ctrlpoints[1][2][2]=points[2][2];
    
    ctrlpoints[2][0][0]=points[0][0];
    ctrlpoints[2][0][1]=points[0][1];
    ctrlpoints[2][0][2]=points[0][2];
    
    ctrlpoints[2][1][0]=points[3][0];
    ctrlpoints[2][1][1]=points[3][1];
    ctrlpoints[2][1][2]=points[3][2];
    
    ctrlpoints[2][2][0]=points[2][0];
    ctrlpoints[2][2][1]=points[2][1];
    ctrlpoints[2][2][2]=points[2][2];
}

void drawMouth(struct Packet* p)
{
    GLshort[4][3][3] ctrlpoints;
    CalculateMouthPoints(ctrlpoints, p);
    
    glMap2f(GL_MAP2_VERTEX_3, 0, 10, 3, 3, 0.0, 10.0, 9, 3, &ctrlpoints[0][0][0]);
    glEnable(GL_MAP2_VERTEX_3);
    glMapGrid2f(10, 0, 10, 10, 0, 10);
    glEnable(GL_AUTO_NORMAL);
    glEvalMesh2(GL_FILL, 0, 10, 0, 10);
}

void initEyes(){
	

void drawEyes(struct Packet* p){
    GLshort eye[3][3][3];
    CalculateEyePoints(eye, p, LEFT);
    glMap2f(GL_MAP2_VERTEX_3, 0, 10, 3, 3, 0.0, 10.0, 9, 3, &eyep[0][0][0]);
    glMapGrid2f(10, 0, 10, 10, 0, 10);
    glEvalMesh2(GL_FILL, 0, 10, 0, 10);
    
    CalculateEyePoints(eye, p, RIGHT);
    glMap2f(GL_MAP2_VERTEX_3, 0, 10, 3, 3, 0.0, 10.0, 9, 3, &eyep[0][0][0]);
    glMapGrid2f(10, 0, 10, 10, 0, 10);
    glEvalMesh2(GL_FILL, 0, 10, 0, 10);
    
}

void drawHead(struct Packet* p){
}