/* Danger from the Deep - Open source submarine simulation Copyright (C) 2003-2006 Thorsten Jordan, Luis Barrancos and others. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // user display: submarine's torpedo room // subsim (C)+(W) Thorsten Jordan. SEE LICENSE #ifndef SUB_TORPEDO_DISPLAY_H #define SUB_TORPEDO_DISPLAY_H #include "user_display.h" #include "submarine.h" #include "vector2.h" #include "texture.h" #include "objcache.h" class sub_torpedo_display : public user_display { // source tube nr for manual torpedo transfer, used for drag & drop drawing unsigned torptranssrc; // textures for drawing the screen std::auto_ptr torpempty; std::auto_ptr torpload; std::auto_ptr torpunload; std::auto_ptr torp1fat1; std::auto_ptr torp1lut1; std::auto_ptr torp1lut2; std::auto_ptr torp1; std::auto_ptr torp1practice; std::auto_ptr torp2; std::auto_ptr torp3afat2; std::auto_ptr torp3alut1; std::auto_ptr torp3alut2; std::auto_ptr torp3fat2; std::auto_ptr torp3; std::auto_ptr torp4; std::auto_ptr torp5b; std::auto_ptr torp5; std::auto_ptr torp6lut1; // std::auto_ptr torp11; std::auto_ptr submodelVIIc; std::auto_ptr background; std::auto_ptr subtopsideview; class desc_text { std::vector txtlines; desc_text(); public: desc_text(const std::string& filename); // give startline and number of lines to fetch (nr=0: all). std::string str(unsigned startline = 0, unsigned nrlines = 0) const; unsigned nr_of_lines() const { return txtlines.size(); } }; mutable objcachet desc_texts; void draw_torpedo(class game& gm, bool usebow, const vector2i& pos, const submarine::stored_torpedo& st) const; int mx, my, mb; mutable unsigned torp_desc_line; const texture& torptex(const std::string& torpname) const; std::vector get_tubecoords(class submarine* sub) const; unsigned get_tube_below_mouse(const std::vector& tubecoords) const; public: sub_torpedo_display(class user_interface& ui_); virtual void display(class game& gm) const; virtual void process_input(class game& gm, const SDL_Event& event); void enter(bool is_day); void leave(); }; #endif