Skip to content

Commit

Permalink
Removed the libs directory (moved everything to src). Put sdl c…
Browse files Browse the repository at this point in the history
…ode in samples (won't be in the standard library).
  • Loading branch information
Ary Borenszweig committed Dec 10, 2014
1 parent 23b428c commit 017bc50
Show file tree
Hide file tree
Showing 50 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion libs/gmp/gmp.cr

This file was deleted.

2 changes: 1 addition & 1 deletion samples/sdl/fire.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "sdl"
require "./sdl/sdl"

class Point
MAX_LIFE = 50
Expand Down
8 changes: 4 additions & 4 deletions samples/sdl/raytracer.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ported from Nimrod: https://gist.github.com/AdrianV/5774141

require "sdl"
require "./sdl/sdl"

WIDTH = 1280
HEIGHT = 720
Expand Down Expand Up @@ -209,9 +209,9 @@ def render(scene, surface)
(hh / 2.0 - yy) / hh * h,
-1.0).normalize
pixel = trace(Ray.new(eye, dir), scene, 0.0)
r = Math.min(255, (pixel.x * 255.0).round)
g = Math.min(255, (pixel.y * 255.0).round)
b = Math.min(255, (pixel.z * 255.0).round)
r = Math.min(255, (pixel.x * 255.0).round.to_i)
g = Math.min(255, (pixel.y * 255.0).round.to_i)
b = Math.min(255, (pixel.z * 255.0).round.to_i)
surface[i] = (b << 24) + (g << 16) + (r << 8)
i += 1
end
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion samples/sdl/tv.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "sdl"
require "./sdl/sdl"

class ColorMaker
def initialize(delay)
Expand Down
2 changes: 1 addition & 1 deletion src/big_int.cr → src/big_int/big_int.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "gmp"
require "./lib_gmp"

struct BigInt < Int
include Comparable(SignedInt)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 017bc50

Please sign in to comment.