From 92fdfa02281895fbef9e255c11e7d62c3bc4630c Mon Sep 17 00:00:00 2001
From: "Silas S. Brown" <ssb22@cam.ac.uk>
Date: Wed, 21 Jul 2021 21:35:45 +0100
Subject: [PATCH] trace.py: 1080x607 mode for WeChat channels

---
 gradint-build/samples/utils/trace.py | 5 +++--
 gradint-build/src/frontend.py        | 6 ++++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/gradint-build/samples/utils/trace.py b/gradint-build/samples/utils/trace.py
index 42ac312..e34c630 100644
--- a/gradint-build/samples/utils/trace.py
+++ b/gradint-build/samples/utils/trace.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python2
 
 # trace.py: script to generate raytraced animations of Gradint lessons
-# Version 1.31 (c) 2018-19,2021 Silas S. Brown.  License: GPL
+# Version 1.32 (c) 2018-19,2021 Silas S. Brown.  License: GPL
 
 #  The Disney Pixar film "Inside Out" (2015) represented
 #  memories as spheres.  I don't have their CGI models, but
@@ -36,7 +36,7 @@ parser = OptionParser()
 parser.add_option("--fps",default=15,dest="theFPS",
                   help="Frames per second (10 is insufficient for fast movement, so recommend at least 15)")
 parser.add_option("--res",default=480,
-                  help="Y-resolution: 240=NTSC VCD, 288=PAL VCD, 480=DVD, 720=Standard HD (Blu-Ray), 1080=Full HD (Blu-Ray)")
+                  help="Y-resolution: 240=NTSC VCD, 288=PAL VCD, 480=DVD, 607=WeChat channel, 720=Standard HD (Blu-Ray), 1080=Full HD (Blu-Ray)")
 parser.add_option("--translucent",action="store_true",default=False,dest="translucent_spheres_when_picture_visible",
                   help="Translucent spheres when picture visible (slows down rendering but is better quality)")
 parser.add_option("--minutes",default=0,
@@ -51,6 +51,7 @@ theFPS,res,minutes,povray_quality = int(theFPS),int(res),int(minutes),int(povray
 if res in [240,288]:
     width_height_antialias = (352,res,0.3) # VCD.  antialias=None doesn't look very good at 300x200, cld try it at higher resolutions (goes to the +A param, PovRay default is 0.3 if -A specified without param; supersample (default 9 rays) if colour differs from neighbours by this amount)
 elif res==480: width_height_antialias = (640,480,0.001) # 480p (DVD)
+elif res==607: width_height_antialias = (1080,607,None) # WeChat Channels
 elif res==720: width_height_antialias = (1280,720,None) # Standard HD (Blu-Ray)
 elif res==1920: width_height_antialias = (1920,1080,None) # Full HD (Blu-Ray)
 else: raise Exception("Unknown vertical resolution specified: "+repr(res))
diff --git a/gradint-build/src/frontend.py b/gradint-build/src/frontend.py
index fa8d07f..852b0cd 100644
--- a/gradint-build/src/frontend.py
+++ b/gradint-build/src/frontend.py
@@ -1667,8 +1667,10 @@ def gui_event_loop():
               if worked:
                 app.setLabel("Compiling...")
                 if system("""tar -zxvf lame*.tar.gz && cd lame-* && if ./configure && make; then ln -s $(pwd)/frontend/lame ../lame || true; else cd .. ; rm -rf lame*; exit 1; fi"""):
-                    if macsound: app.todo.alert = "Compile failed. Check the system has Xcode with command-line license accepted (try running gcc from the Terminal)" # might be asked to run: sudo xcodebuild -license
-                    else: app.todo.alert = "Compile failed"
+                    app.todo.alert = "Compile failed"
+                    if macsound:
+                        app.todo.alert += ". Check the system has Xcode with command-line license accepted (try running gcc from the Terminal)"
+                        # might be asked to run: sudo xcodebuild -license
           app.todo.set_main_menu = 1
         elif (menu_response=="add" or menu_response=="replace") and not (app.Text1.get() and app.Text2.get()): app.todo.alert="You need to type text in both boxes before adding the word/meaning pair to "+vocabFile
         elif menu_response=="add" and hasattr(app,"vocabList") and checkIn((asUnicode(app.Text1.get()),asUnicode(app.Text2.get())),app.vocabList):
-- 
GitLab