int XTCSample::Display(TimeValue t, INode* inode, ViewExp *vpt, int flags, Object *pObj) { if ( ! vpt || ! vpt->IsAlive() ) { // why are we here DbgAssert(!_T("Doing Display() on invalid viewport!")); return FALSE; } if(pObj->ClassID() == XGSPHERE_CLASS_ID || pObj->IsSubClassOf(triObjectClassID)) { return DisplayMesh(t, inode, vpt, flags, GetMesh(pObj)); } #ifndef NO_PATCHES else if( pObj->IsSubClassOf(patchObjectClassID) ) { return DisplayPatch(t, inode, vpt, flags, (PatchObject *) pObj); } #endif else if(pObj->CanConvertToType(triObjectClassID)) { TriObject *pTri = (TriObject *) pObj->ConvertToType(t,triObjectClassID); DisplayMesh(t, inode, vpt, flags, &pTri->mesh); if(pTri != pObj) pTri->DeleteThis(); } return 0; }
void PatchSuchen(void) { int i; for (i=0;i<TEntries;i++) { if (strnicmp(SuchStr,TEntry[i].TName,SPos)==0) { TPos=i-10; TCPos=12; if (TPos<0) { TCPos=i+2; TPos=0; } if (TPos>TEntries-22) { TPos=TEntries-22; TCPos=24-(TEntries-i); } break; } } DisplayPatch(); }
void PatchData(void) { int xoff,yoff,i,k,x=0,y=0,PNum; Print(25,9,1,15,"���������������������������������������������������Ĵ"); for (i=10;i<23;i++) { Print(25,i,1,15,"� "); Print(27,i,0,15," "); Print(76,i,1,15," �"); } Print(25,23,1,15,"�����������������������������������������������������"); for (i=0;i<Tn;i++,y++) { _read(fileno(f),&xoff,2); _read(fileno(f),&yoff,2); _read(fileno(f),&PNum,2); if (y>12) { y=0; x+=10; } Print(27+x,10+y,0,15,PName[PNum].Name); _read(fileno(f),&k,2); _read(fileno(f),&k,2); } getch(); DisplayPatch(); }
void GetPatch(void) { int xoff,yoff,i,k,x,y,PNum; long lll,l; x=(320-Tx)/2; y=(200-Ty)/2; SwitchMode(1); DoomPalette(); if (WinPal==2) Window(0xa000,0,x,y,Tx,Ty); for (i=0;i<Tn;i++) { _read(fileno(f),&xoff,2); _read(fileno(f),&yoff,2); _read(fileno(f),&PNum,2); l=ftell(f); Entry=E; Entry+=PName[PNum].Num; lll=Entry->RStart; TakePic(lll,x,y,xoff,yoff,x+Tx-1,y+Ty-1,0xa000,0); fseek(f,l,0); _read(fileno(f),&k,2); _read(fileno(f),&k,2); } getch(); SwitchMode(0); ScreenAufbau(); DisplayPatch(); }
/* void Print(int x,int y,char h,char v,char string[]); void ScreenAufbau(void); void DisplayPatch(void); void GetPatch(void); void Choose64(void); void PatchData(void); void PatchSuchen(); */ void Patches(void) { long L,l,n,ll; /* int i,k,pepe,k2,k3,Arg; */ int i,pepe,k2,k3; unsigned char Taste; Texes=1; Print(18,10,5,15," ����������������������������������������Ŀ "); Print(18,11,5,15," � Reading Texture Resources... � "); Print(18,12,5,15," ������������������������������������������ "); Print(27,22,0,15," "); for (i=0;i<PNames;i++) PName[i].UsedInTex=999; l=Entry->RStart; fseek(f,l,0); _read(fileno(f),&n,4); TEntries=(int)n; for (L=0;L<n;L++) { i=(int)L; _read(fileno(f),&ll,4); TEntry[i].TStart=ll+l; } for (i=0;i<TEntries;i++) { fseek(f,TEntry[i].TStart,0); _read(fileno(f),&TEntry[i].TName,8); TEntry[i].TName[8]=0; _read(fileno(f),Puffer,12); _read(fileno(f),&pepe,2); _read(fileno(f),Puffer,4); for (k2=0;k2<pepe;k2++) { _read(fileno(f),&k3,2); _read(fileno(f),Puffer,8); PName[k3].UsedInTex=i; } } ScreenAufbau(); DisplayPatch(); for(;;) { Taste=getch(); if (Taste==27) break; if (Taste==73) { TPos-=21; if (TPos<0) { TPos=0; TCPos=2; } DisplayPatch(); Taste=0; } if (Taste==81) { TPos+=21; if (TPos>n-22) { TPos=(int)n-22; TCPos=23; } DisplayPatch(); Taste=0; } if (Taste==72 && TCPos==2 && TPos>0) { TPos--; DisplayPatch(); Taste=0; } if (Taste==80 && TCPos==23) { TPos++; if (TPos>n-22) TPos=(int)n-22; DisplayPatch(); Taste=0; } if (Taste==72 && TCPos==2 && TPos==0) Taste=0; if (Taste==80) { TCPos++; DisplayPatch(); Taste=0; } if (Taste==72) { TCPos--; DisplayPatch(); Taste=0; } if (Taste==79) { TPos=(int)n-22; TCPos=23; DisplayPatch(); } if (Taste==71) { TPos=0; TCPos=2; DisplayPatch(); } if (Taste==13) GetPatch(); if (Taste==60) Choose64(); if (Taste==59) PatchData(); if ( ((Taste>94 && Taste<123) || (Taste>32 && Taste<58)) && SPos<8) { SuchStr[SPos]=Taste; SuchStr[SPos+1]=0; Print(27,22,0,15," "); Print(27,22,0,15,SuchStr); SPos++; if (SPos>0) PatchSuchen(); } if (Taste==8 && SPos>0) { SPos--; SuchStr[SPos]=0; Print(27,22,0,15," "); Print(27,22,0,15,SuchStr); if (SPos>0) PatchSuchen(); } } SuchStr[0]=0; SPos=0; Texes=0; ScreenAufbau(); Display(); }