diff options
-rw-r--r-- | #index.js# | 93 | ||||
-rw-r--r-- | index.css~ | 224 | ||||
-rw-r--r-- | index.html~ | 59 | ||||
-rw-r--r-- | index.js~ | 70 | ||||
-rw-r--r-- | mini-jquery.js~ | 122 | ||||
-rw-r--r-- | posts.css~ | 3 | ||||
-rw-r--r-- | posts.html~ | 87 | ||||
-rwxr-xr-x | resume.css~ | 74 | ||||
-rwxr-xr-x | resume.html~ | 183 | ||||
-rw-r--r-- | resume.js~ | 7 | ||||
-rw-r--r-- | themes/TreeShape.h~ | 104 | ||||
-rwxr-xr-x | upload.sh~ | 1 |
12 files changed, 0 insertions, 1027 deletions
diff --git a/#index.js# b/#index.js# deleted file mode 100644 index f666098..0000000 --- a/#index.js# +++ /dev/null @@ -1,93 +0,0 @@ - -function main() { - var themeSelector = document.getElementById('theme_selector'); - themeSelector.classList.remove('hidden'); - - runCarousel(); -} - -function runCarousel() { - var carouselContainer = document.getElementById("carousel"), - imageContainer = document.getElementById('image_container'), - leftButton = document.getElementById('carousel_left'), - rightButton = document.getElementById('carousel_right'); - - // Carousel logic - var carouselPosition = 0, - numImages = imageContainer.children.length; - - function onCarouselRight() { - carouselPosition = (carouselPosition + 1); - - if (carouselPosition === numImages) { - carouselPosition = 0; - } - updateCarousel(); - } - - function onCarouselLeft() { - carouselPosition = (carouselPosition - 1); - if (carouselPosition < 0) { - carouselPosition = numImages - 1; - } - updateCarousel(); - } - - function onImageClicked() { - var background = document.createElement('div'); // - background.classList.add('carousel_image_expanded_container'); - var clone = this.cloneNode(true); - clone.classList.add('expanded'); - background.append(clone); - clone.addEventListener('click', function(event) { event.stopPropagation(); }); - background.addEventListener('click', function() { background.remove(); }); - window.addEventListener('keydown', function(e) { if (e.key === 'Escape') background.remove(); }); - document.body.parentElement.prepend(background); - } - - function setImageClicked() { - for (var i = 0; i < numImages; i++) { - var image = imageList[i]; - image.addEventListener('click', onImageClicked); - } - } - - function updateCarousel() { - var selectedChildPosition = -(carouselPosition * 240); - imageContainer.style.transform = 'translate(' + selectedChildPosition + 'px, 0)'; - for (var i = 0; i < numImages; i++) { - var image = imageList[i]; - if (i !== carouselPosition) { - if (i === (carouselPosition - 1) % numImages) { - image.style.opacity = 0.3; - } else if (i !== 0 && i === (carouselPosition + 1) % numImages) { - image.style.opacity = 0.3; - } else { - image.style.opacity = 0; - } - } else { - image.style.opacity = 1; - } - - image.style.pointerEvents = image.style.opacity > 0 ? 'all' : 'none'; - } - - rightButton.style.visibility = (carouselPosition === numImages - 1) ? 'hidden' : 'visible'; - leftButton.style.visibility = (carouselPosition === 0) ? 'hidden' : 'visible'; - } - - // -- Set up on image clicked - var imageList = imageContainer.children, - numImages = imageContainer.children.length; - - setImageClicked(); - updateCarousel(); - - leftButton.addEventListener('click', onCarouselLeft); - rightButton.addEventListener('click', onCarouselRight); - - // -- Fade in the container - imageContainer.style.opacity = '1'; -} - -window.onload = main; diff --git a/index.css~ b/index.css~ deleted file mode 100644 index 32bd838..0000000 --- a/index.css~ +++ /dev/null @@ -1,224 +0,0 @@ - -body { - width: 100vw; - height: 100vh; - font-family: Consolas, monaco, monospace; - font-size: 16px; - background-color: #231f1d; - color: white; - padding: 0; - margin: 0; - - display: flex; - flex-direction: column; - align-items: center; -} - -header { - text-align: center; - width: 60%; -} - -header > h1 { - font-family: Georgia, sans-serif; - font-weight: normal; - font-size: 30px; - padding-top: 1rem; - padding-bottom: 0.5rem; - margin: 0; - letter-spacing: 0.25rem; - border-bottom: 1px solid white; -} - -header > nav { - font-family: Georgia, sans-serif; - padding-top: 0.5rem; -} - -header > nav > ul { - display: flex; - flex-direction: row; - align-items: center; - justify-content: space-evenly; - list-style-type: none; - margin: 0; - padding: 0; -} - -header > nav > ul a { - text-decoration: none; - color: inherit; - font-size: 16px; - border-bottom: 1px solid transparent; - transition: border-color 100ms linear; - transition: opacity 100ms linear; -} - -header > nav > ul a:hover { - opacity: 0.8; - border-color: white; -} - -#landing_page { - text-align: center; - flex: 1 1 100%; - width: 50%; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; -} - -/* Carousel styling */ -#carousel { - width: 100%; - height: 360px; - position: relative; - overflow: hidden; -} - -#carousel > button { - position: absolute; - top: calc(50% - 2rem); - font-size: 4rem; - border: none; - background-color: transparent; - color: white; -} - -#carousel > button:hover { - opacity: 0.8; - cursor: pointer; -} - -#carousel_left { - left: 0; -} - -#carousel_right { - right: 0; -} - -#image_container { - position: absolute; - width: 100%; - display: flex; - flex-direction: row; - height: 100%; - transition: left 200ms linear; -} - -.carousel_image { - width: 240px; - transition: opacity 200ms linear; - padding: 0; - margin: 0; - padding-right: 12px; -} - -.carousel_image > figcaption { - font-size: 10px; - font-style: italic; -} - -.carousel_image > img { - width: 240px; - border-radius: 2px; -} - -input { - outline: none; - border: 1px solid transparent; - border-radius: 2px; - font-size: 1rem; - padding: 0.5rem; -} - -input:focus { - border: 1px solid lightgray; -} - -.action_button { - border: 1px solid #f0f0f0; - border-radius: 2px; - width: 108px; - height: 2rem; -} - -.action_button:hover { - cursor: pointer; - opacity: 0.9; -} - -/* Theme display */ -#theme_container { - position: fixed; - top: 0; - left: 0; - width: 100vw; - height: 100vh; - background-color: transparent; - z-index: -1; -} - -#theme_canvas { - width: 100%; - height: 100%; - z-index: -1; -} - -/* Theme Selector */ -#theme_selector { - position: fixed; - width: 50%; - display: flex; - align-items: center; - justify-content: space-evenly; - bottom: 1rem; -} - -#theme_selector > button { - width: 5rem; - height: 2rem; - border-radius: 3px; - border: 1px solid black; - color: black; - background-color: white; - cursor: pointer; - transition: opacity 100ms linear; -} - -#theme_selector > button:hover { - opacity: 0.8; -} - -#theme_selector > #theme_button_default { -} - -#theme_selector > #theme_button_autumn { - background-color: orange; -} - -/* Phone screen adjustments */ -@media only screen and (device-width: 1280px), -only screen and (max-width:1280px) { - body { - font-size: 12px; - } - - header { - width: 90%; - } - - section { - width: 100%; - } - - #landing_page { - width: 75%; - } - - #theme_selector { - width: 90%; - } -} diff --git a/index.html~ b/index.html~ deleted file mode 100644 index 80d17e8..0000000 --- a/index.html~ +++ /dev/null @@ -1,59 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> - <head> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta charset="utf-8"> - <link rel="stylesheet" href="/index.css"> - <title>Matthew Kosarek</title> - <link rel="shortcut icon" href="/favicon/favicon.ico" type="image/x-icon"> - </head> - <body> - <header> - <h1>Matthew Kosarek</h1> - <nav> - <ul> - <li><a href='/'>🏡 Home</a></li> - <li><a href='/resume.html'>📘 CV</a></li> - <li><a href='/posts.html'>📝 Posts</a></li> - </ul> - </nav> - </header> - <section id='landing_page'> - - <p> - <div id='carousel'> - <div id='image_container'> - <figure class='carousel_image'> - <img src='images/portrait.jpg' /> - <figcaption> - Me in front of my desktop, circa August 2021. - </figcaption> - </figure> - <figure class='carousel_image'> - <img src='images/dog_and_me.jpg' /> - <figcaption> - Hanging with my dog named Rizzy, circa May 2020. - </figcaption> - </figure> - <figure class='carousel_image'> - <img src='images/friends.jpg' /> - <figcaption> - Hanging with my friends, circa July 2019. - </figcaption> - </figure> - </div> - <button id='carousel_left'>←</button> - <button id='carousel_right'>→</button> - </div> - </p> - - <p> - My name is Matthew Kosarek. I am a computer programmer currently living in New Jersey. I keep my CV up to date on this website. I also write some posts about computers when I find something particularly interesting. You can find a link to my Github <a href='https://github.com/mattkae'>here</a>. I am also building a website about physics simulation in video games which you can find <a href='https://physicsforgames.com/'>here</a>. - </p> - <br/> - </section> - - </body> - - <script src='/index.js'></script> -</html> diff --git a/index.js~ b/index.js~ deleted file mode 100644 index 1ccc88c..0000000 --- a/index.js~ +++ /dev/null @@ -1,70 +0,0 @@ - -function main() { - runCarousel(); - runPosts(); -} - -function runCarousel() { - var carouselContainer = document.getElementById("carousel"), - imageContainer = document.getElementById('image_container'), - leftButton = document.getElementById('carousel_left'), - rightButton = document.getElementById('carousel_right'); - - // Carousel logic - var carouselPosition = 1, - numImages = imageContainer.children.length; - - function onCarouselRight() { - carouselPosition = (carouselPosition + 1); - - if (carouselPosition === numImages) { - carouselPosition = 0; - } - updateCarousel(); - } - - function onCarouselLeft() { - carouselPosition = (carouselPosition - 1); - if (carouselPosition < 0) { - carouselPosition = numImages - 1; - } - updateCarousel(); - } - - function onImageClicked() { - - } - - function updateCarousel() { - var children = imageContainer.children; - for (var i = 0; i < children.length; i++) { - var image = children[i]; - if (i !== carouselPosition) { - if (i === (carouselPosition - 1) % numImages) { - image.style.opacity = 0.3; - } else if (i !== 0 && i === (carouselPosition + 1) % numImages) { - image.style.opacity = 0.3; - } else { - image.style.opacity = 0; - } - } else { - image.style.opacity = 1; - } - } - - imageContainer.style.left = 'calc(' + (-carouselPosition * 252) + 'px + 50% - 120px)'; - rightButton.style.visibility = (carouselPosition === numImages - 1) ? 'hidden' : 'visible'; - leftButton.style.visibility = (carouselPosition === 0) ? 'hidden' : 'visible'; - } - - updateCarousel(); - - leftButton.addEventListener('click', onCarouselLeft); - rightButton.addEventListener('click', onCarouselRight); -} - -function runPosts() { - -} - -main(); diff --git a/mini-jquery.js~ b/mini-jquery.js~ deleted file mode 100644 index 1e674b3..0000000 --- a/mini-jquery.js~ +++ /dev/null @@ -1,122 +0,0 @@ -// -// mini-jquery.js -// -// Matthew Kosarek -// -// 2021-08-08 -// -// JQuery is huge and I use the smallest portion of it. -// This is my attempt to make a JQuery lookalike that does -// enough for me, but doesn't bloat things. -// - -function MiniJQueryObject(arg) { - this.elementList = []; - if (typeof arg === 'string') { - arg = arg.trim(); - - if (arg[0] === '<' && arg[arg.length - 1] === '>') { - // Trying to create an html element - arg = arg.substring(1, arg.length - 1); - var element = document.createElement(arg); - this.elementList.push(element); - } else { - // Trying to query an html element - - switch (arg[0]) { - case '#': { - arg = arg.substring(1); - var idElement = document.getElementById(arg); - if (idElement) { - this.elementList.push(idElement); - } - break; - } - case '.': { - arg = arg.substring(1); - this.fromHTMLCollection(document.getElementsByClassName(arg)); - break; - } - default: { - this.fromHTMLCollection(document.getElementsByTagName(arg)); - break; - } - } - } - } else if (arg instanceof HTMLElement) { - this.elementList.push(arg); - } else { - console.error('Unknown object: ', arg); - } -} - -MiniJQueryObject.prototype.fromHTMLCollection = function(collection) { - for (var i = 0; i < collection.length; i++) { - this.elementList.push(collection.item(i)); - } -}; - -MiniJQueryObject.prototype.append = function(otherMinJqueryObject) { - this.elementList.forEach(function(element) { - otherMinJqueryObject.elementList.forEach(function(otherElement) { - element.appendChild(otherElement); - }); - }); -}; - -MiniJQueryObject.prototype.appendTo = function(otherMinJqueryObject) { - otherMinJqueryObject.append(this); - return this; -}; - -MiniJQueryObject.prototype.empty = function() { - this.elementList.forEach(function(element) { - element.innerHTML = ''; - }); - return this; -}; - -MiniJQueryObject.prototype._set = function(field, value) { - this.elementList.forEach(function(element) { - element[field] = value; - }); - return this; -}; - -MiniJQueryObject.prototype.type = function(type) { - return this._set('type', type); -}; - -MiniJQueryObject.prototype.val = function(val) { - return this._set('value', val); -}; - -MiniJQueryObject.prototype.disabled = function(val) { - return this._set('disabled', val ? 'true' : undefined); -}; - -MiniJQueryObject.prototype.on = function(event, callback) { - this.elementList.forEach(function(element) { - element.addEventListener(event, callback); - }); - return this; -}; - -MiniJQueryObject.prototype.addClass = function(className) { - this.elementList.forEach(function(element) { - element.classList.add(className); - }); - return this; -}; - -MiniJQueryObject.prototype.removeClass = function(className) { - this.elementList.forEach(function(element) { - element.classList.remove(className); - }); - return this; -}; - -var $ = function(arg) { - return new MiniJQueryObject(arg); -}; -window.$ = $; diff --git a/posts.css~ b/posts.css~ deleted file mode 100644 index 839faf2..0000000 --- a/posts.css~ +++ /dev/null @@ -1,3 +0,0 @@ -article { - -} diff --git a/posts.html~ b/posts.html~ deleted file mode 100644 index 2d9ea0e..0000000 --- a/posts.html~ +++ /dev/null @@ -1,87 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> - <head> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta charset="utf-8"> - <link rel="stylesheet" href="/index.css"> - <link rel="stylesheet" href="/posts.css"> - <title>Matthew Kosarek</title> - <link rel="shortcut icon" href="/favicon/favicon.ico" type="image/x-icon"> - </head> - <body> - <header> - <h1>Matthew Kosarek</h1> - <nav> - <ul> - <li><a href='/'>🏡 Home</a></li> - <li><a href='/resume.html'>📘 CV</a></li> - <li><a href='/posts.html'>📝 Posts</a></li> - </ul> - </nav> - </header> - - <section id='post_section'> - </section> - - <script> - function fetchHtml(fileName) { - return fetch(fileName).then((response) => { - return response.text(); - }); - } - - function nodeScriptReplace(node) { - if ( nodeScriptIs(node) === true ) { - node.parentNode.replaceChild( nodeScriptClone(node) , node ); - } - else { - var i = -1, children = node.childNodes; - while ( ++i < children.length ) { - nodeScriptReplace( children[i] ); - } - } - - return node; - } - function nodeScriptClone(node){ - var script = document.createElement("script"); - script.text = node.innerHTML; - - var i = -1, attrs = node.attributes, attr; - while ( ++i < attrs.length ) { - script.setAttribute( (attr = attrs[i]).name, attr.value ); - } - return script; - } - - function nodeScriptIs(node) { - return node.tagName === 'SCRIPT'; - } - - (function() { - var postList = [ - 'posts/linear_system_solver.html' - ]; - - var postContainer = document.getElementById('post_section'); - if (!postContainer) { - console.error('Could not find post container.'); - return; - } - - postList.forEach(function(postName) { - fetchHtml(postName).then(function(text) { - var newSection = document.createElement('article'); - newSection.innerHTML = text; - nodeScriptReplace(newSection); - postContainer.appendChild(newSection); - }); - }); - })(); - </script> - - </body> - - <script src='/index.js'></script> - <script src='/mini-jquery.js' type='module'></script> -</html> diff --git a/resume.css~ b/resume.css~ deleted file mode 100755 index 87faecd..0000000 --- a/resume.css~ +++ /dev/null @@ -1,74 +0,0 @@ -body { - font-size: 14px !important; -} - -header { - padding-bottom: 1rem; -} - -#actions_container { - padding-bottom: 1rem; - - display: flex; - flex-direction: row; - justify-content: flex-end; -} - -#resume { - text-align: left; - background-color: white; - border-radius: 2px; - color: black; - padding: 2rem; - font-family: Arial,Helvetica Neue,Helvetica,sans-serif !important; - line-height: 1.2rem; -} - -#resume > div { - width: 100%; - text-align: left; -} - -h2 { - font-size: 1.5rem !important; - font-variant: small-caps; - border-bottom: 1px solid #d9d9d9; - font-weight: bold; - width: 100%; - padding: 0; - margin: 0; - line-height: 2rem; -} - -.skill-section { - width: 100%; - display: flex; - flex-direction: row; -} - -.skill-section > h3 { - width: 25%; - font-weight: bold; - font-size: 1rem; - margin: 0; - padding: 0; -} - -.skill-section > div { - width: 75%; -} - -.experience-header > div { - display: flex; - flex-direction: row; - justify-content: space-between; -} - -#resume.resume_fullscreen { - position: fixed; - top: 0; - left: 0; - width: calc(100vw - 4rem); - height: calc(100vh - 4rem); - overflow: auto; -} diff --git a/resume.html~ b/resume.html~ deleted file mode 100755 index 90a33b4..0000000 --- a/resume.html~ +++ /dev/null @@ -1,183 +0,0 @@ -<html> - <head> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta charset="utf-8"> - <link rel="stylesheet" href="/index.css"> - <link rel="stylesheet" href="/resume.css"> - <title>Matthew Kosarek</title> - <link rel="shortcut icon" href="/favicon/favicon.ico" type="image/x-icon"> - </head> - <body> - <header> - <h1>Matthew Kosarek</h1> - <nav> - <ul> - <li><a href='/'>🏡 Home</a></li> - <li><a href='/resume.html'>📘 CV</a></li> - <li><a href='/posts.html'>📝 Posts</a></li> - </ul> - </nav> - </header> - <section id='resume'> - <div id='resume_button_container'> - <button id='full_screen_button' title='Toggle Fullscreen'> - ⛶ - </button> - <button title='Download as PDF'> - 📥 - </button> - </div> - - <div> - <h2>Skills</h2> - <p> - <div class="skill-section"> - <b>Languages & Tech</b><div>C/C++, OpenGL, C#, ASP.NET, TypeScript/JavaScript, ReactJS, ThreeJS, HTML/CSS, SQL, Java</div> - </div> - <div class="skill-section"> - <b>Tools</b><div>Git, Visual Studio, Unity, Sourcetree, NPM, Webpack, TeamCity, NuGet, AWS</div> - </div> - </p> - </div> - <div> - <h2>Experience</h2> - <p> - <div class="experience-item"> - <div class="experience-header"> - <div> - <span><b>Software Engineer</b></span> - <span><i>Vention</i></span> - </div> - <div> - <span>July 2020 to Present</span> - <span>Montreal, QC</span> - </div> - </div> - <ul> - <li> - Implemented new features and fixed bugs as a member of the <i>MachineLogic</i> team, which is tasked with creating a visual programming language for our hardware stack. - </li> - <li> - Developed a CNC application that accepts G-Code files as input and provides a realtime 3D rendering of the path as the machine traces it. Feel free to check out <a href='https://vention.io/path-following'>this link</a> for more info. - </li> - </ul> - </div> - <div class="experience-item"> - <div class="experience-header"> - <div> - <span><b>Software Engineer I</b></span> - <span><i>Big Huge Games</i></span> - </div> - <div> - <span>January 2018 to June 2020</span> - <span>Timonium, MD</span> - </div> - </div> - <ul> - <li> - Developed and maintained the data pipeline - from data entry, to data validation, to data publishing - for <i>Arcane Shodown</i>. - </li> - <li> - Designed, built, and maintained a live operations scheduling and publishing web application for <i>DomiNations</i> - </li> - <li> - Implemented game features on all parts of the stack, including tools, Unity client, and game servers - </li> - <li> - Met weekly with various disciplines to discuss ways to improve the UX of the company's tools - </li> - <li> - Initiated company-wide React and TypeScript code sharing via a private NPM repository - </li> - <li> - Worked within the Agile framework, in which I planned sprint work, attended daily stand-ups, and participated in retrospectives - </li> - </ul> - </div> - <div class="experience-item"> - <div class="experience-header"> - <div> - <span><b>Teaching Assistant for Intro to Video Game Design</b></span> - <span><i>Johns Hopkins University</i></span> - </div> - <div> - <span>September 2017 to December 2017</span> - <span>Baltimore, MD</span> - </div> - </div> - <ul> - <li> - Assisted beginner programmers in the development of 2D game engines using the SDL2 library - </li> - </ul> - </div> - <div class="experience-item"> - <div class="experience-header"> - <div> - <span><b>Software Engineering Intern</b></span> - <span><i>Big Huge Games</i></span> - </div> - <div> - <span>May 2017 to August 2017</span> - <span>Timonium, MD</span> - </div> - </div> - <ul> - <li> - Developed a tool based on the GTK toolkit to improve the workflow of the quality assurance team for <i>DomiNations</i> - </li> - <li> - Wrote a comprehensive user manual that explains how the tool functions for both technical and non-technical users - </li> - </ul> - </div> - <div class="experience-item"> - <div class="experience-header"> - <div> - <span><b>Software Engineering Intern</b></span> - <span><i>Sparkypants Studios</i></span> - </div> - <div> - <span>May 2016 to August 2016</span> - <span>Baltimore, MD</span> - </div> - </div> - <ul> - <li> - Developed an application to measure and report memory usage and run times for all game systems in <i>Dropzone</i> - </li> - </ul> - </div> - </p> - </div> - <div> - <h2>Education</h2> - <p> - <div class="experience-item"> - <div class="experience-header"> - <div> - <span><b>Johns Hopkins University</b></span> - <span>Baltimore, MD</span> - </div> - <div> - <span>September 2014 to December 2017</span> - </div> - </div> - <ul> - <li> - B.S. in Computer Engineering (Magna Cum Laude) - </li> - <li> - 3.53 GPA - </li> - <li> - <i>Relevant Coursework</i>: Computer Graphics, Object Oriented Software Engineering, Linear Algebra, Video Game Engines and Design, Operating Systems, Data Structures, Introduction to Renewable Energy Engineering - </li> - </ul> - </div> - </p> - </div> - </body> - - <script src='/resume.js'></script> -</html> diff --git a/resume.js~ b/resume.js~ deleted file mode 100644 index a3776d8..0000000 --- a/resume.js~ +++ /dev/null @@ -1,7 +0,0 @@ - -var fullScreenButton = document.getElementById('full_screen_button'), - resumeContainer = document.getElementById('resume'); - -fullScreenButton.addEventListener('click', function() { - resumeContainer.classList.add('resume_fullscreen'); -}); diff --git a/themes/TreeShape.h~ b/themes/TreeShape.h~ deleted file mode 100644 index 14ea765..0000000 --- a/themes/TreeShape.h~ +++ /dev/null @@ -1,104 +0,0 @@ -#include "Renderer2d.h" -#include "types.h" -#include "mathlib.h" - -struct TreeBranch { - float32 width = 0.f; - float32 height = 0.f; - Vector2 position; // Center point - Vector2 direction = Vector2 { 1.f, 0.f }; - Vector4 color = Vector4 { 1.f, 0.f, 0.f, 1.f }; - - void fillVertices(Renderer2dVertex* vertices) { - vertices[0] = { - Vector2 { position.x - width / 2.f, position.y }, - color - }; - vertices[1] = { - Vector2 { position.x + width / 2.f, position.y }, - color - }; - vertices[2] = { - Vector2 { position.x - width / 2.f, position.y + height }, - color - }; - vertices[3] = { - Vector2 { position.x - width / 2.f, position.y + height }, - color - }; - vertices[4] = { - Vector2 { position.x + width / 2.f, position.y + height }, - color - }; - vertices[5] = { - Vector2 { position.x + width / 2.f, position.y }, - color - }; - } -}; - -struct TreeShape { - Renderer2dShape shape; - - float32 height = 100.f; // Height of the whole tree - float32 width = 50.f; // Width of the whole tree - int32 divisionsPerBranch = 2; // How many branches to split into at each branch split - int32 numBranchLevels = 8; // How many branch levels to display - float32 animateTimeSeconds = 2.f; // How long it takes the tree to form - - void load(Renderer2d* renderer) { - int32 numBranches = divisionsPerBranch * numBranchLevels; - TreeBranch* branches = new TreeBranch[numBranches]; - TreeBranch trunk = branches[0]; - - int32 numVertices = 6 * numBranches; - Renderer2dVertex* vertices = new Renderer2dVertex[numVertices]; - - - - trunk.width = width; - trunk.height = height; - trunk.position = Vector2 { 0.f, 0.f }; - trunk.direction = Vector2 { 1.f, 0.f }; - trunk.fillVertices(&vertices[0]); - - shape.load(vertices, numVertices, renderer); - - delete[] branches; - delete[] vertices; - } - - void createBranch(TreeBranch* branchList, int32 numBranches, int32* branchIndex, int32 branchLevel, float32 width, float32 height, Vector2 position, Vector2 direction, Renderer2dVertex* vertices) { - branch->width = width; - branch->height = height; - branch->position = position; - branch->direction = direction; - branch->fillIinVertices(&vertices[&branchIndex * 6]); - - if (branchLevel == numBranchLevels) { - return; - } - - float32 branchWidth = width / divisionsPerBranch; - float32 branchHeight = height / divisionsPerBranch; - Vector2 branchPosition = branch->position + (height * branch->direction); - - for (int division = 0; division < divisionsPerBranch; division++) { - (*branchIndex)++; - createBranch(branchList, numBranches, branchIndex, branchLevel + 1, branchWidth, branchHeight, - } - } - - void update(float32 dtSeconds) { - - } - - void render(Renderer2d* renderer) { - shape.render(renderer); - } - - void unload() { - shape.unload(); - } -}; - diff --git a/upload.sh~ b/upload.sh~ deleted file mode 100755 index 0960cbc..0000000 --- a/upload.sh~ +++ /dev/null @@ -1 +0,0 @@ -rsync -a ./ root@physicsforgames.com:/var/www/physicsforgames |