From 1c16d581d94baca62ddb6ad136e444e87fbe13d6 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Thu, 29 Oct 2009 20:46:58 +0100 Subject: Remove get/set_degrees from ray_def. These were used by the temporarily disabled chaos beams. --- crawl-ref/source/ray.cc | 41 ----------------------------------------- crawl-ref/source/ray.h | 5 ----- 2 files changed, 46 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/ray.cc b/crawl-ref/source/ray.cc index 5635aaf161..1094c5f0ae 100644 --- a/crawl-ref/source/ray.cc +++ b/crawl-ref/source/ray.cc @@ -117,47 +117,6 @@ void ray_def::advance_and_bounce() set_reflect_point(oldaccx, oldaccy, blocked_x, blocked_y); } -double ray_def::get_degrees() const -{ - if (slope > 100.0) - return (quadx < 0 ? 90.0 : 270.0); - else if (double_is_zero(slope)) - return (quady > 0 ? 0.0 : 180.0); - - // 0 < deg < 90 - double deg = atan(slope) * 180.0 / M_PI; - if (quadx < 0) - deg = 180.0 - deg; - if (quady < 0) - deg = 360.0 - deg; - return (deg); -} - -void ray_def::set_degrees(double deg) -{ - while (deg < 0.0) - deg += 360.0; - while (deg >= 360.0) - deg -= 360.0; - - if (deg > 180.0) - { - quady = -1; - deg = 360 - deg; - } - if (deg > 90.0) - { - quadx = -1; - deg = 180 - deg; - } - - slope = tan(deg / 180.0 * M_PI); - if (double_is_zero(slope)) - slope = 0.0; - if (slope > 1000.0) - slope = 1000.0; -} - void ray_def::regress() { quadx = -quadx; quady= -quady; diff --git a/crawl-ref/source/ray.h b/crawl-ref/source/ray.h index a720dc4885..5dd97dd0a9 100644 --- a/crawl-ref/source/ray.h +++ b/crawl-ref/source/ray.h @@ -39,11 +39,6 @@ public: void advance_and_bounce(); void regress(); - // Gets/sets the slope in terms of degrees, with 0 = east, 90 = north, - // 180 = west, 270 = south, 360 = east, -90 = south, etc - double get_degrees() const; - void set_degrees(double deg); - protected: adv_type raw_advance_pos(); void flip(); -- cgit v1.2.3-54-g00ecf