import sys import buildmap import namestruct import math map = buildmap.map() def circ(cx, cy, rad, npts, dir = 1): mul =(math.pi*2)/npts * dir for n in xrange(npts): yield (cx + int(math.cos(mul * n) * rad), cy + int(math.sin(mul * n) * rad)) def rotpts(cx, cy, ang, pts): cosa = math.cos(ang) sina = math.sin(ang) for x, y in pts: rx = x - cx ry = y - cy nrx = rx * cosa + ry * sina nry = ry * cosa - rx * sina yield nrx + cx, nry + cy class Sect(object): def __init__(self): self.polys = [] mnpts = 60 circ1 = list(circ(0, 0, 2048 * 6, mnpts / 2)) circ2 = list(circ(0, 0, 2048 * 6 - 256, mnpts)) circ3 = list(circ(0, 0, 2048 * 6 - 384, mnpts))
import buildmap,sys map=buildmap.map(sys.argv[1]) for s in map.sectors: s.ceilingshade=-127 s.floorshade=-127 s.floorpicnum = 22 s.ceilingpicnum = 20 for w in map.walls: w.shade=-127 w.cstat &= ~1 w.picnum = 23 #map.sprites = [a for a in map.sprites if a.picnum != 1] map.writeto(sys.argv[2])
#if not s1[1][-17]: # cc = cols[1] draw.line((w-l.x1*scl,h-l.y1*scl,w-l.x2*scl,h-l.y2*scl),fill=cc) #draw.line((0,0,100,100),fill=(1,1,1)) img.save(sys.argv[2]) else: pts = [] def addspr(x,y): if not (x,y) in pts: pts.append((x,y)) import namestruct,buildmap,sys map=buildmap.map(sys.argv[2]) nspr = [] for s in map.sprites: if s.picnum != 1: nspr.append(s) map.sprites=nspr for l in lins: #if l.s1[1][18]: # continue ln = math.sqrt((l.x2-l.x1)*(l.x2-l.x1) + (l.y2-l.y1)*(l.y2-l.y1)) numspr = int(ln/200) if numspr < 3: numspr = 3 for i in xrange(numspr): f = (float(i)/float(numspr-1))