From de7236c846d6f934b386e113422cd6119e6b5ee2 Mon Sep 17 00:00:00 2001 From: Ivan Mahonin Date: Jun 22 2022 06:05:32 +0000 Subject: fix forest --- diff --git a/build.sh b/build.sh deleted file mode 100755 index 70e0f55..0000000 --- a/build.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -set -e - -for dir in forest; do - echo "-- $dir --" - cd $dir - ./build.sh - cd .. -done - -echo "-- done --" diff --git a/projects/forest/main.c b/projects/forest/main.c index c34f0f5..d610e6f 100644 --- a/projects/forest/main.c +++ b/projects/forest/main.c @@ -89,10 +89,10 @@ void init() { void draw() { - double dt = worldGetFrameTime(); + double dt = windowGetFrameTime(); t += dt; - int w = worldGetWidth(); - int h = worldGetHeight(); + int w = windowGetWidth(); + int h = windowGetHeight(); double range = w; double gy = groundLevel(x); @@ -122,11 +122,11 @@ void draw() { int main() { - worldSetVariableFrameRate(); - worldSetResizable(TRUE); - worldSetInit(&init); - worldSetDraw(&draw); - worldRun(); + windowSetVariableFrameRate(); + windowSetResizable(TRUE); + windowSetInit(&init); + windowSetDraw(&draw); + windowRun(); return 0; } diff --git a/projects/forest/tree.c b/projects/forest/tree.c index 2a4c2f1..1a4e6e9 100644 --- a/projects/forest/tree.c +++ b/projects/forest/tree.c @@ -100,10 +100,10 @@ void treeDraw(const Tree *t, double time, int flags) { saveState(); translate(t->x, t->y); - fill(colorByName("green")); - stroke(colorByName("black")); + fill(colorByRGBA(0, 0.5, 0, 0.5)); + stroke(COLOR_BLACK); srand(t->seed); - branch(0, 0, t->angle, t->width, time, int flags); + branch(0, 0, t->angle, t->width, time, flags); restoreState(); }