MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / HTextureSetDefault

Function HTextureSetDefault

editor/HTexture.cpp:419–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

417}
418
419void HTextureSetDefault(room *rp, int face) {
420 if (Editor_view_mode == VM_TERRAIN) {
421 for (int i = 0; i < TERRAIN_WIDTH * TERRAIN_DEPTH; i++) {
422 if (TerrainSelected[i]) {
423 int index = Terrain_seg[i].texseg_index;
424 Terrain_tex_seg[index].rotation = 0;
425 }
426 }
427 World_changed = 1;
428 } else if (Editor_view_mode == VM_ROOM) {
429 //@@Stretch_scale_x = (float)1.0;
430 //@@Stretch_scale_y = (float)1.0;
431
432 for (int i = 0; i < rp->faces[face].num_verts; i++) {
433 float saveu2 = rp->faces[face].face_uvls[i].u2;
434 float savev2 = rp->faces[face].face_uvls[i].v2;
435
436 GetUVLForRoomPoint(ROOMNUM(rp), face, i, &rp->faces[face].face_uvls[i]);
437
438 rp->faces[face].face_uvls[i].u2 = saveu2;
439 rp->faces[face].face_uvls[i].v2 = savev2;
440 }
441 } else {
442 //@@Stretch_scale_x = (float)1.0;
443 //@@Stretch_scale_y = (float)1.0;
444
445 for (int i = 0; i < rp->faces[face].num_verts; i++) {
446 float saveu2 = rp->faces[face].face_uvls[i].u2;
447 float savev2 = rp->faces[face].face_uvls[i].v2;
448
449 GetUVLForRoomPoint(ROOMNUM(rp), face, i, &rp->faces[face].face_uvls[i]);
450
451 rp->faces[face].face_uvls[i].u2 = saveu2;
452 rp->faces[face].face_uvls[i].v2 = savev2;
453 }
454 }
455
456#ifndef NEWEDITOR
457 World_changed = 1;
458#endif
459}
460
461void HTextureNextEdge() {
462 Curedge++;

Callers 1

OnTexpadSetDefaultMethod · 0.85

Calls 1

GetUVLForRoomPointFunction · 0.85

Tested by

no test coverage detected