void removeface(roteface **face1, roteface *f) { if(*face1==f) *face1=f->next; else { roteface * prev=getprevface(*face1, f); if(prev)prev->next=f->next; } rote_vt_destroy(f->t); free(f); }
static int lua_RoteTerm_gc(lua_State* L) { RoteTerm* rt = lua_RoteTerm_self(L, 1); rote_vt_destroy(rt); return 0; }
~logger() { rote_vt_destroy(t); }
void machine_destroy(Machine *m) { if (!m) return; rote_vt_destroy(m->vt); delete m; m = nullptr; }
int main(int a, char **v) { if (s3d_init(&a,&v,"test")) { printf("opsie\n"); s3d_usage(); exit(1); } tex=s3d_new_object(); selob=s3d_new_object(); boogieman=s3d_new_object(); s3d_flags_on(boogieman, S3D_OF_SELECTABLE);//|S3D_OF_VISIBLE); float bla[12]= {0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1 }; float wla[12]= {0, 1, 0.1, 1, 0, 0, 0.1, 1, 0, 0, 0.1, 1 }; if ((a==2)&&!strcmp(v[1],"r")) { bla[0]=bla[3]=bla[6]=1; bla[3]=bla[7]=bla[11]=1; } else if ((a==2)&&!strcmp(v[1],"g")) { bla[1]=bla[4]=bla[7]=1; bla[3]=bla[7]=bla[11]=1; } else if ((a==2)&&!strcmp(v[1],"b")) { bla[2]=bla[5]=bla[8]=1; bla[3]=bla[7]=bla[11]=1; } else bla[0]=bla[1]=bla[2]=bla[3]=bla[4]=bla[5]=bla[6]=bla[7]=bla[8]=bla[9]=bla[10]=bla[11]=1; s3d_push_materials_a(boogieman,bla, 1); s3d_push_materials_a(boogieman,wla, 1); s3d_push_materials_a(selob,bla, 1); s3d_push_line(selob, 0,1,0); s3d_push_line(selob, 1,2,0); bla[0]=bla[1]=bla[2]=bla[3]=bla[4]=bla[5]=bla[6]=bla[7]=bla[8]=bla[9]=bla[10]=bla[11]=1; s3d_push_materials_a(tex,bla, 1); bla[0]=bla[1]=bla[2]=bla[3]=bla[4]=bla[5]=bla[6]=bla[7]=bla[8]=bla[9]=bla[10]=bla[11]=1; s3d_push_materials_a(tex,bla, 1); int b; int c;//31 for (b=1; b<9; b++) { bla[0]=b/8.0; s3d_push_materials_a(tex,bla, 1); } bla[0]=1; for (b=9; b<17; b++) { bla[1]=9+b/8.0; s3d_push_materials_a(tex,bla, 1); } bla[1]=1; for (b=17; b<25; b++) { bla[2]=17+b/8.0; s3d_push_materials_a(tex,bla, 1); } bla[2]=1; for (b=25; b<32; b++) { bla[2]=bla[1]=25+b/7.0; s3d_push_materials_a(tex,bla, 1); } t=rote_vt_create(30,120); //lines_r_clean(t); rote_vt_forkpty(t,"sh"); dirty=1; zoomx=16.666; zoomy=10; float byoom=zoomy/t->rows; float bxoom=zoomx/t->cols; yoom=byoom/26; xoom=bxoom/13; pokeboogieman(t); s3d_flags_on(tex, S3D_OF_VISIBLE); s3d_set_callback(S3D_EVENT_QUIT, stop); s3d_set_callback(S3D_EVENT_KEY, keypress); s3d_set_callback(S3D_EVENT_OBJ_PCLICK, click); s3d_set_callback(S3D_EVENT_OBJ_INFO, camcamcam); s3d_set_callback(S3D_EVENT_MBUTTON, but); // s3d_set_callback(S3D_EVENT_INIT, init); loadl2("l2"); initbufs(); s3d_mainloop(mainloop); rote_vt_destroy(t); }