Forum Replies Created
-
AuthorPosts
-
Not all the files in the repo are ending their lines with linefeed (unix/linux/osx). The files in modules/std/fiber/native/asm are all ending lines with CRLF (windows style) (LINCENSE.TXT has the same problem but doesn’t matter for code of course)
I tried to play with .gitattributes on a branch but I could not force the .S and .asm (or any file with some CR or CRLF in it) to stop having the CR (chr13) at eol. I could force files with LF as eol to be transformed to CRLF though so I don’t understand, must learn more about git/.gitattribute use.There probably is a solution with .gitattributes but for now I copied the 3 modified files in in a branch and all compiles ok directly with it when dowloading the zip… it should probably be better if all files in the repo had LF eol as it seems to be the standard with git repos.
PS: By trying all this I accidentaly deleted the branch with a pull request for ted2 “file>open”, sorry if you received duplicate messages about it.
August 19, 2016 at 11:45 am in reply to: Ted2 1.0.3 crashes when trying to open a file on W10 and W7 #3225no crashes anymore, no crashes similar to gcmartijn neither.
thx impixi, did pull request your code! it worked nice for me.
solved the problem by editing the following files:
jump_x86_64_sysv_macho_gas.S
make_x86_64_sysv_macho_gas.S
ontop_x86_64_sysv_macho_gas.S“unixed” them with sublime_text_3 view>line_endings>Unix (there’s a osx9 choice too but i chose unix first and it worked)
don’t know how to manage that in github though, will try on my fork using this manual “https://help.github.com/articles/dealing-with-line-endings/” or other googled sources. any suggestion is appreciated.
modified files are attached to this post
Attachments:
uninstalled xcode and command line tools. downloaded zip master from github, installed command line tools with readme suggested command and still have the same error.
I’m on a hackintosh(asus laptop but no virtual machine) so it may be that. though it would be the first time I have issues like that with it (MX1 runs perfectly for example). Usualy only drivers problems occur.
Should I update to 10.11.6? (don’t want to because it can be painfull with a hackintosh).just tried to compile v1.03 on osx 10.11.3 with latest xcode and comand line get this error (no -c flag problem anymore
[/crayon]Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156[crayon-5cb9befab77b1947223896 inline="true" ](some making with no errors here)***** Making module 'std' *****Parsing...Semanting...Translating...Compiling....Build error: System command 'as -o "/Users/koko/Desktop/monkey2103/modules/std/std.buildv1.0.3/build_cache/desktop_release_macos/_1_1_1fiber_2native_2asm_2make_0x86_064_0sysv_0macho_0gas.S.o" "/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S"' failed.as -o "/Users/koko/Desktop/monkey2103/modules/std/std.buildv1.0.3/build_cache/desktop_release_macos/_1_1_1fiber_2native_2asm_2make_0x86_064_0sysv_0macho_0gas.S.o" "/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S").sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:7:Junk character 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:26:Junk character 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:27:Junk character 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:28:Rest of line ignored. 1st junk character valued 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:29:Rest of line ignored. 1st junk character valued 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:30:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:32:invalid character (0xd) in operand 2).sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:33:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:35:invalid character (0xd) in operand 2/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:36:invalid character (0xd) in operand 2).sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:37:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:40:invalid character (0xd) in operand 2).sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:41:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:43:invalid character (0xd) in operand 2).sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:44:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:46:invalid character (0xd) in operand 2/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:49:invalid character (0xd) in operand 2).sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:50:Junk character 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:52:Junk character 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:53:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:55:invalid character (0xd) in operand 2/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:57:invalid character (0xd) in operand 1/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:58:invalid character (0xd) in mnemonic***** Fatal mx2cc error *****Internal mx2cc build errormx2cc version 1.0.3(some more lines with no error here)***** Making module 'stb-vorbis' *****Parsing...Semanting...Translating...Compiling....Archiving /Users/koko/Desktop/monkey2103/modules/stb-vorbis/stb-vorbis.buildv1.0.3/desktop_debug_macos/stb-vorbis.a***** Making module 'std' *****Parsing...Semanting...Translating...Compiling....Build error: System command 'as -o "/Users/koko/Desktop/monkey2103/modules/std/std.buildv1.0.3/build_cache/desktop_debug_macos/_1_1_1fiber_2native_2asm_2make_0x86_064_0sysv_0macho_0gas.S.o" "/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S"' failed.as -o "/Users/koko/Desktop/monkey2103/modules/std/std.buildv1.0.3/build_cache/desktop_debug_macos/_1_1_1fiber_2native_2asm_2make_0x86_064_0sysv_0macho_0gas.S.o" "/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S").sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:7:Junk character 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:26:Junk character 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:27:Junk character 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:28:Rest of line ignored. 1st junk character valued 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:29:Rest of line ignored. 1st junk character valued 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:30:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:32:invalid character (0xd) in operand 2).sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:33:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:35:invalid character (0xd) in operand 2/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:36:invalid character (0xd) in operand 2).sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:37:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:40:invalid character (0xd) in operand 2).sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:41:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:43:invalid character (0xd) in operand 2).sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:44:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:46:invalid character (0xd) in operand 2/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:49:invalid character (0xd) in operand 2).sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:50:Junk character 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:52:Junk character 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:53:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:55:invalid character (0xd) in operand 2/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:57:invalid character (0xd) in operand 1/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:58:invalid character (0xd) in mnemonic***** Fatal mx2cc error *****Internal mx2cc build error***** Rebuilding ted2 *****mx2cc version 1.0.3***** Building app '/Users/koko/Desktop/monkey2103/src/ted2/ted2.monkey2' *****Parsing...Semanting...Translating...Compiling....Build error: System command 'g++ -std=c++11 -Wno-deprecated-declarations -Wno-tautological-pointer-compare -Wno-undefined-bool-conversion -Wno-int-to-void-pointer-cast -Wno-inconsistent-missing-override -Wno-logical-op-parentheses -Wno-parentheses-equality -O3 -DNDEBUG -I"/Users/koko/Desktop/monkey2103/modules/litehtml/litehtml/include/" -I"/Users/koko/Desktop/monkey2103/modules/freetype/freetype-2.6.3/include/" -I"/Users/koko/Desktop/monkey2103/modules/sdl2/SDL/include/" -I"/Users/koko/Desktop/monkey2103/modules/monkey/native" -c -o "/Users/koko/Desktop/monkey2103/src/ted2/ted2.buildv1.0.3/build_cache/desktop_release_macos/ted2_0ted2.cpp.o" "/Users/koko/Desktop/monkey2103/src/ted2/ted2.buildv1.0.3/build_cache/desktop_release_macos/ted2_ted2.cpp"' failed.g++ -std=c++11 -Wno-deprecated-declarations -Wno-tautological-pointer-compare -Wno-undefined-bool-conversion -Wno-int-to-void-pointer-cast -Wno-inconsistent-missing-override -Wno-logical-op-parentheses -Wno-parentheses-equality -O3 -DNDEBUG -I"/Users/koko/Desktop/monkey2103/modules/litehtml/litehtml/include/" -I"/Users/koko/Desktop/monkey2103/modules/freetype/freetype-2.6.3/include/" -I"/Users/koko/Desktop/monkey2103/modules/sdl2/SDL/include/" -I"/Users/koko/Desktop/monkey2103/modules/monkey/native" -c -o "/Users/koko/Desktop/monkey2103/src/ted2/ted2.buildv1.0.3/build_cache/desktop_release_macos/ted2_0ted2.cpp.o" "/Users/koko/Desktop/monkey2103/src/ted2/ted2.buildv1.0.3/build_cache/desktop_release_macos/ted2_ted2.cpp"/Users/koko/Desktop/monkey2103/src/ted2/ted2.buildv1.0.3/build_cache/desktop_release_macos/ted2_ted2.cpp:7:10: fatal error: '../../../../../modules/mojo/mojo.buildv1.0.3/desktop_release_macos/mojo_app_2app.h' file not found#include "../../../../../modules/mojo/mojo.buildv1.0.3/desktop_release_macos/mojo_app_2app.h"^1 error generated.***** Fatal mx2cc error *****Internal mx2cc build errormx2cc version 1.0.3***** Building app '/Users/koko/Desktop/monkey2103/src/launcher/launcher.monkey2' *****Parsing...Semanting...Translating...Compiling....Linking /Users/koko/Desktop/monkey2103/src/launcher/launcher.buildv1.0.3/desktop_release_macos/launcher.app/Contents/MacOS/launcherBuild error: System command 'g++ -Wl,-rpath,@executable_path -Wl,-rpath,@executable_path/../Frameworks -O3 -o "/Users/koko/Desktop/monkey2103/src/launcher/launcher.buildv1.0.3/desktop_release_macos/launcher.app/Contents/MacOS/launcher" "/Users/koko/Desktop/monkey2103/src/launcher/launcher.buildv1.0.3/build_cache/desktop_release_macos/launcher_0launcher.cpp.o" "/Users/koko/Desktop/monkey2103/modules/std/std.buildv1.0.3/desktop_release_macos/std.a" "/Users/koko/Desktop/monkey2103/modules/stb-vorbis/stb-vorbis.buildv1.0.3/desktop_release_macos/stb-vorbis.a" "/Users/koko/Desktop/monkey2103/modules/stb-image-write/stb-image-write.buildv1.0.3/desktop_release_macos/stb-image-write.a" "/Users/koko/Desktop/monkey2103/modules/stb-image/stb-image.buildv1.0.3/desktop_release_macos/stb-image.a" "/Users/koko/Desktop/monkey2103/modules/miniz/miniz.buildv1.0.3/desktop_release_macos/miniz.a" "/Users/koko/Desktop/monkey2103/modules/libc/libc.buildv1.0.3/desktop_release_macos/libc.a" "/Users/koko/Desktop/monkey2103/modules/monkey/monkey.buildv1.0.3/desktop_release_macos/monkey.a" ' failed.g++ -Wl,-rpath,@executable_path -Wl,-rpath,@executable_path/../Frameworks -O3 -o "/Users/koko/Desktop/monkey2103/src/launcher/launcher.buildv1.0.3/desktop_release_macos/launcher.app/Contents/MacOS/launcher" "/Users/koko/Desktop/monkey2103/src/launcher/launcher.buildv1.0.3/build_cache/desktop_release_macos/launcher_0launcher.cpp.o" "/Users/koko/Desktop/monkey2103/modules/std/std.buildv1.0.3/desktop_release_macos/std.a" "/Users/koko/Desktop/monkey2103/modules/stb-vorbis/stb-vorbis.buildv1.0.3/desktop_release_macos/stb-vorbis.a" "/Users/koko/Desktop/monkey2103/modules/stb-image-write/stb-image-write.buildv1.0.3/desktop_release_macos/stb-image-write.a" "/Users/koko/Desktop/monkey2103/modules/stb-image/stb-image.buildv1.0.3/desktop_release_macos/stb-image.a" "/Users/koko/Desktop/monkey2103/modules/miniz/miniz.buildv1.0.3/desktop_release_macos/miniz.a" "/Users/koko/Desktop/monkey2103/modules/libc/libc.buildv1.0.3/desktop_release_macos/libc.a" "/Users/koko/Desktop/monkey2103/modules/monkey/monkey.buildv1.0.3/desktop_release_macos/monkey.a"clang: error: no such file or directory: '/Users/koko/Desktop/monkey2103/modules/std/std.buildv1.0.3/desktop_release_macos/std.a'***** Fatal mx2cc error *****Internal mx2cc build errorcp: ../src/ted2/ted2.buildv1.0.3/desktop_release_macos/ted2.app: No such file or directorymx2cc version 1.0.3(some doccing with no errors here)***** Doccing module 'mojo' *****Parsing...Semanting...MarkdownBuffer: unrecognized directive @see in @see [[ActiveWindow]], [[MouseX]], [[MouseY]]***** Doccing module 'mojox' *****Parsing...Semanting...***** Doccing module 'sdl2-mixer' *****Parsing...Semanting...***** Doccing module 'stb-truetype' *****Parsing...Semanting...I would love to try ted21 for mx2 coding but could not change the font size (too small for me, have to change screen resolution…). It would be great if we could chose some fonts and their sizes, would it be a big work to have that? It’s kind of mandatory for a serious editor. (Or I missed something!?)
Working for me on W7 x64, m2 folder in my home dir. Always better to be in that authorised part (desktop is in that part too) to avoid UAC and other security blockers.
Had to copy vcruntime140.dll in a PATH because I don’t have VC runtime installed but the dll should not be necessary so this should change.
are you noticed of any errors (like “vcruntime140.dll is missing” for example?) or is it just not doing anything?
I would vote for these added to this forums main page. Keymaster would you?
Is those ted improvements on github already? Is it functional/usable? I’m looking forward to see this running.
Code folding and (fully auto)indent by fold+else/elseif+select/case are top features for me.
Here’s the most optimized I could find, if anyone see something to be done for optimization welcome!
I tried a bit to use RGB24 for the pixmap but don’t understand how to get a pointer of that length. But I suppose it won’t change anything with speed or may be worse.
It can zoom and move and save the picture now. Can we set the png quality for pixmap saving? It does not have the exact same look when saved.[/crayon]Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251[crayon-5cb9befacbf17294668662 inline="true" ]''' Julia Set example - resizable window'' a monkey 2 example-learning exercise' points of interest is to optimise: -the drawpoint speed' (done?, optimised by marksibly, using pixmap and pointer,' pointer is faster local compared to field,' should try using smaller pixel formats for pixmap (not done, need to understand how to point to 24bits))' -the choice for globals, fields, locals, struct:' using struct for iterations is slower, see julia_with_struct(non_optim).monkey2 (github)' Double or Float doesn't change anything (on 64bit computers at least?)' Local is faster for basic variables, fields and globals seems to have same speed'' -???''#Import "<std>"#Import "<mojo>"Using std..Using mojo..Global w_width:=1000 'initial window sizeGlobal w_height:=700Global MaxIt:=16 'Julia's calculation precisionGlobal Threshold:Double=2.5 'Julia's escape ThresholdGlobal pxSize:Double=0.006 'Initial size of a pixel on the complex plane (inverted zoom factor)Global viewCenter_r:Double=0.0, viewCenter_i:Double=0.0 'Initial center point for viewing (on complex plane)Global move_spd:Double=0.06Global Palette:UInt[]Class Julia Extends WindowField image:=New Image( w_width,w_height,TextureFlags.Dynamic )Field Cr:Double=0.0, Ci:Double=0.0Field modif_const:=True 'Blocks the anim or not (true=animated) (bad name)Field count:=-1 'count for the auto animField modif_const_mouse:=False 'flag/selector for auto or mouse anim (bad name)Field pixmap:=New Pixmap( w_width,w_height,PixelFormat.RGBA32 )Field saveIt:=FalseMethod New( title:String,width:Int,height:Int,flags:WindowFlags=WindowFlags.Resizable )Super.New( title,width,height,flags )End''These are equivalent to Keyboard.KeyPressed(Key.XXX) But with better memory of things'Sometimes in OnRender with low FPS it skips some Keyboard.Keyxxxxx here not!'Method OnKeyEvent( event:KeyEvent ) OverrideSelect event.TypeCase EventType.KeyDownSelect event.KeyCase Key.Spacemodif_const=Not modif_constCase Key.PsaveIt=TrueCase Key.Cmodif_const_mouse=Not modif_const_mouseEnd SelectEnd SelectEnd MethodMethod OnRender( canvas:Canvas ) Override'' local vars declaration'Local Zr:Double, Zi:Double ' the complex number parts (should probably use struct...)Local ta:Int,tb:Int,tj:Int 'the timer varsLocal x:Int,y:Int 'coord iteratorsLocal max_wh:Int 'to get the maximal value of the window height or widthLocal p:UInt Ptr' mandatory for continuous renderApp.RequestRender()'' adapt to window size (resizable window)'If w_width<>Self.Rect.Size.X or w_height<>Self.Rect.Size.YLocal maxs:=Max(w_width,w_height)w_width=Self.Rect.Size.Xw_height=Self.Rect.Size.YLocal maxs2:=Max(w_width,w_height)pxSize=pxSize*(maxs/(maxs2*1.0)) 'adapt zoom to new window size (because zoom factor is pixel's lenght)image.Discard() 'Images are not Garbage Collected so it's always better to Discard before changing it... (here it's a Field so probably not usefull)image=New Image( w_width,w_height,TextureFlags.Dynamic )pixmap=New Pixmap( w_width,w_height )End If''' Keyboard controls''If Keyboard.KeyDown(Key.Up) Then viewCenter_i-=move_spd*(pxSize/0.006)If Keyboard.KeyDown(Key.Down) Then viewCenter_i+=move_spd*(pxSize/0.006)If Keyboard.KeyDown(Key.Left) Then viewCenter_r-=move_spd*(pxSize/0.006)If Keyboard.KeyDown(Key.Right) Then viewCenter_r+=move_spd*(pxSize/0.006)If Keyboard.KeyDown(Key.W|Key.Raw) Then pxSize=pxSize/1.05If Keyboard.KeyDown(Key.S|Key.Raw) Then pxSize=pxSize*1.05If Keyboard.KeyDown(Key.A|Key.Raw) Then Threshold/=1.01If Keyboard.KeyDown(Key.D|Key.Raw) Then Threshold*=1.01If Keyboard.KeyDown(Key.I|Key.Raw)MaxIt+=1CreateGlobalPalette()EndifIf Keyboard.KeyDown(Key.K|Key.Raw)MaxIt=Max(2,MaxIt-1)CreateGlobalPalette()Endif'' auto or mouse anim'If modif_const_mouse=True'' get the mouse coord and transform it to the complex constant used in Julia set'If modif_const=TrueCr=(App.MouseLocation.x-(w_width/2.0))*pxSize+viewCenter_rCi=(App.MouseLocation.y-(w_height/2.0))*pxSize+viewCenter_iEndifElse'' create an anim while modifying the julia's const'If modif_const=Truecount+=1Cr=1.65*Cos(count/29.0)Ci=1.4*Sin(count/30.0)EndifEndif'' Calculates Julia in indexed colors (iterations up to MaxIt-1 due to array starting at 0)' and copy it to the pixmap with pointer for faster copy (faster than stepixel because the adress only calculated #height times)'For y=0 Until w_heightp=Cast<UInt Ptr>( pixmap.PixelPtr( 0,y ) )Zi=(y-(w_height/2.0))*pxSize+viewCenter_iFor x=0 Until w_widthZr=(x-(w_width/2.0))*pxSize+viewCenter_rLocal t:=NbIter( Zr,Zi,MaxIt,Threshold,Cr,Ci )p[x]=Palette[t]NextNext'' copy the pixmap to an image and put the image to the main canvas'image.Texture.PastePixmap( pixmap,0,0 )canvas.DrawImage( image,0,0 )'' Save the pixmap (if asked) before drawing text on it'If saveIt=True 'this is on the eventlistener for better response while on low FPSsaveIt=FalseLocal filename:="Nothing"filename = RequestFile("Save the file","png",True,"Julia")print ("youy"+filename+"youy")If filename<>""pixmap.Save(filename)ElseNotify("Blempro","No files where selected")EndifEndif' Prints'canvas.Color=Color.Whitecanvas.DrawText("Space: Pause/Play --- C to switch to auto-anim or mouse-anim --- P:Save as PNG",0,0)canvas.DrawText("W/S(Raw):Zoom --- A/D(Raw):Thershold --- I/K:Iterations --- Cursor:Move",0,20)canvas.DrawText("Cr:"+Cr,0,40)canvas.DrawText(" Ci:"+Ci,175,40)canvas.DrawText(" Iter:"+MaxIt,350,40)canvas.DrawText("FPS:"+App.FPS,0,55)EndEnd'' squared complex+const series (Julia)'Function NbIter:Int(Zr:Double,Zi:Double,max_iter:Int,exit_radius:Double,Cr:Double,Ci:Double)Local i:=0Local Zr2:Double, Zi2:Double, er2:Doubleer2=exit_radius*exit_radiusZr2=Zr*ZrZi2=Zi*ZiWhile i<max_iter-1 And Zr2+Zi2<er2Zi=2*Zr*Zi + CiZr=Zr2-Zi2 +CrZr2=Zr*ZrZi2=Zi*Zii+=1WendReturn iEndFunction ColorToBGRA:UInt( color:Color )Return UInt(color.a*255) Shl 24 | UInt(color.b*255) Shl 16 | UInt(color.g*255) Shl 8 | UInt(color.r*255)End'' Create the indexed color Palette'Function CreateGlobalPalette:Void()Palette=New UInt[MaxIt] 'Palette is Global, Max It is global. declared at topFor Local i:=0 Until MaxIt-1Palette[i]=ColorToBGRA( New Color(0.9*Abs(Sin(1.0*Pi*i/MaxIt)),0.9*Abs(Sin(1.0*Pi*i/MaxIt)),0.35-(i/(MaxIt*1.0))*0.34) )NextPalette[MaxIt-1]=ColorToBGRA( Color.Black )EndFunction Main()CreateGlobalPalette()New AppInstanceNew Julia( "Julia",w_width,w_height )App.Run()EndI continued a bit on this exercise and had the flowing conclusions:
-as Simon said Float or Double doesn’t change anything (due to 64bit CPU?)
-Struct is making things slower (made a complex struct based on Vec2)
One thing about that is that setting a Field directly is (much) faster than setting via Properties.
So why would we use such properties if it is only to get and set the field the same way it would be done directly?I made a github repo for my further exercices and posted the two julia versions on it…
https://github.com/abakobo/learn_monkey2July 18, 2016 at 10:26 am in reply to: V1.0.1 and V1.0.2 give "VCRUNTIME140.dll is missing" when launching Ted2 #2258Occured on W7 home x64 using the mingw package advised in readme (i686-5.3.0-posix-dwarf-rt_v4-rev0)
wow! now running at 30fps with FullHD on the edges!
Thanks for that. It shows how pointers are powerfull and is a great lesson.
I will need some time to understand all of that well. Especially the Cast operator that let you use p as an array. Is that some kind of pointer arithmetics?I will have to try some simple examples to get that part.
July 9, 2016 at 10:57 am in reply to: How can I control the framerate / How does the loop loops? #1952Ok so OnUpdate (not documented yet) is a must in some situations…? May be I should wait for more complete docs before trying to understand the whole appInstance/window process.
-
AuthorPosts