Merge branch 'master' into dev

This commit is contained in:
sam-astro 2022-05-24 18:20:20 -04:00 committed by GitHub
commit 83f0affa64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 17 deletions

View File

@ -1,7 +1,11 @@
<img src="https://raw.githubusercontent.com/sam-astro/Z-Sharp/master/ExtraResources/ZS-Gem-Icon-Small.png"/><img src="https://raw.githubusercontent.com/sam-astro/Z-Sharp/master/ExtraResources/ZS-Logo-Light-Small.png"/>
## Introduction
Z-Sharp is a custom programming language I made because I don't like c++ very much (Z-Sharp's interpreter is written in c++ though). It used to be called Slang, standing for "Stupid Lang", but another programming language called Slang already exists :(. Z-Sharp scripts have the file extension .zs. The base syntax and formatting I would say is quite similar to C#, but differs as task complexity increases. It has support for graphics using SDL2, and by default is not enabled.
Z-Sharp is a custom programming language I made because I don't like c++ very much (Z-Sharp's interpreter is written in c++ though). Z-Sharp scripts have the file extension .ZS. The base syntax and formatting I would say is quite similar to C# or Python, but differs as task complexity increases. It has support for graphics using SDL2, and by default is not enabled.
Before using Z#:
There is ***no documentation***, ***strings*** barely work, ***performance*** isn't great, the syntax is ***very specific***, and most errors just cause it to ***crash without warning***. I am just a *single developer* working on this during my free time; between school, other projects, and YouTube. Z-Sharp will most likely never be finished, since it was really supposed to end when the video was published about it.
If you are trying to use a common programming language feature, ask yourself this: ***Is this feature required to play pong?*** If not, then most likely that feature ***has not been implemented yet***. I initially only made the language so I could create pong and make a video about it, so it really is the ***bare minimum***.
## Installation
Downloading or installing is very simple, here is how depending on your version and operating system:
@ -18,16 +22,36 @@ Downloading or installing is very simple, here is how depending on your version
> If you don't want to install ZSharp on your device, or you want easier acces to the executable and .DLLs, another version is provided called `ZS_Win_Base_Raw.zip`. This just contains all of the files the installer puts on your computer.
### Linux
1. Install requirements:
* You need the package ***libsdl2-dev***. For Debian based operating systems you can install it with
* You need the package ***libsdl2-dev***.
For Debian based operating systems you can install it with
```$ sudo apt install libsdl2-dev```
* You also need the package ***libsdl2-image-dev***. For Debian based operating systems you can install it with
For Arch based operating systems you can install it with
```$ sudo pacman -S sdl2```
* You also need the package ***libsdl2-image-dev***.
For Debian based operating systems you can install it with
```$ sudo apt install libsdl2-image-dev```
* You also need the package ***libsdl2-ttf-dev***. For Debian based operating systems you can install it with
For Arch based operating systems you can install it with
```$ sudo pacman -S sdl2_image```
* You also need the package ***libsdl2-ttf-dev***.
For Debian based operating systems you can install it with
```$ sudo apt install libsdl2-ttf-dev```
For Arch based operating systems you can install it with
```$ sudo pacman -S sdl2_ttf```
2. Navigate to [the most recent release](https://github.com/sam-astro/Z-Sharp/releases) and download `ZSharp-Linux.zip`.
3. Unzip `ZSharp-Linux.zip` and open the unzipped folder.
4. You will see some files. The Z# interpreter is `ZSharp`. Any time you want to execute a script, this is the program that will be used. You can use it like so:

View File

@ -64,16 +64,16 @@ Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl"
Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"
[Files]
Source: "D:\Code\Z-Sharp\Releases\ZSharp-Win-x64\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Z-Sharp\Releases\ZSharp-Win-x64\libfreetype-6.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Z-Sharp\Releases\ZSharp-Win-x64\libjpeg-9.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Z-Sharp\Releases\ZSharp-Win-x64\libpng16-16.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Z-Sharp\Releases\ZSharp-Win-x64\libtiff-5.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Z-Sharp\Releases\ZSharp-Win-x64\libwebp-7.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Z-Sharp\Releases\ZSharp-Win-x64\SDL2.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Z-Sharp\Releases\ZSharp-Win-x64\SDL2_image.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Z-Sharp\Releases\ZSharp-Win-x64\SDL2_ttf.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Z-Sharp\Releases\ZSharp-Win-x64\zlib1.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Z-Sharp\Releases\ZS_Win_Base_Raw\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Z-Sharp\Releases\ZS_Win_Base_Raw\libfreetype-6.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Z-Sharp\Releases\ZS_Win_Base_Raw\libjpeg-9.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Z-Sharp\Releases\ZS_Win_Base_Raw\libpng16-16.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Z-Sharp\Releases\ZS_Win_Base_Raw\libtiff-5.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Z-Sharp\Releases\ZS_Win_Base_Raw\libwebp-7.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Z-Sharp\Releases\ZS_Win_Base_Raw\SDL2.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Z-Sharp\Releases\ZS_Win_Base_Raw\SDL2_image.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Z-Sharp\Releases\ZS_Win_Base_Raw\SDL2_ttf.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Z-Sharp\Releases\ZS_Win_Base_Raw\zlib1.dll"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Registry]

View File

@ -538,7 +538,7 @@ public:
{
SDL_Color color = { r, g, b };
SDL_Surface* surface = TTF_RenderText_Solid(font, content.c_str(), color);
SDL_Surface* surface = TTF_RenderText_Blended(font, content.c_str(), color);
texture = SDL_CreateTextureFromSurface(gRenderer, surface);
@ -559,7 +559,7 @@ public:
{
SDL_Color color = { r, g, b };
SDL_Surface* surface = TTF_RenderText_Solid(font, content.c_str(), color);
SDL_Surface* surface = TTF_RenderText_Blended(font, content.c_str(), color);
SDL_DestroyTexture(texture);
texture = SDL_CreateTextureFromSurface(gRenderer, surface);