Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/vulkan' into msvc-vulkan
Browse files Browse the repository at this point in the history
  • Loading branch information
jamievlin committed May 1, 2024
2 parents bc86ccb + 5d0f0b4 commit fe0673e
Show file tree
Hide file tree
Showing 51 changed files with 1,190 additions and 199 deletions.
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,13 @@ renderDocSettings
!webgl/WebGL*.html

v3dheadertypes.h
v3dtypes.h
v3dheadertypes.py
base/v3dheadertypes.asy
base/v3dtypes.asy

v3dtypes.h
v3dtypes.py
base/v3dtypes.asy
shaders/*.spv
# CMake files
CMakeLists.txt.user
CMakeCache.txt
Expand Down
7 changes: 4 additions & 3 deletions GUI/Window1.py
Original file line number Diff line number Diff line change
Expand Up @@ -2460,9 +2460,10 @@ def contextMenuEvent(self, event):
except:
return

if self.fileItems[maj] is not None:
self.contextWindowObject = self.fileItems[maj] #For arrowifying
self.contextWindow = ContextWindow.AnotherWindow(self.fileItems[maj],self)
item=self.fileItems[maj]
if item is not None and isinstance(item, x2a.xasyDrawnItem):
self.contextWindowObject = item #For arrowifying
self.contextWindow = ContextWindow.AnotherWindow(item,self)
self.contextWindow.setMinimumWidth(420)
#self.setCentralWidget(self.contextWindow) #I don't know what this does tbh.
self.contextWindow.show()
Expand Down
5 changes: 2 additions & 3 deletions GUI/xasy2asy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1166,9 +1166,8 @@ class xasyDrawnItem(xasyItem):
"""
Purpose:
--------
A base class dedicated to any xasy item that is drawn on GUI. Every object of this class
will correspond to a particular drawn xasy item on GUI, which contains all its particular
data.
A base class dedicated to any xasy item that is drawn with the GUI.
Each object of this class corresponds to a particular drawn xasy item.
Attributes:
-----------
Expand Down
9 changes: 9 additions & 0 deletions base/mapArray.asy
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
typedef import(Src, Dst);

private typedef Dst MapType(Src);

Dst[] map(MapType f, Src[] a) {
return sequence(
new Dst(int i) {return f(a[i]);},
a.length);
}
2 changes: 2 additions & 0 deletions base/plain.asy
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ string mapArrayString(string From, string To)
}";
}

// This function is deprecated: use
// from mapArray(Src=T1, Dst=T2) access map;
void mapArray(string From, string To)
{
eval(mapArrayString(From,To),true);
Expand Down
4 changes: 2 additions & 2 deletions base/plain_shipout.asy
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ string Embed(string name, string text="", string options="", real width=0,
real height=0);

bool primitive() { // Encode primitive objects
return settings.outformat == "html" || settings.outformat=="v3d";
return settings.outformat == "html" || settings.outformat=="v3d" || settings.v3d;
}

bool prconly(string format="")
Expand Down Expand Up @@ -125,7 +125,7 @@ void shipout(string prefix=defaultfilename, picture pic=currentpicture,
pic.uptodate=true;
if(!uptodate()) {
bool inlinetex=settings.inlinetex;
bool prc=prc(format);
bool prc=prc(format) || settings.v3d;
bool empty3=pic.empty3();
if(prc && !empty3) {
if(settings.render == 0) {
Expand Down
25 changes: 18 additions & 7 deletions base/three.asy
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
private import math;

if(prc0()) {
if(!latex()) settings.prc=false;
if(settings.v3d) settings.prc=false;

if(prc0() || settings.v3d) {
if(!latex()) {
settings.prc=false;
settings.v3d=false;
}
else {
access embed;
Embed=embed.embedplayer;
Expand Down Expand Up @@ -2854,8 +2859,8 @@ object embed(string prefix=outprefix(), string label=prefix,
light Light=modelview*light;

if(prefix == "") prefix=outprefix();
bool preview=settings.render > 0 && !prconly();
if(prc) {
bool preview=settings.render > 0 && !prconly() && !settings.v3d;
if(prc || settings.v3d) {
// The media9.sty package cannot handle spaces or dots in filenames.
string dir=stripfile(prefix);
prefix=dir+replace(stripdirectory(prefix),
Expand All @@ -2864,7 +2869,7 @@ object embed(string prefix=outprefix(), string label=prefix,
prefix += "+"+(string) file3.length;
} else
preview=false;
if(preview || (!prc && settings.render != 0)) {
if(preview || (!prc && settings.render != 0) || settings.v3d) {
frame f=S.f;
triple m,M;
real zcenter;
Expand All @@ -2891,7 +2896,7 @@ object embed(string prefix=outprefix(), string label=prefix,
} else if(M.z >= 0) abort("camera too close");

if(primitive())
format=settings.outformat;
format=settings.v3d ? "v3d" : settings.outformat;

shipout3(prefix,f,preview ? nativeformat() : format,
S.width-defaultrender.margin,S.height-defaultrender.margin,
Expand All @@ -2900,6 +2905,12 @@ object embed(string prefix=outprefix(), string label=prefix,
tinv*inv*shift(0,0,zcenter),Light.background(),Light.position,
Light.diffuse,Light.specular,
view && !preview);
if(settings.v3d) {
string content=prefix+".v3d";
F.L=Embed(content,S.width,S.height);
if(!settings.inlinetex) file3.push(content);
return F;
}
if(!preview) return F;
}

Expand Down Expand Up @@ -2997,7 +3008,7 @@ frame embedder(object embedder(string prefix, string format),
string prefix, string format, bool view, light light)
{
frame f;
bool prc=prc(format);
bool prc=prc(format) || settings.v3d;
if(!prc && settings.render != 0 && !view) {
static int previewcount=0;
bool keep=prefix != "";
Expand Down
4 changes: 2 additions & 2 deletions doc/asy-latex.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Licence: GPL2+
%</driver>
%<pkg>\ProvidesPackage{asymptote}
%<*pkg>
[2021/12/29 v1.37 Asymptote style file for LaTeX]
[2024/02/26 v1.38 Asymptote style file for LaTeX]
%</pkg>
%
%<*driver>
Expand Down Expand Up @@ -165,7 +165,7 @@ Licence: GPL2+
% \end{macrocode}
%
% \begin{macrocode}
\InputIfFileExists{\jobname.pre}{}{}
\InputIfFileExists{\jobname.pre}{}{\typeout{No file \jobname.pre.}}
% \end{macrocode}
%
% \subsection{Allocations}
Expand Down
Loading

0 comments on commit fe0673e

Please sign in to comment.