Mercurial > otakunoraifu
view scn2k/scn2k_impl.h @ 67:419761c8d9b9
Add configure option to build scn2kdump.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Wed, 23 Feb 2011 01:48:51 +0100 (2011-02-23) |
parents | 4416cfac86ae |
children |
line wrap: on
line source
/* * Copyright (c) 2004-2006 Kazunori "jagarl" Ueno * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __SCN2k_IMPL_H__ #define __SCN2k_IMPL_H__ #include "scn2k.h" #include "window/widget.h" #include "window/event.h" #include <vector> #include <string> #include <map> #include <set> struct StackItem { int scn_number; int scn_pt; StackItem(int number, int pt) : scn_number(number), scn_pt(pt) {} }; struct SaveTitle { virtual std::string operator()(int number) const = 0; }; struct Scn2kMenu { Cmd cmd; class Scn2kMenuImpl* pimpl; enum MenuType { MENU_LOAD, MENU_SAVE, MENU_CONFIG, MENU_BACKLOG, MENU_BACKLOG2}; MenuType type; enum MenuStatus { MENU_CONTINUE=0, MENU_CMD=1, MENU_DELETE=2}; MenuStatus status; void InitPanel(Event::Container& event, PicContainer& parent); void InitTitle(const SaveTitle&); void Cancel(void); void Exec(Cmd& cmd); void activate(void); void deactivate(void); Scn2kMenu(MenuType type, class Scn2k& scn_impl, const Flags& flags, Text& text, int system_version); ~Scn2kMenu(); }; struct Scn2kSaveTitle : SaveTitle { const class Scn2k& impl; std::string operator() (int number) const; Scn2kSaveTitle(const Scn2k& _impl) : impl(_impl) {} }; class Scn2k : Event::Time { private: Event::Container& event; PicContainer& parent; AyuSysConfig *config; WidMouseCursor* mcursor; Flags flag; Text text_exec; Grp grp_exec; int system_version; SkipMode skip_mode; int scn_number; int scn_point; enum { SCN_INFO = 999999, SCN_INFO_MENU = 10000001, SCN_INFO_LOCALS = 10000100, SCN_INFO_LOCALSTR = 10000200, SCN_INFO_RETSTR = 10000300 }; // stack に積まれる特殊な番号 int save_scn, save_point; char* script_start; char* script_end; const char* script; int backlog_script_scn; char* backlog_script_start; char* backlog_script_end; std::string window_title; std::vector<StackItem> stack; std::vector<std::string> stack_strbuffer; std::vector<CmdSimplified> cmd_stack; std::vector<std::string> rollback_save; std::string new_rollback_save; std::map<int, std::set<int> > text_readflag; char* cmd_stack_str; char cmd_stack_str_orig[32768]; Cmdtype dialog_type; class WidDialog* dialog; Scn2kMenu* menu; bool menu_mouseshown; Surface* mouse_surface; int mouse_type; int mouse_pressed; void ShowCursor(); void HideCursor(); void SetSkipMode(SkipMode mode); virtual void Elapsed(unsigned int current_time); // セーブ関連 std::string MakeSaveFile(void) const; bool StatSaveFile(int num, int& year, int& month, int& day, int& wday, int& hour,int& min, int& sec, int& msec, std::string& title) const; void SaveImpl(std::string& s); void LoadImpl(const char* s); void Save(Cmd& cmd); void Load(Cmd& cmd); void SaveRollback(void); void LoadRollback(Cmd& cmd); void SaveSys(void); void LoadSys(void); public: Scn2k(Event::Container& _event, PicContainer& _parent); ~Scn2k(); static char* OpenScript(int scn_number, char*& end, int* call_vec, int& system_version); bool ChangeScript(int scn_number, int call_no); bool ReadCmdAt(Cmd& cmd, int scn, int pt); void show_textwindow(int type); void hide_textwindow(void); void SysExec(Cmd& cmd); bool SysWait(Cmd& cmd); friend struct Scn2kSaveTitle; }; #endif