Skip to content

Commit 8a37135

Browse files
committed
Initial commit
0 parents  commit 8a37135

26 files changed

+1554
-0
lines changed

.clang-format

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Language: Cpp
2+
AccessModifierOffset: -4
3+
AlignAfterOpenBracket: DontAlign
4+
AllowShortCaseLabelsOnASingleLine: true
5+
AllowShortIfStatementsOnASingleLine: true
6+
AlwaysBreakTemplateDeclarations: Yes
7+
BraceWrapping:
8+
AfterFunction: true
9+
BreakBeforeBraces: Custom
10+
ColumnLimit: 0
11+
IncludeBlocks: Regroup
12+
IncludeCategories:
13+
- Regex: '^<.*\.h>'
14+
Priority: 2
15+
- Regex: '^<.*'
16+
Priority: 3
17+
- Regex: '.*'
18+
Priority: 1
19+
IndentCaseLabels: true
20+
IndentWidth: 4
21+
KeepEmptyLinesAtTheStartOfBlocks: false
22+
MaxEmptyLinesToKeep: 2
23+
NamespaceIndentation: All
24+
PointerAlignment: Left
25+
SpaceAfterCStyleCast: true
26+
SpacesBeforeTrailingComments: 2

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 4
7+
tab_width = 8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

.gitattributes

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.cpp text
2+
*.h text
3+
*.txt text
4+
*.md text
5+
.* text
6+
*.png filter=lfs diff=lfs merge=lfs -text

.github/workflows/build.yml

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.*'
7+
8+
permissions:
9+
packages: read
10+
contents: write
11+
12+
jobs:
13+
create_release:
14+
name: Create Release
15+
runs-on: ubuntu-latest
16+
17+
outputs:
18+
upload_url: ${{ steps.create_release.outputs.upload_url }}
19+
20+
steps:
21+
- name: Create Release
22+
id: create_release
23+
uses: actions/create-release@v1
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
with:
27+
tag_name: ${{ github.ref }}
28+
release_name: Release ${{ github.ref }}
29+
draft: false
30+
prerelease: false
31+
32+
release_assets:
33+
name: Release Assets
34+
needs: create_release
35+
runs-on: ${{ matrix.os }}
36+
37+
strategy:
38+
matrix:
39+
os: [ubuntu-latest, windows-latest]
40+
build_type: [Release]
41+
cpp_compiler: [g++, cl]
42+
include:
43+
- os: windows-latest
44+
cpp_compiler: cl
45+
- os: ubuntu-latest
46+
cpp_compiler: g++
47+
exclude:
48+
- os: windows-latest
49+
cpp_compiler: g++
50+
- os: ubuntu-latest
51+
cpp_compiler: cl
52+
53+
steps:
54+
- uses: actions/checkout@v3
55+
56+
- name: Set Reusable Strings
57+
id: strings
58+
shell: bash
59+
run: |
60+
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
61+
62+
- name: Configure CMake
63+
run: >
64+
cmake -B ${{ steps.strings.outputs.build-output-dir }}
65+
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
66+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
67+
-S ${{ github.workspace }}
68+
69+
- name: Build
70+
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
71+
72+
- name: Upload Ubuntu Assets
73+
if: ${{ matrix.os == 'ubuntu-latest' }}
74+
uses: actions/upload-release-asset@v1
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77+
with:
78+
upload_url: ${{ needs.create_release.outputs.upload_url }}
79+
asset_name: vtrex
80+
asset_path: ${{ steps.strings.outputs.build-output-dir }}/vtrex
81+
asset_content_type: application/octet-stream
82+
83+
- name: Upload Windows Assets
84+
if: ${{ matrix.os == 'windows-latest' }}
85+
uses: actions/upload-release-asset@v1
86+
env:
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88+
with:
89+
upload_url: ${{ needs.create_release.outputs.upload_url }}
90+
asset_name: vtrex.exe
91+
asset_path: ${{ steps.strings.outputs.build-output-dir }}/Release/vtrex.exe
92+
asset_content_type: application/octet-stream

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.vs/

