#include "conversation.h" conversation::conversation() { for (int x=0; x=(unsigned int)strlen(message[which])) {//ran out of conversation EndConversation(which); return false; } else {//theres more to do progress[which]+=textcols*textrows; if ((unsigned int)progress[which]>(unsigned int)strlen(message[which])) progress[which]=strlen(message[which]); } return true; } void conversation::EndConversation(int which) {//kills the current conversation if (message[which]!=NULL) delete[] message[which]; message[which]=NULL; progress[which]=0; } bool conversation::CheckTalking(int which) { if (message[which]==NULL) return false; if (progress[which]>=strlen(message[which])) return false; if (progress[which]<0) return false; return true; } void conversation::DrawConversation(int which, int numplayers, int windowwidth, int windowheight) {//renders the box if (CheckTalking(which)==false) return; if (numplayers>MAXCHATS) { cerr<<"drawconversation cannot support more than "< at the bottom right corner if there's more text after this glRasterPos2f(30,150); if (numplayers>2) { glTranslatef(borderthickness+30,boxy+boxheight-borderthickness-50,0); glScalef(0.16,0.16,0.16); glDisable(GL_DEPTH_TEST); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glLineWidth(1.0); glEnable(GL_LINE_SMOOTH); } //glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24,'A'); //glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24,'a'); if ((progress[which]>=0)&&(message[which]!=NULL)) { int startprogress=progress[which]; char *thismessage=message[which]; while (progress[which]'); } else { glutStrokeCharacter(GLUT_STROKE_MONO_ROMAN,' '); glutStrokeCharacter(GLUT_STROKE_MONO_ROMAN,'>'); } } progress[which]=startprogress;//only continue function will update it } /* glDisable(GL_DEPTH_TEST); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glEnable(GL_LINE_SMOOTH); glLineWidth(8.0); glTranslatef(0,90,0); glScalef(0.5,0.5,0.5); glutStrokeCharacter(GLUT_STROKE_MONO_ROMAN,'z'); glutStrokeCharacter(GLUT_STROKE_ROMAN,'c'); glDisable(GL_BLEND); */ glPopMatrix(); glEnable(GL_DEPTH_TEST); }