it compiles now weird subset of what i call gneralized c, nut i already made a terrible mes in the source of this compiler
writing compiler is in fact not so easy, or i got things not enough retinked to dwell in swamp again
this is becouse programing is standable when one can divide things on small factorized steps and compiler makes ttouble with dat..its probably possible to divide on this easy clear steps but if some halfly conceptualizes things and half go way on shortcuts it become swamp
what i can now compile is like that:
import "green_fire.dll" (cdecl) DrawAACube DrawAAWireCube RandColor SetupLights_3moving SetPointLight DrawDot3d DrawLine3d SetupWindow2 Set3dDrawingMode DrawSomeText2 rand2 ToggleFullscreen ClearFrameData DrawCircle RegisterRunFrame RegisterMouseMove RegisterKeyDown RegisterOnResize SetSleepValue SetScaleOnResize SetupWindow3 (var) frame_size_x frame_size_y frame_bitmap frame_number
import "msvcrt.dll" (cdecl) printf
void SetupLight
SetPointLight 0 1 -1100.0 0.0 0.0 7000.0 50000.0 0.30 1.9 1.3 1.3 0.01 0.01 0.01 0.18 1.1 1.1 1.1 0.01 0.01 0.01
SetPointLight 1 3 1100.0 500.0 500.0 7000.0 50000.0 0.30 1.3 1.9 1.3 0.01 0.01 0.01 0.18 1.1 1.1 1.1 0.01 0.01 0.01
SetPointLight 2 3 0.0 -1500.0 -500.0 7000.0 50000.0 0.30 1.3 1.3 1.9 0.01 0.01 0.01 0.18 1.1 1.1 1.1 0.01 0.01 0.01 ;
void SetupCloud
{
int[1000] cloud_x,
int[1000] cloud_y,
int[1000] cloud_z,
int[1000] cloud_r,
int[1000] cloud_color
0$ i$999$4:
cloud_x[i] = (rand2 200 500),
cloud_y[i] = (rand2 200 500)
cloud_z[i] = (rand2 0 1300)
cloud_r[i] = (rand2 10 20)
cloud_color[i] = (RandColor 0 255 0 255 0 255) ;
}
void SetupCloud2
{
int[1000] cloud2_x,
int[1000] cloud2_y
int[1000] cloud2_z,
int[1000] cloud2_r
int[1000] cloud2_color
0$ i$999$4:
cloud2_x[i] = (rand2 -1200 -500)
cloud2_y[i] = (rand2 -1200 -1500)
cloud2_z[i] = (rand2 0 -1300)
cloud2_r[i] = (rand2 10 20)
cloud2_color[i] = (RandColor 0 255 0 255 0 255) ;
}
void DrawCloud:
0$ i$999$4: DrawDot3d float(cloud_x[i]) float(cloud_y[i]) float(cloud_z[i]) float(cloud_r[i]) cloud_color[i] ;;
void DrawCloud2:
0$ i$999$4: DrawAAWireCube float(cloud_x[i]) float(cloud_y[i]) float(cloud_z[i]) float(cloud_r[i]) cloud_color[i] ;;
void DrawCloud22:
0$ i$999$4: DrawAACube float(cloud2_x[i]) float(cloud2_y[i]) float(cloud2_z[i]) float(cloud2_r[i]) cloud2_color[i] ;;
void DeawLines:
0$ j$995$4: k = j+4, DrawLine3d float(cloud_x[j]) float(cloud_y[j]) float(cloud_z[j]) float(cloud_x[k]) float(cloud_y[k]) float(cloud_z[k]) 0xaaaa77 ;;
// int initialised = 0
void Initialise { initialised?=0: SetupLight, SetupCloud, SetupCloud2, initialised = 1; }
void RunFrame int advance
{
Initialise, ClearFrameData 0x666666
// SetupLights_3moving
// int f = frame_number
DrawLine3d 100.0 100.0 0.0 100.0 -100.0 0.0 0xffffff
DrawLine3d 100.0 -100.0 0.0 -100.0 -100.0 0.0 0xffffff
DrawLine3d -100.0 -100.0 0.0 -100.0 100.0 0.0 0xffffff
DrawLine3d -100.0 100.0 0.0 100.0 100.0 0.0 0xffffff
DrawDot3d 0.0 0.0 100.0 20.0 0x557788
DrawDot3d 0.0 0.0 150.0 30.0 0x557722
DrawDot3d 0.0 0.0 -100.0 10.0 0xaa7788
DrawCloud, // DrawCloud2,
DrawCloud22
DeawLines
}
void ProcessMouseMove mouse_x mouse_y { }
void ProcessKeyDown key {
}
void OnResize { RunFrame }
void main
{
RegisterMouseMove &ProcessMouseMove
RegisterKeyDown &ProcessKeyDown
RegisterOnResize &OnResize
RegisterRunFrame &RunFrame
SetSleepValue 5, SetScaleOnResize 0, Set3dDrawingMode 1
SetupWindow3 " Example Green Fire App compiled by Furia \x00" 20 20 700 500 700 500
}