CMakeLists.txt

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
cmake_minimum_required(VERSION 3.15)
2+
project(vtrex)
3+
4+
set(
5+
MAIN_FILES
6+
"src/main.cpp"
7+
"src/capabilities.cpp"
8+
"src/coloring.cpp"
9+
"src/engine.cpp"
10+
"src/font.cpp"
11+
"src/macros.cpp"
12+
"src/options.cpp"
13+
"src/os.cpp"
14+
)
15+
16+
set(
17+
DOC_FILES
18+
"README.md"
19+
"LICENSE.txt"
20+
)
21+
22+
if(WIN32)
23+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded")
24+
endif()
25+
26+
add_executable(vtrex ${MAIN_FILES})
27+
28+
if(UNIX)
29+
target_link_libraries(vtrex -static)
30+
endif()
31+
32+
set_target_properties(vtrex PROPERTIES CXX_STANDARD 20 CXX_STANDARD_REQUIRED On)
33+
source_group("Doc Files" FILES ${DOC_FILES})

CMakeSettings.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "x64-Debug",
5+
"generator": "Ninja",
6+
"configurationType": "Debug",
7+
"inheritEnvironments": [ "msvc_x64_x64" ],
8+
"buildRoot": "${projectDir}\\build\\${name}",
9+
"installRoot": "${projectDir}\\build\\install\\${name}",
10+
"cmakeCommandArgs": "",
11+
"buildCommandArgs": "",
12+
"ctestCommandArgs": ""
13+
},
14+
{
15+
"name": "x64-Release",
16+
"generator": "Ninja",
17+
"configurationType": "RelWithDebInfo",
18+
"inheritEnvironments": [ "msvc_x64_x64" ],
19+
"buildRoot": "${projectDir}\\build\\${name}",
20+
"installRoot": "${projectDir}\\build\\install\\${name}",
21+
"cmakeCommandArgs": "",
22+
"buildCommandArgs": "",
23+
"ctestCommandArgs": ""
24+
}
25+
]
26+
}

LICENSE.txt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2024 James Holderness
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
VT-Rex
2+
======
3+
4+
![Screenshot](screenshot.png)
5+
6+
This is an implementation of the Google Chrome [dinosaur game], designed to
7+
be played on a DEC VT terminal. It requires at least a VT420 (or something of
8+
comparable functionality), but a VT525 is best if you want color and sound
9+
effects.
10+
11+
[dinosaur game]: https://en.wikipedia.org/wiki/Dinosaur_Game
12+
13+
14+
Download
15+
--------
16+
17+
The latest binaries can be found on GitHub at the following url:
18+
19+
https://github.com/j4james/vtrex/releases/latest
20+
21+
For Linux download `vtrex`, and for Windows download `vtrex.exe`.
22+
23+
24+
Build Instructions
25+
------------------
26+
27+
If you want to build this yourself, you'll need [CMake] version 3.15 or later
28+
and a C++ compiler supporting C++20 or later.
29+
30+
1. Download or clone the source:
31+
`git clone https://github.com/j4james/vtrex.git`
32+
33+
2. Change into the build directory:
34+
`cd vtrex/build`
35+
36+
3. Generate the build project:
37+
`cmake -D CMAKE_BUILD_TYPE=Release ..`
38+
39+
4. Start the build:
40+
`cmake --build . --config Release`
41+
42+
[CMake]: https://cmake.org/
43+
44+
45+
License
46+
-------
47+
48+
The VT-Rex source code and binaries are released under the MIT License. See
49+
the [LICENSE] file for full license details.
50+
51+
[LICENSE]: LICENSE.txt

build/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

screenshot.png

+3
Loading

0 commit comments

Comments
 (0)