commit 8d0409bd0c5cc5023d18e7edddb466798aeda78a Author: James Turk Date: Thu Nov 21 05:40:49 2002 +0000 Initial revision diff --git a/authors.txt b/authors.txt new file mode 100644 index 0000000..95a15a5 --- /dev/null +++ b/authors.txt @@ -0,0 +1 @@ +James Turk james@conceptofzero.net - Core Engine and Classes for Data Types diff --git a/changelog.txt b/changelog.txt new file mode 100644 index 0000000..7574a29 --- /dev/null +++ b/changelog.txt @@ -0,0 +1,101 @@ +ZEngine Version Log for Version 0.7.4 +$Id: changelog.txt,v 1.1 2002/11/21 05:40:49 cozman Exp $ + +0.7.5 + -Converted all tabs to spaces. + -Added CVS lines to files for date tracking. + -Fixed file layout for CVS and reuploaded files to CVS. + + +0.7.4 + -Modified behavior of ZImage::Attach and changed ZImageTest to use it. + -Added makefile for Linux build support. + -Renamed old makefile to makefile.mingw32 + -Fixed problem in ZImage::SetAlpha when failure occured. + -Added warnings in ZImage for when the display format fails. + -Completely rewrote ZConfigFile to avoid problems with STL map. + -Fixed problem in ZImage with transparency. + -Added doxygen script for linux, and renamed old doxygen script. + +0.7.3 + -Globally evised source variable naming standards. + -Fixed Error Logging in ZImage. + -Added SDL_DisplaySurface and SDL_DisplaySurfaceAlpha calls to speed up blitting in ZImage. + -Fixed bug in ZConfigFile that caused a NULL file to be closed. + -Several Documentation errors corrected. + -Added ZRect class, and ZRectTest. + +0.7.2 + -Fixed small source problem in PhysFS handling of non-supported types. + -Added makefile for Cygwin and Mingw32 + -Removed AFL license, and switched to BSD-style license. + +0.7.1 + -Changed directory layout. + -Changed source files to compile without PhysicsFS. + -Added newline to end of all source files. + +0.7.0 + -Changed slash direction in example programs (fixed non-windows problems). + -Added support for PhysicsFS. + -Added ZConfigFile. + -Updated all examples to be cleaner style and use more features. + -Addes ZConfigFile for test programs. + +0.6.3 + -Fixed directory issues in distribution. + -Updated to specify SDL 1.2.5 compatibility. + -Added IsLoaded method to ZSound,ZMusic,ZImage and ZFont + -Added music.ogg warning to ZMusicTest. + -Minor fixes in Doxygen settings. + -Fixed issues compiling the ZObject Inherited Wrapper types caused by changes in documentation. + -Added file-level documentation for doxygen in src directory. + +0.6.2 + -Updated License to APL 1.1 and all files with it. + +0.6.1 + -Added Mouse Example + -Changed Email Address to james@conceptofzero.net + -Added more test data and information on where data came from + -Removed Ogg file from distribution. + -Changed names of the libraries. + +0.6.0 + -Updated all documentation (including doxygen docs). + -Rewrote Licensing.txt + -Added Authors.txt and Credits.txt + -Added VC7 Non-Debug Projects. + -Removed LGPL.txt (legacy) and Added APL.txt + -Fixed a bug occuring in ZSound and ZFont test programs. + -Proofread and fixed some documentation errors. + +0.5.0 + -Added APL Notice to source files. + -Updated source guidelines file for APL licensing. + -Added ZSound and test program. + -Updated examples to have similar coding guidelines. + +0.4.0 + -Added Source Guidelines file. + -Added ZMusic and test program. + -Fixed a small keypress checking error in fullscreen mode. + -Redesigned entire data storage system (aka ZDataPtr classes) + -Fixed USE_SDL_MIXER and USE_SDL_TTF bugs in ZEngine. + -Removed LGPL licensing messages from source. + -Rewrote buggy ZImage::Attach code that was affecting the test program. + +0.3.0 + -Added ZTimer and ZFont classes and test programs. + -Fixed major hardware setting bugs in ZImage and ZEngine. + -Added alpha blending to tests. + -Reorganized Directory Structure and VC7 Project Files + +0.2.0 + -Doxygen Documentation and LGPL license addition + -Added ZImage, and test program. + -Fixed bugs throughout core of ZEngine and changed methods used to keep static vectors of data. + -Designed ZObject class with virtual destructor. + +0.1.0 + -Initial ZEngine Proof of Concept, core ZEngine class. diff --git a/doc/ZEngine.linux.doxygen b/doc/ZEngine.linux.doxygen new file mode 100644 index 0000000..2edc9c2 --- /dev/null +++ b/doc/ZEngine.linux.doxygen @@ -0,0 +1,191 @@ +# Doxyfile 1.2.17 + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = ZEngine +PROJECT_NUMBER = 0.7.0 +OUTPUT_DIRECTORY = /home/James/ZEngine-dev/doc +OUTPUT_LANGUAGE = English +EXTRACT_ALL = NO +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = NO +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +INTERNAL_DOCS = NO +STRIP_CODE_COMMENTS = YES +CASE_SENSE_NAMES = YES +SHORT_NAMES = NO +HIDE_SCOPE_NAMES = NO +VERBATIM_HEADERS = YES +SHOW_INCLUDE_FILES = YES +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = YES +INHERIT_DOCS = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = NO +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 8 +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ALIASES = +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +SHOW_USED_FILES = YES +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = /home/James/ZEngine-dev/doc/ZEngine.log +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = /home/James/ZEngine-dev/src \ + /home/James/ZEngine-dev/include +FILE_PATTERNS = +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 1 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_SCHEMA = +XML_DTD = +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = NO +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = NO +INCLUDED_BY_GRAPH = NO +GRAPHICAL_HIERARCHY = NO +DOT_IMAGE_FORMAT = png +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO +CGI_NAME = search.cgi +CGI_URL = +DOC_URL = +DOC_ABSPATH = +BIN_ABSPATH = /usr/local/bin/ +EXT_DOC_PATHS = diff --git a/doc/ZEngine.log b/doc/ZEngine.log new file mode 100644 index 0000000..8d7ff92 --- /dev/null +++ b/doc/ZEngine.log @@ -0,0 +1,10 @@ +/home/James/ZEngine-dev/include/ZE_ZConfigFile.h:49: Warning: Compound ZE::ZConfigFile::ZCF_Section is not documented. +/home/James/ZEngine-dev/include/ZE_ZConfigFile.h:43: Warning: Compound ZE::ZConfigFile::ZCF_Variable is not documented. +/home/James/ZEngine-dev/include/ZEngine.h:35: Error: end of paragraph without end of style command +/home/James/ZEngine-dev/include/ZEngine.h:37: Error: Found unknown command `\conceptofzero' +/home/James/ZEngine-dev/include/ZEngine.h:39: Error: found tag without matching in the same paragraph +/home/James/ZEngine-dev/include/ZE_Error.h:58: Error: Unsupported html tag found +/home/James/ZEngine-dev/include/ZE_ZConfigFile.h:70: Warning: Member Exists of class ZE::ZConfigFile is not documented. +/home/James/ZEngine-dev/include/ZE_ZConfigFile.h:71: Warning: Member Exists of class ZE::ZConfigFile is not documented. +/home/James/ZEngine-dev/include/ZE_ZConfigFile.h:72: Warning: Member SetVariable of class ZE::ZConfigFile is not documented. +/home/James/ZEngine-dev/include/ZE_ZConfigFile.h:73: Warning: Member GetVariable of class ZE::ZConfigFile is not documented. diff --git a/doc/ZEngine.win32.doxygen b/doc/ZEngine.win32.doxygen new file mode 100644 index 0000000..7ca7843 --- /dev/null +++ b/doc/ZEngine.win32.doxygen @@ -0,0 +1,193 @@ +# Doxyfile 1.2.17 + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = ZEngine +PROJECT_NUMBER = 0.7.0 +OUTPUT_DIRECTORY = F:\libs\ZEngine-dev\doc\ +OUTPUT_LANGUAGE = English +EXTRACT_ALL = NO +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = NO +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = F:\libs\ZEngine-dev +INTERNAL_DOCS = NO +STRIP_CODE_COMMENTS = YES +CASE_SENSE_NAMES = YES +SHORT_NAMES = NO +HIDE_SCOPE_NAMES = NO +VERBATIM_HEADERS = YES +SHOW_INCLUDE_FILES = YES +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = YES +INHERIT_DOCS = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = NO +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 8 +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ALIASES = +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +SHOW_USED_FILES = YES +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = F:\libs\ZEngine-dev\doc\ZEngine.log +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = F:/libs/ZEngine-dev/src \ + F:/libs/ZEngine-dev/include +FILE_PATTERNS = +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 1 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_SCHEMA = +XML_DTD = +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = NO +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = NO +INCLUDED_BY_GRAPH = NO +GRAPHICAL_HIERARCHY = NO +DOT_IMAGE_FORMAT = png +DOT_PATH = "c:/Program Files/KingsTools/" +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO +CGI_NAME = search.cgi +CGI_URL = +DOC_URL = +DOC_ABSPATH = +BIN_ABSPATH = /usr/local/bin/ +EXT_DOC_PATHS = diff --git a/doc/html/ZE__DataPtr_8h-source.html b/doc/html/ZE__DataPtr_8h-source.html new file mode 100644 index 0000000..08c961e --- /dev/null +++ b/doc/html/ZE__DataPtr_8h-source.html @@ -0,0 +1,77 @@ + + +/home/James/ZEngine-dev/include/ZE_DataPtr.h Source File + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_DataPtr.h

Go to the documentation of this file.
00001 /*******************************************************************************
+00002          This file is Part of the ZEngine Library for SDL Game Development.
+00003                       Copyright (C) 2002 ConceptOfZero.net
+00004 
+00005              Licensed under the BSD License, see licensing.txt.
+00006 
+00007     The maintainer of this library is James Turk (jturk@conceptofzero.net) 
+00008          and the home of this Library is http://www.conceptofzero.net/
+00009 *******************************************************************************/
+00010 
+00025 #ifndef __ze_dataptr_h__
+00026 #define __ze_dataptr_h__
+00027 
+00028 #include "ZE_Includes.h"
+00029 
+00030 namespace ZE
+00031 {
+00032 
+00034 //Utility Classes Used Throughout ZEngine//
+00036 
+00042 class ImageData
+00043 {
+00044         public:
+00046                 SDL_Surface *image;
+00048                 string filename;
+00054                 ImageData() { image = NULL; };
+00055 };
+00056 
+00057 #ifdef USE_SDL_TTF
+00058 
+00064 class FontData
+00065 {
+00066         public:
+00068                 TTF_Font *font;
+00070                 string filename;
+00076                 FontData() { font = NULL; };
+00077 };
+00078 
+00079 #endif //USE_SDL_TTF
+00080 
+00081 #ifdef USE_SDL_MIXER
+00082 
+00088 class SoundData
+00089 {
+00090         public:
+00092                 Mix_Chunk *sound;
+00094                 string filename;
+00100                 SoundData() { sound = NULL; };
+00101 };
+00102 
+00108 class MusicData
+00109 {
+00110         public:
+00112                 Mix_Music *music;
+00114                 string filename;
+00120                 MusicData() { music = NULL; };
+00121 };
+00122 
+00123 #endif //USE_SDL_MIXER
+00124 
+00125 }
+00126 
+00127 #endif //__ze_dataptr_h__
+

Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__DataPtr_8h.html b/doc/html/ZE__DataPtr_8h.html new file mode 100644 index 0000000..3a7625e --- /dev/null +++ b/doc/html/ZE__DataPtr_8h.html @@ -0,0 +1,32 @@ + + +ZE_DataPtr.h File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_DataPtr.h File Reference


Detailed Description

+
File Header:
File: Types/ZE_DataPtr.h
+ Description: Header file for ZEngine Data Pointer Classes
+ Author(s): James Turk
+ Last Updated: 9/8/02
+
+ +

+Definition file for ZEngine Data Pointer Classes. ([Image,Font,Sound,Music]Ptr) These classes are used to keep track of the Images (Fonts and Sounds) throughout the entire ZEngine. +

+#include "ZE_Includes.h"
+ +

+Go to the source code of this file. + + + +

Namespaces

namespace  ZE
+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__Defines_8h-source.html b/doc/html/ZE__Defines_8h-source.html new file mode 100644 index 0000000..1a94d14 --- /dev/null +++ b/doc/html/ZE__Defines_8h-source.html @@ -0,0 +1,36 @@ + + +/home/James/ZEngine-dev/include/ZE_Defines.h Source File + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_Defines.h

Go to the documentation of this file.
00001 /*******************************************************************************
+00002          This file is Part of the ZEngine Library for SDL Game Development.
+00003                       Copyright (C) 2002 ConceptOfZero.net
+00004 
+00005              Licensed under the BSD License, see licensing.txt.
+00006 
+00007     The maintainer of this library is James Turk (jturk@conceptofzero.net) 
+00008          and the home of this Library is http://www.conceptofzero.net/
+00009 *******************************************************************************/
+00010 
+00024 #ifndef __ze_defines_h__
+00025 #define __ze_defines_h__
+00026 
+00027 //defines- undefine any of these if you dont have the indicated SDL extension//
+00029 #define USE_SDL_TTF
+00031 #define USE_SDL_IMAGE
+00033 #define USE_SDL_MIXER
+00035 //#define USE_PHYSFS
+00037 #define DEBUG_STREAM
+00039 #define VERSION "0.7.3"
+00040 
+00041 #endif //__ze_defines_h__
+

Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__Defines_8h.html b/doc/html/ZE__Defines_8h.html new file mode 100644 index 0000000..15f90b0 --- /dev/null +++ b/doc/html/ZE__Defines_8h.html @@ -0,0 +1,45 @@ + + +ZE_Defines.h File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_Defines.h File Reference


Detailed Description

+
File Header:
File: ZE_Defines.h
+ Description: Defines header file for ZEngine class, where all #define statements to control compilation options are placed.
+ Author(s): James Turk
+ Last Updated: 11/07/02
+
+ +

+Definition file, holds #define statements describing optional features of ZEngine. +

+ +

+Go to the source code of this file. + + + + + + + + + + + + +

Defines

+#define USE_SDL_TTF
 Define to include font support.

+#define USE_SDL_IMAGE
 Define to include non-bmp image file support.

+#define USE_SDL_MIXER
 Define to include sound support.

+#define DEBUG_STREAM
 Undefine to disable debug streams for Error Handler.

+#define VERSION   "0.7.3"
 Version number.

+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__Error_8cpp.html b/doc/html/ZE__Error_8cpp.html new file mode 100644 index 0000000..8c5f12e --- /dev/null +++ b/doc/html/ZE__Error_8cpp.html @@ -0,0 +1,30 @@ + + +ZE_Error.cpp File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/src/ZE_Error.cpp File Reference


Detailed Description

+
File Header:
File: Util/ZE_Error.cpp
+ Description: Implementation source file for ZEngine error logging utility functions.
+ Author(s): James Turk
+ Last Updated: 10/8/02
+
+ +

+Error logging utilities for ZEngine and programs making use of ZEngine. +

+#include "ZE_Error.h"
+ + + + +

Namespaces

namespace  ZE
+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__Error_8h-source.html b/doc/html/ZE__Error_8h-source.html new file mode 100644 index 0000000..c337a68 --- /dev/null +++ b/doc/html/ZE__Error_8h-source.html @@ -0,0 +1,48 @@ + + +/home/James/ZEngine-dev/include/ZE_Error.h Source File + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_Error.h

Go to the documentation of this file.
00001 /*******************************************************************************
+00002          This file is Part of the ZEngine Library for SDL Game Development.
+00003                       Copyright (C) 2002 ConceptOfZero.net
+00004 
+00005              Licensed under the BSD License, see licensing.txt.
+00006 
+00007     The maintainer of this library is James Turk (jturk@conceptofzero.net) 
+00008          and the home of this Library is http://www.conceptofzero.net/
+00009 *******************************************************************************/
+00010 
+00024 #ifndef __ze_error_h__
+00025 #define __ze_error_h__
+00026 
+00027 #include "ZE_Includes.h"
+00028 
+00029 namespace ZE
+00030 {
+00031 
+00032 
+00034 //Error Logging + Formatting//
+00036 
+00046 string _GetError(int line, string file, string str);
+00047 
+00056 void _LogError(int line, string file, string str);
+00057 
+00067 string FormatStr(const char *fmtstr, ...);
+00068 
+00072 #define GetError(str) _GetError(__LINE__,__FILE__,str)
+00073 
+00077 #define LogError(str) _LogError(__LINE__,__FILE__,str)
+00078 
+00079 }
+00080 
+00081 #endif //__ze_error_h__
+

Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__Error_8h.html b/doc/html/ZE__Error_8h.html new file mode 100644 index 0000000..9cd2ad1 --- /dev/null +++ b/doc/html/ZE__Error_8h.html @@ -0,0 +1,90 @@ + + +ZE_Error.h File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_Error.h File Reference


Detailed Description

+
File Header:
File: Util/ZE_Error.h
+ Description: Header file for ZEngine Error Handling Functions.
+ Author(s): James Turk
+ Last Updated: 9/8/02
+
+ +

+Definition file for ZEngine Error Logging + Formatting functions which are used for internal and external errors. +

+#include "ZE_Includes.h"
+ +

+Go to the source code of this file. + + + + + + +

Namespaces

namespace  ZE

Defines

#define GetError(str)   _GetError(__LINE__,__FILE__,str)
#define LogError(str)   _LogError(__LINE__,__FILE__,str)
+


Define Documentation

+

+ + + + +
+ + + + + + + +
#define GetErrorstr      _GetError(__LINE__,__FILE__,str) +
+
+ + + + + +
+   + + +

+Creates a string about an error, telling what file it occured in and where, and gives a user defined string as well.

+

+ + + + +
+ + + + + + + +
#define LogErrorstr      _LogError(__LINE__,__FILE__,str) +
+
+ + + + + +
+   + + +

+Logs a string about an error, telling what file it occured in and where, and gives a user defined string as well.

+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__Includes_8h-source.html b/doc/html/ZE__Includes_8h-source.html new file mode 100644 index 0000000..9111dcd --- /dev/null +++ b/doc/html/ZE__Includes_8h-source.html @@ -0,0 +1,55 @@ + + +/home/James/ZEngine-dev/include/ZE_Includes.h Source File + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_Includes.h

Go to the documentation of this file.
00001 /*******************************************************************************
+00002          This file is Part of the ZEngine Library for SDL Game Development.
+00003                       Copyright (C) 2002 ConceptOfZero.net
+00004 
+00005              Licensed under the BSD License, see licensing.txt.
+00006 
+00007     The maintainer of this library is James Turk (jturk@conceptofzero.net) 
+00008          and the home of this Library is http://www.conceptofzero.net/
+00009 *******************************************************************************/
+00010 
+00025 #ifndef __ze_includes_h__
+00026 #define __ze_includes_h__
+00027 
+00028 #include "ZE_Defines.h"
+00029 
+00030 #include "SDL.h"
+00031 #ifdef USE_SDL_IMAGE
+00032 #include "SDL_image.h"
+00033 #endif
+00034 #ifdef USE_SDL_TTF
+00035 #include "SDL_ttf.h"
+00036 #endif
+00037 #ifdef USE_SDL_MIXER
+00038 #include "SDL_mixer.h"
+00039 #endif
+00040 #ifdef USE_PHYSFS
+00041 #include "physfs.h"
+00042 #include "external/physfsrwops.h"
+00043 #endif
+00044 
+00045 #include <string>
+00046 #include <vector>
+00047 #include <fstream>
+00048 #include <list>
+00049 #include <cstdio>
+00050 #include <cstdlib>
+00051 #include <cstdarg>
+00052 #include <cctype>
+00053 using namespace std;
+00054 
+00055 #endif //__ze_includes_h__
+

Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__Includes_8h.html b/doc/html/ZE__Includes_8h.html new file mode 100644 index 0000000..4266161 --- /dev/null +++ b/doc/html/ZE__Includes_8h.html @@ -0,0 +1,44 @@ + + +ZE_Includes.h File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_Includes.h File Reference


Detailed Description

+
File Header:
File: ZE_Includes.h
+ Description: Header file for ZEngine universal includes.
+ Author(s): James Turk
+ Last Updated: 11/01/02
+
+ +

+ZE_*.h files should only include this file and any other ZE_*.h files that they need, External Library or C/C++ Standard Library files should be included from within this file. +

+#include "ZE_Defines.h"
+#include "SDL.h"
+#include "SDL_image.h"
+#include "SDL_ttf.h"
+#include "SDL_mixer.h"
+#include <string>
+#include <vector>
+#include <fstream>
+#include <list>
+#include <cstdio>
+#include <cstdlib>
+#include <cstdarg>
+#include <cctype>
+ +

+Go to the source code of this file. + + + +

Namespaces

namespace  std
+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZConfigFile_8cpp.html b/doc/html/ZE__ZConfigFile_8cpp.html new file mode 100644 index 0000000..41ec606 --- /dev/null +++ b/doc/html/ZE__ZConfigFile_8cpp.html @@ -0,0 +1,30 @@ + + +ZE_ZConfigFile.cpp File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/src/ZE_ZConfigFile.cpp File Reference


Detailed Description

+
File Header:
File: Types/ZE_ZConfigFile.cpp
+ Description: Implementation source file for ZConfigFile, the ZEngine INI-Style Config File.
+ Author(s): James Turk
+ Last Updated: 11/07/02
+
+ +

+Implementation of ZConfigFile, the ZEngine INI-Style Config File. +

+#include "ZE_ZConfigFile.h"
+ + + + +

Namespaces

namespace  ZE
+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZConfigFile_8h-source.html b/doc/html/ZE__ZConfigFile_8h-source.html new file mode 100644 index 0000000..09c0d70 --- /dev/null +++ b/doc/html/ZE__ZConfigFile_8h-source.html @@ -0,0 +1,91 @@ + + +/home/James/ZEngine-dev/include/ZE_ZConfigFile.h Source File + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_ZConfigFile.h

Go to the documentation of this file.
00001 /*******************************************************************************
+00002          This file is Part of the ZEngine Library for SDL Game Development.
+00003                       Copyright (C) 2002 ConceptOfZero.net
+00004 
+00005              Licensed under the BSD License, see licensing.txt.
+00006 
+00007     The maintainer of this library is James Turk (jturk@conceptofzero.net) 
+00008          and the home of this Library is http://www.conceptofzero.net/
+00009 *******************************************************************************/
+00010 
+00025 #ifndef __ze_zconfigfile_h__
+00026 #define __ze_zconfigfile_h__
+00027 
+00028 #include "ZE_ZObject.h"         //included even though ZCF isn't derived (to obtain all other needed headers)
+00029 
+00030 namespace ZE
+00031 {
+00032 
+00038 class ZConfigFile : public ZObject
+00039 {
+00040         private:
+00041 
+00042                 /*Private Types*/
+00043                 class ZCF_Variable
+00044                 {
+00045                         public:
+00046                                 string var;
+00047                                 string val;
+00048                 };
+00049                 class ZCF_Section
+00050                 {
+00051                         public:
+00052                                 string section;
+00053                                 list<ZCF_Variable> varList;
+00054                 };
+00055 
+00057                 list<ZCF_Section> mFileLayout;
+00058 
+00060                 string mFilename;
+00061 
+00069                 string CleanString(string str);
+00070                 
+00071                 bool Exists(string sec);
+00072                 bool Exists(string sec, string var);
+00073                 void SetVariable(string sec, string var, string val);
+00074                 string GetVariable(string sec, string var, string defVal);
+00075 
+00076         public:
+00077 
+00083                 ZConfigFile();
+00084 
+00091                 ZConfigFile(string filename);
+00092 
+00098                 ~ZConfigFile();
+00099 
+00106                 void Process(string filename);
+00107 
+00117                 int GetInt(string section, string var, int defVal);
+00118 
+00129                 bool GetBool(string section, string var, bool defVal);
+00130 
+00140                 string GetString(string section, string var, string defVal);
+00141 
+00151                 void SetInt(string section, string var, int val);
+00152 
+00162                 void SetBool(string section, string var, bool val);
+00163 
+00173                 void SetString(string section, string var, string val);
+00174                 
+00180                 void Flush();
+00181 
+00187                 void Close();
+00188 };
+00189 
+00190 }
+00191 
+00192 #endif //__ze_zconfigfile_h__
+

Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZConfigFile_8h.html b/doc/html/ZE__ZConfigFile_8h.html new file mode 100644 index 0000000..d37d0d1 --- /dev/null +++ b/doc/html/ZE__ZConfigFile_8h.html @@ -0,0 +1,32 @@ + + +ZE_ZConfigFile.h File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_ZConfigFile.h File Reference


Detailed Description

+
File Header:
File: Types/ZE_ZConfigFile.h
+ Description: Header file for ZEngine INI-Style Config Files.
+ Author(s): James Turk
+ Last Updated: 11/07/02
+
+ +

+Definition file for ZConfigFile, an INI-style Config format. +

+#include "ZE_ZObject.h"
+ +

+Go to the source code of this file. + + + +

Namespaces

namespace  ZE
+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZEngine_8cpp.html b/doc/html/ZE__ZEngine_8cpp.html new file mode 100644 index 0000000..e3f623a --- /dev/null +++ b/doc/html/ZE__ZEngine_8cpp.html @@ -0,0 +1,30 @@ + + +ZE_ZEngine.cpp File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/src/ZE_ZEngine.cpp File Reference


Detailed Description

+
File Header:
File: ZE_ZEngine.cpp
+ Description: Implementation source file for ZEngine library main singleton class.
+ Author(s): James Turk
+ Last Updated: 11/07/02
+
+ +

+Actual implementation of ZEngine singleton class at heart of ZEngine. +

+#include "ZE_ZEngine.h"
+ + + + +

Namespaces

namespace  ZE
+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZEngine_8h-source.html b/doc/html/ZE__ZEngine_8h-source.html new file mode 100644 index 0000000..9fc1c9b --- /dev/null +++ b/doc/html/ZE__ZEngine_8h-source.html @@ -0,0 +1,203 @@ + + +/home/James/ZEngine-dev/include/ZE_ZEngine.h Source File + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_ZEngine.h

Go to the documentation of this file.
00001 /*******************************************************************************
+00002          This file is Part of the ZEngine Library for SDL Game Development.
+00003                       Copyright (C) 2002 ConceptOfZero.net
+00004 
+00005              Licensed under the BSD License, see licensing.txt.
+00006 
+00007     The maintainer of this library is James Turk (jturk@conceptofzero.net) 
+00008          and the home of this Library is http://www.conceptofzero.net/
+00009 *******************************************************************************/
+00010 
+00024 #ifndef __ze_zengine_h__
+00025 #define __ze_zengine_h__
+00026 
+00027 #include "ZE_DataPtr.h"
+00028 #include "ZE_Error.h"
+00029 #include "ZE_Defines.h"
+00030 #include "ZE_Includes.h"
+00031 
+00037 namespace ZE
+00038 {
+00039 
+00046 class ZEngine
+00047 {
+00049         //Singleton + Memory Management//
+00051 
+00052         private:
+00054                 static ZEngine *sInstance;
+00055 
+00061                 ZEngine();
+00062 
+00063         public:
+00064 
+00071                 static ZEngine* GetInstance();
+00072 
+00078                 static void ReleaseInstance();
+00079 
+00086                 static string GetVersion();
+00087 
+00089         //Initialization//
+00091 
+00092         private:
+00094                 int mWidth;
+00096                 int mHeight;
+00098                 int mBPP;
+00100                 bool mFullscreen;
+00101 
+00102 #ifdef USE_SDL_MIXER 
+00103 
+00104                 int mRate;
+00106                 bool mStereo;
+00107 #endif 
+00108 
+00109 
+00110         public:
+00111                 //add initialization
+00112 
+00123                 void SetupDisplay(int width, int height, int bpp, bool fullscreen);
+00124 
+00125 #ifdef USE_SDL_MIXER
+00126 
+00134                 void SetupSound(int rate, bool stereo);
+00135 #endif 
+00136 
+00146                 void CreateWindow(string title, string icon="");
+00147 
+00153                 void CloseWindow();
+00154 
+00156         //Screen Access//
+00158 
+00159         private:
+00161                 SDL_Surface *mScreen;
+00162 
+00163         public:
+00170                 SDL_Surface *GetDisplay();
+00171 
+00177                 void UpdateScreen();
+00178 
+00190                 Uint32 MapColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a=255);
+00191 
+00199                 void Clear(Uint32 color=0, SDL_Rect *rect=NULL);
+00200 
+00202         //Timer and Framerate Independent Movement//
+00204         
+00205         private:
+00207                 bool mPaused;
+00209                 bool mUnpauseOnActive;
+00211                 Uint32 mLastPause;
+00213                 Uint32 mPausedTime;
+00215                 Uint32 mLastTime;
+00217                 double mSecPerFrame;
+00218 
+00219         public:
+00226                 void Sleep(Uint32 milliseconds);
+00227 
+00234                 Uint32 GetTime();
+00235 
+00241                 void PauseTimer();
+00242 
+00248                 void UnpauseTimer();
+00249 
+00256                 double GetFrameTime();
+00257 
+00264                 bool IsPaused();
+00265 
+00267         //Event and Input Handling//
+00269 
+00270         private:
+00272                 bool mActive;
+00274                 bool mQuit;
+00276                 Uint8 *mKeyPressed;
+00278                 int mMouseX;
+00280                 int mMouseY;
+00282                 Uint8 mMouseB;
+00283 
+00284         public:
+00291                 bool IsActive();
+00292 
+00299                 void RequestQuit();
+00300 
+00308                 bool QuitRequested();
+00309                 
+00317                 bool KeyIsPressed(SDLKey key);
+00318 
+00324                 void HideCursor();
+00325 
+00331                 void ShowCursor();
+00332 
+00339                 int GetMouseX();
+00340 
+00347                 int GetMouseY();
+00348 
+00355                 bool LButtonPressed();
+00356 
+00363                 bool RButtonPressed();
+00364 
+00372                 bool MouseInRect(SDL_Rect *rect);
+00373 
+00379                 void CheckEvents();
+00380 
+00381 #ifdef USE_PHYSFS
+00382 
+00383         //Physfs Utilities//
+00385         public:
+00392                 void InitPhysFS(string argv);
+00393 
+00400                 void AddPhysFSDir(string dir);
+00401 
+00402 #endif  //USE_PHYSFS
+00403 
+00404 
+00406         //Data Loading + Unloading//
+00408         public:
+00416                 ImageData LoadImage(string filename);
+00417 
+00424                 void FreeImage(ImageData &image);
+00425 
+00426 #ifdef USE_SDL_MIXER
+00427 
+00434                 SoundData LoadSound(string filename);
+00435 
+00442                 void FreeSound(SoundData &sound);
+00443 
+00451                 MusicData LoadMusic(string filename);
+00452 
+00459                 void FreeMusic(MusicData &music);
+00460 #endif
+00461 
+00462 #ifdef USE_SDL_TTF
+00463 
+00471                 FontData LoadFont(string filename, int size);
+00472 
+00479                 void FreeFont(FontData &font);
+00480 #endif 
+00481 
+00483         //Accessors//
+00485         
+00486         public: 
+00493                 int GetWidth();
+00494 
+00501                 int GetHeight();
+00502 
+00509                 int GetBPP();
+00510 
+00517                 bool IsFullscreen();
+00518 };
+00519 
+00520 }
+00521 
+00522 #endif //__ze_zengine_h__
+

Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZEngine_8h.html b/doc/html/ZE__ZEngine_8h.html new file mode 100644 index 0000000..ba52078 --- /dev/null +++ b/doc/html/ZE__ZEngine_8h.html @@ -0,0 +1,35 @@ + + +ZE_ZEngine.h File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_ZEngine.h File Reference


Detailed Description

+
File Header:
File: ZE_ZEngine.h
+ Description: Header file for ZEngine class, the core of the ZEngine.
+ Author(s): James Turk
+ Last Updated: 11/07/02
+
+ +

+ZEngine Game Engine core Engine definition. +

+#include "ZE_DataPtr.h"
+#include "ZE_Error.h"
+#include "ZE_Defines.h"
+#include "ZE_Includes.h"
+ +

+Go to the source code of this file. + + + +

Namespaces

namespace  ZE
+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZFont_8cpp.html b/doc/html/ZE__ZFont_8cpp.html new file mode 100644 index 0000000..ba1c922 --- /dev/null +++ b/doc/html/ZE__ZFont_8cpp.html @@ -0,0 +1,28 @@ + + +ZE_ZFont.cpp File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/src/ZE_ZFont.cpp File Reference


Detailed Description

+
File Header:
File: Types/ZE_ZFont.cpp
+ Description: Implementation source file for core ZEngine Font Object.
+ Author(s): James Turk
+ Last Updated: 11/07/02
+
+ +

+Implementation of ZFont, the basic Font class for ZEngine. +

+#include "ZE_ZFont.h"
+ + +
+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZFont_8h-source.html b/doc/html/ZE__ZFont_8h-source.html new file mode 100644 index 0000000..808359e --- /dev/null +++ b/doc/html/ZE__ZFont_8h-source.html @@ -0,0 +1,94 @@ + + +/home/James/ZEngine-dev/include/ZE_ZFont.h Source File + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_ZFont.h

Go to the documentation of this file.
00001 /*******************************************************************************
+00002          This file is Part of the ZEngine Library for SDL Game Development.
+00003                       Copyright (C) 2002 ConceptOfZero.net
+00004 
+00005              Licensed under the BSD License, see licensing.txt.
+00006 
+00007     The maintainer of this library is James Turk (jturk@conceptofzero.net) 
+00008          and the home of this Library is http://www.conceptofzero.net/
+00009 *******************************************************************************/
+00010 
+00024 #ifndef __ze_zfont_h__
+00025 #define __ze_zfont_h__
+00026 
+00027 #include "ZE_ZObject.h"
+00028 #include "ZE_ZImage.h"
+00029 
+00030 #ifdef USE_SDL_TTF
+00031 
+00032 namespace ZE
+00033 {
+00034 
+00040 class ZFont : public ZObject
+00041 {
+00042         protected:
+00044                 FontData rFont;
+00046                 SDL_Color rColor;
+00048                 SDL_Color rBGColor;
+00049 
+00050         public:
+00051 
+00053                 //Opening and Closing//
+00055 
+00061                 ZFont();
+00062 
+00070                 ZFont(string filename, int size);
+00071 
+00077                 ~ZFont();
+00078 
+00086                 void Open(string filename, int size);
+00087 
+00093                 void Release();
+00094 
+00096                 //Settings and Drawing//
+00098 
+00106                 void DrawText(string text, ZImage &image);
+00107 
+00115                 void DrawShadedText(string text, ZImage &image);
+00116 
+00125                 void SetColor(Uint8 r, Uint8 g, Uint8 b);
+00126 
+00135                 void SetBGColor(Uint8 r, Uint8 g, Uint8 b);
+00136 
+00145                 void SetStyle(bool bold, bool italic, bool underline);
+00146 
+00153                 void Resize(int size);
+00154 
+00156                 //Accessors//
+00158 
+00165                 bool IsLoaded();
+00166 
+00173                 bool IsBold();
+00174 
+00181                 bool IsItalic();
+00182 
+00189                 bool IsUnderlined();
+00190 
+00197                 int GetHeight();
+00198 
+00205                 int GetLineSkip();
+00206 
+00214                 int GetStringWidth(string text);
+00215 
+00223                 int GetStringHeight(string text);
+00224 };
+00225 
+00226 }
+00227 
+00228 #endif //USE_SDL_TTF
+00229 
+00230 #endif //__ze_zfont_h__
+

Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZFont_8h.html b/doc/html/ZE__ZFont_8h.html new file mode 100644 index 0000000..71abe65 --- /dev/null +++ b/doc/html/ZE__ZFont_8h.html @@ -0,0 +1,33 @@ + + +ZE_ZFont.h File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_ZFont.h File Reference


Detailed Description

+
File Header:
File: Types/ZE_ZFont.h
+ Description: Header file for core ZEngine Font Object.
+ Author(s): James Turk
+ Last Updated: 11/07/02
+
+ +

+Definition file for ZFont, the basic Font class for ZEngine. +

+#include "ZE_ZObject.h"
+#include "ZE_ZImage.h"
+ +

+Go to the source code of this file. + + + +

Namespaces

namespace  ZE
+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZImage_8cpp.html b/doc/html/ZE__ZImage_8cpp.html new file mode 100644 index 0000000..e491df2 --- /dev/null +++ b/doc/html/ZE__ZImage_8cpp.html @@ -0,0 +1,30 @@ + + +ZE_ZImage.cpp File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/src/ZE_ZImage.cpp File Reference


Detailed Description

+
File Header:
File: Types/ZE_ZImage.cpp
+ Description: Implementation source file for core ZEngine Image Object.
+ Author(s): James Turk
+ Last Updated: 11/07/02
+
+ +

+Implementation of ZImage, the basic Image class for ZEngine. +

+#include "ZE_ZImage.h"
+ + + + +

Namespaces

namespace  ZE
+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZImage_8h-source.html b/doc/html/ZE__ZImage_8h-source.html new file mode 100644 index 0000000..325f628 --- /dev/null +++ b/doc/html/ZE__ZImage_8h-source.html @@ -0,0 +1,81 @@ + + +/home/James/ZEngine-dev/include/ZE_ZImage.h Source File + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_ZImage.h

Go to the documentation of this file.
00001 /*******************************************************************************
+00002          This file is Part of the ZEngine Library for SDL Game Development.
+00003                       Copyright (C) 2002 ConceptOfZero.net
+00004 
+00005              Licensed under the BSD License, see licensing.txt.
+00006 
+00007     The maintainer of this library is James Turk (jturk@conceptofzero.net) 
+00008          and the home of this Library is http://www.conceptofzero.net/
+00009 *******************************************************************************/
+00010 
+00024 #ifndef __ze_zimage_h__
+00025 #define __ze_zimage_h__
+00026 
+00027 #include "ZE_ZObject.h"
+00028 
+00029 namespace ZE
+00030 {
+00031 
+00037 class ZImage : public ZObject
+00038 {
+00039         protected:
+00041                 ImageData rImage;
+00042         public:
+00043 
+00049                 ZImage();
+00050 
+00057                 ZImage(string filename);
+00058 
+00065                 ZImage(SDL_Surface *surface);
+00066 
+00078                 ZImage(SDL_Surface *img, Sint16 x, Sint16 y, Sint16 w, Sint16 h);
+00079 
+00085                 ~ZImage();
+00086 
+00088                 //Opening and Closing//
+00090 
+00097                 void Open(string filename);
+00098 
+00110                 void OpenFromImage(SDL_Surface *img, Sint16 x, Sint16 y, Sint16 w, Sint16 h);
+00111 
+00118                 void Attach(SDL_Surface *surface);
+00119 
+00125                 void Release();
+00126 
+00128                 //Graphics//
+00130 
+00137                 void SetAlpha(Uint8 alpha);
+00138 
+00145                 void SetColorKey(Uint32 color);
+00146 
+00154                 void Draw(Sint16 x, Sint16 y);
+00155 
+00157                 //Accessors//
+00159 
+00166                 bool IsLoaded();
+00167 
+00173                 SDL_Surface *GetImage();
+00174 
+00181                 int GetWidth();
+00182 
+00189                 int GetHeight();
+00190 
+00197                 string GetFilename();
+00198 };
+00199 }
+00200 
+00201 #endif //__ze_zimage_h__
+

Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZImage_8h.html b/doc/html/ZE__ZImage_8h.html new file mode 100644 index 0000000..508b131 --- /dev/null +++ b/doc/html/ZE__ZImage_8h.html @@ -0,0 +1,32 @@ + + +ZE_ZImage.h File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_ZImage.h File Reference


Detailed Description

+
File Header:
File: Types/ZE_ZImage.h
+ Description: Header file for core ZEngine Image Object.
+ Author(s): James Turk
+ Last Updated: 11/08/02
+
+ +

+Definition file for ZImage, the basic Image class for ZEngine. +

+#include "ZE_ZObject.h"
+ +

+Go to the source code of this file. + + + +

Namespaces

namespace  ZE
+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZMusic_8cpp.html b/doc/html/ZE__ZMusic_8cpp.html new file mode 100644 index 0000000..7ed367f --- /dev/null +++ b/doc/html/ZE__ZMusic_8cpp.html @@ -0,0 +1,28 @@ + + +ZE_ZMusic.cpp File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/src/ZE_ZMusic.cpp File Reference


Detailed Description

+
File Header:
File: Types/ZE_ZMusic.cpp
+ Description: Implementation source file for core ZEngine Music Object.
+ Author(s): James Turk
+ Last Updated: 11/07/02
+
+ +

+Implementation of ZMusic, the basic Music class for ZEngine. +

+#include "ZE_ZMusic.h"
+ + +
+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZMusic_8h-source.html b/doc/html/ZE__ZMusic_8h-source.html new file mode 100644 index 0000000..1609224 --- /dev/null +++ b/doc/html/ZE__ZMusic_8h-source.html @@ -0,0 +1,85 @@ + + +/home/James/ZEngine-dev/include/ZE_ZMusic.h Source File + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_ZMusic.h

Go to the documentation of this file.
00001 /*******************************************************************************
+00002          This file is Part of the ZEngine Library for SDL Game Development.
+00003                       Copyright (C) 2002 ConceptOfZero.net
+00004 
+00005              Licensed under the BSD License, see licensing.txt.
+00006 
+00007     The maintainer of this library is James Turk (jturk@conceptofzero.net) 
+00008          and the home of this Library is http://www.conceptofzero.net/
+00009 *******************************************************************************/
+00010 
+00024 #ifndef __ze_zmusic_h__
+00025 #define __ze_zmusic_h__
+00026 
+00027 #include "ZE_ZObject.h"
+00028 
+00029 #ifdef USE_SDL_MIXER
+00030 
+00031 namespace ZE
+00032 {
+00033 
+00039 class ZMusic : public ZObject 
+00040 {
+00041         protected:
+00043                 MusicData rMusic;
+00044 
+00045         public:
+00047                 static const int LoopInfinite;
+00048 
+00050                 //Opening and Closing//
+00052 
+00058                 ZMusic();
+00059 
+00066                 ZMusic(string filename);
+00067 
+00073                 ~ZMusic();
+00074 
+00081                 void Open(string filename);
+00082 
+00088                 void Release();
+00089 
+00091                 //Play Controls//
+00093 
+00102                 void Play(int loopNum=0, int fadeTime=0);
+00103 
+00109                 void Pause();
+00110 
+00116                 void Unpause();
+00117 
+00123                 void Rewind();
+00124 
+00131                 void Stop(int fadeTime=0);
+00132 
+00139                 void SetVolume(int volume);
+00140 
+00142                 //Accessors//
+00144 
+00151                 bool IsLoaded();
+00152 
+00159                 bool IsPlaying();
+00160 
+00167                 bool IsPaused();
+00168 
+00175                 int GetVolume();
+00176 };
+00177 
+00178 
+00179 }
+00180 
+00181 #endif //USE_SDL_MIXER
+00182 
+00183 #endif //__ze_zmusic_h__
+

Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZMusic_8h.html b/doc/html/ZE__ZMusic_8h.html new file mode 100644 index 0000000..32652bc --- /dev/null +++ b/doc/html/ZE__ZMusic_8h.html @@ -0,0 +1,32 @@ + + +ZE_ZMusic.h File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_ZMusic.h File Reference


Detailed Description

+
File Header:
File: Types/ZE_ZMusic.h
+ Description: Header file for core ZEngine Music Wrapper Object.
+ Author(s): James Turk
+ Last Updated: 11/07/02
+
+ +

+Definition file for ZMusic, the Music file wrapper for ZEngine. +

+#include "ZE_ZObject.h"
+ +

+Go to the source code of this file. + + + +

Namespaces

namespace  ZE
+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZObject_8h-source.html b/doc/html/ZE__ZObject_8h-source.html new file mode 100644 index 0000000..b5acf5a --- /dev/null +++ b/doc/html/ZE__ZObject_8h-source.html @@ -0,0 +1,43 @@ + + +/home/James/ZEngine-dev/include/ZE_ZObject.h Source File + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_ZObject.h

Go to the documentation of this file.
00001 /*******************************************************************************
+00002          This file is Part of the ZEngine Library for SDL Game Development.
+00003                       Copyright (C) 2002 ConceptOfZero.net
+00004 
+00005              Licensed under the BSD License, see licensing.txt.
+00006 
+00007     The maintainer of this library is James Turk (jturk@conceptofzero.net) 
+00008          and the home of this Library is http://www.conceptofzero.net/
+00009 *******************************************************************************/
+00010 
+00024 #ifndef __ze_zobject_h__
+00025 #define __ze_zobject_h__
+00026 
+00027 #include "ZE_ZEngine.h"
+00028 
+00029 namespace ZE
+00030 {
+00036 class ZObject
+00037 {
+00038         protected:
+00040                 ZEngine* rEngine;
+00041         public:
+00047                 ZObject() { rEngine = ZEngine::GetInstance(); };
+00048 
+00054                 virtual ~ZObject() {};
+00055 };
+00056 }
+00057 
+00058 #endif //__ze_zobject_h__
+

Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZObject_8h.html b/doc/html/ZE__ZObject_8h.html new file mode 100644 index 0000000..10c8aaa --- /dev/null +++ b/doc/html/ZE__ZObject_8h.html @@ -0,0 +1,32 @@ + + +ZE_ZObject.h File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_ZObject.h File Reference


Detailed Description

+
File Header:
File: Types/ZE_ZObject.h
+ Description: Header file for ZEngine core Object ZObject, base of most ZEngine objects.
+ Author(s): James Turk
+ Last Updated: 11/07/02
+
+ +

+Definition file for ZObject the Virtual Base Class for majority of the ZEngine Objects. +

+#include "ZE_ZEngine.h"
+ +

+Go to the source code of this file. + + + +

Namespaces

namespace  ZE
+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZRect_8cpp.html b/doc/html/ZE__ZRect_8cpp.html new file mode 100644 index 0000000..08a0325 --- /dev/null +++ b/doc/html/ZE__ZRect_8cpp.html @@ -0,0 +1,30 @@ + + +ZE_ZRect.cpp File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/src/ZE_ZRect.cpp File Reference


Detailed Description

+
File Header:
File: ZE_ZRect.cpp
+ Description: Implementation source file for core ZEngine Rectangle Object.
+ Author(s): James Turk
+ Last Updated: 11/08/02
+
+ +

+Implementation of ZRect, the Rectangle class for ZEngine. +

+#include "ZE_ZRect.h"
+ + + + +

Namespaces

namespace  ZE
+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZRect_8h-source.html b/doc/html/ZE__ZRect_8h-source.html new file mode 100644 index 0000000..edd3cd0 --- /dev/null +++ b/doc/html/ZE__ZRect_8h-source.html @@ -0,0 +1,90 @@ + + +/home/James/ZEngine-dev/include/ZE_ZRect.h Source File + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_ZRect.h

Go to the documentation of this file.
00001 /*******************************************************************************
+00002          This file is Part of the ZEngine Library for SDL Game Development.
+00003                       Copyright (C) 2002 ConceptOfZero.net
+00004 
+00005              Licensed under the BSD License, see licensing.txt.
+00006 
+00007     The maintainer of this library is James Turk (jturk@conceptofzero.net) 
+00008          and the home of this Library is http://www.conceptofzero.net/
+00009 *******************************************************************************/
+00010 
+00024 #ifndef __ze_zrect_h__
+00025 #define __ze_zrect_h__
+00026 
+00027 #include "ZE_ZObject.h"         //included even though ZRect isn't derived (to obtain all other needed headers)
+00028 
+00029 namespace ZE
+00030 {
+00031 
+00037 class ZRect
+00038 {
+00039         private:
+00041                 int mX;
+00043                 int mY;
+00045                 int mWidth;
+00047                 int mHeight;
+00048 
+00049         public:
+00050 
+00056                 ZRect();
+00057 
+00067                 ZRect(int x, int y, int width, int height);
+00068 
+00075                 ZRect(const ZRect &rhs);
+00076 
+00084                 const ZRect& operator=(const ZRect &rhs);
+00085 
+00094                 bool operator<(const ZRect &rhs) const;
+00095 
+00103                 void Move(int x, int y);
+00104 
+00112                 void MoveRel(int xMove, int yMove);
+00113 
+00121                 void Resize(int width, int height);
+00122 
+00130                 void ResizeRel(int widthChange, int heightChange);
+00131 
+00139                 bool Intersects(const ZRect &rect) const;
+00140 
+00149                 bool Contains(int x, int y) const;
+00150 
+00158                 bool Contains(const ZRect &rect) const;
+00159 
+00167                 ZRect Intersection(const ZRect &rect) const;
+00168 
+00175                 SDL_Rect SDLrect() const;
+00176 
+00183                 int X() const;
+00184 
+00191                 int Y() const;
+00192 
+00199                 int Left() const;
+00200 
+00207                 int Right() const;
+00208 
+00215                 int Top() const;
+00216 
+00223                 int Bottom() const;
+00224 
+00231                 int Width() const;
+00232 
+00239                 int Height() const;
+00240 };
+00241 
+00242 } //namspace ZE
+00243 
+00244 #endif //__ze_zrect_h__
+

Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZRect_8h.html b/doc/html/ZE__ZRect_8h.html new file mode 100644 index 0000000..2db4fab --- /dev/null +++ b/doc/html/ZE__ZRect_8h.html @@ -0,0 +1,32 @@ + + +ZE_ZRect.h File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_ZRect.h File Reference


Detailed Description

+
File Header:
File: ZE_ZRect.h
+ Description: Header file for core ZEngine Rectangle Object.
+ Author(s): James Turk
+ Last Updated: 11/08/02
+
+ +

+Definition file for ZRect, the Rectangle class for ZEngine. +

+#include "ZE_ZObject.h"
+ +

+Go to the source code of this file. + + + +

Namespaces

namespace  ZE
+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZSound_8cpp.html b/doc/html/ZE__ZSound_8cpp.html new file mode 100644 index 0000000..4813c83 --- /dev/null +++ b/doc/html/ZE__ZSound_8cpp.html @@ -0,0 +1,28 @@ + + +ZE_ZSound.cpp File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/src/ZE_ZSound.cpp File Reference


Detailed Description

+
File Header:
File: Types/ZE_ZSound.cpp
+ Description: Implementation source file for core ZEngine Sound Object.
+ Author(s): James Turk
+ Last Updated: 11/07/02
+
+ +

+Implementation of ZSound, the basic Sound class for ZEngine. +

+#include "ZE_ZSound.h"
+ + +
+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZSound_8h-source.html b/doc/html/ZE__ZSound_8h-source.html new file mode 100644 index 0000000..1c24441 --- /dev/null +++ b/doc/html/ZE__ZSound_8h-source.html @@ -0,0 +1,84 @@ + + +/home/James/ZEngine-dev/include/ZE_ZSound.h Source File + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_ZSound.h

Go to the documentation of this file.
00001 /*******************************************************************************
+00002          This file is Part of the ZEngine Library for SDL Game Development.
+00003                       Copyright (C) 2002 ConceptOfZero.net
+00004 
+00005              Licensed under the BSD License, see licensing.txt.
+00006 
+00007     The maintainer of this library is James Turk (jturk@conceptofzero.net) 
+00008          and the home of this Library is http://www.conceptofzero.net/
+00009 *******************************************************************************/
+00010 
+00024 #ifndef __ze_zsound_h__
+00025 #define __ze_zsound_h__
+00026 
+00027 #include "ZE_ZObject.h"
+00028 
+00029 #ifdef USE_SDL_MIXER
+00030 
+00031 namespace ZE
+00032 {
+00033 
+00039 class ZSound : public ZObject 
+00040 {
+00041         protected:
+00043                 SoundData rSound;
+00045                 int rChannelID;
+00046 
+00047         public:
+00049                 static const int LoopInfinite;
+00050 
+00052                 //Opening and Closing//
+00054 
+00060                 ZSound();
+00061 
+00068                 ZSound(string filename);
+00069 
+00075                 ~ZSound();
+00076 
+00083                 void Open(string filename);
+00084 
+00090                 void Release();
+00091 
+00093                 //Play Controls//
+00095 
+00104                 void Play(int loopNum=0, int fadeTime=0);
+00105 
+00111                 void Pause();
+00112 
+00118                 void Unpause();
+00119 
+00126                 void Stop(int fadeTime=0);
+00127 
+00134                 void SetVolume(int volume);
+00135 
+00137                 //Accessors//
+00139 
+00146                 bool IsLoaded();
+00147 
+00154                 bool IsPlaying();
+00155 
+00162                 bool IsPaused();
+00163 
+00170                 int GetVolume();
+00171 };
+00172 
+00173 
+00174 }
+00175 
+00176 #endif //USE_SDL_MIXER
+00177 
+00178 #endif //__ze_zsound_h__
+

Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZSound_8h.html b/doc/html/ZE__ZSound_8h.html new file mode 100644 index 0000000..c312b84 --- /dev/null +++ b/doc/html/ZE__ZSound_8h.html @@ -0,0 +1,32 @@ + + +ZE_ZSound.h File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_ZSound.h File Reference


Detailed Description

+
File Header:
File: Types/ZE_ZSound.h
+ Description: Header file for core ZEngine Sound Wrapper Object.
+ Author(s): James Turk
+ Last Updated: 11/07/02
+
+ +

+Definition file for ZSound, the Sound Effect wrapper for ZEngine. +

+#include "ZE_ZObject.h"
+ +

+Go to the source code of this file. + + + +

Namespaces

namespace  ZE
+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZTimer_8cpp.html b/doc/html/ZE__ZTimer_8cpp.html new file mode 100644 index 0000000..1b4056f --- /dev/null +++ b/doc/html/ZE__ZTimer_8cpp.html @@ -0,0 +1,30 @@ + + +ZE_ZTimer.cpp File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/src/ZE_ZTimer.cpp File Reference


Detailed Description

+
File Header:
File: ZE_ZTimer.cpp
+ Description: Implementation source file for core ZEngine Timer Object.
+ Author(s): James Turk
+ Last Updated: 11/08/02
+
+ +

+Implementation of ZTimer, the basic Timer class for ZEngine. +

+#include "ZE_ZTimer.h"
+ + + + +

Namespaces

namespace  ZE
+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZTimer_8h-source.html b/doc/html/ZE__ZTimer_8h-source.html new file mode 100644 index 0000000..85472bc --- /dev/null +++ b/doc/html/ZE__ZTimer_8h-source.html @@ -0,0 +1,60 @@ + + +/home/James/ZEngine-dev/include/ZE_ZTimer.h Source File + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_ZTimer.h

Go to the documentation of this file.
00001 /*******************************************************************************
+00002          This file is Part of the ZEngine Library for SDL Game Development.
+00003                       Copyright (C) 2002 ConceptOfZero.net
+00004 
+00005              Licensed under the BSD License, see licensing.txt.
+00006 
+00007     The maintainer of this library is James Turk (jturk@conceptofzero.net) 
+00008          and the home of this Library is http://www.conceptofzero.net/
+00009 *******************************************************************************/
+00010 
+00024 #ifndef __ze_ztimer_h__
+00025 #define __ze_ztimer_h__
+00026 
+00027 #include "ZE_ZObject.h"
+00028 
+00029 namespace ZE
+00030 {
+00031 
+00037 class ZTimer : public ZObject 
+00038 {
+00039         protected:
+00041                 bool rPaused;
+00043                 bool rUseZEngine;
+00045                 Uint32 rPausedTime;
+00047                 Uint32 rLastPause;
+00048 
+00055                 Uint32 GetParentTime();
+00056 
+00057         public:
+00058 
+00065                 ZTimer(bool useZEngine=true);
+00066 
+00072                 void Reset();
+00073 
+00079                 void Pause();
+00080 
+00086                 void Unpause();
+00087 
+00094                 Uint32 GetTime();
+00095 
+00102                 bool IsPaused();
+00103 };
+00104 
+00105 }
+00106 
+00107 #endif //__ze_ztimer_h__
+

Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZE__ZTimer_8h.html b/doc/html/ZE__ZTimer_8h.html new file mode 100644 index 0000000..feda7ba --- /dev/null +++ b/doc/html/ZE__ZTimer_8h.html @@ -0,0 +1,32 @@ + + +ZE_ZTimer.h File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZE_ZTimer.h File Reference


Detailed Description

+
File Header:
File: Types/ZE_ZTimer.h
+ Description: Header file for core ZEngine Timer Object.
+ Author(s): James Turk
+ Last Updated: 11/07/02
+
+ +

+Definition file for ZTimer, the Timer class for ZEngine. +

+#include "ZE_ZObject.h"
+ +

+Go to the source code of this file. + + + +

Namespaces

namespace  ZE
+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZEngine_8h-source.html b/doc/html/ZEngine_8h-source.html new file mode 100644 index 0000000..3cc0afb --- /dev/null +++ b/doc/html/ZEngine_8h-source.html @@ -0,0 +1,27 @@ + + +/home/James/ZEngine-dev/include/ZEngine.h Source File + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZEngine.h

Go to the documentation of this file.
00001 
+00043 #include "ZE_ZEngine.h"
+00044 #include "ZE_ZImage.h"
+00045 #include "ZE_ZTimer.h"
+00046 #include "ZE_ZConfigFile.h"
+00047 #include "ZE_ZRect.h"
+00048 #ifdef USE_SDL_TTF
+00049 #include "ZE_ZFont.h"
+00050 #endif
+00051 #ifdef USE_SDL_MIXER
+00052 #include "ZE_ZSound.h"
+00053 #include "ZE_ZMusic.h"
+00054 #endif
+

Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/ZEngine_8h.html b/doc/html/ZEngine_8h.html new file mode 100644 index 0000000..5bb7b41 --- /dev/null +++ b/doc/html/ZEngine_8h.html @@ -0,0 +1,37 @@ + + +ZEngine.h File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/ZEngine.h File Reference


Detailed Description

+
File Header:
File: ZEngine.h
+ Description: Public Header File for ZEngine.
+ Author(s): James Turk
+ Last Updated: 11/07/02
+
+ +

+Header file for ZEngine Game Engine from Concept of Zero, this is the file that programs that wish to utilize ZEngine should include. +

+#include "ZE_ZEngine.h"
+#include "ZE_ZImage.h"
+#include "ZE_ZTimer.h"
+#include "ZE_ZConfigFile.h"
+#include "ZE_ZRect.h"
+#include "ZE_ZFont.h"
+#include "ZE_ZSound.h"
+#include "ZE_ZMusic.h"
+ +

+Go to the source code of this file. + +
+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/annotated.html b/doc/html/annotated.html new file mode 100644 index 0000000..691175d --- /dev/null +++ b/doc/html/annotated.html @@ -0,0 +1,29 @@ + + +Annotated Index + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZEngine Compound List

Here are the classes, structs, unions and interfaces with brief descriptions: + + + + + + + + + + + + + +
ZE::FontDataClass to wrap TTF_Font pointers
ZE::ImageDataClass to wrap SDL_Surface pointers
ZE::MusicDataClass to wrap Mix_Music pointers
ZE::SoundDataClass to wrap Mix_Chunk pointers
ZE::ZConfigFileZConfigFile Class for use in ZEngine
ZE::ZEngineMain ZEngine Singleton Class
ZE::ZFontZFont class for basic Font use
ZE::ZImageZImage class for basic Image use
ZE::ZMusicZMusic class for playing full length music (eg. ogg or wav)
ZE::ZObjectZObject base class for other ZEngine objects
ZE::ZRectZEngine class for simplified rectangle use
ZE::ZSoundZSound class for playing sound effects. (WAV)
ZE::ZTimerZTimer class for Timer use
+
Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1FontData-members.html b/doc/html/classZE_1_1FontData-members.html new file mode 100644 index 0000000..ddf043b --- /dev/null +++ b/doc/html/classZE_1_1FontData-members.html @@ -0,0 +1,18 @@ + + +Member List + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::FontData Member List

This is the complete list of members for ZE::FontData, including all inherited members. + + + +
filenameZE::FontData
fontZE::FontData
FontData()ZE::FontData [inline]

Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1FontData.html b/doc/html/classZE_1_1FontData.html new file mode 100644 index 0000000..42c48f4 --- /dev/null +++ b/doc/html/classZE_1_1FontData.html @@ -0,0 +1,63 @@ + + +ZE::FontData class Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::FontData Class Reference

#include <ZE_DataPtr.h> +

+List of all members.


Detailed Description

+Class used to keep track of loaded data and associate a TTF_Font with an index number and filename. +

+ + + + + + + + + + +

Public Methods

 FontData ()
 Initialize FontData.


Public Attributes

+TTF_Font * font
 Pointer to SDL_TTF font data.

+string filename
 File font was loaded from.

+


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + +
ZE::FontData::FontData   [inline]
+
+ + + + + +
+   + + +

+Sets font pointer to NULL

+


The documentation for this class was generated from the following file: +
Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1ImageData-members.html b/doc/html/classZE_1_1ImageData-members.html new file mode 100644 index 0000000..2f2be83 --- /dev/null +++ b/doc/html/classZE_1_1ImageData-members.html @@ -0,0 +1,18 @@ + + +Member List + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::ImageData Member List

This is the complete list of members for ZE::ImageData, including all inherited members. + + + +
filenameZE::ImageData
imageZE::ImageData
ImageData()ZE::ImageData [inline]

Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1ImageData.html b/doc/html/classZE_1_1ImageData.html new file mode 100644 index 0000000..116f861 --- /dev/null +++ b/doc/html/classZE_1_1ImageData.html @@ -0,0 +1,63 @@ + + +ZE::ImageData class Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::ImageData Class Reference

#include <ZE_DataPtr.h> +

+List of all members.


Detailed Description

+Class used to keep track of loaded data and associate an SDL_Surface with an index number and filename. +

+ + + + + + + + + + +

Public Methods

 ImageData ()
 Initialize ImageData.


Public Attributes

+SDL_Surface * image
 Pointer to SDL_Surface.

+string filename
 File image was loaded from.

+


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + +
ZE::ImageData::ImageData   [inline]
+
+ + + + + +
+   + + +

+Sets image pointer to NULL

+


The documentation for this class was generated from the following file: +
Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1MusicData-members.html b/doc/html/classZE_1_1MusicData-members.html new file mode 100644 index 0000000..dc3d551 --- /dev/null +++ b/doc/html/classZE_1_1MusicData-members.html @@ -0,0 +1,18 @@ + + +Member List + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::MusicData Member List

This is the complete list of members for ZE::MusicData, including all inherited members. + + + +
filenameZE::MusicData
musicZE::MusicData
MusicData()ZE::MusicData [inline]

Generated on Wed Nov 20 01:18:06 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1MusicData.html b/doc/html/classZE_1_1MusicData.html new file mode 100644 index 0000000..36739da --- /dev/null +++ b/doc/html/classZE_1_1MusicData.html @@ -0,0 +1,63 @@ + + +ZE::MusicData class Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::MusicData Class Reference

#include <ZE_DataPtr.h> +

+List of all members.


Detailed Description

+Class used to keep track of loaded data and associate a Mix_Music with an index number and filename. +

+ + + + + + + + + + +

Public Methods

 MusicData ()
 Initialize MusicData.


Public Attributes

+Mix_Music * music
 Pointer to SDL_Mixer music data.

+string filename
 File music was loaded from.

+


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + +
ZE::MusicData::MusicData   [inline]
+
+ + + + + +
+   + + +

+Sets music pointer to NULL

+


The documentation for this class was generated from the following file: +
Generated on Wed Nov 20 01:18:06 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1SoundData-members.html b/doc/html/classZE_1_1SoundData-members.html new file mode 100644 index 0000000..c671b86 --- /dev/null +++ b/doc/html/classZE_1_1SoundData-members.html @@ -0,0 +1,18 @@ + + +Member List + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::SoundData Member List

This is the complete list of members for ZE::SoundData, including all inherited members. + + + +
filenameZE::SoundData
soundZE::SoundData
SoundData()ZE::SoundData [inline]

Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1SoundData.html b/doc/html/classZE_1_1SoundData.html new file mode 100644 index 0000000..f389970 --- /dev/null +++ b/doc/html/classZE_1_1SoundData.html @@ -0,0 +1,63 @@ + + +ZE::SoundData class Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::SoundData Class Reference

#include <ZE_DataPtr.h> +

+List of all members.


Detailed Description

+Class used to keep track of loaded data and associate a Mix_Chunk with an index number and filename. +

+ + + + + + + + + + +

Public Methods

 SoundData ()
 Initialize SoundData.


Public Attributes

+Mix_Chunk * sound
 Pointer to SDL_Mixer sound effect data.

+string filename
 File sound effect was loaded from.

+


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + +
ZE::SoundData::SoundData   [inline]
+
+ + + + + +
+   + + +

+Sets sound pointer to NULL

+


The documentation for this class was generated from the following file: +
Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1ZConfigFile-members.html b/doc/html/classZE_1_1ZConfigFile-members.html new file mode 100644 index 0000000..c8cdf03 --- /dev/null +++ b/doc/html/classZE_1_1ZConfigFile-members.html @@ -0,0 +1,37 @@ + + +Member List + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::ZConfigFile Member List

This is the complete list of members for ZE::ZConfigFile, including all inherited members. + + + + + + + + + + + + + + + + + + + + + + +
CleanString(string str)ZE::ZConfigFile [private]
Close()ZE::ZConfigFile
Exists(string sec) (defined in ZE::ZConfigFile)ZE::ZConfigFile [private]
Exists(string sec, string var) (defined in ZE::ZConfigFile)ZE::ZConfigFile [private]
Flush()ZE::ZConfigFile
GetBool(string section, string var, bool defVal)ZE::ZConfigFile
GetInt(string section, string var, int defVal)ZE::ZConfigFile
GetString(string section, string var, string defVal)ZE::ZConfigFile
GetVariable(string sec, string var, string defVal) (defined in ZE::ZConfigFile)ZE::ZConfigFile [private]
mFileLayoutZE::ZConfigFile [private]
mFilenameZE::ZConfigFile [private]
Process(string filename)ZE::ZConfigFile
rEngineZE::ZObject [protected]
SetBool(string section, string var, bool val)ZE::ZConfigFile
SetInt(string section, string var, int val)ZE::ZConfigFile
SetString(string section, string var, string val)ZE::ZConfigFile
SetVariable(string sec, string var, string val) (defined in ZE::ZConfigFile)ZE::ZConfigFile [private]
ZConfigFile()ZE::ZConfigFile
ZConfigFile(string filename)ZE::ZConfigFile
ZObject()ZE::ZObject [inline]
~ZConfigFile()ZE::ZConfigFile
~ZObject()ZE::ZObject [inline, virtual]

Generated on Wed Nov 20 01:18:06 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1ZConfigFile.html b/doc/html/classZE_1_1ZConfigFile.html new file mode 100644 index 0000000..427e10a --- /dev/null +++ b/doc/html/classZE_1_1ZConfigFile.html @@ -0,0 +1,595 @@ + + +ZE::ZConfigFile class Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::ZConfigFile Class Reference

#include <ZE_ZConfigFile.h> +

+Inherits ZE::ZObject. +

+List of all members.


Detailed Description

+ZConfigFile class for INI-style configuration files for games or applications. Inherited from ZObject. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

 ZConfigFile ()
 Default constructor.

 ZConfigFile (string filename)
 Constructor which takes filename.

 ~ZConfigFile ()
 Destructor, flushes file.

void Process (string filename)
 Parse a file.

int GetInt (string section, string var, int defVal)
 Get value in integer format from file.

bool GetBool (string section, string var, bool defVal)
 Get value in boolean format from file.

string GetString (string section, string var, string defVal)
 Get value in string format from file.

void SetInt (string section, string var, int val)
 Set value in integer format in file.

void SetBool (string section, string var, bool val)
 Set value in boolean format in file.

void SetString (string section, string var, string val)
 Set value in string format in file.

void Flush ()
 Write all values to file.

void Close ()
 Close the file.


Private Methods

string CleanString (string str)
 Reformat a string in a form more suitable to parsing.

+bool Exists (string sec)
+bool Exists (string sec, string var)
+void SetVariable (string sec, string var, string val)
+string GetVariable (string sec, string var, string defVal)

Private Attributes

+list< ZCF_Section > mFileLayout
 List of sections of internal type.

+string mFilename
 Filename of file currently open.

+


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + +
ZE::ZConfigFile::ZConfigFile  
+
+ + + + + +
+   + + +

+A no-op default constructor.

+

+ + + + +
+ + + + + + + + + + +
ZE::ZConfigFile::ZConfigFile string   filename
+
+ + + + + +
+   + + +

+Constructor takes filename, and calls process on it.

Parameters:
+ + +
filename File to load as ZConfigFile.
+
+
+

+ + + + +
+ + + + + + + + + +
ZE::ZConfigFile::~ZConfigFile  
+
+ + + + + +
+   + + +

+Flushes the file, ensures a flush if the file is left open.

+


Member Function Documentation

+

+ + + + +
+ + + + + + + + + + +
string ZE::ZConfigFile::CleanString string   str [private]
+
+ + + + + +
+   + + +

+Removes whitespace from a string and makes all characters lowercase.

Parameters:
+ + +
str The string to get a clean version of.
+
+
Returns:
Cleaned string.
+
+

+ + + + +
+ + + + + + + + + + +
void ZE::ZConfigFile::Process string   filename
+
+ + + + + +
+   + + +

+Parses the file, reading the contents into the fileLayout map.

Parameters:
+ + +
filename File to parse and attach this ZDataFile to.
+
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
int ZE::ZConfigFile::GetInt string   section,
string   var,
int   defVal
+
+ + + + + +
+   + + +

+Get the current value of a variable in the file, or defVal if not found in file.

Parameters:
+ + + + +
section Name of section to seek variable under.
var Name of variable to seek value for.
defVal Value to return if var does not exist within section.
+
+
Returns:
Contents of the variable in integer format.
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
bool ZE::ZConfigFile::GetBool string   section,
string   var,
bool   defVal
+
+ + + + + +
+   + + +

+Get the current value of a variable in the file, or defVal if not found in file. (Valid values are "0","1","true" and "false")

Parameters:
+ + + + +
section Name of section to seek variable under.
var Name of variable to seek value for.
defVal Value to return if var does not exist within section.
+
+
Returns:
Contents of the variable in boolean format.
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
string ZE::ZConfigFile::GetString string   section,
string   var,
string   defVal
+
+ + + + + +
+   + + +

+Get the current value of a variable in the file, or defVal if not found in file.

Parameters:
+ + + + +
section Name of section to seek variable under.
var Name of variable to seek value for.
defVal Value to return if var does not exist within section.
+
+
Returns:
Contents of the variable in string format.
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
void ZE::ZConfigFile::SetInt string   section,
string   var,
int   val
+
+ + + + + +
+   + + +

+Set the new value of a variable in the file to val, creating the section and variable if not already found in file.

Parameters:
+ + + + +
section Name of section to edit variable under.
var Name of variable to set value for.
val Integer value to set variable to in file.
+
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
void ZE::ZConfigFile::SetBool string   section,
string   var,
bool   val
+
+ + + + + +
+   + + +

+Set the new value of a variable in the file to val, creating the section and variable if not already found in file.

Parameters:
+ + + + +
section Name of section to edit variable under.
var Name of variable to set value for.
val Boolean value to set variable to in file.
+
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
void ZE::ZConfigFile::SetString string   section,
string   var,
string   val
+
+ + + + + +
+   + + +

+Set the new value of a variable in the file to val, creating the section and variable if not already found in file.

Parameters:
+ + + + +
section Name of section to edit variable under.
var Name of variable to set value for.
val String value to set variable to in file.
+
+
+

+ + + + +
+ + + + + + + + + +
void ZE::ZConfigFile::Flush  
+
+ + + + + +
+   + + +

+Writes all values and sections to file.

+

+ + + + +
+ + + + + + + + + +
void ZE::ZConfigFile::Close  
+
+ + + + + +
+   + + +

+Flush the file and clear the filename.

+


The documentation for this class was generated from the following files: +
Generated on Wed Nov 20 01:18:06 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1ZEngine-members.html b/doc/html/classZE_1_1ZEngine-members.html new file mode 100644 index 0000000..3462ac3 --- /dev/null +++ b/doc/html/classZE_1_1ZEngine-members.html @@ -0,0 +1,77 @@ + + +Member List + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::ZEngine Member List

This is the complete list of members for ZE::ZEngine, including all inherited members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CheckEvents()ZE::ZEngine
Clear(Uint32 color=0, SDL_Rect *rect=NULL)ZE::ZEngine
CloseWindow()ZE::ZEngine
CreateWindow(string title, string icon="")ZE::ZEngine
FreeFont(FontData &font)ZE::ZEngine
FreeImage(ImageData &image)ZE::ZEngine
FreeMusic(MusicData &music)ZE::ZEngine
FreeSound(SoundData &sound)ZE::ZEngine
GetBPP()ZE::ZEngine
GetDisplay()ZE::ZEngine
GetFrameTime()ZE::ZEngine
GetHeight()ZE::ZEngine
GetInstance()ZE::ZEngine [static]
GetMouseX()ZE::ZEngine
GetMouseY()ZE::ZEngine
GetTime()ZE::ZEngine
GetVersion()ZE::ZEngine [static]
GetWidth()ZE::ZEngine
HideCursor()ZE::ZEngine
IsActive()ZE::ZEngine
IsFullscreen()ZE::ZEngine
IsPaused()ZE::ZEngine
KeyIsPressed(SDLKey key)ZE::ZEngine
LButtonPressed()ZE::ZEngine
LoadFont(string filename, int size)ZE::ZEngine
LoadImage(string filename)ZE::ZEngine
LoadMusic(string filename)ZE::ZEngine
LoadSound(string filename)ZE::ZEngine
mActiveZE::ZEngine [private]
MapColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a=255)ZE::ZEngine
mBPPZE::ZEngine [private]
mFullscreenZE::ZEngine [private]
mHeightZE::ZEngine [private]
mKeyPressedZE::ZEngine [private]
mLastPauseZE::ZEngine [private]
mLastTimeZE::ZEngine [private]
mMouseBZE::ZEngine [private]
mMouseXZE::ZEngine [private]
mMouseYZE::ZEngine [private]
MouseInRect(SDL_Rect *rect)ZE::ZEngine
mPausedZE::ZEngine [private]
mPausedTimeZE::ZEngine [private]
mQuitZE::ZEngine [private]
mRateZE::ZEngine [private]
mScreenZE::ZEngine [private]
mSecPerFrameZE::ZEngine [private]
mStereoZE::ZEngine [private]
mUnpauseOnActiveZE::ZEngine [private]
mWidthZE::ZEngine [private]
PauseTimer()ZE::ZEngine
QuitRequested()ZE::ZEngine
RButtonPressed()ZE::ZEngine
ReleaseInstance()ZE::ZEngine [static]
RequestQuit()ZE::ZEngine
SetupDisplay(int width, int height, int bpp, bool fullscreen)ZE::ZEngine
SetupSound(int rate, bool stereo)ZE::ZEngine
ShowCursor()ZE::ZEngine
sInstanceZE::ZEngine [private, static]
Sleep(Uint32 milliseconds)ZE::ZEngine
UnpauseTimer()ZE::ZEngine
UpdateScreen()ZE::ZEngine
ZEngine()ZE::ZEngine [private]

Generated on Wed Nov 20 01:18:06 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1ZEngine.html b/doc/html/classZE_1_1ZEngine.html new file mode 100644 index 0000000..c6de3cf --- /dev/null +++ b/doc/html/classZE_1_1ZEngine.html @@ -0,0 +1,1566 @@ + + +ZE::ZEngine class Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::ZEngine Class Reference

#include <ZE_ZEngine.h> +

+List of all members.


Detailed Description

+ZEngine Singleton Class, accessible from anywhere in a ZEngine-based program by nature. Controls core elements of program and does majority of SDL wrapping. Also keeps track of loaded data and helps programs avoid memory leaks and dangling pointers. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

void SetupDisplay (int width, int height, int bpp, bool fullscreen)
 Setup Display for SDL.

void SetupSound (int rate, bool stereo)
 Initialize Sound for SDL.

void CreateWindow (string title, string icon="")
 Create Window with predefined settings.

void CloseWindow ()
 Quit SDL and any Subsystems.

SDL_Surface * GetDisplay ()
 Allow access to Screen Surface.

void UpdateScreen ()
 Update screen contents.

Uint32 MapColor (Uint8 r, Uint8 g, Uint8 b, Uint8 a=255)
 Create Color in SDL Uint32 Format.

void Clear (Uint32 color=0, SDL_Rect *rect=NULL)
 Clear screen or portion of screen to a color.

void Sleep (Uint32 milliseconds)
 Sleep for a certain amount of time.

Uint32 GetTime ()
 Get Global ZEngine time.

void PauseTimer ()
 Pause ZEngine.

void UnpauseTimer ()
 Unpause ZEngine.

double GetFrameTime ()
 Get Seconds Per Frame.

bool IsPaused ()
 Check Engine Paused State.

bool IsActive ()
 Find out if application is active.

void RequestQuit ()
 Request A Quit.

bool QuitRequested ()
 Find out if user has requested to quit.

bool KeyIsPressed (SDLKey key)
 Find the state of a key.

void HideCursor ()
 Hide mouse cursor.

void ShowCursor ()
 Show mouse cursor.

int GetMouseX ()
 Get X Position of Mouse.

int GetMouseY ()
 Get Y Position of Mouse.

bool LButtonPressed ()
 Get Status of Left Button.

bool RButtonPressed ()
 Get Status of Right Button.

bool MouseInRect (SDL_Rect *rect)
 Check if mouse is in given rectangle.

void CheckEvents ()
 Check for Activation, Window Manager, and Quit Events.

ImageData LoadImage (string filename)
 Load an Image.

void FreeImage (ImageData &image)
 Free an Image.

SoundData LoadSound (string filename)
 Load a Sound.

void FreeSound (SoundData &sound)
 Free a Sound.

MusicData LoadMusic (string filename)
 Load a Music File.

void FreeMusic (MusicData &music)
 Free a Music Sample.

FontData LoadFont (string filename, int size)
 Load a Font.

void FreeFont (FontData &font)
 Free a Font.

int GetWidth ()
 Get Current Display Width.

int GetHeight ()
 Get Current Display Height.

int GetBPP ()
 Get Current Display BPP.

bool IsFullscreen ()
 Get Fullscreen setting.


Static Public Methods

ZEngine * GetInstance ()
 Get Instance.

void ReleaseInstance ()
 Release Instance.

string GetVersion ()
 Get Current Version.


Private Methods

 ZEngine ()
 Constructor for ZEngine.


Private Attributes

+int mWidth
 Width of Display.

+int mHeight
 Height of Display.

+int mBPP
 BPP Setting of Display.

+bool mFullscreen
 Fullscreen setting of Display.

+int mRate
 Sound Bitrate.

+bool mStereo
 Stereo setting of Sound Subsystem.

+SDL_Surface * mScreen
 Pointer to Display.

+bool mPaused
 Keep track of paused state of game.

+bool mUnpauseOnActive
 Keep track of if ZEngine should unpause on active event.

+Uint32 mLastPause
 Keep track of time game was last paused.

+Uint32 mPausedTime
 Keep track of total globally paused time.

+Uint32 mLastTime
 Keep track of last screen update time.

+double mSecPerFrame
 Seconds per frame.

+bool mActive
 bool describing Active or Inactive State of Game

+bool mQuit
 bool for checking if a Quit event has been detected

+Uint8 * mKeyPressed
 Pointer to array of Keys.

+int mMouseX
 X Position of Mouse.

+int mMouseY
 Y Position of Mouse.

+Uint8 mMouseB
 Mouse Button Information.


Static Private Attributes

+ZEngine * sInstance = NULL
 Static Pointer to Instance of ZEngine for Singleton.

+


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + +
ZE::ZEngine::ZEngine   [private]
+
+ + + + + +
+   + + +

+Initialize ZEngine values to defaults. (Private so that only one instance may be created.)

+


Member Function Documentation

+

+ + + + +
+ + + + + + + + + +
ZEngine * ZE::ZEngine::GetInstance   [static]
+
+ + + + + +
+   + + +

+Static function, returns pointer to instance of ZEngine, creating an instance if none exist.

Returns:
Instance to the ZEngine.
+
+

+ + + + +
+ + + + + + + + + +
void ZE::ZEngine::ReleaseInstance   [static]
+
+ + + + + +
+   + + +

+Release memory held by instance of engine and closes window.

+

+ + + + +
+ + + + + + + + + +
string ZE::ZEngine::GetVersion   [static]
+
+ + + + + +
+   + + +

+Get Version Number of ZEngine. (Major.Minor.Extension#)

Returns:
string containing version number
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void ZE::ZEngine::SetupDisplay int   width,
int   height,
int   bpp,
bool   fullscreen
+
+ + + + + +
+   + + +

+Sets display parameters to specified parameters. (called before CreateDisplay) +

+

Parameters:
+ + + + + +
width Desired width of screen or window.
height Desired height of screen or window.
bpp Desired BPP for screen (only works in fullscreen).
fullscreen A bool for fullscreen setting.
+
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void ZE::ZEngine::SetupSound int   rate,
bool   stereo
+
+ + + + + +
+   + + +

+Set sound settings to specified parameters. (called before CreateDisplay) +

+

Parameters:
+ + + +
rate Desired sound bitrate.
stereo A bool for stereo setting.
+
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void ZE::ZEngine::CreateWindow string   title,
string   icon = ""
+
+ + + + + +
+   + + +

+SetupDisplay and SetupSound should be called prior to this to change settings, settings from those do not go into effect until this function is called. Specify no icon file to use default OS icon. +

+

Parameters:
+ + + +
title Window Title.
icon Path to Icon File.
+
+
+

+ + + + +
+ + + + + + + + + +
void ZE::ZEngine::CloseWindow  
+
+ + + + + +
+   + + +

+Shut down SDL (and SDL_ttf,SDL_mixer if necessary).

+

+ + + + +
+ + + + + + + + + +
SDL_Surface * ZE::ZEngine::GetDisplay  
+
+ + + + + +
+   + + +

+Get pointer to screen SDL_Surface, allowing direct screen manipulation using SDL.

Returns:
Pointer to Display Surface.
+
+

+ + + + +
+ + + + + + + + + +
void ZE::ZEngine::UpdateScreen  
+
+ + + + + +
+   + + +

+Flip double buffer in SDL if double buffered, otherwise tell video to refresh entire screen.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Uint32 ZE::ZEngine::MapColor Uint8   r,
Uint8   g,
Uint8   b,
Uint8   a = 255
+
+ + + + + +
+   + + +

+Turn RGBA values into SDL Uint32 color. (Alpha value will be ignored if not in use) +

+

Parameters:
+ + + + + +
r Red component of color (0-255).
g Green component of color (0-255).
b Blue component of color (0-255).
a Alpha (translucency) component of color (0-255). [Default 255]
+
+
Returns:
Uint32 of color requested.
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void ZE::ZEngine::Clear Uint32   color = 0,
SDL_Rect *   rect = NULL
+
+ + + + + +
+   + + +

+Clears a rectangle on screen to a color.

Parameters:
+ + + +
color Color to clear surface to, defaults to black.
rect Rectangle of screen to clear or NULL for entire surface.
+
+
+

+ + + + +
+ + + + + + + + + + +
void ZE::ZEngine::Sleep Uint32   milliseconds
+
+ + + + + +
+   + + +

+Freeze everything for given number of milliseconds.

Parameters:
+ + +
milliseconds Number of milliseconds to freeze.
+
+
+

+ + + + +
+ + + + + + + + + +
Uint32 ZE::ZEngine::GetTime  
+
+ + + + + +
+   + + +

+Get active time since ZEngine initialization in milliseconds, paused time doesn't count.

Returns:
Number of active milliseconds since initialization.
+
+

+ + + + +
+ + + + + + + + + +
void ZE::ZEngine::PauseTimer  
+
+ + + + + +
+   + + +

+Pause ZEngine timer and all ZTimer objects that rely on ZEngine.

+

+ + + + +
+ + + + + + + + + +
void ZE::ZEngine::UnpauseTimer  
+
+ + + + + +
+   + + +

+Unpause ZEngine timer and all ZTimer objects that rely on ZEngine.

+

+ + + + +
+ + + + + + + + + +
double ZE::ZEngine::GetFrameTime  
+
+ + + + + +
+   + + +

+Get double that describes the time passed between screen updates. (used for Framerate Independant Movement)

Returns:
Time between screen updates.
+
+

+ + + + +
+ + + + + + + + + +
bool ZE::ZEngine::IsPaused  
+
+ + + + + +
+   + + +

+Find out if engine timer is paused.

Returns:
Paused State of engine.
+
+

+ + + + +
+ + + + + + + + + +
bool ZE::ZEngine::IsActive  
+
+ + + + + +
+   + + +

+Function to find out if application currently has focus.

Returns:
bool telling active/inactive state of application.
+
+

+ + + + +
+ + + + + + + + + +
void ZE::ZEngine::RequestQuit  
+
+ + + + + +
+   + + +

+Tell the engine that it should behave as if a Quit was requested, does not call any shutdown functions.

+

+ + + + +
+ + + + + + + + + +
bool ZE::ZEngine::QuitRequested  
+
+ + + + + +
+   + + +

+Function to find out if user or operating system has requested program cease execution, can be set by Alt-F4, SDL_Quit event or ZEngine::RequestQuit().

Returns:
bool telling if quit has been requested.
+
+

+ + + + +
+ + + + + + + + + + +
bool ZE::ZEngine::KeyIsPressed SDLKey   key
+
+ + + + + +
+   + + +

+Function returns true/false based on if key is pressed or not.

Parameters:
+ + +
key code of key to find status of.
+
+
Returns:
bool state of requested key.
+
+

+ + + + +
+ + + + + + + + + +
void ZE::ZEngine::HideCursor  
+
+ + + + + +
+   + + +

+Hide the system mouse cursor.

+

+ + + + +
+ + + + + + + + + +
void ZE::ZEngine::ShowCursor  
+
+ + + + + +
+   + + +

+Show the system mouse cursor.

+

+ + + + +
+ + + + + + + + + +
int ZE::ZEngine::GetMouseX  
+
+ + + + + +
+   + + +

+Find X Position of Mouse on screen.

Returns:
X Position of Mouse.
+
+

+ + + + +
+ + + + + + + + + +
int ZE::ZEngine::GetMouseY  
+
+ + + + + +
+   + + +

+Find Y Position of Mouse on screen.

Returns:
Y Position of Mouse.
+
+

+ + + + +
+ + + + + + + + + +
bool ZE::ZEngine::LButtonPressed  
+
+ + + + + +
+   + + +

+Get pressed status of left button of mouse.

Returns:
true if left button is pressed, false otherwise.
+
+

+ + + + +
+ + + + + + + + + +
bool ZE::ZEngine::RButtonPressed  
+
+ + + + + +
+   + + +

+Get pressed status of right button of mouse.

Returns:
true if right button is pressed, false otherwise.
+
+

+ + + + +
+ + + + + + + + + + +
bool ZE::ZEngine::MouseInRect SDL_Rect *   rect
+
+ + + + + +
+   + + +

+Return status of mouse in current rectangle (used for buttons)

Parameters:
+ + +
rect Rectangle to check if mouse is in.
+
+
Returns:
true if mouse is in rectangle, false otherwise
+
+

+ + + + +
+ + + + + + + + + +
void ZE::ZEngine::CheckEvents  
+
+ + + + + +
+   + + +

+Cycle through event queue, processing events, updating all Event Related variables, should be called once per frame.

+

+ + + + +
+ + + + + + + + + + +
ImageData ZE::ZEngine::LoadImage string   filename
+
+ + + + + +
+   + + +

+Loads an Image to an ImageData class which keeps vital information on the Image.

Parameters:
+ + +
filename path to file to load.
+
+
Returns:
A ImageData class containing filename and pointer to data.
+
+

+ + + + +
+ + + + + + + + + + +
void ZE::ZEngine::FreeImage ImageData  image
+
+ + + + + +
+   + + +

+Free memory of an Image in an ImageData class.

Parameters:
+ + +
image ImageData structure of image to free.
+
+
+

+ + + + +
+ + + + + + + + + + +
SoundData ZE::ZEngine::LoadSound string   filename
+
+ + + + + +
+   + + +

+Loads a Sound to a SoundData class which keeps vital information on the Sound

Parameters:
+ + +
filename path to file to load.
+
+
Returns:
A SoundData class containing filename and pointer to data.
+
+

+ + + + +
+ + + + + + + + + + +
void ZE::ZEngine::FreeSound SoundData  sound
+
+ + + + + +
+   + + +

+Free memory of a Sound in a SoundData class.

Parameters:
+ + +
sound SoundData structure of sound to free.
+
+
+

+ + + + +
+ + + + + + + + + + +
MusicData ZE::ZEngine::LoadMusic string   filename
+
+ + + + + +
+   + + +

+Loads a Music Clip to a MusicData class which keeps vital information on the Music Data

Parameters:
+ + +
filename path to file to load.
+
+
Returns:
A MusicData class containing filename and pointer to data.
+
+

+ + + + +
+ + + + + + + + + + +
void ZE::ZEngine::FreeMusic MusicData  music
+
+ + + + + +
+   + + +

+Free memory of Music in a MusicData class.

Parameters:
+ + +
music MusicData structure of music to free.
+
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
FontData ZE::ZEngine::LoadFont string   filename,
int   size
+
+ + + + + +
+   + + +

+Loads a Font to a FontData class which keeps vital information on the Font

Parameters:
+ + + +
filename path to file to load.
size point size of font
+
+
Returns:
A FontData class containing filename and pointer to data.
+
+

+ + + + +
+ + + + + + + + + + +
void ZE::ZEngine::FreeFont FontData  font
+
+ + + + + +
+   + + +

+Free memory of a Font in a FontData class.

Parameters:
+ + +
font FontData structure of font to free.
+
+
+

+ + + + +
+ + + + + + + + + +
int ZE::ZEngine::GetWidth  
+
+ + + + + +
+   + + +

+Get Width of Window or Fullscreen mode.

Returns:
Width of Display.
+
+

+ + + + +
+ + + + + + + + + +
int ZE::ZEngine::GetHeight  
+
+ + + + + +
+   + + +

+Get Height of Window or Fullscreen mode.

Returns:
Height of Display.
+
+

+ + + + +
+ + + + + + + + + +
int ZE::ZEngine::GetBPP  
+
+ + + + + +
+   + + +

+Get BPP of Window or Fullscreen mode.

Returns:
BPP of Display.
+
+

+ + + + +
+ + + + + + + + + +
bool ZE::ZEngine::IsFullscreen  
+
+ + + + + +
+   + + +

+Get Fullscreen setting of Display.

Returns:
True if Fullscreen, False if Windowed
+
+


The documentation for this class was generated from the following files: +
Generated on Wed Nov 20 01:18:06 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1ZFont-members.html b/doc/html/classZE_1_1ZFont-members.html new file mode 100644 index 0000000..b45e5f0 --- /dev/null +++ b/doc/html/classZE_1_1ZFont-members.html @@ -0,0 +1,40 @@ + + +Member List + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::ZFont Member List

This is the complete list of members for ZE::ZFont, including all inherited members. + + + + + + + + + + + + + + + + + + + + + + + + + +
DrawShadedText(string text, ZImage &image)ZE::ZFont
DrawText(string text, ZImage &image)ZE::ZFont
GetHeight()ZE::ZFont
GetLineSkip()ZE::ZFont
GetStringHeight(string text)ZE::ZFont
GetStringWidth(string text)ZE::ZFont
IsBold()ZE::ZFont
IsItalic()ZE::ZFont
IsLoaded()ZE::ZFont
IsUnderlined()ZE::ZFont
Open(string filename, int size)ZE::ZFont
rBGColorZE::ZFont [protected]
rColorZE::ZFont [protected]
Release()ZE::ZFont
rEngineZE::ZObject [protected]
Resize(int size)ZE::ZFont
rFontZE::ZFont [protected]
SetBGColor(Uint8 r, Uint8 g, Uint8 b)ZE::ZFont
SetColor(Uint8 r, Uint8 g, Uint8 b)ZE::ZFont
SetStyle(bool bold, bool italic, bool underline)ZE::ZFont
ZFont()ZE::ZFont
ZFont(string filename, int size)ZE::ZFont
ZObject()ZE::ZObject [inline]
~ZFont()ZE::ZFont
~ZObject()ZE::ZObject [inline, virtual]

Generated on Wed Nov 20 01:18:06 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1ZFont.html b/doc/html/classZE_1_1ZFont.html new file mode 100644 index 0000000..083fab0 --- /dev/null +++ b/doc/html/classZE_1_1ZFont.html @@ -0,0 +1,768 @@ + + +ZE::ZFont class Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::ZFont Class Reference

#include <ZE_ZFont.h> +

+Inherits ZE::ZObject. +

+List of all members.


Detailed Description

+ZFont font container class, class wraps common features of SDL_TTF. Inherited from ZObject. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

 ZFont ()
 Default Constructor.

 ZFont (string filename, int size)
 Constructor that opens a font with a certain size.

 ~ZFont ()
 Destructor, frees memory.

void Open (string filename, int size)
 Opens a font with a certain size.

void Release ()
 Release font.

void DrawText (string text, ZImage &image)
 Draws a string in a color to a ZImage.

void DrawShadedText (string text, ZImage &image)
 Draws a string with a colored background to a ZImage.

void SetColor (Uint8 r, Uint8 g, Uint8 b)
 Set Text rColor.

void SetBGColor (Uint8 r, Uint8 g, Uint8 b)
 Set Background rColor.

void SetStyle (bool bold, bool italic, bool underline)
 Set display format.

void Resize (int size)
 Resize Font.

bool IsLoaded ()
 Check if file is loaded.

bool IsBold ()
 Get Bold Setting.

bool IsItalic ()
 Get Italic Setting.

bool IsUnderlined ()
 Get Underlined Setting.

int GetHeight ()
 Get Height of Font.

int GetLineSkip ()
 Get Line Skip for Font.

int GetStringWidth (string text)
 Get String Width.

int GetStringHeight (string text)
 Get String Height.


Protected Attributes

+FontData rFont
 Class containing font and filename.

+SDL_Color rColor
 SDL_Color for current text color.

+SDL_Color rBGColor
 SDL_Color for background color to be used in shaded draws.

+


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + +
ZE::ZFont::ZFont  
+
+ + + + + +
+   + + +

+Default Constructor, does nothing.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
ZE::ZFont::ZFont string   filename,
int   size
+
+ + + + + +
+   + + +

+Constructor simply calls ZFont::Open() with same parameters.

Parameters:
+ + + +
filename Font to open.
size Size to use for font.
+
+
+

+ + + + +
+ + + + + + + + + +
ZE::ZFont::~ZFont  
+
+ + + + + +
+   + + +

+Destructor calls ZFont::Release().

+


Member Function Documentation

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void ZE::ZFont::Open string   filename,
int   size
+
+ + + + + +
+   + + +

+Opens a font given a filename and a point size.

Parameters:
+ + + +
filename Font to open.
size Size to use for font.
+
+
+

+ + + + +
+ + + + + + + + + +
void ZE::ZFont::Release  
+
+ + + + + +
+   + + +

+Release memory held by font.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void ZE::ZFont::DrawText string   text,
ZImage  image
+
+ + + + + +
+   + + +

+Draw to a surface in specified color and associate that surface with a ZImage.

Parameters:
+ + + +
text String to write.
image ZImage to draw to.
+
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void ZE::ZFont::DrawShadedText string   text,
ZImage  image
+
+ + + + + +
+   + + +

+Draw to a surface a string with a background of rBGColor and lettering in the normal color and associate that surface with a ZImage.

Parameters:
+ + + +
text String to write.
image ZImage to draw to.
+
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
void ZE::ZFont::SetColor Uint8   r,
Uint8   g,
Uint8   b
+
+ + + + + +
+   + + +

+Set rColor of Text Output.

Parameters:
+ + + + +
r Red component of color (0-255).
g Green component of color (0-255).
b Blue component of color (0-255).
+
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
void ZE::ZFont::SetBGColor Uint8   r,
Uint8   g,
Uint8   b
+
+ + + + + +
+   + + +

+Set rColor of Background for Shaded Draw.

Parameters:
+ + + + +
r Red component of color (0-255).
g Green component of color (0-255).
b Blue component of color (0-255).
+
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
void ZE::ZFont::SetStyle bool   bold,
bool   italic,
bool   underline
+
+ + + + + +
+   + + +

+Set display format (bold, italic, underline).

Parameters:
+ + + + +
bold Decides bold setting of font.
italic Decides italic setting of font.
underline Decides underline setting of font.
+
+
+

+ + + + +
+ + + + + + + + + + +
void ZE::ZFont::Resize int   size
+
+ + + + + +
+   + + +

+Release and Reopen font in new size.

Parameters:
+ + +
size New size for font.
+
+
+

+ + + + +
+ + + + + + + + + +
bool ZE::ZFont::IsLoaded  
+
+ + + + + +
+   + + +

+Check if file is loaded and pointer to data is non-NULL.

Returns:
Loaded or Unloaded state of data.
+
+

+ + + + +
+ + + + + + + + + +
bool ZE::ZFont::IsBold  
+
+ + + + + +
+   + + +

+Check if font output is currently bold.

Returns:
True or False state of bold.
+
+

+ + + + +
+ + + + + + + + + +
bool ZE::ZFont::IsItalic  
+
+ + + + + +
+   + + +

+Check if font output is currently italic.

Returns:
True or False state of italic.
+
+

+ + + + +
+ + + + + + + + + +
bool ZE::ZFont::IsUnderlined  
+
+ + + + + +
+   + + +

+Check if font output is currently underline.

Returns:
True or False state of underline.
+
+

+ + + + +
+ + + + + + + + + +
int ZE::ZFont::GetHeight  
+
+ + + + + +
+   + + +

+Check font height as reported by SDL_ttf.

Returns:
Height of font.
+
+

+ + + + +
+ + + + + + + + + +
int ZE::ZFont::GetLineSkip  
+
+ + + + + +
+   + + +

+Check font line skip as reported by SDL_ttf.

Returns:
Recommended Line Skip of font.
+
+

+ + + + +
+ + + + + + + + + + +
int ZE::ZFont::GetStringWidth string   text
+
+ + + + + +
+   + + +

+Get Width of String in Current Font in Pixels.

Parameters:
+ + +
text String to get width of.
+
+
Returns:
Width of String in Current font.
+
+

+ + + + +
+ + + + + + + + + + +
int ZE::ZFont::GetStringHeight string   text
+
+ + + + + +
+   + + +

+Get Height of String in Current Font in Pixels.

Parameters:
+ + +
text String to get height of.
+
+
Returns:
Height of String in Current font.
+
+


The documentation for this class was generated from the following file: +
Generated on Wed Nov 20 01:18:06 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1ZImage-members.html b/doc/html/classZE_1_1ZImage-members.html new file mode 100644 index 0000000..393fafa --- /dev/null +++ b/doc/html/classZE_1_1ZImage-members.html @@ -0,0 +1,36 @@ + + +Member List + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::ZImage Member List

This is the complete list of members for ZE::ZImage, including all inherited members. + + + + + + + + + + + + + + + + + + + + + +
Attach(SDL_Surface *surface)ZE::ZImage
Draw(Sint16 x, Sint16 y)ZE::ZImage
GetFilename()ZE::ZImage
GetHeight()ZE::ZImage
GetImage()ZE::ZImage
GetWidth()ZE::ZImage
IsLoaded()ZE::ZImage
Open(string filename)ZE::ZImage
OpenFromImage(SDL_Surface *img, Sint16 x, Sint16 y, Sint16 w, Sint16 h)ZE::ZImage
Release()ZE::ZImage
rEngineZE::ZObject [protected]
rImageZE::ZImage [protected]
SetAlpha(Uint8 alpha)ZE::ZImage
SetColorKey(Uint32 color)ZE::ZImage
ZImage()ZE::ZImage
ZImage(string filename)ZE::ZImage
ZImage(SDL_Surface *surface)ZE::ZImage
ZImage(SDL_Surface *img, Sint16 x, Sint16 y, Sint16 w, Sint16 h)ZE::ZImage
ZObject()ZE::ZObject [inline]
~ZImage()ZE::ZImage
~ZObject()ZE::ZObject [inline, virtual]

Generated on Wed Nov 20 01:18:06 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1ZImage.html b/doc/html/classZE_1_1ZImage.html new file mode 100644 index 0000000..f0f44db --- /dev/null +++ b/doc/html/classZE_1_1ZImage.html @@ -0,0 +1,678 @@ + + +ZE::ZImage class Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::ZImage Class Reference

#include <ZE_ZImage.h> +

+Inherits ZE::ZObject. +

+List of all members.


Detailed Description

+ZImage image drawing class, class wraps common features of SDL_Surface. Inherited from ZObject. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

 ZImage ()
 Default Constructor.

 ZImage (string filename)
 Constructor to Construct from File.

 ZImage (SDL_Surface *surface)
 Constructor to Construct from SDL_Surface*.

 ZImage (SDL_Surface *img, Sint16 x, Sint16 y, Sint16 w, Sint16 h)
 Constructor to Construct from part of an SDL_Surface*.

 ~ZImage ()
 Destructor, frees memory.

void Open (string filename)
 Opens a file.

void OpenFromImage (SDL_Surface *img, Sint16 x, Sint16 y, Sint16 w, Sint16 h)
 Cuts part of an existing image to create the new image.

void Attach (SDL_Surface *surface)
 Attach an existing surface to class.

void Release ()
 Releases image.

void SetAlpha (Uint8 alpha)
 Sets Alpha (transparency) value of Image.

void SetColorKey (Uint32 color)
 Set Color Key (transparent color) of Image.

void Draw (Sint16 x, Sint16 y)
 Draw Image to Screen.

bool IsLoaded ()
 Check if file is loaded.

SDL_Surface * GetImage ()
 Get SDL_Surface. Get SDL_Surface pointer to actual image data.

int GetWidth ()
 Get Width.

int GetHeight ()
 Get Height.

string GetFilename ()
 Get filename of image.


Protected Attributes

+ImageData rImage
 Class containing image and filename.

+


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + +
ZE::ZImage::ZImage  
+
+ + + + + +
+   + + +

+Default Constructor, does nothing.

+

+ + + + +
+ + + + + + + + + + +
ZE::ZImage::ZImage string   filename
+
+ + + + + +
+   + + +

+Constructor is same as calling ZImage::Open() on passed filename.

Parameters:
+ + +
filename File to open as rImage.
+
+
+

+ + + + +
+ + + + + + + + + + +
ZE::ZImage::ZImage SDL_Surface *   surface
+
+ + + + + +
+   + + +

+Constructor is same as calling ZImage::Attach() on passed SDL_Surface*.

Parameters:
+ + +
surface SDL_Surface* to use as rImage.
+
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ZE::ZImage::ZImage SDL_Surface *   img,
Sint16   x,
Sint16   y,
Sint16   w,
Sint16   h
+
+ + + + + +
+   + + +

+Constructor is same as calling ZImage::OpenFromImage. +

+

Parameters:
+ + + + + + +
img Image to take new image from.
x X Coordinate in source of top left corner.
y Y Coordinate in source of top left corner.
w Width of new image.
h Height of new image.
+
+
+

+ + + + +
+ + + + + + + + + +
ZE::ZImage::~ZImage  
+
+ + + + + +
+   + + +

+Destructor calls ZImage::Release().

+


Member Function Documentation

+

+ + + + +
+ + + + + + + + + + +
void ZE::ZImage::Open string   filename
+
+ + + + + +
+   + + +

+Open a file using ZEngine. Loads into rImage member of class.

Parameters:
+ + +
filename File to open as rImage.
+
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void ZE::ZImage::OpenFromImage SDL_Surface *   img,
Sint16   x,
Sint16   y,
Sint16   w,
Sint16   h
+
+ + + + + +
+   + + +

+Cut part of an SDL_Surface to create a new Image. +

+

Parameters:
+ + + + + + +
img Image to take new image from.
x X Coordinate in source of top left corner.
y Y Coordinate in source of top left corner.
w Width of new image.
h Height of new image.
+
+
+

+ + + + +
+ + + + + + + + + + +
void ZE::ZImage::Attach SDL_Surface *   surface
+
+ + + + + +
+   + + +

+Attach a pointer to instance of ZImage. (NOTE: Should not be used on a surface that is owned elsewhere.)

Parameters:
+ + +
surface SDL_Surface* to use as rImage.
+
+
+

+ + + + +
+ + + + + + + + + +
void ZE::ZImage::Release  
+
+ + + + + +
+   + + +

+Frees memory via call to SDL_FreeSurface for the image.

+

+ + + + +
+ + + + + + + + + + +
void ZE::ZImage::SetAlpha Uint8   alpha
+
+ + + + + +
+   + + +

+Set Alpha channel of an Image, only used in 32 bit mode.

Parameters:
+ + +
alpha Number 0-255 describing translucency of image. (0 = transparent, 255 = opaque)
+
+
+

+ + + + +
+ + + + + + + + + + +
void ZE::ZImage::SetColorKey Uint32   color
+
+ + + + + +
+   + + +

+Set color which will not be drawn in image.

Parameters:
+ + +
color Uint32 color describing color to use as transparent.
+
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void ZE::ZImage::Draw Sint16   x,
Sint16   y
+
+ + + + + +
+   + + +

+Draw Image to screen at specified location.

Parameters:
+ + + +
x X coord to draw Image to.
y Y coord to draw Image to.
+
+
+

+ + + + +
+ + + + + + + + + +
bool ZE::ZImage::IsLoaded  
+
+ + + + + +
+   + + +

+Check if file is loaded and pointer to data is non-NULL.

Returns:
Loaded or Unloaded state of data.
+
+

+ + + + +
+ + + + + + + + + +
SDL_Surface * ZE::ZImage::GetImage  
+
+ + + + + +
+   + + +

+

Returns:
SDL_Surface* of rImage.
+
+

+ + + + +
+ + + + + + + + + +
int ZE::ZImage::GetWidth  
+
+ + + + + +
+   + + +

+Get Width of Image.

Returns:
Image Width.
+
+

+ + + + +
+ + + + + + + + + +
int ZE::ZImage::GetHeight  
+
+ + + + + +
+   + + +

+Get Height of Image.

Returns:
Image Height.
+
+

+ + + + +
+ + + + + + + + + +
string ZE::ZImage::GetFilename  
+
+ + + + + +
+   + + +

+Get filename of image or if Image doesn't have a specific filename string describing origin of image.

Returns:
Image Filename.
+
+


The documentation for this class was generated from the following files: +
Generated on Wed Nov 20 01:18:06 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1ZMusic-members.html b/doc/html/classZE_1_1ZMusic-members.html new file mode 100644 index 0000000..752e0fb --- /dev/null +++ b/doc/html/classZE_1_1ZMusic-members.html @@ -0,0 +1,35 @@ + + +Member List + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::ZMusic Member List

This is the complete list of members for ZE::ZMusic, including all inherited members. + + + + + + + + + + + + + + + + + + + + +
GetVolume()ZE::ZMusic
IsLoaded()ZE::ZMusic
IsPaused()ZE::ZMusic
IsPlaying()ZE::ZMusic
LoopInfiniteZE::ZMusic [static]
Open(string filename)ZE::ZMusic
Pause()ZE::ZMusic
Play(int loopNum=0, int fadeTime=0)ZE::ZMusic
Release()ZE::ZMusic
rEngineZE::ZObject [protected]
Rewind()ZE::ZMusic
rMusicZE::ZMusic [protected]
SetVolume(int volume)ZE::ZMusic
Stop(int fadeTime=0)ZE::ZMusic
Unpause()ZE::ZMusic
ZMusic()ZE::ZMusic
ZMusic(string filename)ZE::ZMusic
ZObject()ZE::ZObject [inline]
~ZMusic()ZE::ZMusic
~ZObject()ZE::ZObject [inline, virtual]

Generated on Wed Nov 20 01:18:06 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1ZMusic.html b/doc/html/classZE_1_1ZMusic.html new file mode 100644 index 0000000..df80789 --- /dev/null +++ b/doc/html/classZE_1_1ZMusic.html @@ -0,0 +1,531 @@ + + +ZE::ZMusic class Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::ZMusic Class Reference

#include <ZE_ZMusic.h> +

+Inherits ZE::ZObject. +

+List of all members.


Detailed Description

+ZMusic music class, class wraps common features for SDL_Mixer's Mix_Music. Inherited from ZObject. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

 ZMusic ()
 Default Constructor.

 ZMusic (string filename)
 Constructor that opens a music file.

 ~ZMusic ()
 Destructor, frees memory.

void Open (string filename)
 Opens a music file.

void Release ()
 Release music.

void Play (int loopNum=0, int fadeTime=0)
 Play currently loaded music.

void Pause ()
 Pause music.

void Unpause ()
 Unpause music.

void Rewind ()
 Rewind music.

void Stop (int fadeTime=0)
 Stop music.

void SetVolume (int volume)
 Change Volume.

bool IsLoaded ()
 Check if file is loaded.

bool IsPlaying ()
 Check if music is Playing.

bool IsPaused ()
 Check if music is Paused.

int GetVolume ()
 Find Current Volume of Music.


Static Public Attributes

+const int LoopInfinite
 Static Variable For Infinite loop of sound. (Defined as -1).


Protected Attributes

+MusicData rMusic
 Class containing music data and music filename.

+


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + +
ZE::ZMusic::ZMusic  
+
+ + + + + +
+   + + +

+Default Constructor, does nothing.

+

+ + + + +
+ + + + + + + + + + +
ZE::ZMusic::ZMusic string   filename
+
+ + + + + +
+   + + +

+Constructor simply calls ZMusic::Open() with same filename. (WAV,MOD,MID,OGG)

Parameters:
+ + +
filename Music to open.
+
+
+

+ + + + +
+ + + + + + + + + +
ZE::ZMusic::~ZMusic  
+
+ + + + + +
+   + + +

+Destructor calls ZMusic::Release().

+


Member Function Documentation

+

+ + + + +
+ + + + + + + + + + +
void ZE::ZMusic::Open string   filename
+
+ + + + + +
+   + + +

+Open a music file to be used.

Parameters:
+ + +
filename Music to open.
+
+
+

+ + + + +
+ + + + + + + + + +
void ZE::ZMusic::Release  
+
+ + + + + +
+   + + +

+Release memory held by music data.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void ZE::ZMusic::Play int   loopNum = 0,
int   fadeTime = 0
+
+ + + + + +
+   + + +

+Play music currently loaded in ZMusic, looping loopNum times. (use ZMusic::LoopInfinite to loop forever.) If fade is not zero (which it defaults to) music will fade in over specified number of milliseconds.

Parameters:
+ + + +
loopNum Number of times to loop song, defaults to zero.
fadeTime Milliseconds to fade to full volume, defaults to zero for no fade.
+
+
+

+ + + + +
+ + + + + + + + + +
void ZE::ZMusic::Pause  
+
+ + + + + +
+   + + +

+Pause currently playing music.

+

+ + + + +
+ + + + + + + + + +
void ZE::ZMusic::Unpause  
+
+ + + + + +
+   + + +

+Unpause currently paused music.

+

+ + + + +
+ + + + + + + + + +
void ZE::ZMusic::Rewind  
+
+ + + + + +
+   + + +

+Rewind music to beginning.

+

+ + + + +
+ + + + + + + + + + +
void ZE::ZMusic::Stop int   fadeTime = 0
+
+ + + + + +
+   + + +

+Stop currently playing music, if fadeTime is not zero, fade out over specified time.

Parameters:
+ + +
fadeTime Milliseconds to fade out over, defaults to zero for immediate stop.
+
+
+

+ + + + +
+ + + + + + + + + + +
void ZE::ZMusic::SetVolume int   volume
+
+ + + + + +
+   + + +

+Change volume of currently playing music.

Parameters:
+ + +
volume Volume to change to, can be in a range from 0 to 128
+
+
+

+ + + + +
+ + + + + + + + + +
bool ZE::ZMusic::IsLoaded  
+
+ + + + + +
+   + + +

+Check if file is loaded and pointer to data is non-NULL.

Returns:
Loaded or Unloaded state of data.
+
+

+ + + + +
+ + + + + + + + + +
bool ZE::ZMusic::IsPlaying  
+
+ + + + + +
+   + + +

+Check if music is playing, specifically if it is not stopped. (Paused state should be checked for by IsPaused)

Returns:
Playing / Not Playing State of Music.
+
+

+ + + + +
+ + + + + + + + + +
bool ZE::ZMusic::IsPaused  
+
+ + + + + +
+   + + +

+Check if music is "playing" but currently paused.

Returns:
Paused / Not Paused State of Music.
+
+

+ + + + +
+ + + + + + + + + +
int ZE::ZMusic::GetVolume  
+
+ + + + + +
+   + + +

+Get current volume of music represented as a value from 0-128.

Returns:
Volume of music, 0-128.
+
+


The documentation for this class was generated from the following file: +
Generated on Wed Nov 20 01:18:06 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1ZObject-members.html b/doc/html/classZE_1_1ZObject-members.html new file mode 100644 index 0000000..a10b432 --- /dev/null +++ b/doc/html/classZE_1_1ZObject-members.html @@ -0,0 +1,18 @@ + + +Member List + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::ZObject Member List

This is the complete list of members for ZE::ZObject, including all inherited members. + + + +
rEngineZE::ZObject [protected]
ZObject()ZE::ZObject [inline]
~ZObject()ZE::ZObject [inline, virtual]

Generated on Wed Nov 20 01:18:06 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1ZObject.html b/doc/html/classZE_1_1ZObject.html new file mode 100644 index 0000000..848fc69 --- /dev/null +++ b/doc/html/classZE_1_1ZObject.html @@ -0,0 +1,92 @@ + + +ZE::ZObject class Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::ZObject Class Reference

#include <ZE_ZObject.h> +

+Inherited by ZE::ZConfigFile, ZE::ZFont, ZE::ZImage, ZE::ZMusic, ZE::ZSound, and ZE::ZTimer. +

+List of all members.


Detailed Description

+This is the base class from which all ZEngine internal objects are derived from. +

+ + + + + + + + + + +

Public Methods

 ZObject ()
 ZEngine Constructor.

virtual ~ZObject ()
 ZEngine Virtual destructor.


Protected Attributes

+ZEnginerEngine
 Pointer to ZEngine Object.

+


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + +
ZE::ZObject::ZObject   [inline]
+
+ + + + + +
+   + + +

+ZEngine Constructor, gets Engine pointer for Object.

+

+ + + + +
+ + + + + + + + + +
virtual ZE::ZObject::~ZObject   [inline, virtual]
+
+ + + + + +
+   + + +

+ZEngine destructor, provided to make class safely inheritable.

+


The documentation for this class was generated from the following file: +
Generated on Wed Nov 20 01:18:06 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1ZRect-members.html b/doc/html/classZE_1_1ZRect-members.html new file mode 100644 index 0000000..1e9c938 --- /dev/null +++ b/doc/html/classZE_1_1ZRect-members.html @@ -0,0 +1,41 @@ + + +Member List + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::ZRect Member List

This is the complete list of members for ZE::ZRect, including all inherited members. + + + + + + + + + + + + + + + + + + + + + + + + + + +
Bottom() constZE::ZRect
Contains(int x, int y) constZE::ZRect
Contains(const ZRect &rect) constZE::ZRect
Height() constZE::ZRect
Intersection(const ZRect &rect) constZE::ZRect
Intersects(const ZRect &rect) constZE::ZRect
Left() constZE::ZRect
mHeightZE::ZRect [private]
Move(int x, int y)ZE::ZRect
MoveRel(int xMove, int yMove)ZE::ZRect
mWidthZE::ZRect [private]
mXZE::ZRect [private]
mYZE::ZRect [private]
operator<(const ZRect &rhs) constZE::ZRect
operator=(const ZRect &rhs)ZE::ZRect
Resize(int width, int height)ZE::ZRect
ResizeRel(int widthChange, int heightChange)ZE::ZRect
Right() constZE::ZRect
SDLrect() constZE::ZRect
Top() constZE::ZRect
Width() constZE::ZRect
X() constZE::ZRect
Y() constZE::ZRect
ZRect()ZE::ZRect
ZRect(int x, int y, int width, int height)ZE::ZRect
ZRect(const ZRect &rhs)ZE::ZRect

Generated on Wed Nov 20 01:18:06 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1ZRect.html b/doc/html/classZE_1_1ZRect.html new file mode 100644 index 0000000..d3baaed --- /dev/null +++ b/doc/html/classZE_1_1ZRect.html @@ -0,0 +1,861 @@ + + +ZE::ZRect class Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::ZRect Class Reference

#include <ZE_ZRect.h> +

+List of all members.


Detailed Description

+ZRect Rectangle class, used to define a rectangular area or perform operations on the defined area. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

 ZRect ()
 Default constructor for ZRect.

 ZRect (int x, int y, int width, int height)
 Constructor for ZRect that takes inital values.

 ZRect (const ZRect &rhs)
 Copy constructor for ZRect.

const ZRect & operator= (const ZRect &rhs)
 Overload for = operator with ZRect.

bool operator< (const ZRect &rhs) const
 Overload for < operator with ZRect, based upon location then size.

void Move (int x, int y)
 Changes the location of the rectangle.

void MoveRel (int xMove, int yMove)
 Changes the location of the rectangle based upon the current location.

void Resize (int width, int height)
 Resize rectangle.

void ResizeRel (int widthChange, int heightChange)
 Grows or shrinks current rectangle.

bool Intersects (const ZRect &rect) const
 Check if one ZRect intersects another.

bool Contains (int x, int y) const
 Check if a rectangle contains a given point.

bool Contains (const ZRect &rect) const
 Check if a rectangle contains a given point.

ZRect Intersection (const ZRect &rect) const
 Finds intersection of two rectangles.

SDL_Rect SDLrect () const
 Returns an SDL_Rect representing the rectangle.

int X () const
 Returns X Location.

int Y () const
 Returns Y Location.

int Left () const
 Return position of left side.

int Right () const
 Return position of right side.

int Top () const
 Return position of top side.

int Bottom () const
 Return position of bottom side.

int Width () const
 Returns Width.

int Height () const
 Returns Height.


Private Attributes

+int mX
 X Position of top left corner of rectangle.

+int mY
 Y Position of top left corner of rectangle.

+int mWidth
 Width of Rectangle.

+int mHeight
 Height of Rectangle.

+


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + +
ZE::ZRect::ZRect  
+
+ + + + + +
+   + + +

+Default constructor, initializes all values to zero.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ZE::ZRect::ZRect int   x,
int   y,
int   width,
int   height
+
+ + + + + +
+   + + +

+Constructor for ZRect that takes inital values for all four members.

Parameters:
+ + + + + +
x Value for x position.
y Value for y position.
width Value for width.
height Value for height.
+
+
+

+ + + + +
+ + + + + + + + + + +
ZE::ZRect::ZRect const ZRect &   rhs
+
+ + + + + +
+   + + +

+Takes a ZRect and constructs a new identical rectangle.

Parameters:
+ + +
rhs Rectangle to construct from.
+
+
+


Member Function Documentation

+

+ + + + +
+ + + + + + + + + + +
const ZRect & ZE::ZRect::operator= const ZRect &   rhs
+
+ + + + + +
+   + + +

+Copies all values from one ZRect into another.

Parameters:
+ + +
rhs Rectangle to copy values from.
+
+
Returns:
New value of the ZRect.
+
+

+ + + + +
+ + + + + + + + + + +
bool ZE::ZRect::operator< const ZRect &   rhs const
+
+ + + + + +
+   + + +

+Rectangles are sorted by y value, followed by x value, if they start at the same place, the smaller of the two is deemed less than the other.

Parameters:
+ + +
rhs Rectangle to compare.
+
+
Returns:
True if this rectangle is smaller than the rhs rectangle, false otherwise.
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void ZE::ZRect::Move int   x,
int   y
+
+ + + + + +
+   + + +

+Changes the current x,y position of the rectangle.

Parameters:
+ + + +
x New x position for rectangle.
y New y position for rectangle.
+
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void ZE::ZRect::MoveRel int   xMove,
int   yMove
+
+ + + + + +
+   + + +

+Changes the current x,y position of the rectangle relative to the current location.

Parameters:
+ + + +
xMove Offset for new x position from current.
yMove Offset for new y position from current.
+
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void ZE::ZRect::Resize int   width,
int   height
+
+ + + + + +
+   + + +

+Changes the current width and height of the rectangle.

Parameters:
+ + + +
width New width for rectangle.
height New height for rectangle.
+
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void ZE::ZRect::ResizeRel int   widthChange,
int   heightChange
+
+ + + + + +
+   + + +

+Changes the current width and height of the rectangle based upon current values.

Parameters:
+ + + +
widthChange Amount to add or subtract from width.
heightChange Amount to add or subtract from height.
+
+
+

+ + + + +
+ + + + + + + + + + +
bool ZE::ZRect::Intersects const ZRect &   rect const
+
+ + + + + +
+   + + +

+Checks for overlap and returns boolean value based on if overlap exists.

Parameters:
+ + +
rect Rectangle to check for intersection with.
+
+
Returns:
True if intersection occured, false otherwise.
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
bool ZE::ZRect::Contains int   x,
int   y
const
+
+ + + + + +
+   + + +

+Checks point against boundaries of rectangle and returns result.

Parameters:
+ + + +
x X value of point to check.
y Y value of poitn to check.
+
+
Returns:
Boolean variable, true if point is inside rectangle, false otherwise.
+
+

+ + + + +
+ + + + + + + + + + +
bool ZE::ZRect::Contains const ZRect &   rect const
+
+ + + + + +
+   + + +

+Checks point against boundaries of rectangle and returns result.

Parameters:
+ + +
rect Rectangle to check for point.
+
+
Returns:
Boolean variable, true if point is inside rectangle, false otherwise.
+
+

+ + + + +
+ + + + + + + + + + +
ZRect ZE::ZRect::Intersection const ZRect &   rect const
+
+ + + + + +
+   + + +

+Checks for intersection, and returns rectangle where the two rectangles intersect.

Parameters:
+ + +
rect Rectangle to check intersection with.
+
+
Returns:
ZRect describing intersection area.
+
+

+ + + + +
+ + + + + + + + + +
SDL_Rect ZE::ZRect::SDLrect   const
+
+ + + + + +
+   + + +

+Makes a SDL_Rect representing the rectangle, for use where functions require an SDL_Rect.

Returns:
SDL_Rect representing the ZRect.
+
+

+ + + + +
+ + + + + + + + + +
int ZE::ZRect::X   const
+
+ + + + + +
+   + + +

+Access private X location member.

Returns:
Value of mX.
+
+

+ + + + +
+ + + + + + + + + +
int ZE::ZRect::Y   const
+
+ + + + + +
+   + + +

+Access private Y location member.

Returns:
Value of mY.
+
+

+ + + + +
+ + + + + + + + + +
int ZE::ZRect::Left   const
+
+ + + + + +
+   + + +

+Find X position of left side of rectangle.

Returns:
X position of left side.
+
+

+ + + + +
+ + + + + + + + + +
int ZE::ZRect::Right   const
+
+ + + + + +
+   + + +

+Find X position of right side of rectangle.

Returns:
X position of right side.
+
+

+ + + + +
+ + + + + + + + + +
int ZE::ZRect::Top   const
+
+ + + + + +
+   + + +

+Find Y position of top side of rectangle.

Returns:
Y position of top side.
+
+

+ + + + +
+ + + + + + + + + +
int ZE::ZRect::Bottom   const
+
+ + + + + +
+   + + +

+Find Y position of left side of rectangle.

Returns:
Y position of bottom side.
+
+

+ + + + +
+ + + + + + + + + +
int ZE::ZRect::Width   const
+
+ + + + + +
+   + + +

+Access private width member.

Returns:
Value of mWidth.
+
+

+ + + + +
+ + + + + + + + + +
int ZE::ZRect::Height   const
+
+ + + + + +
+   + + +

+Access private height member.

Returns:
Value of mHeight.
+
+


The documentation for this class was generated from the following files: +
Generated on Wed Nov 20 01:18:06 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1ZSound-members.html b/doc/html/classZE_1_1ZSound-members.html new file mode 100644 index 0000000..3715fb1 --- /dev/null +++ b/doc/html/classZE_1_1ZSound-members.html @@ -0,0 +1,35 @@ + + +Member List + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::ZSound Member List

This is the complete list of members for ZE::ZSound, including all inherited members. + + + + + + + + + + + + + + + + + + + + +
GetVolume()ZE::ZSound
IsLoaded()ZE::ZSound
IsPaused()ZE::ZSound
IsPlaying()ZE::ZSound
LoopInfiniteZE::ZSound [static]
Open(string filename)ZE::ZSound
Pause()ZE::ZSound
Play(int loopNum=0, int fadeTime=0)ZE::ZSound
rChannelIDZE::ZSound [protected]
Release()ZE::ZSound
rEngineZE::ZObject [protected]
rSoundZE::ZSound [protected]
SetVolume(int volume)ZE::ZSound
Stop(int fadeTime=0)ZE::ZSound
Unpause()ZE::ZSound
ZObject()ZE::ZObject [inline]
ZSound()ZE::ZSound
ZSound(string filename)ZE::ZSound
~ZObject()ZE::ZObject [inline, virtual]
~ZSound()ZE::ZSound

Generated on Wed Nov 20 01:18:06 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1ZSound.html b/doc/html/classZE_1_1ZSound.html new file mode 100644 index 0000000..afc5287 --- /dev/null +++ b/doc/html/classZE_1_1ZSound.html @@ -0,0 +1,504 @@ + + +ZE::ZSound class Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::ZSound Class Reference

#include <ZE_ZSound.h> +

+Inherits ZE::ZObject. +

+List of all members.


Detailed Description

+ZSound music class, class wraps common features for SDL_Mixer's Mix_Chunk. Inherited from ZObject. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

 ZSound ()
 Default Constructor.

 ZSound (string filename)
 Constructor that opens a sound effect file.

 ~ZSound ()
 Destructor, frees memory.

void Open (string filename)
 Opens a sound effect file.

void Release ()
 Release sound effect.

void Play (int loopNum=0, int fadeTime=0)
 Play currently loaded sound effect.

void Pause ()
 Pause sound.

void Unpause ()
 Unpause sound.

void Stop (int fadeTime=0)
 Stop sound.

void SetVolume (int volume)
 Change Volume.

bool IsLoaded ()
 Check if file is loaded.

bool IsPlaying ()
 Check if sound is Playing.

bool IsPaused ()
 Check if sound is Paused.

int GetVolume ()
 Find Current Volume of Sound Channel.


Static Public Attributes

+const int LoopInfinite
 Static Variable For Infinite loop of sound. (Defined as -1).


Protected Attributes

+SoundData rSound
 Class containing music data and music filename.

+int rChannelID
 Channel ID Number from SDL_Mixer.

+


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + +
ZE::ZSound::ZSound  
+
+ + + + + +
+   + + +

+Default Constructor, does nothing.

+

+ + + + +
+ + + + + + + + + + +
ZE::ZSound::ZSound string   filename
+
+ + + + + +
+   + + +

+Constructor simply calls ZSound::Open() with same filename. (WAV,MOD,MID,OGG)

Parameters:
+ + +
filename Sound effect to open.
+
+
+

+ + + + +
+ + + + + + + + + +
ZE::ZSound::~ZSound  
+
+ + + + + +
+   + + +

+Destructor calls ZSound::Release().

+


Member Function Documentation

+

+ + + + +
+ + + + + + + + + + +
void ZE::ZSound::Open string   filename
+
+ + + + + +
+   + + +

+Open a music file to be used.

Parameters:
+ + +
filename Music to open.
+
+
+

+ + + + +
+ + + + + + + + + +
void ZE::ZSound::Release  
+
+ + + + + +
+   + + +

+Release memory held by sample data.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void ZE::ZSound::Play int   loopNum = 0,
int   fadeTime = 0
+
+ + + + + +
+   + + +

+Play sound effect, looping loopNum times. (use ZSound::LoopInfinite to loop forever.) If fade is not zero (which it defaults to) music will fade in over specified number of milliseconds.

Parameters:
+ + + +
loopNum Number of times to loop song, defaults to zero.
fadeTime Milliseconds to fade to full volume, defaults to zero for no fade.
+
+
+

+ + + + +
+ + + + + + + + + +
void ZE::ZSound::Pause  
+
+ + + + + +
+   + + +

+Pause currently playing sound.

+

+ + + + +
+ + + + + + + + + +
void ZE::ZSound::Unpause  
+
+ + + + + +
+   + + +

+Unpause currently playing sound.

+

+ + + + +
+ + + + + + + + + + +
void ZE::ZSound::Stop int   fadeTime = 0
+
+ + + + + +
+   + + +

+Stop currently playing sound, if fadeTime is not zero, fade out over specified time.

Parameters:
+ + +
fadeTime Milliseconds to fade out over, defaults to zero for immediate stop.
+
+
+

+ + + + +
+ + + + + + + + + + +
void ZE::ZSound::SetVolume int   volume
+
+ + + + + +
+   + + +

+Change volume of currently playing sample.

Parameters:
+ + +
volume Volume to change to, can be in a range from 0 to 128.
+
+
+

+ + + + +
+ + + + + + + + + +
bool ZE::ZSound::IsLoaded  
+
+ + + + + +
+   + + +

+Check if file is loaded and pointer to data is non-NULL.

Returns:
Loaded or Unloaded state of data.
+
+

+ + + + +
+ + + + + + + + + +
bool ZE::ZSound::IsPlaying  
+
+ + + + + +
+   + + +

+Check if sound is playing, specifically if it is not stopped. (Paused state should be checked for by IsPaused)

Returns:
Playing / Not Playing State of sound.
+
+

+ + + + +
+ + + + + + + + + +
bool ZE::ZSound::IsPaused  
+
+ + + + + +
+   + + +

+Check if sound is "playing" but currently paused.

Returns:
Paused / Not Paused State of Sound.
+
+

+ + + + +
+ + + + + + + + + +
int ZE::ZSound::GetVolume  
+
+ + + + + +
+   + + +

+Get current volume of sound channel represented as a value from 0-128.

Returns:
Volume of sound channel, 0-128.
+
+


The documentation for this class was generated from the following file: +
Generated on Wed Nov 20 01:18:06 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1ZTimer-members.html b/doc/html/classZE_1_1ZTimer-members.html new file mode 100644 index 0000000..572d972 --- /dev/null +++ b/doc/html/classZE_1_1ZTimer-members.html @@ -0,0 +1,29 @@ + + +Member List + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::ZTimer Member List

This is the complete list of members for ZE::ZTimer, including all inherited members. + + + + + + + + + + + + + + +
GetParentTime()ZE::ZTimer [protected]
GetTime()ZE::ZTimer
IsPaused()ZE::ZTimer
Pause()ZE::ZTimer
rEngineZE::ZObject [protected]
Reset()ZE::ZTimer
rLastPauseZE::ZTimer [protected]
rPausedZE::ZTimer [protected]
rPausedTimeZE::ZTimer [protected]
rUseZEngineZE::ZTimer [protected]
Unpause()ZE::ZTimer
ZObject()ZE::ZObject [inline]
ZTimer(bool useZEngine=true)ZE::ZTimer
~ZObject()ZE::ZObject [inline, virtual]

Generated on Wed Nov 20 01:18:06 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/classZE_1_1ZTimer.html b/doc/html/classZE_1_1ZTimer.html new file mode 100644 index 0000000..a73e213 --- /dev/null +++ b/doc/html/classZE_1_1ZTimer.html @@ -0,0 +1,262 @@ + + +ZE::ZTimer class Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE::ZTimer Class Reference

#include <ZE_ZTimer.h> +

+Inherits ZE::ZObject. +

+List of all members.


Detailed Description

+ZTimer timing class, class wraps common features of SDL timer. Inherited from ZObject and tied to ZEngine main timer. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

 ZTimer (bool useZEngine=true)
 Constructs a new Timer.

void Reset ()
 Reset Timer.

void Pause ()
 Pause Timer.

void Unpause ()
 Unpause Timer.

Uint32 GetTime ()
 Get Time of Timer.

bool IsPaused ()
 Get paused state.


Protected Methods

Uint32 GetParentTime ()
 Get time from parent timer.


Protected Attributes

+bool rPaused
 Paused / Unpaused state of Timer.

+bool rUseZEngine
 Using ZEngine timer or SDL global timer.

+Uint32 rPausedTime
 Total time this timer has been paused.

+Uint32 rLastPause
 Time this Timer was paused.

+


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + + +
ZE::ZTimer::ZTimer bool   useZEngine = true
+
+ + + + + +
+   + + +

+Sets TimePaused to current ZEngine time if useZEngine is true, otherwise uses SDL timer.

Parameters:
+ + +
useZEngine Tells if timer should use ZEngine or SDL.
+
+
+


Member Function Documentation

+

+ + + + +
+ + + + + + + + + +
Uint32 ZE::ZTimer::GetParentTime   [protected]
+
+ + + + + +
+   + + +

+Protected method to get time from whichever timer is parent.

Returns:
Time on parent timer.
+
+

+ + + + +
+ + + + + + + + + +
void ZE::ZTimer::Reset  
+
+ + + + + +
+   + + +

+Set Timer back to Zero, will also unpause timer if it was paused.

+

+ + + + +
+ + + + + + + + + +
void ZE::ZTimer::Pause  
+
+ + + + + +
+   + + +

+Pause the timer if it is unpaused.

+

+ + + + +
+ + + + + + + + + +
void ZE::ZTimer::Unpause  
+
+ + + + + +
+   + + +

+Unpause the timer if it is paused.

+

+ + + + +
+ + + + + + + + + +
Uint32 ZE::ZTimer::GetTime  
+
+ + + + + +
+   + + +

+Get current time accounting for time paused.

Returns:
Current Timer Time.
+
+

+ + + + +
+ + + + + + + + + +
bool ZE::ZTimer::IsPaused  
+
+ + + + + +
+   + + +

+Find out paused state of timer.

Returns:
Paused state for timer.
+
+


The documentation for this class was generated from the following files: +
Generated on Wed Nov 20 01:18:06 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/doxygen.css b/doc/html/doxygen.css new file mode 100644 index 0000000..e527a57 --- /dev/null +++ b/doc/html/doxygen.css @@ -0,0 +1,49 @@ +H1 { text-align: center; } +CAPTION { font-weight: bold } +A.qindex {} +A.qindexRef {} +A.el { text-decoration: none; font-weight: bold } +A.elRef { font-weight: bold } +A.code { text-decoration: none; font-weight: normal; color: #4444ee } +A.codeRef { font-weight: normal; color: #4444ee } +A:hover { text-decoration: none; background-color: #f2f2ff } +DL.el { margin-left: -1cm } +DIV.fragment { width: 100%; border: none; background-color: #eeeeee } +DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } +TD.md { background-color: #f2f2ff; font-weight: bold; } +TD.mdname1 { background-color: #f2f2ff; font-weight: bold; color: #602020; } +TD.mdname { background-color: #f2f2ff; font-weight: bold; color: #602020; width: 600px; } +DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold } +DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller } +BODY { background: white } +TD.indexkey { + background-color: #eeeeff; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px +} +TD.indexvalue { + background-color: #eeeeff; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px +} +span.keyword { color: #008000 } +span.keywordtype { color: #604020 } +span.keywordflow { color: #e08000 } +span.comment { color: #800000 } +span.preprocessor { color: #806020 } +span.stringliteral { color: #002080 } +span.charliteral { color: #008080 } diff --git a/doc/html/doxygen.gif b/doc/html/doxygen.gif new file mode 100644 index 0000000..192c83c Binary files /dev/null and b/doc/html/doxygen.gif differ diff --git a/doc/html/doxygen.png b/doc/html/doxygen.png new file mode 100644 index 0000000..96ae72c Binary files /dev/null and b/doc/html/doxygen.png differ diff --git a/doc/html/files.html b/doc/html/files.html new file mode 100644 index 0000000..5efc28e --- /dev/null +++ b/doc/html/files.html @@ -0,0 +1,40 @@ + + +File Index + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZEngine File List

Here is a list of all documented files with brief descriptions: + + + + + + + + + + + + + + + + + + + + + + + + +
/home/James/ZEngine-dev/include/ZE_DataPtr.h [code]Definition file for ZEngine Data/Pointer Classes. ([Image,Font,Sound,Music]Data/Ptr)
/home/James/ZEngine-dev/include/ZE_Defines.h [code]Define file for ZEngine
/home/James/ZEngine-dev/include/ZE_Error.h [code]Definition file for ZEngine Error Handling Functions
/home/James/ZEngine-dev/include/ZE_Includes.h [code]Include file for SDL and C++ Includes that many ZEngine files need
/home/James/ZEngine-dev/include/ZE_ZConfigFile.h [code]Definition file for ZConfigFile
/home/James/ZEngine-dev/include/ZE_ZEngine.h [code]Definition file for core ZEngine class
/home/James/ZEngine-dev/include/ZE_ZFont.h [code]Definition file for ZFont
/home/James/ZEngine-dev/include/ZE_ZImage.h [code]Definition file for ZImage
/home/James/ZEngine-dev/include/ZE_ZMusic.h [code]Definition file for ZMusic
/home/James/ZEngine-dev/include/ZE_ZObject.h [code]Definition file for ZObject Base Class
/home/James/ZEngine-dev/include/ZE_ZRect.h [code]Definition file for ZRect
/home/James/ZEngine-dev/include/ZE_ZSound.h [code]Definition file for ZSound
/home/James/ZEngine-dev/include/ZE_ZTimer.h [code]Definition file for ZTimer
/home/James/ZEngine-dev/include/ZEngine.h [code]Header file for ZEngine
/home/James/ZEngine-dev/include/external/physfsrwops.h [code]
/home/James/ZEngine-dev/src/ZE_Error.cppSource file for error logging utilities
/home/James/ZEngine-dev/src/ZE_ZConfigFile.cppSource file for ZConfigFile
/home/James/ZEngine-dev/src/ZE_ZEngine.cppCentral source file for ZEngine
/home/James/ZEngine-dev/src/ZE_ZFont.cppSource file for ZFont
/home/James/ZEngine-dev/src/ZE_ZImage.cppSource file for ZImage
/home/James/ZEngine-dev/src/ZE_ZMusic.cppSource file for ZMusic
/home/James/ZEngine-dev/src/ZE_ZRect.cppSource file for ZRect
/home/James/ZEngine-dev/src/ZE_ZSound.cppSource file for ZSound
/home/James/ZEngine-dev/src/ZE_ZTimer.cppSource file for ZTimer
+
Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/functions.html b/doc/html/functions.html new file mode 100644 index 0000000..1156f14 --- /dev/null +++ b/doc/html/functions.html @@ -0,0 +1,248 @@ + + +Compound Member Index + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZEngine Compound Members

+a | b | c | d | f | g | h | i | k | l | m | o | p | q | r | s | t | u | w | x | y | z | ~
+ +

+Here is a list of all documented class members with links to the class documentation for each member:

- a - +

+

- b - +

+

- c - +

+

- d - +

+

- f - +

+

- g - +

+

- h - +

+

- i - +

+

- k - +

+

- l - +

+

- m - +

+

- o - +

+

- p - +

+

- q - +

+

- r - +

+

- s - +

+

- t - +

+

- u - +

+

- w - +

+

- x - +

+

- y - +

+

- z - +

+

- ~ - +

+
Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/globals.html b/doc/html/globals.html new file mode 100644 index 0000000..973e73f --- /dev/null +++ b/doc/html/globals.html @@ -0,0 +1,40 @@ + + +File Member Index + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZEngine File Members

+d | g | l | u | v
+ +

+Here is a list of all documented file members with links to the documentation:

- d - +

+

- g - +

+

- l - +

+

- u - +

+

- v - +

+
Generated on Wed Nov 20 01:18:06 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/hierarchy.html b/doc/html/hierarchy.html new file mode 100644 index 0000000..231b099 --- /dev/null +++ b/doc/html/hierarchy.html @@ -0,0 +1,31 @@ + + +Hierarchical Index + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZEngine Class Hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically: +
Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/index.html b/doc/html/index.html new file mode 100644 index 0000000..c6154e1 --- /dev/null +++ b/doc/html/index.html @@ -0,0 +1,35 @@ + + +ZEngine Documentation + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZEngine Documentation

+

+

0.7.0

Author:
James Turk
+
Version:
0.7.3
+
Date:
07 November, 2002
+

+About ZEngine

+
+ ZEngine is designed to wrap common interfaces of the SDL API in an Object Oriented manner. It is licensed under the Academic Free License, and anyone is free to suggest or implement changes to be added to the Engine. In addition ZEngine hopes to provide a core engine which can be used to develop a game without having to rewrite large amounts of code.

+Licensing

+
+
+
+         This file is Part of the ZEngine Library for SDL Game Development.
+                      Copyright (C) 2002 ConceptOfZero.net
+ +

+Licensed under the BSD License, see licensing.txt. +

+The maintainer of this library is James Turk (james.net) and the home of this Library is http://www.conceptofzero.net/

+Contributing Authors

+James Turk james@conceptofzero.net - Core Engine and Classes for Data Types
Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/namespaceZE.html b/doc/html/namespaceZE.html new file mode 100644 index 0000000..b201f28 --- /dev/null +++ b/doc/html/namespaceZE.html @@ -0,0 +1,209 @@ + + +ZE Namespace Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZE Namespace Reference


Detailed Description

+Namespace for ZEngine classes and utility functions. +

+ +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Compounds

class  ImageData
 Class to wrap SDL_Surface pointers. More...

class  FontData
 Class to wrap TTF_Font pointers. More...

class  SoundData
 Class to wrap Mix_Chunk pointers. More...

class  MusicData
 Class to wrap Mix_Music pointers. More...

class  ZConfigFile
 ZConfigFile Class for use in ZEngine. More...

class  ZCF_Variable
class  ZCF_Section
class  ZEngine
 Main ZEngine Singleton Class. More...

class  ZFont
 ZFont class for basic Font use. More...

class  ZImage
 ZImage class for basic Image use. More...

class  ZMusic
 ZMusic class for playing full length music (eg. ogg or wav). More...

class  ZObject
 ZObject base class for other ZEngine objects. More...

class  ZRect
 ZEngine class for simplified rectangle use. More...

class  ZSound
 ZSound class for playing sound effects. (WAV). More...

class  ZTimer
 ZTimer class for Timer use. More...


Functions

string _GetError (int line, string file, string str)
 Error handling Utiltity function.

void _LogError (int line, string file, string str)
 Error handling Utiltity function.

string FormatStr (const char *fmtstr,...)
 Parses a string and interprets variable arguments, similar to sprintf.

+


Function Documentation

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
string ZE::_GetError int   line,
string   file,
string   str
+
+ + + + + +
+   + + +

+Get string describing error given appropriate details.

Parameters:
+ + + + +
line Line error occured on.
file Name of file error occured in.
str More detail on error.
+
+
Returns:
String describing error.
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
void ZE::_LogError int   line,
string   file,
string   str
+
+ + + + + +
+   + + +

+Log error to stderr, describing error given appropriate details.

Parameters:
+ + + + +
line Line error occured on.
file Name of file error occured in.
str More detail on error.
+
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
string ZE::FormatStr const char *   fmtstr,
...  
+
+ + + + + +
+   + + +

+Takes identifiers out of fmtstr and parses them, replacing them with cooresponding values in the variable arguments list. For more detail view documentation.

Parameters:
+ + + +
fmtstr defines format of resulting string
... variable number of arguments after fmtstr
+
+
Returns:
string of parsed and combined string
+
+


Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/namespacemembers.html b/doc/html/namespacemembers.html new file mode 100644 index 0000000..c9149ec --- /dev/null +++ b/doc/html/namespacemembers.html @@ -0,0 +1,27 @@ + + +Namespace Member Index + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZEngine Namespace Members

+_ | f
+ +

+Here is a list of all documented namespace members with links to the namespaces they belong to:

- _ - +

    +
  • _GetError() +: ZE
  • _LogError() +: ZE
+

- f - +

    +
  • FormatStr() +: ZE
+
Generated on Wed Nov 20 01:18:06 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/namespaces.html b/doc/html/namespaces.html new file mode 100644 index 0000000..70ec724 --- /dev/null +++ b/doc/html/namespaces.html @@ -0,0 +1,17 @@ + + +Namespace Index + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

ZEngine Namespace List

Here is a list of all documented namespaces with brief descriptions: + +
ZEZEngine Namespace
+
Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/doc/html/physfsrwops_8h-source.html b/doc/html/physfsrwops_8h-source.html new file mode 100644 index 0000000..74340b6 --- /dev/null +++ b/doc/html/physfsrwops_8h-source.html @@ -0,0 +1,54 @@ + + +/home/James/ZEngine-dev/include/external/physfsrwops.h Source File + + + +
+Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  
+

/home/James/ZEngine-dev/include/external/physfsrwops.h

00001 /*
+00002  * This code provides a glue layer between PhysicsFS and Simple Directmedia
+00003  *  Layer's (SDL) RWops i/o abstraction.
+00004  *
+00005  * License: this code is public domain. I make no warranty that it is useful,
+00006  *  correct, harmless, or environmentally safe.
+00007  *
+00008  * This particular file may be used however you like, including copying it
+00009  *  verbatim into a closed-source project, exploiting it commercially, and
+00010  *  removing any trace of my name from the source (although I hope you won't
+00011  *  do that). I welcome enhancements and corrections to this file, but I do
+00012  *  not require you to send me patches if you make changes.
+00013  *
+00014  * Unless otherwise stated, the rest of PhysicsFS falls under the GNU Lesser
+00015  *  General Public License: http://www.gnu.org/licenses/lgpl.txt
+00016  *
+00017  * SDL falls under the LGPL, too. You can get SDL at http://www.libsdl.org/
+00018  *
+00019  *  This file was written by Ryan C. Gordon. (icculus@clutteredmind.org).
+00020  */
+00021 
+00022 #ifndef _INCLUDE_PHYSFSRWOPS_H_
+00023 #define _INCLUDE_PHYSFSRWOPS_H_
+00024 
+00025 #include <physfs.h>
+00026 #include <SDL.h>
+00027 
+00038 SDL_RWops *PHYSFSRWOPS_openRead(const char *fname);
+00039 
+00050 SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname);
+00051 
+00062 SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname);
+00063 
+00074 SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_file *handle);
+00075 
+00076 
+00077 #endif /* include-once blocker */
+00078 
+00079 /* end of physfsrwops.h ... */
+00080 
+

Generated on Wed Nov 20 01:18:05 2002 for ZEngine by + +doxygen1.3-rc1
+ + diff --git a/include/ZE_DataPtr.h b/include/ZE_DataPtr.h new file mode 100644 index 0000000..d44bc6d --- /dev/null +++ b/include/ZE_DataPtr.h @@ -0,0 +1,127 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (jturk@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +/*! +\par File Header: +File: ZE_DataPtr.h
+Description: Header file for ZEngine Data Pointer Classes
+Author(s): James Turk
+$Id: ZE_DataPtr.h,v 1.1 2002/11/21 05:41:10 cozman Exp $
+ + \file ZE_DataPtr.h + \brief Definition file for ZEngine Data/Pointer Classes. ([Image,Font,Sound,Music]Data/Ptr) + + Definition file for ZEngine Data Pointer Classes. ([Image,Font,Sound,Music]Ptr) These classes are used to keep track of the Images (Fonts and Sounds) throughout + the entire ZEngine. +**/ + +#ifndef __ze_dataptr_h__ +#define __ze_dataptr_h__ + +#include "ZE_Includes.h" + +namespace ZE +{ + +/////////////////////////////////////////// +//Utility Classes Used Throughout ZEngine// +/////////////////////////////////////////// + +/*! + \brief Class to wrap SDL_Surface pointers. + + Class used to keep track of loaded data and associate an SDL_Surface with an index number and filename. +**/ +class ImageData +{ + public: + //! Pointer to SDL_Surface. + SDL_Surface *image; + //! File image was loaded from. + string filename; + /*! + \brief Initialize ImageData. + + Sets image pointer to NULL + **/ + ImageData() { image = NULL; }; +}; + +#ifdef USE_SDL_TTF + +/*! + \brief Class to wrap TTF_Font pointers. + + Class used to keep track of loaded data and associate a TTF_Font with an index number and filename. +**/ +class FontData +{ + public: + //! Pointer to SDL_TTF font data. + TTF_Font *font; + //! File font was loaded from. + string filename; + /*! + \brief Initialize FontData. + + Sets font pointer to NULL + **/ + FontData() { font = NULL; }; +}; + +#endif //USE_SDL_TTF + +#ifdef USE_SDL_MIXER + +/*! + \brief Class to wrap Mix_Chunk pointers. + + Class used to keep track of loaded data and associate a Mix_Chunk with an index number and filename. +**/ +class SoundData +{ + public: + //! Pointer to SDL_Mixer sound effect data. + Mix_Chunk *sound; + //! File sound effect was loaded from. + string filename; + /*! + \brief Initialize SoundData. + + Sets sound pointer to NULL + **/ + SoundData() { sound = NULL; }; +}; + +/*! + \brief Class to wrap Mix_Music pointers. + + Class used to keep track of loaded data and associate a Mix_Music with an index number and filename. +**/ +class MusicData +{ + public: + //! Pointer to SDL_Mixer music data. + Mix_Music *music; + //! File music was loaded from. + string filename; + /*! + \brief Initialize MusicData. + + Sets music pointer to NULL + **/ + MusicData() { music = NULL; }; +}; + +#endif //USE_SDL_MIXER + +} + +#endif //__ze_dataptr_h__ diff --git a/include/ZE_Defines.h b/include/ZE_Defines.h new file mode 100644 index 0000000..f37edc3 --- /dev/null +++ b/include/ZE_Defines.h @@ -0,0 +1,41 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (jturk@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +/*! +\par File Header: +File: ZE_Defines.h
+Description: Defines header file for ZEngine class, where all #define statements to control compilation options are placed.
+Author(s): James Turk
+$Id: ZE_Defines.h,v 1.1 2002/11/21 05:41:10 cozman Exp $
+ + \file ZE_Defines.h + \brief Define file for ZEngine. + + Definition file, holds #define statements describing optional features of ZEngine. +**/ + +#ifndef __ze_defines_h__ +#define __ze_defines_h__ + +//defines- undefine any of these if you dont have the indicated SDL extension// +//! Define to include font support. +#define USE_SDL_TTF +//! Define to include non-bmp image file support. +#define USE_SDL_IMAGE +//! Define to include sound support. +#define USE_SDL_MIXER +//! Define to use the Physfs file system. +//#define USE_PHYSFS +//! Undefine to disable debug streams for Error Handler. +#define DEBUG_STREAM +//! Version number. +#define VERSION "0.7.3" + +#endif //__ze_defines_h__ diff --git a/include/ZE_Error.h b/include/ZE_Error.h new file mode 100644 index 0000000..ec9540f --- /dev/null +++ b/include/ZE_Error.h @@ -0,0 +1,81 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (jturk@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +/*! +\par File Header: +File: ZE_Error.h
+Description: Header file for ZEngine Error Handling Functions.
+Author(s): James Turk
+$Id: ZE_Error.h,v 1.1 2002/11/21 05:41:10 cozman Exp $
+ + \file ZE_Error.h + \brief Definition file for ZEngine Error Handling Functions. + + Definition file for ZEngine Error Logging + Formatting functions which are used for internal and external errors. +**/ + +#ifndef __ze_error_h__ +#define __ze_error_h__ + +#include "ZE_Includes.h" + +namespace ZE +{ + + +////////////////////////////// +//Error Logging + Formatting// +////////////////////////////// + +/*! + \brief Error handling Utiltity function. + + Get string describing error given appropriate details. + \param line Line error occured on. + \param file Name of file error occured in. + \param str More detail on error. + \return String describing error. +**/ +string _GetError(int line, string file, string str); + +/*! + \brief Error handling Utiltity function. + + Log error to stderr, describing error given appropriate details. + \param line Line error occured on. + \param file Name of file error occured in. + \param str More detail on error. +**/ +void _LogError(int line, string file, string str); + +/*! + \brief Parses a string and interprets variable arguments, similar to sprintf. + + Takes % identifiers out of fmtstr and parses them, replacing them with cooresponding values + in the variable arguments list. For more detail view documentation. + \param fmtstr defines format of resulting string + \param ... variable number of arguments after fmtstr + \return string of parsed and combined string +**/ +string FormatStr(const char *fmtstr, ...); + +/*! + Creates a string about an error, telling what file it occured in and where, and gives a user defined string as well. +**/ +#define GetError(str) _GetError(__LINE__,__FILE__,str) + +/*! + Logs a string about an error, telling what file it occured in and where, and gives a user defined string as well. +**/ +#define LogError(str) _LogError(__LINE__,__FILE__,str) + +} + +#endif //__ze_error_h__ diff --git a/include/ZE_Includes.h b/include/ZE_Includes.h new file mode 100644 index 0000000..3281760 --- /dev/null +++ b/include/ZE_Includes.h @@ -0,0 +1,55 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (jturk@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +/*! +\par File Header: +File: ZE_Includes.h
+Description: Header file for ZEngine universal includes.
+Author(s): James Turk
+$Id: ZE_Includes.h,v 1.1 2002/11/21 05:41:10 cozman Exp $
+ + \file ZE_Includes.h + \brief Include file for SDL and C++ Includes that many ZEngine files need. + + ZE_*.h files should only include this file and any other ZE_*.h files that they need, External Library or C/C++ Standard Library + files should be included from within this file. +**/ + +#ifndef __ze_includes_h__ +#define __ze_includes_h__ + +#include "ZE_Defines.h" + +#include "SDL.h" +#ifdef USE_SDL_IMAGE +#include "SDL_image.h" +#endif +#ifdef USE_SDL_TTF +#include "SDL_ttf.h" +#endif +#ifdef USE_SDL_MIXER +#include "SDL_mixer.h" +#endif +#ifdef USE_PHYSFS +#include "physfs.h" +#include "external/physfsrwops.h" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; + +#endif //__ze_includes_h__ diff --git a/include/ZE_ZConfigFile.h b/include/ZE_ZConfigFile.h new file mode 100644 index 0000000..c0da5da --- /dev/null +++ b/include/ZE_ZConfigFile.h @@ -0,0 +1,192 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (jturk@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +/*! +\par File Header: +File: Types/ZE_ZConfigFile.h
+Description: Header file for ZEngine INI-Style Config Files.
+Author(s): James Turk
+$Id: ZE_ZConfigFile.h,v 1.1 2002/11/21 05:41:10 cozman Exp $
+ + \file ZE_ZConfigFile.h + \brief Definition file for ZConfigFile. + + Definition file for ZConfigFile, an INI-style Config format. +**/ + + +#ifndef __ze_zconfigfile_h__ +#define __ze_zconfigfile_h__ + +#include "ZE_ZObject.h" //included even though ZCF isn't derived (to obtain all other needed headers) + +namespace ZE +{ + +/*! + \brief ZConfigFile Class for use in ZEngine. + + ZConfigFile class for INI-style configuration files for games or applications. Inherited from ZObject. +**/ +class ZConfigFile : public ZObject +{ + private: + + /*Private Types*/ + class ZCF_Variable + { + public: + string var; + string val; + }; + class ZCF_Section + { + public: + string section; + list varList; + }; + + //! List of sections of internal type. + list mFileLayout; + + //! Filename of file currently open. + string mFilename; + + /*! + \brief Reformat a string in a form more suitable to parsing. + + Removes whitespace from a string and makes all characters lowercase. + \param str The string to get a clean version of. + \return Cleaned string. + **/ + string CleanString(string str); + + bool Exists(string sec); + bool Exists(string sec, string var); + void SetVariable(string sec, string var, string val); + string GetVariable(string sec, string var, string defVal); + + public: + + /*! + \brief Default constructor. + + A no-op default constructor. + **/ + ZConfigFile(); + + /*! + \brief Constructor which takes filename. + + Constructor takes filename, and calls process on it. + \param filename File to load as ZConfigFile. + **/ + ZConfigFile(string filename); + + /*! + \brief Destructor, flushes file. + + Flushes the file, ensures a flush if the file is left open. + **/ + ~ZConfigFile(); + + /*! + \brief Parse a file. + + Parses the file, reading the contents into the fileLayout map. + \param filename File to parse and attach this ZDataFile to. + **/ + void Process(string filename); + + /*! + \brief Get value in integer format from file. + + Get the current value of a variable in the file, or defVal if not found in file. + \param section Name of section to seek variable under. + \param var Name of variable to seek value for. + \param defVal Value to return if var does not exist within section. + \return Contents of the variable in integer format. + **/ + int GetInt(string section, string var, int defVal); + + /*! + \brief Get value in boolean format from file. + + Get the current value of a variable in the file, or defVal if not found in file. + (Valid values are "0","1","true" and "false") + \param section Name of section to seek variable under. + \param var Name of variable to seek value for. + \param defVal Value to return if var does not exist within section. + \return Contents of the variable in boolean format. + **/ + bool GetBool(string section, string var, bool defVal); + + /*! + \brief Get value in string format from file. + + Get the current value of a variable in the file, or defVal if not found in file. + \param section Name of section to seek variable under. + \param var Name of variable to seek value for. + \param defVal Value to return if var does not exist within section. + \return Contents of the variable in string format. + **/ + string GetString(string section, string var, string defVal); + + /*! + \brief Set value in integer format in file. + + Set the new value of a variable in the file to val, creating the section and variable + if not already found in file. + \param section Name of section to edit variable under. + \param var Name of variable to set value for. + \param val Integer value to set variable to in file. + **/ + void SetInt(string section, string var, int val); + + /*! + \brief Set value in boolean format in file. + + Set the new value of a variable in the file to val, creating the section and variable + if not already found in file. + \param section Name of section to edit variable under. + \param var Name of variable to set value for. + \param val Boolean value to set variable to in file. + **/ + void SetBool(string section, string var, bool val); + + /*! + \brief Set value in string format in file. + + Set the new value of a variable in the file to val, creating the section and variable + if not already found in file. + \param section Name of section to edit variable under. + \param var Name of variable to set value for. + \param val String value to set variable to in file. + **/ + void SetString(string section, string var, string val); + + /*! + \brief Write all values to file + + Writes all values and sections to file. + **/ + void Flush(); + + /*! + \brief Close the file. + + Flush the file and clear the filename. + **/ + void Close(); +}; + +} + +#endif //__ze_zconfigfile_h__ diff --git a/include/ZE_ZEngine.h b/include/ZE_ZEngine.h new file mode 100644 index 0000000..7885d89 --- /dev/null +++ b/include/ZE_ZEngine.h @@ -0,0 +1,522 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (jturk@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +/*! +\par File Header: +File: ZE_ZEngine.h
+Description: Header file for ZEngine class, the core of the ZEngine.
+Author(s): James Turk
+$Id: ZE_ZEngine.h,v 1.1 2002/11/21 05:41:10 cozman Exp $
+ + \file ZE_ZEngine.h + \brief Definition file for core ZEngine class. + + ZEngine Game Engine core Engine definition. +**/ + +#ifndef __ze_zengine_h__ +#define __ze_zengine_h__ + +#include "ZE_DataPtr.h" +#include "ZE_Error.h" +#include "ZE_Defines.h" +#include "ZE_Includes.h" + +/*! + \brief ZEngine Namespace. + + Namespace for ZEngine classes and utility functions. +**/ +namespace ZE +{ + +/*! + \brief Main ZEngine Singleton Class + + ZEngine Singleton Class, accessible from anywhere in a ZEngine-based program by nature. Controls core elements of program and does + majority of SDL wrapping. Also keeps track of loaded data and helps programs avoid memory leaks and dangling pointers. +**/ +class ZEngine +{ + ///////////////////////////////// + //Singleton + Memory Management// + ///////////////////////////////// + + private: + //! Static Pointer to Instance of ZEngine for Singleton. + static ZEngine *sInstance; + + /*! + \brief Constructor for ZEngine. + + Initialize ZEngine values to defaults. (Private so that only one instance may be created.) + **/ + ZEngine(); + + public: + + /*! + \brief Get Instance. + + Static function, returns pointer to instance of ZEngine, creating an instance if none exist. + \return Instance to the ZEngine. + **/ + static ZEngine* GetInstance(); + + /*! + \brief Release Instance. + + Release memory held by instance of engine and closes window. + **/ + static void ReleaseInstance(); + + /*! + \brief Get Current Version. + + Get Version Number of ZEngine. (Major.Minor.Extension#) + \return string containing version number + **/ + static string GetVersion(); + + ////////////////// + //Initialization// + ////////////////// + + private: + //! Width of Display + int mWidth; + //! Height of Display + int mHeight; + //! BPP Setting of Display + int mBPP; + //! Fullscreen setting of Display + bool mFullscreen; + +#ifdef USE_SDL_MIXER + //! Sound Bitrate + int mRate; + //! Stereo setting of Sound Subsystem + bool mStereo; +#endif + + + public: + //add initialization + + /*! + \brief Setup Display for SDL. + + Sets display parameters to specified parameters. (called before CreateDisplay) + + \param width Desired width of screen or window. + \param height Desired height of screen or window. + \param bpp Desired BPP for screen (only works in fullscreen). + \param fullscreen A bool for fullscreen setting. + **/ + void SetupDisplay(int width, int height, int bpp, bool fullscreen); + +#ifdef USE_SDL_MIXER + /*! + \brief Initialize Sound for SDL. + + Set sound settings to specified parameters. (called before CreateDisplay) + + \param rate Desired sound bitrate. + \param stereo A bool for stereo setting. + **/ + void SetupSound(int rate, bool stereo); +#endif + + /*! + \brief Create Window with predefined settings. + + SetupDisplay and SetupSound should be called prior to this to change settings, settings from those do not go into effect + until this function is called. Specify no icon file to use default OS icon. + + \param title Window Title. + \param icon Path to Icon File. + **/ + void CreateWindow(string title, string icon=""); + + /*! + \brief Quit SDL and any Subsystems. + + Shut down SDL (and SDL_ttf,SDL_mixer if necessary). + **/ + void CloseWindow(); + + ///////////////// + //Screen Access// + ///////////////// + + private: + //! Pointer to Display + SDL_Surface *mScreen; + + public: + /*! + \brief Allow access to Screen Surface. + + Get pointer to screen SDL_Surface, allowing direct screen manipulation using SDL. + \return Pointer to Display Surface. + **/ + SDL_Surface *GetDisplay(); + + /*! + \brief Update screen contents. + + Flip double buffer in SDL if double buffered, otherwise tell video to refresh entire screen. + **/ + void UpdateScreen(); + + /*! + \brief Create Color in SDL Uint32 Format + + Turn RGBA values into SDL Uint32 color. (Alpha value will be ignored if not in use) + + \param r Red component of color (0-255). + \param g Green component of color (0-255). + \param b Blue component of color (0-255). + \param a Alpha (translucency) component of color (0-255). [Default 255] + \return Uint32 of color requested. + **/ + Uint32 MapColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a=255); + + /*! + \brief Clear screen or portion of screen to a color. + + Clears a rectangle on screen to a color. + \param color Color to clear surface to, defaults to black. + \param rect Rectangle of screen to clear or NULL for entire surface. + **/ + void Clear(Uint32 color=0, SDL_Rect *rect=NULL); + + //////////////////////////////////////////// + //Timer and Framerate Independent Movement// + //////////////////////////////////////////// + + private: + //! Keep track of paused state of game. + bool mPaused; + //! Keep track of if ZEngine should unpause on active event. + bool mUnpauseOnActive; + //! Keep track of time game was last paused. + Uint32 mLastPause; + //! Keep track of total globally paused time. + Uint32 mPausedTime; + //! Keep track of last screen update time. + Uint32 mLastTime; + //! Seconds per frame. + double mSecPerFrame; + + public: + /*! + \brief Sleep for a certain amount of time. + + Freeze everything for given number of milliseconds. + \param milliseconds Number of milliseconds to freeze. + **/ + void Sleep(Uint32 milliseconds); + + /*! + \brief Get Global ZEngine time. + + Get active time since ZEngine initialization in milliseconds, paused time doesn't count. + \return Number of active milliseconds since initialization. + **/ + Uint32 GetTime(); + + /*! + \brief Pause ZEngine. + + Pause ZEngine timer and all ZTimer objects that rely on ZEngine. + **/ + void PauseTimer(); + + /*! + \brief Unpause ZEngine. + + Unpause ZEngine timer and all ZTimer objects that rely on ZEngine. + **/ + void UnpauseTimer(); + + /*! + \brief Get Seconds Per Frame. + + Get double that describes the time passed between screen updates. (used for Framerate Independant Movement) + \return Time between screen updates. + **/ + double GetFrameTime(); + + /*! + \brief Check Engine Paused State. + + Find out if engine timer is paused. + \return Paused State of engine. + **/ + bool IsPaused(); + + //////////////////////////// + //Event and Input Handling// + //////////////////////////// + + private: + //! bool describing Active or Inactive State of Game + bool mActive; + //! bool for checking if a Quit event has been detected + bool mQuit; + //! Pointer to array of Keys + Uint8 *mKeyPressed; + //! X Position of Mouse + int mMouseX; + //! Y Position of Mouse + int mMouseY; + //! Mouse Button Information + Uint8 mMouseB; + + public: + /*! + \brief Find out if application is active. + + Function to find out if application currently has focus. + \return bool telling active/inactive state of application. + **/ + bool IsActive(); + + /*! + \brief Request A Quit. + + Tell the engine that it should behave as if a Quit was requested, does not call + any shutdown functions. + **/ + void RequestQuit(); + + /*! + \brief Find out if user has requested to quit. + + Function to find out if user or operating system has requested program cease execution, can be + set by Alt-F4, SDL_Quit event or ZEngine::RequestQuit(). + \return bool telling if quit has been requested. + **/ + bool QuitRequested(); + + /*! + \brief Find the state of a key. + + Function returns true/false based on if key is pressed or not. + \param key code of key to find status of. + \return bool state of requested key. + **/ + bool KeyIsPressed(SDLKey key); + + /*! + \brief Hide mouse cursor. + + Hide the system mouse cursor. + **/ + void HideCursor(); + + /*! + \brief Show mouse cursor. + + Show the system mouse cursor. + **/ + void ShowCursor(); + + /*! + \brief Get X Position of Mouse. + + Find X Position of Mouse on screen. + \return X Position of Mouse. + **/ + int GetMouseX(); + + /*! + \brief Get Y Position of Mouse. + + Find Y Position of Mouse on screen. + \return Y Position of Mouse. + **/ + int GetMouseY(); + + /*! + \brief Get Status of Left Button. + + Get pressed status of left button of mouse. + \return true if left button is pressed, false otherwise. + **/ + bool LButtonPressed(); + + /*! + \brief Get Status of Right Button. + + Get pressed status of right button of mouse. + \return true if right button is pressed, false otherwise. + **/ + bool RButtonPressed(); + + /*! + \brief Check if mouse is in given rectangle. + + Return status of mouse in current rectangle (used for buttons) + \param rect Rectangle to check if mouse is in. + \return true if mouse is in rectangle, false otherwise + **/ + bool MouseInRect(SDL_Rect *rect); + + /*! + \brief Check for Activation, Window Manager, and Quit Events. + + Cycle through event queue, processing events, updating all Event Related variables, should be called once per frame. + **/ + void CheckEvents(); + +#ifdef USE_PHYSFS + //////////////////// + //Physfs Utilities// + //////////////////// + public: + /*! + \brief Initialize PhysicsFS + + Sets up PhysicsFS, must be called when application is started. + \param argv argv[0] from application's main. + **/ + void InitPhysFS(string argv); + + /*! + \brief Add Directory to PhysFS Search Path. + + Add Directory to PhysicsFS search path, the path it looks in for files when attempting to load. + \param dir Directory to add to search path. + **/ + void AddPhysFSDir(string dir); + +#endif //USE_PHYSFS + + + //////////////////////////// + //Data Loading + Unloading// + //////////////////////////// + public: + /*! + \brief Load an Image. + + Loads an Image to an ImageData class which keeps vital information on the Image. + \param filename path to file to load. + \return A ImageData class containing filename and pointer to data. + **/ + ImageData LoadImage(string filename); + + /*! + \brief Free an Image. + + Free memory of an Image in an ImageData class. + \param image ImageData structure of image to free. + **/ + void FreeImage(ImageData &image); + +#ifdef USE_SDL_MIXER + /*! + \brief Load a Sound + + Loads a Sound to a SoundData class which keeps vital information on the Sound + \param filename path to file to load. + \return A SoundData class containing filename and pointer to data. + **/ + SoundData LoadSound(string filename); + + /*! + \brief Free a Sound. + + Free memory of a Sound in a SoundData class. + \param sound SoundData structure of sound to free. + **/ + void FreeSound(SoundData &sound); + + /*! + \brief Load a Music File + + Loads a Music Clip to a MusicData class which keeps vital information on the Music Data + \param filename path to file to load. + \return A MusicData class containing filename and pointer to data. + **/ + MusicData LoadMusic(string filename); + + /*! + \brief Free a Music Sample. + + Free memory of Music in a MusicData class. + \param music MusicData structure of music to free. + **/ + void FreeMusic(MusicData &music); +#endif + +#ifdef USE_SDL_TTF + /*! + \brief Load a Font. + + Loads a Font to a FontData class which keeps vital information on the Font + \param filename path to file to load. + \param size point size of font + \return A FontData class containing filename and pointer to data. + **/ + FontData LoadFont(string filename, int size); + + /*! + \brief Free a Font. + + Free memory of a Font in a FontData class. + \param font FontData structure of font to free. + **/ + void FreeFont(FontData &font); +#endif + + ///////////// + //Accessors// + ///////////// + + public: + /*! + \brief Get Current Display Width. + + Get Width of Window or Fullscreen mode. + \return Width of Display. + **/ + int GetWidth(); + + /*! + \brief Get Current Display Height. + + Get Height of Window or Fullscreen mode. + \return Height of Display. + **/ + int GetHeight(); + + /*! + \brief Get Current Display BPP. + + Get BPP of Window or Fullscreen mode. + \return BPP of Display. + **/ + int GetBPP(); + + /*! + \brief Get Fullscreen setting. + + Get Fullscreen setting of Display. + \return True if Fullscreen, False if Windowed + **/ + bool IsFullscreen(); +}; + +} + +#endif //__ze_zengine_h__ diff --git a/include/ZE_ZFont.h b/include/ZE_ZFont.h new file mode 100644 index 0000000..dd1458c --- /dev/null +++ b/include/ZE_ZFont.h @@ -0,0 +1,230 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (jturk@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +/*! +\par File Header: +File: ZE_ZFont.h
+Description: Header file for core ZEngine Font Object.
+Author(s): James Turk
+$Id: ZE_ZFont.h,v 1.1 2002/11/21 05:41:10 cozman Exp $
+ + \file ZE_ZFont.h + \brief Definition file for ZFont. + + Definition file for ZFont, the basic Font class for ZEngine. +**/ + +#ifndef __ze_zfont_h__ +#define __ze_zfont_h__ + +#include "ZE_ZObject.h" +#include "ZE_ZImage.h" + +#ifdef USE_SDL_TTF + +namespace ZE +{ + +/*! + \brief ZFont class for basic Font use. + + ZFont font container class, class wraps common features of SDL_TTF. Inherited from ZObject. +**/ +class ZFont : public ZObject +{ + protected: + //! Class containing font and filename. + FontData rFont; + //! SDL_Color for current text color. + SDL_Color rColor; + //! SDL_Color for background color to be used in shaded draws. + SDL_Color rBGColor; + + public: + + /////////////////////// + //Opening and Closing// + /////////////////////// + + /*! + \brief Default Constructor. + + Default Constructor, does nothing. + **/ + ZFont(); + + /*! + \brief Constructor that opens a font with a certain size. + + Constructor simply calls ZFont::Open() with same parameters. + \param filename Font to open. + \param size Size to use for font. + **/ + ZFont(string filename, int size); + + /*! + \brief Destructor, frees memory. + + Destructor calls ZFont::Release(). + **/ + ~ZFont(); + + /*! + \brief Opens a font with a certain size. + + Opens a font given a filename and a point size. + \param filename Font to open. + \param size Size to use for font. + **/ + void Open(string filename, int size); + + /*! + \brief Release font. + + Release memory held by font. + **/ + void Release(); + + //////////////////////// + //Settings and Drawing// + //////////////////////// + + /*! + \brief Draws a string in a color to a ZImage. + + Draw to a surface in specified color and associate that surface with a ZImage. + \param text String to write. + \param image ZImage to draw to. + **/ + void DrawText(string text, ZImage &image); + + /*! + \brief Draws a string with a colored background to a ZImage. + + Draw to a surface a string with a background of rBGColor and lettering in the normal color and associate that surface with a ZImage. + \param text String to write. + \param image ZImage to draw to. + **/ + void DrawShadedText(string text, ZImage &image); + + /*! + \brief Set Text rColor. + + Set rColor of Text Output. + \param r Red component of color (0-255). + \param g Green component of color (0-255). + \param b Blue component of color (0-255). + **/ + void SetColor(Uint8 r, Uint8 g, Uint8 b); + + /*! + \brief Set Background rColor. + + Set rColor of Background for Shaded Draw. + \param r Red component of color (0-255). + \param g Green component of color (0-255). + \param b Blue component of color (0-255). + **/ + void SetBGColor(Uint8 r, Uint8 g, Uint8 b); + + /*! + \brief Set display format. + + Set display format (bold, italic, underline). + \param bold Decides bold setting of font. + \param italic Decides italic setting of font. + \param underline Decides underline setting of font. + **/ + void SetStyle(bool bold, bool italic, bool underline); + + /*! + \brief Resize Font. + + Release and Reopen font in new size. + \param size New size for font. + **/ + void Resize(int size); + + ///////////// + //Accessors// + ///////////// + + /*! + \brief Check if file is loaded. + + Check if file is loaded and pointer to data is non-NULL. + \return Loaded or Unloaded state of data. + **/ + bool IsLoaded(); + + /*! + \brief Get Bold Setting. + + Check if font output is currently bold. + \return True or False state of bold. + **/ + bool IsBold(); + + /*! + \brief Get Italic Setting. + + Check if font output is currently italic. + \return True or False state of italic. + **/ + bool IsItalic(); + + /*! + \brief Get Underlined Setting. + + Check if font output is currently underline. + \return True or False state of underline. + **/ + bool IsUnderlined(); + + /*! + \brief Get Height of Font. + + Check font height as reported by SDL_ttf. + \return Height of font. + **/ + int GetHeight(); + + /*! + \brief Get Line Skip for Font. + + Check font line skip as reported by SDL_ttf. + \return Recommended Line Skip of font. + **/ + int GetLineSkip(); + + /*! + \brief Get String Width. + + Get Width of String in Current Font in Pixels. + \param text String to get width of. + \return Width of String in Current font. + **/ + int GetStringWidth(string text); + + /*! + \brief Get String Height. + + Get Height of String in Current Font in Pixels. + \param text String to get height of. + \return Height of String in Current font. + **/ + int GetStringHeight(string text); +}; + +} + +#endif //USE_SDL_TTF + +#endif //__ze_zfont_h__ diff --git a/include/ZE_ZImage.h b/include/ZE_ZImage.h new file mode 100644 index 0000000..378be7e --- /dev/null +++ b/include/ZE_ZImage.h @@ -0,0 +1,201 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (jturk@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +/*! +\par File Header: +File: ZE_ZImage.h
+Description: Header file for core ZEngine Image Object.
+Author(s): James Turk
+$Id: ZE_ZImage.h,v 1.1 2002/11/21 05:41:10 cozman Exp $
+ + \file ZE_ZImage.h + \brief Definition file for ZImage. + + Definition file for ZImage, the basic Image class for ZEngine. +**/ + +#ifndef __ze_zimage_h__ +#define __ze_zimage_h__ + +#include "ZE_ZObject.h" + +namespace ZE +{ + +/*! + \brief ZImage class for basic Image use. + + ZImage image drawing class, class wraps common features of SDL_Surface. Inherited from ZObject. +**/ +class ZImage : public ZObject +{ + protected: + //! Class containing image and filename. + ImageData rImage; + public: + + /*! + \brief Default Constructor. + + Default Constructor, does nothing. + **/ + ZImage(); + + /*! + \brief Constructor to Construct from File. + + Constructor is same as calling ZImage::Open() on passed filename. + \param filename File to open as rImage. + **/ + ZImage(string filename); + + /*! + \brief Constructor to Construct from SDL_Surface*. + + Constructor is same as calling ZImage::Attach() on passed SDL_Surface*. + \param surface SDL_Surface* to use as rImage. + **/ + ZImage(SDL_Surface *surface); + + /*! + \brief Constructor to Construct from part of an SDL_Surface*. + + Constructor is same as calling ZImage::OpenFromImage. + + \param img Image to take new image from. + \param x X Coordinate in source of top left corner. + \param y Y Coordinate in source of top left corner. + \param w Width of new image. + \param h Height of new image. + **/ + ZImage(SDL_Surface *img, Sint16 x, Sint16 y, Sint16 w, Sint16 h); + + /*! + \brief Destructor, frees memory. + + Destructor calls ZImage::Release(). + **/ + ~ZImage(); + + /////////////////////// + //Opening and Closing// + /////////////////////// + + /*! + \brief Opens a file. + + Open a file using ZEngine. Loads into rImage member of class. + \param filename File to open as rImage. + **/ + void Open(string filename); + + /*! + \brief Cuts part of an existing image to create the new image. + + Cut part of an SDL_Surface to create a new Image. + + \param img Image to take new image from. + \param x X Coordinate in source of top left corner. + \param y Y Coordinate in source of top left corner. + \param w Width of new image. + \param h Height of new image. + **/ + void OpenFromImage(SDL_Surface *img, Sint16 x, Sint16 y, Sint16 w, Sint16 h); + + /*! + \brief Attach an existing surface to class. + + Attach a pointer to instance of ZImage. (NOTE: Should not be used on a surface that is owned elsewhere.) + \param surface SDL_Surface* to use as rImage. + **/ + void Attach(SDL_Surface *surface); + + /*! + \brief Releases image. + + Frees memory via call to SDL_FreeSurface for the image. + **/ + void Release(); + + //////////// + //Graphics// + //////////// + + /*! + \brief Sets Alpha (transparency) value of Image. + + Set Alpha channel of an Image, only used in 32 bit mode. + \param alpha Number 0-255 describing translucency of image. (0 = transparent, 255 = opaque) + **/ + void SetAlpha(Uint8 alpha); + + /*! + \brief Set Color Key (transparent color) of Image. + + Set color which will not be drawn in image. + \param color Uint32 color describing color to use as transparent. + **/ + void SetColorKey(Uint32 color); + + /*! + \brief Draw Image to Screen. + + Draw Image to screen at specified location. + \param x X coord to draw Image to. + \param y Y coord to draw Image to. + **/ + void Draw(Sint16 x, Sint16 y); + + ///////////// + //Accessors// + ///////////// + + /*! + \brief Check if file is loaded. + + Check if file is loaded and pointer to data is non-NULL. + \return Loaded or Unloaded state of data. + **/ + bool IsLoaded(); + + /*! + \brief Get SDL_Surface. + Get SDL_Surface pointer to actual image data. + \return SDL_Surface* of rImage. + **/ + SDL_Surface *GetImage(); + + /*! + \brief Get Width. + + Get Width of Image. + \return Image Width. + **/ + int GetWidth(); + + /*! + \brief Get Height. + + Get Height of Image. + \return Image Height. + **/ + int GetHeight(); + + /*! + \brief Get filename of image. + + Get filename of image or if Image doesn't have a specific filename string describing origin of image. + \return Image Filename. + **/ + string GetFilename(); +}; +} + +#endif //__ze_zimage_h__ diff --git a/include/ZE_ZMusic.h b/include/ZE_ZMusic.h new file mode 100644 index 0000000..ab5d87c --- /dev/null +++ b/include/ZE_ZMusic.h @@ -0,0 +1,183 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (jturk@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +/*! +\par File Header: +File: ZE_ZMusic.h
+Description: Header file for core ZEngine Music Wrapper Object.
+Author(s): James Turk
+$Id: ZE_ZMusic.h,v 1.1 2002/11/21 05:41:11 cozman Exp $
+ + \file ZE_ZMusic.h + \brief Definition file for ZMusic. + + Definition file for ZMusic, the Music file wrapper for ZEngine. +**/ + +#ifndef __ze_zmusic_h__ +#define __ze_zmusic_h__ + +#include "ZE_ZObject.h" + +#ifdef USE_SDL_MIXER + +namespace ZE +{ + +/*! + \brief ZMusic class for playing full length music (eg. ogg or wav). + + ZMusic music class, class wraps common features for SDL_Mixer's Mix_Music. Inherited from ZObject. +**/ +class ZMusic : public ZObject +{ + protected: + //! Class containing music data and music filename. + MusicData rMusic; + + public: + //! Static Variable For Infinite loop of sound. (Defined as -1) + static const int LoopInfinite; + + /////////////////////// + //Opening and Closing// + /////////////////////// + + /*! + \brief Default Constructor. + + Default Constructor, does nothing. + **/ + ZMusic(); + + /*! + \brief Constructor that opens a music file. + + Constructor simply calls ZMusic::Open() with same filename. (WAV,MOD,MID,OGG) + \param filename Music to open. + **/ + ZMusic(string filename); + + /*! + \brief Destructor, frees memory. + + Destructor calls ZMusic::Release(). + **/ + ~ZMusic(); + + /*! + \brief Opens a music file. + + Open a music file to be used. + \param filename Music to open. + **/ + void Open(string filename); + + /*! + \brief Release music. + + Release memory held by music data. + **/ + void Release(); + + ///////////////// + //Play Controls// + ///////////////// + + /*! + \brief Play currently loaded music. + + Play music currently loaded in ZMusic, looping loopNum times. (use ZMusic::LoopInfinite to loop forever.) + If fade is not zero (which it defaults to) music will fade in over specified number of milliseconds. + \param loopNum Number of times to loop song, defaults to zero. + \param fadeTime Milliseconds to fade to full volume, defaults to zero for no fade. + **/ + void Play(int loopNum=0, int fadeTime=0); + + /*! + \brief Pause music. + + Pause currently playing music. + **/ + void Pause(); + + /*! + \brief Unpause music. + + Unpause currently paused music. + **/ + void Unpause(); + + /*! + \brief Rewind music. + + Rewind music to beginning. + **/ + void Rewind(); + + /*! + \brief Stop music. + + Stop currently playing music, if fadeTime is not zero, fade out over specified time. + \param fadeTime Milliseconds to fade out over, defaults to zero for immediate stop. + **/ + void Stop(int fadeTime=0); + + /*! + \brief Change Volume. + + Change volume of currently playing music. + \param volume Volume to change to, can be in a range from 0 to 128 + **/ + void SetVolume(int volume); + + ///////////// + //Accessors// + ///////////// + + /*! + \brief Check if file is loaded. + + Check if file is loaded and pointer to data is non-NULL. + \return Loaded or Unloaded state of data. + **/ + bool IsLoaded(); + + /*! + \brief Check if music is Playing. + + Check if music is playing, specifically if it is not stopped. (Paused state should be checked for by IsPaused) + \return Playing / Not Playing State of Music. + **/ + bool IsPlaying(); + + /*! + \brief Check if music is Paused. + + Check if music is "playing" but currently paused. + \return Paused / Not Paused State of Music. + **/ + bool IsPaused(); + + /*! + \brief Find Current Volume of Music. + + Get current volume of music represented as a value from 0-128. + \return Volume of music, 0-128. + **/ + int GetVolume(); +}; + + +} + +#endif //USE_SDL_MIXER + +#endif //__ze_zmusic_h__ diff --git a/include/ZE_ZObject.h b/include/ZE_ZObject.h new file mode 100644 index 0000000..2b0c7b2 --- /dev/null +++ b/include/ZE_ZObject.h @@ -0,0 +1,58 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (jturk@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +/*! +\par File Header: +File: ZE_ZObject.h
+Description: Header file for ZEngine core Object ZObject, base of most ZEngine objects.
+Author(s): James Turk
+$Id: ZE_ZObject.h,v 1.1 2002/11/21 05:41:11 cozman Exp $
+ + \file ZE_ZObject.h + \brief Definition file for ZObject Base Class. + + Definition file for ZObject the Virtual Base Class for majority of the ZEngine Objects. +**/ + +#ifndef __ze_zobject_h__ +#define __ze_zobject_h__ + +#include "ZE_ZEngine.h" + +namespace ZE +{ +/*! + \brief ZObject base class for other ZEngine objects. + + This is the base class from which all ZEngine internal objects are derived from. +**/ +class ZObject +{ + protected: + //! Pointer to ZEngine Object + ZEngine* rEngine; + public: + /*! + \brief ZEngine Constructor. + + ZEngine Constructor, gets Engine pointer for Object. + **/ + ZObject() { rEngine = ZEngine::GetInstance(); }; + + /*! + \brief ZEngine Virtual destructor. + + ZEngine destructor, provided to make class safely inheritable. + **/ + virtual ~ZObject() {}; +}; +} + +#endif //__ze_zobject_h__ diff --git a/include/ZE_ZRect.h b/include/ZE_ZRect.h new file mode 100644 index 0000000..ebce462 --- /dev/null +++ b/include/ZE_ZRect.h @@ -0,0 +1,244 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (jturk@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +/*! +\par File Header: +File: ZE_ZRect.h
+Description: Header file for core ZEngine Rectangle Object.
+Author(s): James Turk
+$Id: ZE_ZRect.h,v 1.1 2002/11/21 05:41:11 cozman Exp $
+ + \file ZE_ZRect.h + \brief Definition file for ZRect. + + Definition file for ZRect, the Rectangle class for ZEngine. +**/ + +#ifndef __ze_zrect_h__ +#define __ze_zrect_h__ + +#include "ZE_ZObject.h" //included even though ZRect isn't derived (to obtain all other needed headers) + +namespace ZE +{ + +/*! + \brief ZEngine class for simplified rectangle use. + + ZRect Rectangle class, used to define a rectangular area or perform operations on the defined area. +**/ +class ZRect +{ + private: + //! X Position of top left corner of rectangle. + int mX; + //! Y Position of top left corner of rectangle. + int mY; + //! Width of Rectangle. + int mWidth; + //! Height of Rectangle. + int mHeight; + + public: + + /*! + \brief Default constructor for ZRect. + + Default constructor, initializes all values to zero. + **/ + ZRect(); + + /*! + \brief Constructor for ZRect that takes inital values. + + Constructor for ZRect that takes inital values for all four members. + \param x Value for x position. + \param y Value for y position. + \param width Value for width. + \param height Value for height. + **/ + ZRect(int x, int y, int width, int height); + + /*! + \brief Copy constructor for ZRect. + + Takes a ZRect and constructs a new identical rectangle. + \param rhs Rectangle to construct from. + **/ + ZRect(const ZRect &rhs); + + /*! + \brief Overload for = operator with ZRect. + + Copies all values from one ZRect into another. + \param rhs Rectangle to copy values from. + \return New value of the ZRect. + **/ + const ZRect& operator=(const ZRect &rhs); + + /*! + \brief Overload for < operator with ZRect, based upon location then size. + + Rectangles are sorted by y value, followed by x value, if they start at the same place, + the smaller of the two is deemed less than the other. + \param rhs Rectangle to compare. + \return True if this rectangle is smaller than the rhs rectangle, false otherwise. + **/ + bool operator<(const ZRect &rhs) const; + + /*! + \brief Changes the location of the rectangle. + + Changes the current x,y position of the rectangle. + \param x New x position for rectangle. + \param y New y position for rectangle. + **/ + void Move(int x, int y); + + /*! + \brief Changes the location of the rectangle based upon the current location. + + Changes the current x,y position of the rectangle relative to the current location. + \param xMove Offset for new x position from current. + \param yMove Offset for new y position from current. + **/ + void MoveRel(int xMove, int yMove); + + /*! + \brief Resize rectangle. + + Changes the current width and height of the rectangle. + \param width New width for rectangle. + \param height New height for rectangle. + **/ + void Resize(int width, int height); + + /*! + \brief Grows or shrinks current rectangle. + + Changes the current width and height of the rectangle based upon current values. + \param widthChange Amount to add or subtract from width. + \param heightChange Amount to add or subtract from height. + **/ + void ResizeRel(int widthChange, int heightChange); + + /*! + \brief Check if one ZRect intersects another. + + Checks for overlap and returns boolean value based on if overlap exists. + \param rect Rectangle to check for intersection with. + \return True if intersection occured, false otherwise. + **/ + bool Intersects(const ZRect &rect) const; + + /*! + \brief Check if a rectangle contains a given point. + + Checks point against boundaries of rectangle and returns result. + \param x X value of point to check. + \param y Y value of poitn to check. + \return Boolean variable, true if point is inside rectangle, false otherwise. + **/ + bool Contains(int x, int y) const; + + /*! + \brief Check if a rectangle contains a given point. + + Checks point against boundaries of rectangle and returns result. + \param rect Rectangle to check for point. + \return Boolean variable, true if point is inside rectangle, false otherwise. + **/ + bool Contains(const ZRect &rect) const; + + /*! + \brief Finds intersection of two rectangles. + + Checks for intersection, and returns rectangle where the two rectangles intersect. + \param rect Rectangle to check intersection with. + \return ZRect describing intersection area. + **/ + ZRect Intersection(const ZRect &rect) const; + + /*! + \brief Returns an SDL_Rect representing the rectangle. + + Makes a SDL_Rect representing the rectangle, for use where functions require an SDL_Rect. + \return SDL_Rect representing the ZRect. + **/ + SDL_Rect SDLrect() const; + + /*! + \brief Returns X Location. + + Access private X location member. + \return Value of mX. + **/ + int X() const; + + /*! + \brief Returns Y Location. + + Access private Y location member. + \return Value of mY. + **/ + int Y() const; + + /*! + \brief Return position of left side. + + Find X position of left side of rectangle. + \return X position of left side. + **/ + int Left() const; + + /*! + \brief Return position of right side. + + Find X position of right side of rectangle. + \return X position of right side. + **/ + int Right() const; + + /*! + \brief Return position of top side. + + Find Y position of top side of rectangle. + \return Y position of top side. + **/ + int Top() const; + + /*! + \brief Return position of bottom side. + + Find Y position of left side of rectangle. + \return Y position of bottom side. + **/ + int Bottom() const; + + /*! + \brief Returns Width. + + Access private width member. + \return Value of mWidth. + **/ + int Width() const; + + /*! + \brief Returns Height. + + Access private height member. + \return Value of mHeight. + **/ + int Height() const; +}; + +} //namspace ZE + +#endif //__ze_zrect_h__ diff --git a/include/ZE_ZSound.h b/include/ZE_ZSound.h new file mode 100644 index 0000000..654fef0 --- /dev/null +++ b/include/ZE_ZSound.h @@ -0,0 +1,178 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (jturk@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +/*! +\par File Header: +File: ZE_ZSound.h
+Description: Header file for core ZEngine Sound Wrapper Object.
+Author(s): James Turk
+$Id: ZE_ZSound.h,v 1.1 2002/11/21 05:41:12 cozman Exp $
+ + \file ZE_ZSound.h + \brief Definition file for ZSound. + + Definition file for ZSound, the Sound Effect wrapper for ZEngine. +**/ + +#ifndef __ze_zsound_h__ +#define __ze_zsound_h__ + +#include "ZE_ZObject.h" + +#ifdef USE_SDL_MIXER + +namespace ZE +{ + +/*! + \brief ZSound class for playing sound effects. (WAV) + + ZSound music class, class wraps common features for SDL_Mixer's Mix_Chunk. Inherited from ZObject. +**/ +class ZSound : public ZObject +{ + protected: + //! Class containing music data and music filename. + SoundData rSound; + //! Channel ID Number from SDL_Mixer. + int rChannelID; + + public: + //! Static Variable For Infinite loop of sound. (Defined as -1) + static const int LoopInfinite; + + /////////////////////// + //Opening and Closing// + /////////////////////// + + /*! + \brief Default Constructor. + + Default Constructor, does nothing. + **/ + ZSound(); + + /*! + \brief Constructor that opens a sound effect file. + + Constructor simply calls ZSound::Open() with same filename. (WAV,MOD,MID,OGG) + \param filename Sound effect to open. + **/ + ZSound(string filename); + + /*! + \brief Destructor, frees memory. + + Destructor calls ZSound::Release(). + **/ + ~ZSound(); + + /*! + \brief Opens a sound effect file. + + Open a music file to be used. + \param filename Music to open. + **/ + void Open(string filename); + + /*! + \brief Release sound effect. + + Release memory held by sample data. + **/ + void Release(); + + ///////////////// + //Play Controls// + ///////////////// + + /*! + \brief Play currently loaded sound effect. + + Play sound effect, looping loopNum times. (use ZSound::LoopInfinite to loop forever.) + If fade is not zero (which it defaults to) music will fade in over specified number of milliseconds. + \param loopNum Number of times to loop song, defaults to zero. + \param fadeTime Milliseconds to fade to full volume, defaults to zero for no fade. + **/ + void Play(int loopNum=0, int fadeTime=0); + + /*! + \brief Pause sound. + + Pause currently playing sound. + **/ + void Pause(); + + /*! + \brief Unpause sound. + + Unpause currently playing sound. + **/ + void Unpause(); + + /*! + \brief Stop sound. + + Stop currently playing sound, if fadeTime is not zero, fade out over specified time. + \param fadeTime Milliseconds to fade out over, defaults to zero for immediate stop. + **/ + void Stop(int fadeTime=0); + + /*! + \brief Change Volume. + + Change volume of currently playing sample. + \param volume Volume to change to, can be in a range from 0 to 128. + **/ + void SetVolume(int volume); + + ///////////// + //Accessors// + ///////////// + + /*! + \brief Check if file is loaded. + + Check if file is loaded and pointer to data is non-NULL. + \return Loaded or Unloaded state of data. + **/ + bool IsLoaded(); + + /*! + \brief Check if sound is Playing. + + Check if sound is playing, specifically if it is not stopped. (Paused state should be checked for by IsPaused) + \return Playing / Not Playing State of sound. + **/ + bool IsPlaying(); + + /*! + \brief Check if sound is Paused. + + Check if sound is "playing" but currently paused. + \return Paused / Not Paused State of Sound. + **/ + bool IsPaused(); + + /*! + \brief Find Current Volume of Sound Channel. + + Get current volume of sound channel represented as a value from 0-128. + \return Volume of sound channel, 0-128. + **/ + int GetVolume(); +}; + + +} + +#endif //USE_SDL_MIXER + +#endif //__ze_zsound_h__ diff --git a/include/ZE_ZTimer.h b/include/ZE_ZTimer.h new file mode 100644 index 0000000..3602129 --- /dev/null +++ b/include/ZE_ZTimer.h @@ -0,0 +1,107 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (jturk@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +/*! +\par File Header: +File: ZE_ZTimer.h
+Description: Header file for core ZEngine Timer Object.
+Author(s): James Turk
+$Id: ZE_ZTimer.h,v 1.1 2002/11/21 05:41:12 cozman Exp $
+ + \file ZE_ZTimer.h + \brief Definition file for ZTimer. + + Definition file for ZTimer, the Timer class for ZEngine. +**/ + +#ifndef __ze_ztimer_h__ +#define __ze_ztimer_h__ + +#include "ZE_ZObject.h" + +namespace ZE +{ + +/*! + \brief ZTimer class for Timer use. + + ZTimer timing class, class wraps common features of SDL timer. Inherited from ZObject and tied to ZEngine main timer. +**/ +class ZTimer : public ZObject +{ + protected: + //! Paused / Unpaused state of Timer + bool rPaused; + //! Using ZEngine timer or SDL global timer. + bool rUseZEngine; + //! Total time this timer has been paused. + Uint32 rPausedTime; + //! Time this Timer was paused. + Uint32 rLastPause; + + /*! + \brief Get time from parent timer. + + Protected method to get time from whichever timer is parent. + \return Time on parent timer. + **/ + Uint32 GetParentTime(); + + public: + + /*! + \brief Constructs a new Timer. + + Sets TimePaused to current ZEngine time if useZEngine is true, otherwise uses SDL timer. + \param useZEngine Tells if timer should use ZEngine or SDL. + **/ + ZTimer(bool useZEngine=true); + + /*! + \brief Reset Timer. + + Set Timer back to Zero, will also unpause timer if it was paused. + **/ + void Reset(); + + /*! + \brief Pause Timer. + + Pause the timer if it is unpaused. + **/ + void Pause(); + + /*! + \brief Unpause Timer. + + Unpause the timer if it is paused. + **/ + void Unpause(); + + /*! + \brief Get Time of Timer. + + Get current time accounting for time paused. + \return Current Timer Time. + **/ + Uint32 GetTime(); + + /*! + \brief Get paused state. + + Find out paused state of timer. + \return Paused state for timer. + **/ + bool IsPaused(); +}; + +} + +#endif //__ze_ztimer_h__ diff --git a/include/ZEngine.h b/include/ZEngine.h new file mode 100644 index 0000000..34e27ef --- /dev/null +++ b/include/ZEngine.h @@ -0,0 +1,54 @@ +/*! +\par File Header: +File: ZEngine.h
+Description: Public Header File for ZEngine.
+Author(s): James Turk
+$Id: ZEngine.h,v 1.1 2002/11/21 05:41:10 cozman Exp $
+ + \file ZEngine.h + \brief Header file for ZEngine. + + Header file for ZEngine Game Engine from Concept of Zero, this is the file that programs that wish to + utilize ZEngine should include. +**/ + +/*! + \mainpage ZEngine Documentation + + \author James Turk + \version 0.7.5 + \date 21 November, 2002 + + \section ZEngine About ZEngine +
+ ZEngine is designed to wrap common interfaces of the SDL API in an Object Oriented manner. It is licensed under + a very liberal BSD-style license, and anyone is free to suggest or implement changes to be added to the Engine. In addition + ZEngine hopes to provide a core engine which can be used to develop a game without having to rewrite large amounts + of code. + + \section Licensing Licensing +
+         This file is Part of the ZEngine Library for SDL Game Development.
+                      Copyright (C) 2002 ConceptOfZero.net
+
+             Licensed under the BSD License, see licensing.txt.
+
+    The maintainer of this library is James Turk (james@conceptofzero.net) 
+         and the home of this Library is http://www.conceptofzero.net/
+     
+ \section Authors Contributing Authors + James Turk james@conceptofzero.net - Core Engine and Classes for Data Types +**/ + +#include "ZE_ZEngine.h" +#include "ZE_ZImage.h" +#include "ZE_ZTimer.h" +#include "ZE_ZConfigFile.h" +#include "ZE_ZRect.h" +#ifdef USE_SDL_TTF +#include "ZE_ZFont.h" +#endif +#ifdef USE_SDL_MIXER +#include "ZE_ZSound.h" +#include "ZE_ZMusic.h" +#endif diff --git a/include/external/physfsrwops.h b/include/external/physfsrwops.h new file mode 100644 index 0000000..9f58c89 --- /dev/null +++ b/include/external/physfsrwops.h @@ -0,0 +1,80 @@ +/* + * This code provides a glue layer between PhysicsFS and Simple Directmedia + * Layer's (SDL) RWops i/o abstraction. + * + * License: this code is public domain. I make no warranty that it is useful, + * correct, harmless, or environmentally safe. + * + * This particular file may be used however you like, including copying it + * verbatim into a closed-source project, exploiting it commercially, and + * removing any trace of my name from the source (although I hope you won't + * do that). I welcome enhancements and corrections to this file, but I do + * not require you to send me patches if you make changes. + * + * Unless otherwise stated, the rest of PhysicsFS falls under the GNU Lesser + * General Public License: http://www.gnu.org/licenses/lgpl.txt + * + * SDL falls under the LGPL, too. You can get SDL at http://www.libsdl.org/ + * + * This file was written by Ryan C. Gordon. (icculus@clutteredmind.org). + */ + +#ifndef _INCLUDE_PHYSFSRWOPS_H_ +#define _INCLUDE_PHYSFSRWOPS_H_ + +#include +#include + +/** + * Open a platform-independent filename for reading, and make it accessible + * via an SDL_RWops structure. The file will be closed in PhysicsFS when the + * RWops is closed. PhysicsFS should be configured to your liking before + * opening files through this method. + * + * @param filename File to open in platform-independent notation. + * @return A valid SDL_RWops structure on success, NULL on error. Specifics + * of the error can be gleaned from PHYSFS_getLastError(). + */ +SDL_RWops *PHYSFSRWOPS_openRead(const char *fname); + +/** + * Open a platform-independent filename for writing, and make it accessible + * via an SDL_RWops structure. The file will be closed in PhysicsFS when the + * RWops is closed. PhysicsFS should be configured to your liking before + * opening files through this method. + * + * @param filename File to open in platform-independent notation. + * @return A valid SDL_RWops structure on success, NULL on error. Specifics + * of the error can be gleaned from PHYSFS_getLastError(). + */ +SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname); + +/** + * Open a platform-independent filename for appending, and make it accessible + * via an SDL_RWops structure. The file will be closed in PhysicsFS when the + * RWops is closed. PhysicsFS should be configured to your liking before + * opening files through this method. + * + * @param filename File to open in platform-independent notation. + * @return A valid SDL_RWops structure on success, NULL on error. Specifics + * of the error can be gleaned from PHYSFS_getLastError(). + */ +SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname); + +/** + * Make a SDL_RWops from an existing PhysicsFS file handle. You should + * dispose of any references to the handle after successful creation of + * the RWops. The actual PhysicsFS handle will be destroyed when the + * RWops is closed. + * + * @param handle a valid PhysicsFS file handle. + * @return A valid SDL_RWops structure on success, NULL on error. Specifics + * of the error can be gleaned from PHYSFS_getLastError(). + */ +SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_file *handle); + + +#endif /* include-once blocker */ + +/* end of physfsrwops.h ... */ + diff --git a/licensing.txt b/licensing.txt new file mode 100644 index 0000000..4ea798b --- /dev/null +++ b/licensing.txt @@ -0,0 +1,38 @@ +Copyright (c) James Turk, 2002 +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * 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. + * Neither the name of the Concept of Zero nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT OWNER OR CONTRIBUTORS 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. + +In this distribution all files which fall under the license are marked as such with +the following notice: + +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (james@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ \ No newline at end of file diff --git a/makefile b/makefile new file mode 100644 index 0000000..a00026e --- /dev/null +++ b/makefile @@ -0,0 +1,22 @@ +CC=g++ +CFLAGS=-O2 -W -Wall -I"/usr/include/SDL" -I"/home/James/ZEngine-dev/include" -L"/usr/lib/SDL" -L"/home/James/ZEngine-dev/lib" +LIBS=-lZEngineS -lSDL_mixer -lSDL_image -lSDL_ttf -lSDLmain -lSDL + +ZEngineS.a: src/ZE_ZTimer.cpp src/ZE_ZImage.cpp src/ZE_ZFont.cpp src/ZE_ZMusic.cpp src/ZE_ZConfigFile.cpp src/ZE_ZSound.cpp src/ZE_ZMusic.cpp src/ZE_ZRect.cpp src/ZE_Error.cpp src/ZE_ZEngine.cpp + $(CC) $(CFLAGS) -c src/ZE_ZTimer.cpp src/ZE_ZImage.cpp src/ZE_ZFont.cpp src/ZE_ZMusic.cpp src/ZE_ZConfigFile.cpp src/ZE_ZSound.cpp src/ZE_ZMusic.cpp src/ZE_ZRect.cpp src/ZE_Error.cpp src/ZE_ZEngine.cpp + ar rcs lib/libZEngineS.a ZE_ZTimer.o ZE_ZImage.o ZE_ZFont.o ZE_ZMusic.o ZE_ZConfigFile.o ZE_ZSound.o ZE_ZMusic.o ZE_Error.o ZE_ZRect.o ZE_ZEngine.o + +tests: test/ZFontTest.cpp test/ZMouseTest.cpp test/ZMusicTest.cpp test/ZSoundTest.cpp test/ZTimerTest.cpp test/ZImageTest.cpp test/ZRectTest.cpp + $(CC) $(CFLAGS) test/ZFontTest.cpp -o test/bin/ZFontTest $(LIBS) + $(CC) $(CFLAGS) test/ZMouseTest.cpp -o test/bin/ZMouseTest $(LIBS) + $(CC) $(CFLAGS) test/ZMusicTest.cpp -o test/bin/ZMusicTest $(LIBS) + $(CC) $(CFLAGS) test/ZSoundTest.cpp -o test/bin/ZSoundTest $(LIBS) + $(CC) $(CFLAGS) test/ZTimerTest.cpp -o test/bin/ZTimerTest $(LIBS) + $(CC) $(CFLAGS) test/ZImageTest.cpp -o test/bin/ZImageTest $(LIBS) + $(CC) $(CFLAGS) test/ZRectTest.cpp -o test/bin/ZRectTest $(LIBS) + +.PHONY: clean + +clean: + rm *.o + diff --git a/makefile.mingw32 b/makefile.mingw32 new file mode 100644 index 0000000..44a368a --- /dev/null +++ b/makefile.mingw32 @@ -0,0 +1,20 @@ +CC=g++ +CFLAGS=-O2 -W -Wall -pedantic -I"c:/zengine-dev/include/" -L"c:/zengine-dev/lib/" +LIBS=-lmingw32 -mwindows -lZEngine -lSDL_mixer -lSDL_ttf -lSDLmain -lSDL + +zengine.a: src/ZE_ZTimer.cpp src/ZE_ZImage.cpp src/ZE_ZFont.cpp src/ZE_ZMusic.cpp src/ZE_ZConfigFile.cpp src/ZE_ZSound.cpp src/ZE_ZMusic.cpp src/ZE_Error.cpp src/ZE_ZEngine.cpp + $(CC) $(CFLAGS) -c src/ZE_ZTimer.cpp src/ZE_ZImage.cpp src/ZE_ZFont.cpp src/ZE_ZMusic.cpp src/ZE_ZConfigFile.cpp src/ZE_ZSound.cpp src/ZE_ZMusic.cpp src/ZE_Error.cpp src/ZE_ZEngine.cpp + ar rcs lib/libZEngine.a ZE_ZTimer.o ZE_ZImage.o ZE_ZFont.o ZE_ZMusic.o ZE_ZConfigFile.o ZE_ZSound.o ZE_ZMusic.o ZE_Error.o ZE_ZEngine.o + +tests: test/ZFontTest.cpp test/ZMouseTest.cpp test/ZMusicTest.cpp test/ZSoundTest.cpp test/ZTimerTest.cpp test/ZImageTest.cpp + $(CC) $(CFLAGS) test/ZFontTest.cpp -o test/bin/ZFontTest.exe $(LIBS) + $(CC) $(CFLAGS) test/ZMouseTest.cpp -o test/bin/ZMouseTest.exe $(LIBS) + $(CC) $(CFLAGS) test/ZMusicTest.cpp -o test/bin/ZMusicTest.exe $(LIBS) + $(CC) $(CFLAGS) test/ZSoundTest.cpp -o test/bin/ZSoundTest.exe $(LIBS) + $(CC) $(CFLAGS) test/ZTimerTest.cpp -o test/bin/ZTimerTest.exe $(LIBS) + $(CC) $(CFLAGS) test/ZImageTest.cpp -o test/bin/ZImageTest.exe $(LIBS) + +.PHONY: clean + +clean: + rm *.o \ No newline at end of file diff --git a/readme-external.txt b/readme-external.txt new file mode 100644 index 0000000..4190736 --- /dev/null +++ b/readme-external.txt @@ -0,0 +1 @@ +Files in the src/external and include/external directories are not part of ZEngine, but may be used by ZEngine to interface with external libraries. Such files are only modified to be compatible with ZEngine and marked where such modifcations occur. \ No newline at end of file diff --git a/src/ZE_Error.cpp b/src/ZE_Error.cpp new file mode 100644 index 0000000..edc7793 --- /dev/null +++ b/src/ZE_Error.cpp @@ -0,0 +1,53 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (james@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +/*! +\par File Header: +File: ZE_Error.cpp
+Description: Implementation source file for ZEngine error logging utility functions.
+Author(s): James Turk
+$Id: ZE_Error.cpp,v 1.1 2002/11/21 05:41:12 cozman Exp $
+ + \file ZE_Error.cpp + \brief Source file for error logging utilities. + + Error logging utilities for ZEngine and programs making use of ZEngine. +**/ + +#include "ZE_Error.h" + +namespace ZE +{ + +string _GetError(int line, string file, string str) +{ + return FormatStr("%s (Line %d)\n Message Was: %s \n",file.c_str(),line,str.c_str()); +} + +void _LogError(int line, string file, string str) +{ + string errstr = _GetError(line,file,str); +#ifdef DEBUG_STREAM + fprintf(stderr,errstr.c_str()); //this line writes the actual debug info +#endif +} + +string FormatStr(const char *fmtstr, ...) +{ + char buf[512]; + va_list args; + + va_start(args,fmtstr); + vsprintf(buf, fmtstr, args); + va_end(args); + return buf; +} + +} diff --git a/src/ZE_ZConfigFile.cpp b/src/ZE_ZConfigFile.cpp new file mode 100644 index 0000000..022a672 --- /dev/null +++ b/src/ZE_ZConfigFile.cpp @@ -0,0 +1,326 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (james@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +/*! +\par File Header: +File: ZE_ZConfigFile.cpp
+Description: Implementation source file for ZConfigFile, the ZEngine INI-Style Config File.
+Author(s): James Turk
+$Id: ZE_ZConfigFile.cpp,v 1.1 2002/11/21 05:41:12 cozman Exp $
+ + \file ZE_ZConfigFile.cpp + \brief Source file for ZConfigFile. + + Implementation of ZConfigFile, the ZEngine INI-Style Config File. +**/ + +#include "ZE_ZConfigFile.h" + +namespace ZE +{ + +string ZConfigFile::CleanString(string str) +{ + string tmpStr; + bool inQuotes = false; + + //cycle through, only copy spaces and if a character is uppercase, convert it to lowercase + for(string::size_type i = 0; i < str.length(); i++) + { + if(!isspace(str[i]) || inQuotes) + { + if(str[i] == '\"') + inQuotes = !inQuotes; + if(isupper(str[i]) && !inQuotes) + str[i] = static_cast(tolower(str[i])); + tmpStr += str[i]; + } + } + return tmpStr; +} + +bool ZConfigFile::Exists(string sec) +{ + list::iterator secIter; + + sec = CleanString(sec); + + for(secIter = mFileLayout.begin(); secIter != mFileLayout.end(); secIter++) + { + if(CleanString((*secIter).section) == sec) + return true; + } + return false; +} + +bool ZConfigFile::Exists(string sec, string var) +{ + list::iterator secIter; + list::iterator varIter; + + sec = CleanString(sec); + var = CleanString(var); + + for(secIter = mFileLayout.begin(); secIter != mFileLayout.end(); secIter++) + { + if(CleanString((*secIter).section) == sec) + { + for(varIter = (*secIter).varList.begin(); varIter != (*secIter).varList.end(); varIter++) + { + if(CleanString((*varIter).var) == var) + return true; + } + } + } + return false; +} + +void ZConfigFile::SetVariable(string sec, string var, string val) +{ + list::iterator secIter; + list::iterator varIter; + + if(Exists(CleanString(sec))) + { + sec = CleanString(sec); + for(secIter = mFileLayout.begin(); secIter != mFileLayout.end(); secIter++) + { + if(CleanString((*secIter).section) == sec) //if this is the section + { + if(Exists(sec,var)) + { + var = CleanString(var); + for(varIter = (*secIter).varList.begin(); varIter != (*secIter).varList.end(); varIter++) + { + if(CleanString((*varIter).var) == var) //if this is the variable + { + (*varIter).val = val; + break; //break from this loop + } + } + break; //done in the for loop, time to go + } + else + { + ZCF_Variable tempVar; + tempVar.var = var; + (*secIter).varList.push_back(tempVar); + SetVariable(sec,var,val); + } + } + } + } + else + { + ZCF_Section tempSec; + tempSec.section = sec; + mFileLayout.push_back(tempSec); + SetVariable(sec,var,val); + } +} + +string ZConfigFile::GetVariable(string sec, string var, string defVal) +{ + list::iterator secIter; + list::iterator varIter; + + sec = CleanString(sec); + var = CleanString(var); + + if(Exists(sec)) + { + for(secIter = mFileLayout.begin(); secIter != mFileLayout.end(); secIter++) + { + if(CleanString((*secIter).section) == sec) //if this is the section + { + if(Exists(sec,var)) + { + for(varIter = (*secIter).varList.begin(); varIter != (*secIter).varList.end(); varIter++) + { + if(CleanString((*varIter).var) == var) //if this is the variable + return (*varIter).val; //return now + } + break; //done in the for loop, time to go + } + else + { + return defVal; + break; + } + } + } + } + + return defVal; //if it gets to the end just return the default +} + +ZConfigFile::ZConfigFile() {} + +ZConfigFile::ZConfigFile(string mFilename) +{ + Process(mFilename); +} + +ZConfigFile::~ZConfigFile() +{ + Close(); +} + +void ZConfigFile::Process(string filename) +{ + mFilename = filename; + + ifstream cfile(mFilename.c_str()); + string section, str, var, tmp; + + mFileLayout.clear(); + + while(!cfile.eof() && cfile.is_open()) + { + getline(cfile,str); //read in a line + tmp = CleanString(str); //get a clean version + + //if string is bracketed it is a section, if it begins in a letter it is a variable + if(tmp[0] == '[' && tmp[tmp.length()-1] == ']') + section = str; + else if(isalpha(tmp[0])) + { + var = str.substr(0,str.find('=')); //split the string at the equals sign + SetVariable(section,var,str.substr(str.find('=')+1,str.length()-var.length()-1)); + } + } + cfile.close(); +} + +int ZConfigFile::GetInt(string section, string var, int defVal) +{ + string val; + char tmp[20]; + + section = CleanString(section); + var = CleanString(var); + + section = '[' + section + ']'; + + sprintf(tmp,"%d",defVal); + val = GetVariable(section,var,tmp); + + if(!atoi(val.c_str()) && val[0] !='0') //if it is zero but doesn't start with a zero + return defVal; + else + return atoi(val.c_str()); +} + +bool ZConfigFile::GetBool(string section, string var, bool defVal) +{ + string val,tmp; + + section = CleanString(section); + var = CleanString(var); + + section = '[' + section + ']'; + + tmp = defVal ? "true" : "false"; + val = CleanString(GetVariable(section,var,tmp)); + + if(val == "true" || val == "1") + return true; + else if(val == "false" || val == "0") + return false; + else + return defVal; +} + +string ZConfigFile::GetString(string section, string var, string defVal) +{ + string val; + + section = CleanString(section); + var = CleanString(var); + + section = '[' + section + ']'; + + val = CleanString(GetVariable(section,var,defVal)); + if(val == CleanString(defVal)) + val = defVal; + + + if(val[0] == '\"' && val[val.length()-1] == '\"') + return val.substr(1,val.length()-2); //chop off quotes + else + return val; +} + +void ZConfigFile::SetInt(string section, string var, int val) +{ + char buf[20]; + sprintf(buf,"%d",val); + + section = '[' + section + ']'; + SetVariable(section,var,buf); +} + +void ZConfigFile::SetBool(string section, string var, bool val) +{ + string tmp = val ? "true" : "false"; + + section = '[' + section + ']'; + SetVariable(section,var,tmp); +} + +void ZConfigFile::SetString(string section, string var, string val) +{ + section = '[' + section + ']'; + val = "\"" + val + "\""; + SetVariable(section,var,val); +} + +void ZConfigFile::Flush() +{ + list::iterator secIter; + list::iterator varIter; + string secName; + + //in case the filename is already cleared somehow + if(mFilename.length()) + { + ofstream cfile(mFilename.c_str(), ios::out|ios::trunc); + + if(cfile) + { + //iteration through sections + for(secIter = mFileLayout.begin(); secIter != mFileLayout.end(); secIter++) + { + //ensure that section is valid + secName = CleanString((*secIter).section); + if(secName.length() && secName[0] == '[' && secName[secName.length()-1] == ']') + { + cfile << (*secIter).section << endl; //write out raw section title + + //for each variable in section, write out variable=value + for(varIter = (*secIter).varList.begin(); varIter != (*secIter).varList.end(); varIter++) + { + if(CleanString((*varIter).var).length()) //ensures that variable is valid + cfile << (*varIter).var << '=' << (*varIter).val << endl; + } + } + } + cfile.close(); + } + } +} + +void ZConfigFile::Close() +{ + Flush(); + mFilename = ""; +} + +} diff --git a/src/ZE_ZEngine.cpp b/src/ZE_ZEngine.cpp new file mode 100644 index 0000000..234bcee --- /dev/null +++ b/src/ZE_ZEngine.cpp @@ -0,0 +1,535 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (james@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +/*! +\par File Header: +File: ZE_ZEngine.cpp
+Description: Implementation source file for ZEngine library main singleton class.
+Author(s): James Turk
+$Id: ZE_ZEngine.cpp,v 1.1 2002/11/21 05:41:12 cozman Exp $
+ + \file ZE_ZEngine.cpp + \brief Central source file for ZEngine. + + Actual implementation of ZEngine singleton class at heart of ZEngine. +**/ + +#include "ZE_ZEngine.h" + +namespace ZE +{ + +ZEngine *ZEngine::sInstance=NULL; + +ZEngine::ZEngine() +{ + mWidth = 640; + mHeight = 480; + mBPP = 16; + mFullscreen = true; + +#ifdef USE_SDL_MIXER + mRate = 22050; + mStereo = false; +#endif + + mScreen = NULL; + + mActive = mQuit = false; + mKeyPressed = NULL; + mMouseX = mMouseY = 0; + mMouseB = 0; + + mUnpauseOnActive = mPaused = false; + mLastPause = mPausedTime = mLastTime = 0; + mSecPerFrame = 0.0; +} + +ZEngine* ZEngine::GetInstance() +{ + if(!sInstance) + sInstance = new ZEngine; + + return sInstance; +} + +void ZEngine::ReleaseInstance() +{ + if(sInstance) + { + sInstance->CloseWindow(); + delete sInstance; + } + sInstance = NULL; +} + +string ZEngine::GetVersion() +{ + return VERSION; +} + +void ZEngine::SetupDisplay(int width, int height, int bpp, bool fullscreen) +{ + mWidth = width; + mHeight = height; + mBPP = bpp; + mFullscreen = fullscreen; +} + +#ifdef USE_SDL_MIXER +void ZEngine::SetupSound(int rate, bool stereo) +{ + mRate = rate; + mStereo = stereo; +} +#endif + +void ZEngine::CreateWindow(string title, string icon) +{ + Uint32 flags = SDL_DOUBLEBUF|SDL_HWPALETTE; + ImageData iconImg; + SDL_VideoInfo *videoInfo; + + if(SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_AUDIO) < 0) + { + LogError(FormatStr("SDL could not be Initialized: %s", SDL_GetError())); + //CloseWindow(); + } + +#ifdef USE_SDL_MIXER + Mix_OpenAudio(mRate, AUDIO_S16SYS, mStereo?2:1, 4096); //Open Audio Stream (Stereo?2:1 is conditional for number of channels) +#endif + + videoInfo = const_cast(SDL_GetVideoInfo()); + + //check capabilities and use what we can// + if(videoInfo->hw_available) + flags |= SDL_HWSURFACE; + else + flags |= SDL_SWSURFACE; + if(videoInfo->blit_hw) + flags |= SDL_HWACCEL; + + //Window Manager settings// + if(!icon.length()) + SDL_WM_SetCaption(title.c_str(),NULL); + else + { + SDL_WM_SetCaption(title.c_str(),icon.c_str()); + iconImg = LoadImage(icon); + SDL_WM_SetIcon(iconImg.image,NULL); + FreeImage(iconImg); + } + + //create SDL screen// + if(mFullscreen) + flags |= SDL_FULLSCREEN; + mScreen = SDL_SetVideoMode(mWidth, mHeight, mBPP, flags); + + if(!mScreen) + { + LogError(FormatStr("Unable to set video mode %dx%d (%dBpp): %s",mWidth,mHeight,mBPP,SDL_GetError())); + CloseWindow(); + } + mKeyPressed = SDL_GetKeyState(NULL); + +#ifdef USE_SDL_TTF + TTF_Init(); +#endif + + mLastTime = mPausedTime = SDL_GetTicks(); + mActive = true; +} + +void ZEngine::CloseWindow() +{ +#ifdef USE_SDL_TTF + TTF_Quit(); +#endif + +#ifdef USE_SDL_MIXER + Mix_CloseAudio(); +#endif + +#ifdef USE_PHYSFS + PHYSFS_deinit(); +#endif + + SDL_Quit(); +} + +SDL_Surface *ZEngine::GetDisplay() +{ + return mScreen; +} + +void ZEngine::UpdateScreen() +{ + SDL_Flip(mScreen); + + mSecPerFrame = (GetTime()-mLastTime)/1000.0; + mLastTime = GetTime(); +} + +Uint32 ZEngine::MapColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a) +{ + return SDL_MapRGBA(mScreen->format,r,g,b,a); +} + +void ZEngine::Clear(Uint32 color, SDL_Rect *rect) +{ + SDL_FillRect(mScreen,rect,color); +} + +void ZEngine::Sleep(Uint32 milliseconds) +{ + SDL_Delay(milliseconds); +} + +Uint32 ZEngine::GetTime() +{ + if(mPaused) + return SDL_GetTicks() - (mPausedTime + (SDL_GetTicks() - mLastPause)); + else + return SDL_GetTicks() - mPausedTime; +} + +void ZEngine::PauseTimer() +{ + if(!mPaused) + { + mLastPause = SDL_GetTicks(); + mPaused = true; + } +} + +void ZEngine::UnpauseTimer() +{ + if(mPaused) + { + mPausedTime += (SDL_GetTicks() - mLastPause); + mPaused = false; + } +} + +double ZEngine::GetFrameTime() +{ + return mSecPerFrame; +} + +bool ZEngine::IsPaused() +{ + return mPaused; +} + +bool ZEngine::IsActive() +{ + return mActive; +} + +void ZEngine::RequestQuit() +{ + mQuit = true; //simply request a quit, nothing more +} + +bool ZEngine::QuitRequested() +{ + return mQuit; +} + +bool ZEngine::KeyIsPressed(SDLKey key) +{ + return mKeyPressed[key] == 1; +} + +void ZEngine::HideCursor() +{ + SDL_ShowCursor(SDL_DISABLE); +} + +void ZEngine::ShowCursor() +{ + SDL_ShowCursor(SDL_ENABLE); +} + +int ZEngine::GetMouseX() +{ + return mMouseX; +} + +int ZEngine::GetMouseY() +{ + return mMouseY; +} + +bool ZEngine::LButtonPressed() +{ + return (mMouseB & SDL_BUTTON_LMASK) > 0; +} + +bool ZEngine::RButtonPressed() +{ + return (mMouseB & SDL_BUTTON_RMASK) > 0; +} + +bool ZEngine::MouseInRect(SDL_Rect *rect) +{ + return (mMouseX >= rect->x && mMouseX <= rect->x+rect->w && + mMouseY >= rect->y && mMouseY <= rect->y+rect->h); +} + +void ZEngine::CheckEvents() +{ + SDL_Event event; + + while(SDL_PollEvent(&event)) + { + switch(event.type) + { + case SDL_VIDEOEXPOSE: + case SDL_ACTIVEEVENT: + if(event.active.state & SDL_APPACTIVE || event.active.state & SDL_APPINPUTFOCUS) + { + if( (event.type == SDL_ACTIVEEVENT && event.active.gain == 1) || event.type == SDL_VIDEOEXPOSE) + { + mActive = true; + if(mUnpauseOnActive) + UnpauseTimer(); + } + else + { + mActive = mUnpauseOnActive = false; + if(!mPaused) + { + mUnpauseOnActive = true; + PauseTimer(); + } + else + mUnpauseOnActive = false; + } + } + break; + case SDL_QUIT: + mQuit = true; + break; + default: + break; + } + } + + mKeyPressed = SDL_GetKeyState(NULL); //recommended but not needed (says Sam) + + if(mKeyPressed[SDLK_F4] && (mKeyPressed[SDLK_LALT] || mKeyPressed[SDLK_RALT])) + mQuit = true; + + mMouseB = SDL_GetMouseState(&mMouseX,&mMouseY); +} + +#ifdef USE_PHYSFS + +void ZEngine::InitPhysFS(string argv) +{ + string::size_type pos; + PHYSFS_init(argv.c_str()); + + pos = argv.rfind(PHYSFS_getDirSeparator()); + if(pos != string::npos) + AddPhysFSDir(argv.substr(0,pos)); +} + +void ZEngine::AddPhysFSDir(string dir) +{ + PHYSFS_addToSearchPath(dir.c_str(),0); +} + +#endif //USE_PHYSFS + +ImageData ZEngine::LoadImage(string filename) +{ + ImageData img; + +//using physfs// +#ifdef USE_PHYSFS + SDL_RWops *rw; + rw = PHYSFSRWOPS_openRead(filename.c_str()); + if(!rw) + LogError(FormatStr("PhysFS RWops failed: %s",SDL_GetError())); +#ifdef USE_SDL_IMAGE + img.image = IMG_Load_RW(rw,0); +#else + img.image = SDL_LoadBMP_RW(rw,0); +#endif //USE_SDL_IMAGE + SDL_FreeRW(rw); +//end using physfs// + +//Just SDL// +#else +#ifdef USE_SDL_IMAGE + img.image = IMG_Load(filename.c_str()); +#else + img.image = SDL_LoadBMP(filename.c_str()); +#endif //USE_SDL_IMAGE +#endif //USE_PHYSFS + + if(!img.image) + { + img.filename = FormatStr("LoadImage could not load %s.",filename.c_str()); + LogError(img.filename); + } + else + img.filename = filename; + + return img; +} + +void ZEngine::FreeImage(ImageData &image) +{ + if(image.image) + { + SDL_FreeSurface(image.image); + image.image = NULL; + image.filename = "free"; + } +} + +#ifdef USE_SDL_MIXER + +SoundData ZEngine::LoadSound(string filename) +{ + SoundData snd; + +#ifdef USE_PHYSFS + SDL_RWops *rw; + rw = PHYSFSRWOPS_openRead(filename.c_str()); + snd.sound = Mix_LoadWAV_RW(rw,0); + SDL_FreeRW(rw); +#else + snd.sound = Mix_LoadWAV(filename.c_str()); +#endif //USE_PHYSFS + + if(!snd.sound) + { + snd.filename = FormatStr("LoadSound could not load %s.",filename.c_str()); + LogError(snd.filename); + } + else + snd.filename = filename; + + return snd; +} + +void ZEngine::FreeSound(SoundData &sound) +{ + if(sound.sound) + { + Mix_FreeChunk(sound.sound); + sound.sound = NULL; + sound.filename = "free"; + } +} + +MusicData ZEngine::LoadMusic(string filename) +{ + MusicData mus; + +//Currently SDL_Mixer doesn't support Music from a RW +//#ifdef USE_PHYSFS +// SDL_RWops *rw; +// rw = PHYSFSRWOPS_openRead(filename.c_str()); +// mus.music = Mix_LoadMUS_RW(filename.c_str(),0); +// SDL_FreeRW(rw); +//#else + mus.music = Mix_LoadMUS(filename.c_str()); +//#endif //USE_PHYSFS + + if(!mus.music) + { + mus.filename = FormatStr("LoadMusic could not load %s.",filename.c_str()); + LogError(mus.filename); + } + else + mus.filename = filename; + + return mus; +} + +void ZEngine::FreeMusic(MusicData &music) +{ + if(music.music) + { + Mix_FreeMusic(music.music); + music.music = NULL; + music.filename = "free"; + } +} + +#endif + +#ifdef USE_SDL_TTF + +FontData ZEngine::LoadFont(string filename, int size) +{ + FontData fnt; + +//Currently SDL_ttf doesn't support Fonts from a RW +//#ifdef USE_PHYSFS +// SDL_RWops *rw; +// rw = PHYSFSRWOPS_openRead(filename.c_str()); +// fnt.font = TTF_OpenFontRW(rw,0); +// SDL_FreeRW(rw); +//#else + fnt.font = TTF_OpenFont(filename.c_str(),size); +//#endif //USE_PHYSFS + + if(!fnt.font) + { + fnt.filename = FormatStr("LoadFont could not load %s.",filename.c_str()); + LogError(fnt.filename); + } + else + fnt.filename = filename; + + return fnt; +} + +void ZEngine::FreeFont(FontData &font) +{ + if(font.font) + { + TTF_CloseFont(font.font); + font.font = NULL; + font.filename = "free"; + } +} + + +#endif + +int ZEngine::GetWidth() +{ + return mWidth; +} + +int ZEngine::GetHeight() +{ + return mHeight; +} + +int ZEngine::GetBPP() +{ + return mBPP; +} + +bool ZEngine::IsFullscreen() +{ + return mFullscreen; +} + +} diff --git a/src/ZE_ZFont.cpp b/src/ZE_ZFont.cpp new file mode 100644 index 0000000..69057a9 --- /dev/null +++ b/src/ZE_ZFont.cpp @@ -0,0 +1,203 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (james@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +/*! +\par File Header: +File: ZE_ZFont.cpp
+Description: Implementation source file for core ZEngine Font Object.
+Author(s): James Turk
+$Id: ZE_ZFont.cpp,v 1.1 2002/11/21 05:41:13 cozman Exp $
+ + \file ZE_ZFont.cpp + \brief Source file for ZFont. + + Implementation of ZFont, the basic Font class for ZEngine. +**/ + +#include "ZE_ZFont.h" + +#ifdef USE_SDL_TTF + +namespace ZE +{ + + +ZFont::ZFont() +{ + rColor.r = rColor.g = rColor.b = rColor.unused = 255; + rBGColor.r = rBGColor.g = rBGColor.b = rBGColor.unused = 0; +} + +ZFont::ZFont(string filename, int size) +{ + rColor.r = rColor.g = rColor.b = rColor.unused = 255; + rBGColor.r = rBGColor.g = rBGColor.b = rBGColor.unused = 0; + Open(filename,size); +} + +ZFont::~ZFont() +{ + Release(); +} + +void ZFont::Open(string filename, int size) +{ + Release(); + rFont = rEngine->LoadFont(filename,size); +} + +void ZFont::Release() +{ + rEngine->FreeFont(rFont); +} + +void ZFont::DrawText(string text, ZImage &image) +{ + image.Attach(TTF_RenderText_Solid(rFont.font, text.c_str(), rColor)); +} + +void ZFont::DrawShadedText(string text, ZImage &image) +{ + image.Attach(TTF_RenderText_Shaded(rFont.font, text.c_str(), rColor, rBGColor)); +} + +void ZFont::SetColor(Uint8 r, Uint8 g, Uint8 b) +{ + rColor.r = r; + rColor.g = g; + rColor.b = b; +} + +void ZFont::SetBGColor(Uint8 r, Uint8 g, Uint8 b) +{ + rBGColor.r = r; + rBGColor.g = g; + rBGColor.b = b; +} + +void ZFont::SetStyle(bool Bold, bool Italic, bool Underline) +{ + int flags=0; + + if(Bold) + flags |= TTF_STYLE_BOLD; + if(Italic) + flags |= TTF_STYLE_ITALIC; + if(Underline) + flags |= TTF_STYLE_UNDERLINE; + if(!flags) + flags = TTF_STYLE_NORMAL; + + if(rFont.font) + TTF_SetFontStyle(rFont.font,flags); + else + LogError(FormatStr("ZFont not initialized in ZFont::SetStyle(), filename: %s.",rFont.filename.c_str())); +} + +void ZFont::Resize(int size) +{ + Open(rFont.filename,size); +} + +bool ZFont::IsLoaded() +{ + return rFont.font != NULL; +} + +bool ZFont::IsBold() +{ + if(rFont.font) + return (TTF_GetFontStyle(rFont.font) & TTF_STYLE_BOLD) > 0; + else + { + LogError(FormatStr("ZFont not initialized in ZFont::IsBold(), filename: %s.",rFont.filename.c_str())); + return false; + } +} + +bool ZFont::IsItalic() +{ + if(rFont.font) + return (TTF_GetFontStyle(rFont.font) & TTF_STYLE_ITALIC) > 0; + else + { + LogError(FormatStr("ZFont not initialized in ZFont::IsItalic(), filename: %s.",rFont.filename.c_str())); + return false; + } +} + +bool ZFont::IsUnderlined() +{ + if(rFont.font) + return (TTF_GetFontStyle(rFont.font) & TTF_STYLE_UNDERLINE) > 0; + else + { + LogError(FormatStr("ZFont not initialized in ZFont::IsUnderlined(), filename: %s.",rFont.filename.c_str())); + return false; + } +} + +int ZFont::GetHeight() +{ + if(rFont.font) + return TTF_FontHeight(rFont.font); + else + { + LogError(FormatStr("ZFont not initialized in ZFont::GetHeight(), filename: %s.",rFont.filename.c_str())); + return 0; + } +} + +int ZFont::GetLineSkip() +{ + if(rFont.font) + return TTF_FontLineSkip(rFont.font); + else + { + LogError(FormatStr("ZFont not initialized in ZFont::GetLineSkip(), filename: %s.",rFont.filename.c_str())); + return 0; + } +} + +int ZFont::GetStringWidth(string text) +{ + int w,h; + + if(rFont.font) + { + TTF_SizeText(rFont.font,text.c_str(),&w,&h); + return w; + } + else + { + LogError(FormatStr("ZFont not initialized in ZFont::GetStringWidth(%s), filename: %s.",text.c_str(),rFont.filename.c_str())); + return 0; + } +} + +int ZFont::GetStringHeight(string text) +{ + int w,h; + + if(rFont.font) + { + TTF_SizeText(rFont.font,text.c_str(),&w,&h); + return h; + } + else + { + LogError(FormatStr("ZFont not initialized in ZFont::GetStringHeight(%s), filename: %s.",text.c_str(),rFont.filename.c_str())); + return 0; + } +} + +} + +#endif //USE_SDL_TTF diff --git a/src/ZE_ZImage.cpp b/src/ZE_ZImage.cpp new file mode 100644 index 0000000..241b459 --- /dev/null +++ b/src/ZE_ZImage.cpp @@ -0,0 +1,214 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (james@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +/*! +\par File Header: +File: ZE_ZImage.cpp
+Description: Implementation source file for core ZEngine Image Object.
+Author(s): James Turk
+$Id: ZE_ZImage.cpp,v 1.1 2002/11/21 05:41:13 cozman Exp $
+ + \file ZE_ZImage.cpp + \brief Source file for ZImage. + + Implementation of ZImage, the basic Image class for ZEngine. +**/ + +#include "ZE_ZImage.h" + +namespace ZE +{ + +ZImage::ZImage() +{ +} + +ZImage::ZImage(string filename) +{ + Open(filename); +} + +ZImage::ZImage(SDL_Surface *surface) +{ + Attach(surface); +} + +ZImage::ZImage(SDL_Surface *img, Sint16 x, Sint16 y, Sint16 w, Sint16 h) +{ + OpenFromImage(img,x,y,w,h); +} + +ZImage::~ZImage() +{ + Release(); +} + +void ZImage::Open(string filename) +{ + Release(); + rImage = rEngine->LoadImage(filename); +} + +void ZImage::OpenFromImage(SDL_Surface *img, Sint16 x, Sint16 y, Sint16 w, Sint16 h) +{ + Uint32 flags; + SDL_Surface *screen = rEngine->GetDisplay(); + SDL_Rect rect; + SDL_VideoInfo *videoInfo; + + Release(); + rImage.filename = "cut from image"; + + //either set hardware or software surface// + videoInfo = const_cast(SDL_GetVideoInfo()); + + if(videoInfo->hw_available) + flags = SDL_HWSURFACE; + else + flags = SDL_SWSURFACE; + + rect.x = x; + rect.y = y; + rect.w = w; + rect.h = h; + + if(!img) + LogError("Invalid Parameter to ZImage::OpenFromImage: img==NULL"); + + rImage.image = SDL_CreateRGBSurface(flags, rect.w, rect.h, rEngine->GetBPP(), + screen->format->Rmask, screen->format->Gmask, screen->format->Bmask, screen->format->Amask); + + if(!rImage.image) + LogError(FormatStr("SDL_CreateRGBSurface failed in ZImage::OpenFromImage: %s",SDL_GetError())); + + SDL_BlitSurface(img,&rect,rImage.image,NULL); +} + +void ZImage::Attach(SDL_Surface *surface) +{ + Release(); + rImage.filename = "attached"; + rImage.image = surface; +} + +void ZImage::Release() +{ + rEngine->FreeImage(rImage); +} + +void ZImage::SetAlpha(Uint8 alpha) +{ + SDL_Surface *temp=NULL; + + if(rImage.image) + { + if(SDL_SetAlpha(rImage.image, SDL_RLEACCEL|SDL_SRCALPHA, alpha) < 0) + LogError("Invalid Call to SDL_SetAlpha."); + else + { + //surface conversion// + temp = rImage.image; + rImage.image = SDL_DisplayFormat(temp); + if(rImage.image) + { + SDL_FreeSurface(temp); + temp = NULL; + } + else //can't convert (add error warning here?) + { + LogError("Alpha surface conversion failed."); + rImage.image = temp; + } + } + } + else + LogError("ZImage not initialized in ZImage::SetAlpha."); +} + +void ZImage::SetColorKey(Uint32 color) +{ + SDL_Surface *temp=NULL; + + if(rImage.image) + { + if(SDL_SetColorKey(rImage.image, SDL_RLEACCEL|SDL_SRCCOLORKEY, color) < 0) + LogError("Invalid Call to SDL_SetColorKey."); + else + { + //surface conversion// + temp = rImage.image; + rImage.image = SDL_DisplayFormat(temp); + if(rImage.image) + { + SDL_FreeSurface(temp); + temp = NULL; + } + else //can't convert (add error warning here?) + { + LogError("Surface conversion failed."); + rImage.image = temp; + } + } + } + else + LogError("ZImage not initialized in ZImage::SetColorKey."); +} + +void ZImage::Draw(Sint16 x, Sint16 y) +{ + SDL_Rect rect; + + rect.x = x; + rect.y = y; + + if(rImage.image) + SDL_BlitSurface(rImage.image,NULL,rEngine->GetDisplay(),&rect); + else + LogError("ZImage not initialized in ZImage::Draw."); +} + +bool ZImage::IsLoaded() +{ + return rImage.image != NULL; +} + +SDL_Surface *ZImage::GetImage() +{ + return rImage.image; +} + +int ZImage::GetWidth() +{ + if(rImage.image) + return rImage.image->w; + else + { + LogError("ZImage not initialized in ZImage::GetWidth."); + return 0; + } +} + +int ZImage::GetHeight() +{ + if(rImage.image) + return rImage.image->h; + else + { + LogError("ZImage not initialized in ZImage::GetHeight."); + return 0; + } +} + +string ZImage::GetFilename() +{ + return rImage.filename.c_str(); +} + +} diff --git a/src/ZE_ZMusic.cpp b/src/ZE_ZMusic.cpp new file mode 100644 index 0000000..6eb2746 --- /dev/null +++ b/src/ZE_ZMusic.cpp @@ -0,0 +1,160 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (james@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +/*! +\par File Header: +File: ZE_ZMusic.cpp
+Description: Implementation source file for core ZEngine Music Object.
+Author(s): James Turk
+$Id: ZE_ZMusic.cpp,v 1.1 2002/11/21 05:41:13 cozman Exp $
+ + \file ZE_ZMusic.cpp + \brief Source file for ZMusic. + + Implementation of ZMusic, the basic Music class for ZEngine. +**/ + +#include "ZE_ZMusic.h" + +#ifdef USE_SDL_MIXER + +namespace ZE +{ + +const int ZMusic::LoopInfinite = -1; + +ZMusic::ZMusic() +{ +} + +ZMusic::ZMusic(string filename) +{ + Open(filename); +} + +ZMusic::~ZMusic() +{ + Release(); +} + +void ZMusic::Open(string filename) +{ + Release(); + rMusic = rEngine->LoadMusic(filename); +} + +void ZMusic::Release() +{ + Mix_HaltMusic(); + rEngine->FreeMusic(rMusic); +} + +void ZMusic::Play(int loopNum, int fadeTime) +{ + if(Mix_PlayingMusic()) //stop currently playing music + Mix_HaltMusic(); + + if(rMusic.music) + { + if(fadeTime) + Mix_FadeInMusic(rMusic.music, loopNum, fadeTime); + else + Mix_PlayMusic(rMusic.music, loopNum); + } + else + LogError(FormatStr("ZMusic not initialized in ZMusic::Play(%d,%d), filename: %s.",loopNum,fadeTime,rMusic.filename.c_str())); +} + +void ZMusic::Pause() +{ + if(rMusic.music) + Mix_PauseMusic(); + else + LogError(FormatStr("ZMusic not initialized in ZMusic::Pause(), filename: %s.",rMusic.filename.c_str())); +} + +void ZMusic::Unpause() +{ + if(rMusic.music) + Mix_ResumeMusic(); + else + LogError(FormatStr("ZMusic not initialized in ZMusic::Unpause(), filename: %s.",rMusic.filename.c_str())); +} + +void ZMusic::Rewind() +{ + if(rMusic.music) + Mix_RewindMusic(); + else + LogError(FormatStr("ZMusic not initialized in ZMusic::Rewind(), filename: %s.",rMusic.filename.c_str())); +} + +void ZMusic::Stop(int fadeTime) +{ + if(rMusic.music) + { + if(fadeTime) + Mix_FadeOutMusic(fadeTime); + else + Mix_HaltMusic(); + } + else + LogError(FormatStr("ZMusic not initialized in ZMusic::Stop(%d), filename: %s.",fadeTime,rMusic.filename.c_str())); +} + +void ZMusic::SetVolume(int volume) +{ + if(rMusic.music) + Mix_VolumeMusic(volume); + else + LogError(FormatStr("ZMusic not initialized in ZMusic::SetVolume(%d), filename: %s.",volume,rMusic.filename.c_str())); +} + +bool ZMusic::IsLoaded() +{ + return rMusic.music != NULL; +} + +bool ZMusic::IsPlaying() +{ + if(rMusic.music) + return Mix_PlayingMusic() > 0; + else + { + LogError(FormatStr("ZMusic not initialized in ZMusic::IsPlaying(), filename: %s.",rMusic.filename.c_str())); + return false; + } +} + +bool ZMusic::IsPaused() +{ + if(rMusic.music) + return Mix_PausedMusic() > 0; + else + { + LogError(FormatStr("ZMusic not initialized in ZMusic::IsPaused(), filename: %s.",rMusic.filename.c_str())); + return false; + } +} + +int ZMusic::GetVolume() +{ + if(rMusic.music) + return Mix_VolumeMusic(-1); + else + { + LogError(FormatStr("ZMusic not initialized in ZMusic::GetVolume(), filename: %s.",rMusic.filename.c_str())); + return false; + } +} + +} + +#endif diff --git a/src/ZE_ZRect.cpp b/src/ZE_ZRect.cpp new file mode 100644 index 0000000..1771062 --- /dev/null +++ b/src/ZE_ZRect.cpp @@ -0,0 +1,201 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (james@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +/*! +\par File Header: +File: ZE_ZRect.cpp
+Description: Implementation source file for core ZEngine Rectangle Object.
+Author(s): James Turk
+$Id: ZE_ZRect.cpp,v 1.1 2002/11/21 05:41:13 cozman Exp $
+ + \file ZE_ZRect.cpp + \brief Source file for ZRect. + + Implementation of ZRect, the Rectangle class for ZEngine. +**/ + +#include "ZE_ZRect.h" + +namespace ZE +{ + +ZRect::ZRect() : + mX(0),mY(0),mWidth(0),mHeight(0) +{ +} + +ZRect::ZRect(int x, int y, int width, int height) : + mX(x),mY(y),mWidth(width),mHeight(height) +{ +} + +ZRect::ZRect(const ZRect &rhs) : + mX(rhs.X()),mY(rhs.Y()),mWidth(rhs.Width()),mHeight(rhs.Height()) +{ +} + +const ZRect& ZRect::operator=(const ZRect &rhs) +{ + if(this != &rhs) + { + mX = rhs.X(); + mY = rhs.Y(); + mWidth = rhs.Width(); + mHeight = rhs.Height(); + } + return *this; +} + +bool ZRect::operator<(const ZRect &rhs) const +{ + //< is the one that is closer to top corner (as a whole)// + + if(mY < rhs.Y()) //check Ys + return true; + else if(mY > rhs.Y()) + return false; + else + { + if(mX < rhs.X()) //check Xs + return true; + else if(mX > rhs.X()) + return false; + else + { + if(mHeight < rhs.Height()) //check heights + return true; + else if(mHeight > rhs.Height()) + return false; + else + { + if(mWidth < rhs.Width()) //check widths + return true; + else if(mWidth > rhs.Width()) + return false; + else + return false; //nothing left to check they are == + } + } + } +} + +void ZRect::Move(int x, int y) +{ + mX = x; + mY = y; +} + +void ZRect::MoveRel(int xMove, int yMove) +{ + mX += xMove; + mY += yMove; +} + +void ZRect::Resize(int width, int height) +{ + mWidth = width; + mHeight = height; +} + +void ZRect::ResizeRel(int widthChange, int heightChange) +{ + mWidth += widthChange; + mHeight += heightChange; +} + +bool ZRect::Intersects(const ZRect &rect) const +{ + return !(mX > rect.Right() || rect.Left() > mX+mWidth || + mY > rect.Bottom() || rect.Top() > mY+mHeight); +} + +bool ZRect::Contains(int x, int y) const +{ + return x > mX && x < mX+mWidth && y > mY && y < mY+mHeight; +} + +bool ZRect::Contains(const ZRect &rect) const +{ + //contains all 4 points + return Contains(rect.Left(),rect.Top()) && Contains(rect.Right(),rect.Top()) && + Contains(rect.Left(),rect.Bottom()) && Contains(rect.Right(),rect.Bottom()); +} + +ZRect ZRect::Intersection(const ZRect &rect) const +{ + int tempX=0,tempY=0,tempW=0,tempH=0; + + if(Intersects(rect)) + { + tempX = mX > rect.X() ? mX : rect.X(); + tempY = mY > rect.Y() ? mY : rect.Y(); + tempW = mX+mWidth < rect.Right() ? mX+mWidth : rect.Right(); + tempH = mY+mHeight < rect.Bottom() ? mY+mHeight : rect.Bottom(); + + tempW -= tempX; //adjust width and height + tempH -= tempY; + } + + return ZRect(tempX,tempY,tempW,tempH); +} + +SDL_Rect ZRect::SDLrect() const +{ + SDL_Rect ret; + + ret.x = static_cast(mX); + ret.y = static_cast(mY); + ret.w = static_cast(mWidth); + ret.h = static_cast(mHeight); + + return ret; +} + +int ZRect::X() const +{ + return mX; +} + +int ZRect::Y() const +{ + return mY; +} + +int ZRect::Left() const +{ + return mX; +} + +int ZRect::Right() const +{ + return mX+mWidth; +} + +int ZRect::Top() const +{ + return mY; +} + +int ZRect::Bottom() const +{ + return mY+mHeight; +} + +int ZRect::Width() const +{ + return mWidth; +} + +int ZRect::Height() const +{ + return mHeight; +} + +} //namespace ZE diff --git a/src/ZE_ZSound.cpp b/src/ZE_ZSound.cpp new file mode 100644 index 0000000..9b11c0b --- /dev/null +++ b/src/ZE_ZSound.cpp @@ -0,0 +1,156 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (james@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +/*! +\par File Header: +File: ZE_ZSound.cpp
+Description: Implementation source file for core ZEngine Sound Object.
+Author(s): James Turk
+$Id: ZE_ZSound.cpp,v 1.1 2002/11/21 05:41:13 cozman Exp $
+ + \file ZE_ZSound.cpp + \brief Source file for ZSound. + + Implementation of ZSound, the basic Sound class for ZEngine. +**/ + +#include "ZE_ZSound.h" + +#ifdef USE_SDL_MIXER + +namespace ZE +{ + +const int ZSound::LoopInfinite = -1; + +ZSound::ZSound() +{ + rChannelID = -1; //request channel ID +} + +ZSound::ZSound(string filename) +{ + rChannelID = -1; //request channel ID + Open(filename); +} + +ZSound::~ZSound() +{ + Release(); +} + +void ZSound::Open(string filename) +{ + Release(); + rSound = rEngine->LoadSound(filename); +} + +void ZSound::Release() +{ + if(rChannelID >= 0) + Mix_HaltChannel(rChannelID); + rEngine->FreeSound(rSound); +} + +void ZSound::Play(int loopNum, int fadeTime) +{ + if(rChannelID >= 0 && Mix_Playing(rChannelID)) //stop currently playing sound + Mix_HaltChannel(rChannelID); + + if(rSound.sound) + { + if(fadeTime) + rChannelID = Mix_FadeInChannel(rChannelID, rSound.sound, loopNum, fadeTime); + else + rChannelID = Mix_PlayChannel(rChannelID, rSound.sound, loopNum); + } + else if(!rSound.sound) + LogError(FormatStr("ZSound not initialized in ZSound::Play(%d,%d), filename: %s.",loopNum,fadeTime,rSound.filename.c_str())); +} + +void ZSound::Pause() +{ + if(rSound.sound && rChannelID >= 0) + Mix_Pause(rChannelID); + else if(!rSound.sound) + LogError(FormatStr("ZSound not initialized in ZSound::Pause(), filename: %s.",rSound.filename.c_str())); +} + +void ZSound::Unpause() +{ + if(rSound.sound && rChannelID >= 0) + Mix_Resume(rChannelID); + else if(!rSound.sound) + LogError(FormatStr("ZSound not initialized in ZSound::Unpause(), filename: %s.",rSound.filename.c_str())); +} + +void ZSound::Stop(int fadeTime) +{ + if(rSound.sound && rChannelID >= 0) + { + if(fadeTime) + Mix_FadeOutChannel(rChannelID,fadeTime); + else + Mix_HaltChannel(rChannelID); + } + else if(!rSound.sound) + LogError(FormatStr("ZSound not initialized in ZSound::Stop(%d), filename: %s.",fadeTime,rSound.filename.c_str())); +} + +void ZSound::SetVolume(int volume) +{ + if(rSound.sound) + Mix_VolumeChunk(rSound.sound,volume); + else + LogError(FormatStr("ZSound not initialized in ZSound::SetVolume(%d), filename: %s.",volume,rSound.filename.c_str())); +} + +bool ZSound::IsLoaded() +{ + return rSound.sound != NULL; +} + +bool ZSound::IsPlaying() +{ + if(rSound.sound && rChannelID >= 0) + return Mix_Playing(rChannelID) > 0; + else + { + if(rChannelID >= 0) + LogError(FormatStr("ZSound not initialized in ZSound::IsPlaying(), filename: %s.",rSound.filename.c_str())); + return false; + } +} + +bool ZSound::IsPaused() +{ + if(rSound.sound && rChannelID >= 0) + return Mix_Paused(rChannelID) > 0; + else + { + LogError(FormatStr("ZSound not initialized in ZSound::IsPaused(), filename: %s.",rSound.filename.c_str())); + return false; + } +} + +int ZSound::GetVolume() +{ + if(rSound.sound) + return Mix_VolumeChunk(rSound.sound,-1); + else + { + LogError(FormatStr("ZSound not initialized in ZSound::GetVolume(), filename: %s.",rSound.filename.c_str())); + return false; + } +} + +} + +#endif diff --git a/src/ZE_ZTimer.cpp b/src/ZE_ZTimer.cpp new file mode 100644 index 0000000..944f24c --- /dev/null +++ b/src/ZE_ZTimer.cpp @@ -0,0 +1,81 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (james@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +/*! +\par File Header: +File: ZE_ZTimer.cpp
+Description: Implementation source file for core ZEngine Timer Object.
+Author(s): James Turk
+$Id: ZE_ZTimer.cpp,v 1.1 2002/11/21 05:41:13 cozman Exp $
+ + \file ZE_ZTimer.cpp + \brief Source file for ZTimer. + + Implementation of ZTimer, the basic Timer class for ZEngine. +**/ + +#include "ZE_ZTimer.h" + +namespace ZE +{ + +Uint32 ZTimer::GetParentTime() +{ + if(rUseZEngine) + return rEngine->GetTime(); + else + return SDL_GetTicks(); +} + +ZTimer::ZTimer(bool useZEngine) +{ + rUseZEngine = useZEngine; + rPaused = false; + Reset(); +} + +void ZTimer::Reset() +{ + rLastPause = rPausedTime = GetParentTime(); + rPaused = false; +} + +void ZTimer::Pause() +{ + if(!rPaused) + { + rLastPause = GetParentTime(); + rPaused = true; + } +} + +void ZTimer::Unpause() +{ + if(rPaused) + { + rPausedTime += (GetParentTime()-rLastPause); + rPaused = false; + } +} + +Uint32 ZTimer::GetTime() +{ + if(rPaused) + return GetParentTime() - (rPausedTime + (GetParentTime() - rLastPause)); + else + return GetParentTime() - rPausedTime; +} + +bool ZTimer::IsPaused() +{ + return rPaused; +} + +} diff --git a/src/external/physfsrwops.cpp b/src/external/physfsrwops.cpp new file mode 100644 index 0000000..26615a5 --- /dev/null +++ b/src/external/physfsrwops.cpp @@ -0,0 +1,194 @@ +/* + * This code provides a glue layer between PhysicsFS and Simple Directmedia + * Layer's (SDL) RWops i/o abstraction. + * + * License: this code is public domain. I make no warranty that it is useful, + * correct, harmless, or environmentally safe. + * + * This particular file may be used however you like, including copying it + * verbatim into a closed-source project, exploiting it commercially, and + * removing any trace of my name from the source (although I hope you won't + * do that). I welcome enhancements and corrections to this file, but I do + * not require you to send me patches if you make changes. + * + * Unless otherwise stated, the rest of PhysicsFS falls under the GNU Lesser + * General Public License: http://www.gnu.org/licenses/lgpl.txt + * + * SDL falls under the LGPL, too. You can get SDL at http://www.libsdl.org/ + * + * This file was written by Ryan C. Gordon. (icculus@clutteredmind.org). + */ + +#include "ZE_ZEngine.h" + +#ifdef USE_PHYSFS //PHYSFS check added by James for ZEngine + +static int physfsrwops_seek(SDL_RWops *rw, int offset, int whence) +{ + PHYSFS_file *handle = (PHYSFS_file *) rw->hidden.unknown.data1; + int pos = 0; + + if (whence == SEEK_SET) + { + pos = offset; + } /* if */ + + else if (whence == SEEK_CUR) + { + PHYSFS_sint64 current = PHYSFS_tell(handle); + if (current == -1) + { + SDL_SetError("Can't find position in file: %s", + PHYSFS_getLastError()); + return(-1); + } /* if */ + + pos = (int) current; + if ( ((PHYSFS_sint64) pos) != current ) + { + SDL_SetError("Can't fit current file position in an int!"); + return(-1); + } /* if */ + + if (offset == 0) /* this is a "tell" call. We're done. */ + return(pos); + + pos += offset; + } /* else if */ + + else if (whence == SEEK_END) + { + PHYSFS_sint64 len = PHYSFS_fileLength(handle); + if (len == -1) + { + SDL_SetError("Can't find end of file: %s", PHYSFS_getLastError()); + return(-1); + } /* if */ + + pos = (int) len; + if ( ((PHYSFS_sint64) pos) != len ) + { + SDL_SetError("Can't fit end-of-file position in an int!"); + return(-1); + } /* if */ + + pos += offset; + } /* else if */ + + else + { + SDL_SetError("Invalid 'whence' parameter."); + return(-1); + } /* else */ + + if ( pos < 0 ) + { + SDL_SetError("Attempt to seek past start of file."); + return(-1); + } /* if */ + + if (!PHYSFS_seek(handle, (PHYSFS_uint64) pos)) + { + SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError()); + return(-1); + } /* if */ + + return(pos); +} /* physfsrwops_seek */ + + +static int physfsrwops_read(SDL_RWops *rw, void *ptr, int size, int maxnum) +{ + PHYSFS_file *handle = (PHYSFS_file *) rw->hidden.unknown.data1; + PHYSFS_sint64 rc = PHYSFS_read(handle, ptr, size, maxnum); + if (rc != maxnum) + { + if (!PHYSFS_eof(handle)) /* not EOF? Must be an error. */ + SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError()); + } /* if */ + + return((int) rc); +} /* physfsrwops_read */ + + +static int physfsrwops_write(SDL_RWops *rw, const void *ptr, int size, int num) +{ + PHYSFS_file *handle = (PHYSFS_file *) rw->hidden.unknown.data1; + PHYSFS_sint64 rc = PHYSFS_write(handle, ptr, size, num); + if (rc != num) + SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError()); + + return((int) rc); +} /* physfsrwops_write */ + + +static int physfsrwops_close(SDL_RWops *rw) +{ + PHYSFS_file *handle = (PHYSFS_file *) rw->hidden.unknown.data1; + if (!PHYSFS_close(handle)) + { + SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError()); + return(-1); + } /* if */ + + SDL_FreeRW(rw); + return(0); +} /* physfsrwops_close */ + + +static SDL_RWops *create_rwops(PHYSFS_file *handle) +{ + SDL_RWops *retval = NULL; + + if (handle == NULL) + SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError()); + else + { + retval = SDL_AllocRW(); + if (retval != NULL) + { + retval->seek = physfsrwops_seek; + retval->read = physfsrwops_read; + retval->write = physfsrwops_write; + retval->close = physfsrwops_close; + retval->hidden.unknown.data1 = handle; + } /* if */ + } /* else */ + + return(retval); +} /* create_rwops */ + + +SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_file *handle) +{ + SDL_RWops *retval = NULL; + if (handle == NULL) + SDL_SetError("NULL pointer passed to PHYSFSRWOPS_makeRWops()."); + else + retval = create_rwops(handle); + + return(retval); +} /* PHYSFSRWOPS_makeRWops */ + + +SDL_RWops *PHYSFSRWOPS_openRead(const char *fname) +{ + return(create_rwops(PHYSFS_openRead(fname))); +} /* PHYSFSRWOPS_openRead */ + + +SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname) +{ + return(create_rwops(PHYSFS_openWrite(fname))); +} /* PHYSFSRWOPS_openWrite */ + + +SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname) +{ + return(create_rwops(PHYSFS_openAppend(fname))); +} /* PHYSFSRWOPS_openAppend */ + + +/* end of physfsrwops.c ... */ + +#endif //USE_PHYSFS diff --git a/tab2space.py b/tab2space.py new file mode 100755 index 0000000..b0ce84f --- /dev/null +++ b/tab2space.py @@ -0,0 +1,43 @@ +#!/usr/bin/python + + +#Python script used to convert tabs to spaces. +import os,re + +def ProcessFile(filename): + linenum = 0 + print filename, + lines = open(filename,'r').readlines() + f = open(filename,'w') + for line in lines: + linenum+=1 + f.write(line.expandtabs(4)) + if len(line) > 80: + print linenum,'[',len(line),']', + f.close() + print 'Done!' + +def FileType(filename): + try: + return filename.split('.')[1] + except: + return '' + +def ProcessDir(dir): + entries = os.listdir(dir) + for entry in entries: + if os.path.isdir(os.path.join(dir,entry)): + ProcessDir(os.path.join(dir,entry)) + else: + type = FileType(entry) + if(type == 'cpp' or type == 'h' or type == 'txt'): + ProcessFile(os.path.join(dir,entry)) + + +def main(): + dir = os.getcwd() + ProcessDir(dir) + +main() + + diff --git a/test/ZFontTest.cpp b/test/ZFontTest.cpp new file mode 100644 index 0000000..60be1aa --- /dev/null +++ b/test/ZFontTest.cpp @@ -0,0 +1,87 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (jturk@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +#include +#include +using namespace std; +using namespace ZE; + +void Initialize() +{ + ZEngine *engine = ZEngine::GetInstance(); + ZConfigFile cfg("tests.zcf"); + int w,h,bpp; + bool fs; + string title; + + w = cfg.GetInt("ZFontTest","width",800); + h = cfg.GetInt("ZFontTest","height",600); + bpp = cfg.GetInt("ZFontTest","bpp",32); + fs = cfg.GetBool("ZFontTest","fullscreen",false); + title = cfg.GetString("ZFontTest","title","ZFont Test"); + + engine->SetupDisplay(w,h,bpp,fs); + engine->CreateWindow(title); +} + +void Test() +{ + ZEngine *engine = ZEngine::GetInstance(); + + //Open and Setup all the Fonts and Create Images// + ZImage text[5]; + ZFont almonte("data/almontew.ttf",48), axaxax("data/axaxax.ttf",32), betsy("data/betsy.ttf",64); + almonte.SetColor(255,0,0); + almonte.DrawText("This is the font test.",text[0]); + axaxax.SetColor(0,255,255); + axaxax.SetStyle(true,false,false); + axaxax.DrawText("Fonts free from: ",text[1]); + axaxax.SetStyle(false,true,true); + axaxax.DrawText("http://larabiefonts.com/",text[2]); + almonte.SetBGColor(0,0,128); + almonte.SetColor(0,0,255); + almonte.SetStyle(false,true,false); + almonte.DrawShadedText("Shaded, italic, bold and underlined tested. ",text[3]); + betsy.SetColor(255,255,255); + betsy.DrawText("Font test successful.",text[4]); + + do + { + //In the active loop, check events first// + engine->CheckEvents(); + if(engine->KeyIsPressed(SDLK_s)) + { + //code to toggle screen// + engine->SetupDisplay(engine->GetWidth(),engine->GetHeight(),engine->GetBPP(),!engine->IsFullscreen()); + engine->CreateWindow("ZImage Test"); + } + if(engine->KeyIsPressed(SDLK_ESCAPE)) + engine->RequestQuit(); + + engine->Clear(); //clear screen + //draw the images// + for(int i=0; i <= 4; i++) + text[i].Draw(10*i,50*i); + engine->UpdateScreen(); //update the screen + + } while(!engine->QuitRequested()); //quit only when engine has encountered a quit request +} + +int main(int argc, char *argv[]) +{ + ZEngine *engine = ZEngine::GetInstance(); + + Initialize(); + //engine->InitPhysFS(argv[0]); //remove this line if PhysFS is not available + Test(); + + ZEngine::ReleaseInstance(); //release engine instance + return 0; +} diff --git a/test/ZImageTest.cpp b/test/ZImageTest.cpp new file mode 100644 index 0000000..892fd3e --- /dev/null +++ b/test/ZImageTest.cpp @@ -0,0 +1,87 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (jturk@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +#include +#include +using namespace std; +using namespace ZE; + +void Initialize() +{ + ZEngine *engine = ZEngine::GetInstance(); + ZConfigFile cfg("tests.zcf"); + int w,h,bpp; + bool fs; + string title; + + w = cfg.GetInt("ZImageTest","width",800); + h = cfg.GetInt("ZImageTest","height",600); + bpp = cfg.GetInt("ZImageTest","bpp",32); + fs = cfg.GetBool("ZImageTest","fullscreen",false); + title = cfg.GetString("ZImageTest","title","ZImage Test"); + + engine->SetupDisplay(w,h,bpp,fs); + engine->CreateWindow(title); +} + +void Test() +{ + ZEngine *engine = ZEngine::GetInstance(); + + //Open and Setup all the Images// + SDL_Surface *temp; + ZImage image1, image2("data/test01.bmp"), image3(image2.GetImage(),20,20,20,20), textImage; + ZFont font("data/almontew.ttf",30); + + temp = SDL_LoadBMP("data/test02.bmp"); //this is a separate surface + image1.Attach(temp); //this attaches the surface into itself + temp = NULL; //and temp will now be controlled and freed by image1 + image1.SetColorKey(engine->MapColor(255,0,255)); + image2.SetAlpha(75); + image2.SetColorKey(engine->MapColor(255,0,255)); + font.SetColor(0,255,0); + font.SetBGColor(0,0,255); + font.DrawShadedText("ZImage Test.",textImage); + + do + { + //In the active loop, check events first// + engine->CheckEvents(); + if(engine->KeyIsPressed(SDLK_s)) + { + //code to toggle screen// + engine->SetupDisplay(engine->GetWidth(),engine->GetHeight(),engine->GetBPP(),!engine->IsFullscreen()); + engine->CreateWindow("ZImage Test"); + } + if(engine->KeyIsPressed(SDLK_ESCAPE)) + engine->RequestQuit(); + + engine->Clear(); //clear screen + //draw the images// + image1.Draw(0,0); + image2.Draw(100,0); + image3.Draw(200,0); + textImage.Draw(0,100); + engine->UpdateScreen(); //update the screen + + } while(!engine->QuitRequested()); //quit only when engine has encountered a quit request +} + +int main(int argc, char **argv) +{ + ZEngine *engine = ZEngine::GetInstance(); + + Initialize(); + //engine->InitPhysFS(argv[0]); //remove this line if PhysFS is not available + Test(); + + ZEngine::ReleaseInstance(); //release engine instance + return 0; +} diff --git a/test/ZMouseTest.cpp b/test/ZMouseTest.cpp new file mode 100644 index 0000000..907539c --- /dev/null +++ b/test/ZMouseTest.cpp @@ -0,0 +1,97 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (jturk@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +#include +#include +using namespace std; +using namespace ZE; + +void Initialize() +{ + ZEngine *engine = ZEngine::GetInstance(); + ZConfigFile cfg("tests.zcf"); + int w,h,bpp; + bool fs; + string title; + + w = cfg.GetInt("ZMouseTest","width",800); + h = cfg.GetInt("ZMouseTest","height",600); + bpp = cfg.GetInt("ZMouseTest","bpp",32); + fs = cfg.GetBool("ZMouseTest","fullscreen",false); + title = cfg.GetString("ZMouseTest","title","ZMouse Test"); + + engine->SetupDisplay(w,h,bpp,fs); + engine->CreateWindow(title); +} + +void Test() +{ + ZEngine *engine = ZEngine::GetInstance(); + + //Open and Setup all the Images// + ZImage text[3], cursor("data/cursor.bmp"); + ZFont font("data/almontew.ttf",30); + SDL_Rect textRect; + + engine->HideCursor(); + cursor.SetColorKey(engine->MapColor(255,0,255)); + + font.SetColor(0,255,0); + font.SetBGColor(0,0,255); + font.DrawText("Mouse Test",text[0]); + font.DrawShadedText("Mouse Test",text[1]); + textRect.x = textRect.y = 100; + textRect.w = font.GetStringWidth("Mouse Test"); + textRect.h = font.GetStringHeight("Mouse Test"); + + do + { + //In the active loop, check events first// + engine->CheckEvents(); + if(engine->KeyIsPressed(SDLK_s)) + { + //code to toggle screen// + engine->SetupDisplay(engine->GetWidth(),engine->GetHeight(),engine->GetBPP(),!engine->IsFullscreen()); + engine->CreateWindow("ZEngine Mouse Test"); + } + if(engine->KeyIsPressed(SDLK_ESCAPE)) + engine->RequestQuit(); + + //show where mouse is (clicked or not)// + if(engine->RButtonPressed()) + font.DrawText(FormatStr("Right button clicked at %d,%d",engine->GetMouseX(),engine->GetMouseY()),text[2]); + else if(engine->LButtonPressed()) + font.DrawText(FormatStr("Left button clicked at %d,%d",engine->GetMouseX(),engine->GetMouseY()),text[2]); + else + font.DrawText(FormatStr("Mouse at %d,%d",engine->GetMouseX(),engine->GetMouseY()),text[2]); + + + engine->Clear(); //clear screen + //draw the images// + text[engine->MouseInRect(&textRect)].Draw(100,100); + text[2].Draw(0,0); + cursor.Draw(engine->GetMouseX()-8,engine->GetMouseY()-8); + + engine->UpdateScreen(); //update the screen + + } while(!engine->QuitRequested()); //quit only when engine has encountered a quit request +} + +int main(int argc, char *argv[]) +{ + ZEngine *engine = ZEngine::GetInstance(); + + Initialize(); + //engine->InitPhysFS(argv[0]); //remove this line if PhysFS is not available + Test(); + + ZEngine::ReleaseInstance(); //release engine instance + return 0; +} diff --git a/test/ZMusicTest.cpp b/test/ZMusicTest.cpp new file mode 100644 index 0000000..c932ed6 --- /dev/null +++ b/test/ZMusicTest.cpp @@ -0,0 +1,111 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (jturk@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +#include +#include +using namespace std; +using namespace ZE; + +void Initialize() +{ + ZEngine *engine = ZEngine::GetInstance(); + ZConfigFile cfg("tests.zcf"); + int w,h,bpp; + bool fs; + string title; + + w = cfg.GetInt("ZMusicTest","width",800); + h = cfg.GetInt("ZMusicTest","height",600); + bpp = cfg.GetInt("ZMusicTest","bpp",32); + fs = cfg.GetBool("ZMusicTest","fullscreen",false); + title = cfg.GetString("ZMusicTest","title","ZMusic Test"); + + engine->SetupDisplay(w,h,bpp,fs); + engine->CreateWindow(title); +} + +void Test() +{ + ZEngine *engine = ZEngine::GetInstance(); + + ZMusic song("data/music.ogg"); + ZFont font("data/almontew.ttf",48); + ZImage text[4]; + + if(!song.IsLoaded()) //this executes if there is no music.ogg file + { + engine->SetupDisplay(800,70,32,false); + engine->CreateWindow("ZMusic Test"); + font.DrawText("Music.ogg does not exist, please read music.txt.",text[0]); + text[0].Draw(0,0); + engine->UpdateScreen(); + do + { + engine->CheckEvents(); + } while(!engine->QuitRequested()); + } + else //this is the actual example + { + font.DrawText("(P)ause\t(U)npause\t(R)ewind",text[0]); + font.DrawText("(F)ade Out\t(H)alt\t",text[1]); + font.DrawText("Space - Play\t Up/Down - Control Volume",text[2]); + + song.Play(); + do + { + //In the active loop, check events first// + engine->CheckEvents(); + if(engine->KeyIsPressed(SDLK_s)) + { + //code to toggle screen// + engine->SetupDisplay(engine->GetWidth(),engine->GetHeight(),engine->GetBPP(),!engine->IsFullscreen()); + engine->CreateWindow("ZMusic Test"); + } + if(engine->KeyIsPressed(SDLK_ESCAPE)) + engine->RequestQuit(); + if(engine->KeyIsPressed(SDLK_r)) + song.Rewind(); + if(engine->KeyIsPressed(SDLK_p)) + song.Pause(); + if(engine->KeyIsPressed(SDLK_u)) + song.Unpause(); + if(engine->KeyIsPressed(SDLK_f)) + song.Stop(5000); + if(engine->KeyIsPressed(SDLK_h)) + song.Stop(); + if(engine->KeyIsPressed(SDLK_SPACE)) + song.Play(); + if(engine->KeyIsPressed(SDLK_UP)) + song.SetVolume(song.GetVolume()+1); + if(engine->KeyIsPressed(SDLK_DOWN)) + song.SetVolume(song.GetVolume()-1); + + + font.DrawText(FormatStr("Volume: %d",song.GetVolume()),text[3]); + + engine->Clear(); //clear screen + for(int i=0; i < 4; i++) + text[i].Draw(0,i*50); + engine->UpdateScreen(); //update the screen + } while(!engine->QuitRequested()); //quit only when engine has encountered a quit request + } +} + +int main(int argc, char *argv[]) +{ + ZEngine *engine = ZEngine::GetInstance(); + + Initialize(); + //engine->InitPhysFS(argv[0]); //remove this line if PhysFS is not available + Test(); + + ZEngine::ReleaseInstance(); //release engine instance + return 0; +} diff --git a/test/ZRectTest.cpp b/test/ZRectTest.cpp new file mode 100644 index 0000000..90042fd --- /dev/null +++ b/test/ZRectTest.cpp @@ -0,0 +1,90 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (jturk@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +#include +#include +using namespace std; +using namespace ZE; + +void Initialize() +{ + ZEngine *engine = ZEngine::GetInstance(); + ZConfigFile cfg("tests.zcf"); + int w,h,bpp; + bool fs; + string title; + + w = cfg.GetInt("ZRectTest","Width",800); + h = cfg.GetInt("ZRectTest","height",600); + bpp = cfg.GetInt("ZRectTest","bpp",32); + fs = cfg.GetBool("ZRectTest","fullscreen",false); + title = cfg.GetString("ZRectTest","title","ZRect Test"); + + engine->SetupDisplay(w,h,bpp,fs); + engine->CreateWindow(title); +} + +void Test() +{ + ZEngine *engine = ZEngine::GetInstance(); + ZRect moveRect(0,0,25,25),stillRect(100,100,100,100); + + do + { + //In the active loop, check events first// + engine->CheckEvents(); + if(engine->KeyIsPressed(SDLK_s)) + { + //code to toggle screen// + engine->SetupDisplay(engine->GetWidth(),engine->GetHeight(),engine->GetBPP(),!engine->IsFullscreen()); + engine->CreateWindow("ZRect Test"); + } + if(engine->KeyIsPressed(SDLK_ESCAPE)) + engine->RequestQuit(); + //movement// + if(engine->KeyIsPressed(SDLK_LEFT)) + moveRect.MoveRel(-3,0); + if(engine->KeyIsPressed(SDLK_RIGHT)) + moveRect.MoveRel(3,0); + if(engine->KeyIsPressed(SDLK_UP)) + moveRect.MoveRel(0,-3); + if(engine->KeyIsPressed(SDLK_DOWN)) + moveRect.MoveRel(0,3); + if(engine->KeyIsPressed(SDLK_EQUALS)) + { + moveRect.MoveRel(-1,-1); + moveRect.ResizeRel(2,2); + } + if(engine->KeyIsPressed(SDLK_MINUS)) + { + moveRect.MoveRel(1,1); + moveRect.ResizeRel(-2,-2); + } + + engine->Clear(); + engine->Clear(engine->MapColor(255,0,0,128),&moveRect.SDLrect()); + engine->Clear(engine->MapColor(0,0,255),&stillRect.SDLrect()); + engine->Clear(engine->MapColor(0,255,0),&moveRect.Intersection(stillRect).SDLrect()); + engine->UpdateScreen(); + + } while(!engine->QuitRequested()); +} + +int main(int argc, char *argv[]) +{ + ZEngine *engine = ZEngine::GetInstance(); + + Initialize(); + //engine->InitPhysFS(argv[0]); //remove this line if PhysFS is not available + Test(); + + ZEngine::ReleaseInstance(); //release engine instance + return 0; +} diff --git a/test/ZSoundTest.cpp b/test/ZSoundTest.cpp new file mode 100644 index 0000000..1f3a3c9 --- /dev/null +++ b/test/ZSoundTest.cpp @@ -0,0 +1,110 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (jturk@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +#include +#include +using namespace std; +using namespace ZE; + +void Initialize() +{ + ZEngine *engine = ZEngine::GetInstance(); + ZConfigFile cfg("tests.zcf"); + int w,h,bpp; + bool fs; + string title; + + w = cfg.GetInt("ZSoundTest","width",800); + h = cfg.GetInt("ZSoundTest","height",600); + bpp = cfg.GetInt("ZSoundTest","bpp",32); + fs = cfg.GetBool("ZSoundTest","fullscreen",false); + title = cfg.GetString("ZSoundTest","title","ZSound Test"); + + engine->SetupDisplay(w,h,bpp,fs); + engine->CreateWindow(title); +} + +void Test() +{ + ZEngine *engine = ZEngine::GetInstance(); + + string name[5] = { "monkey", "rooster", "kick", "carcrash", "whip" }; + ZSound sample[5]; + ZFont font("data/almontew.ttf",48); + ZImage text[6]; + int sampleNum = 0; + + for(int i=0; i < 5; i++) + sample[i].Open(FormatStr("data/%s.wav",name[i].c_str())); + + font.DrawText("(P)ause\t(U)npause",text[0]); + font.DrawText("(F)ade Out\t(H)alt\t",text[1]); + font.DrawText("Space - Play\t Up/Down - Control Volume",text[2]); + font.DrawText("1-5 Change Sample Being Controled",text[3]); + do + { + //In the active loop, check events first// + engine->CheckEvents(); + if(engine->KeyIsPressed(SDLK_s)) + { + //code to toggle screen// + engine->SetupDisplay(engine->GetWidth(),engine->GetHeight(),engine->GetBPP(),!engine->IsFullscreen()); + engine->CreateWindow("ZSound Test"); + } + if(engine->KeyIsPressed(SDLK_ESCAPE)) + engine->RequestQuit(); + if(engine->KeyIsPressed(SDLK_1)) + sampleNum = 0; + if(engine->KeyIsPressed(SDLK_2)) + sampleNum = 1; + if(engine->KeyIsPressed(SDLK_3)) + sampleNum = 2; + if(engine->KeyIsPressed(SDLK_4)) + sampleNum = 3; + if(engine->KeyIsPressed(SDLK_5)) + sampleNum = 4; + if(engine->KeyIsPressed(SDLK_p)) + sample[sampleNum].Pause(); + if(engine->KeyIsPressed(SDLK_u)) + sample[sampleNum].Unpause(); + if(engine->KeyIsPressed(SDLK_f)) + sample[sampleNum].Stop(5000); + if(engine->KeyIsPressed(SDLK_h)) + sample[sampleNum].Stop(); + if(engine->KeyIsPressed(SDLK_SPACE)) + sample[sampleNum].Play(); + if(engine->KeyIsPressed(SDLK_UP)) + sample[sampleNum].SetVolume(sample[sampleNum].GetVolume()+1); + if(engine->KeyIsPressed(SDLK_DOWN)) + sample[sampleNum].SetVolume(sample[sampleNum].GetVolume()-1); + + + font.DrawText(FormatStr("Volume: %d",sample[sampleNum].GetVolume()),text[4]); + font.DrawText(FormatStr("Sample: %s",name[sampleNum].c_str()),text[5]); + + engine->Clear(); //clear screen + for(int i=0; i < 6; i++) + text[i].Draw(0,i*50); + engine->UpdateScreen(); //update the screen + + } while(!engine->QuitRequested()); //quit only when engine has encountered a quit request +} + +int main(int argc, char *argv[]) +{ + ZEngine *engine = ZEngine::GetInstance(); + + Initialize(); + //engine->InitPhysFS(argv[0]); //remove this line if PhysFS is not available + Test(); + + ZEngine::ReleaseInstance(); //release engine instance + return 0; +} diff --git a/test/ZTimerTest.cpp b/test/ZTimerTest.cpp new file mode 100644 index 0000000..59e5a2a --- /dev/null +++ b/test/ZTimerTest.cpp @@ -0,0 +1,127 @@ +/******************************************************************************* + This file is Part of the ZEngine Library for SDL Game Development. + Copyright (C) 2002 ConceptOfZero.net + + Licensed under the BSD License, see licensing.txt. + + The maintainer of this library is James Turk (jturk@conceptofzero.net) + and the home of this Library is http://www.conceptofzero.net/ +*******************************************************************************/ + +#include +#include +using namespace std; +using namespace ZE; + +void Initialize() +{ + ZEngine *engine = ZEngine::GetInstance(); + ZConfigFile cfg("tests.zcf"); + int w,h,bpp; + bool fs; + string title; + + w = cfg.GetInt("ZTimerTest","width",800); + h = cfg.GetInt("ZTimerTest","height",600); + bpp = cfg.GetInt("ZTimerTest","bpp",32); + fs = cfg.GetBool("ZTimerTest","fullscreen",false); + title = cfg.GetString("ZTimerTest","title","ZTimer Test"); + + engine->SetupDisplay(w,h,bpp,fs); + engine->CreateWindow(title); +} + +void Test() +{ + ZEngine *engine = ZEngine::GetInstance(); + + string TimerName[3] = {"ZEngine Timer", "ZEngine Hooked Timer", "SDL Hooked Timer"}; + int curTimer = 0; + + //Open and Setup Font and Create Images and Timers// + ZImage text[5]; + ZFont font("data/almontew.ttf",48); + ZTimer TimerOne, TimerTwo(false); //Timer Two is on the SDL Timer. + + //do this only once// + font.DrawText("(T)oggle | (P)ause | (U)npause",text[4]); + + do + { + //In the active loop, check events first// + engine->CheckEvents(); + if(engine->KeyIsPressed(SDLK_s)) + { + //code to toggle screen// + engine->SetupDisplay(engine->GetWidth(),engine->GetHeight(),engine->GetBPP(),!engine->IsFullscreen()); + engine->CreateWindow("ZImage Test"); + } + if(engine->KeyIsPressed(SDLK_ESCAPE)) + engine->RequestQuit(); + //pause current timer// + if(engine->KeyIsPressed(SDLK_p)) + { + switch(curTimer) + { + case 0: + engine->PauseTimer(); + break; + case 1: + TimerOne.Pause(); + break; + case 2: + TimerTwo.Pause(); + break; + } + } + //unpause current timer// + if(engine->KeyIsPressed(SDLK_u)) + { + switch(curTimer) + { + case 0: + engine->UnpauseTimer(); + break; + case 1: + TimerOne.Unpause(); + break; + case 2: + TimerTwo.Unpause(); + break; + } + } + //switch// + if(engine->KeyIsPressed(SDLK_t)) + { + if(++curTimer > 2) + curTimer = 0; + engine->Sleep(200); + } + + //Render all the fonts// + font.DrawText(FormatStr("Current Timer: %s",TimerName[curTimer].c_str()),text[0]); + font.DrawText(FormatStr("%s Time: %d",TimerName[0].c_str(),engine->GetTime()),text[1]); + font.DrawText(FormatStr("%s Time: %d",TimerName[1].c_str(),TimerOne.GetTime()),text[2]); + font.DrawText(FormatStr("%s Time: %d",TimerName[2].c_str(),TimerTwo.GetTime()),text[3]); + + engine->Clear(); //clear screen + + for(int i=0; i <= 4; i++) + text[i].Draw(0,i*50); + + engine->UpdateScreen(); //update the screen + + } while(!engine->QuitRequested()); //quit only when engine has encountered a quit request +} + +int main(int argc, char *argv[]) +{ + ZEngine *engine = ZEngine::GetInstance(); + + Initialize(); + //engine->InitPhysFS(argv[0]); //remove this line if PhysFS is not available + Test(); + + ZEngine::ReleaseInstance(); //release engine instance + return 0; +} diff --git a/test/bin/data/almontew.ttf b/test/bin/data/almontew.ttf new file mode 100644 index 0000000..a3fa930 Binary files /dev/null and b/test/bin/data/almontew.ttf differ diff --git a/test/bin/data/axaxax.ttf b/test/bin/data/axaxax.ttf new file mode 100644 index 0000000..602ceae Binary files /dev/null and b/test/bin/data/axaxax.ttf differ diff --git a/test/bin/data/betsy.ttf b/test/bin/data/betsy.ttf new file mode 100644 index 0000000..19f6432 Binary files /dev/null and b/test/bin/data/betsy.ttf differ diff --git a/test/bin/data/betsy.txt b/test/bin/data/betsy.txt new file mode 100644 index 0000000..7d43419 --- /dev/null +++ b/test/bin/data/betsy.txt @@ -0,0 +1,63 @@ +BETSY.TTF + +Here's how you can access the control keys in Betsy Flanagan + +Hold 'ALT' type a 4 digit number on your number pad and voila! + +0161 blank key +0162 blank key +0163 blank key +0164 blank key +0165 Alt +0166 Ctrl +0167 Shift with arrow +0168 Shift +0169 Enter with arrow +0170 Enter +0171 Space +0172 F1 +0173 F2 +0174 F3 +0175 F4 +0176 F5 +0177 F6 +0178 F7 +0179 F8 +0180 F9 +0181 F10 +0182 F11 +0183 F12 +0184 Esc Wide +0185 Esc +0186 Tab +0187 Caps +0188 Caps Lock +0189 Num Lock +0190 Print Screen +0191 Scroll Lock +0192 Pause +0193 Ins +0194 Del +0195 Home +0196 End +0197 Page Up +0198 Page Down +0199 left arrow +0200 up arrow +0201 right arrow +0202 down arrow +0203 Bksp +0204 Back +0205 Space +0206 Spacebar +0207 Windows Key +0208 Properties Key + +Ray Larabie +Larabie Fonts + +rlarabie@hotmail.com +http://www.larabiefonts.com +http://come.to/larabiefonts +http://www.goldenapplecomics.com/larabiefonts +http://www.swnakarmy.net/larabiefonts \ No newline at end of file diff --git a/test/bin/data/carcrash.wav b/test/bin/data/carcrash.wav new file mode 100644 index 0000000..5d69e50 Binary files /dev/null and b/test/bin/data/carcrash.wav differ diff --git a/test/bin/data/cursor.bmp b/test/bin/data/cursor.bmp new file mode 100644 index 0000000..dcd49b0 Binary files /dev/null and b/test/bin/data/cursor.bmp differ diff --git a/test/bin/data/kick.wav b/test/bin/data/kick.wav new file mode 100644 index 0000000..34c56df Binary files /dev/null and b/test/bin/data/kick.wav differ diff --git a/test/bin/data/monkey.wav b/test/bin/data/monkey.wav new file mode 100644 index 0000000..08b6efd Binary files /dev/null and b/test/bin/data/monkey.wav differ diff --git a/test/bin/data/rooster.wav b/test/bin/data/rooster.wav new file mode 100644 index 0000000..727baf9 Binary files /dev/null and b/test/bin/data/rooster.wav differ diff --git a/test/bin/data/test01.bmp b/test/bin/data/test01.bmp new file mode 100644 index 0000000..1cecf14 Binary files /dev/null and b/test/bin/data/test01.bmp differ diff --git a/test/bin/data/test02.bmp b/test/bin/data/test02.bmp new file mode 100644 index 0000000..df4bbea Binary files /dev/null and b/test/bin/data/test02.bmp differ diff --git a/test/bin/data/thanks.txt b/test/bin/data/thanks.txt new file mode 100644 index 0000000..1b39b5e --- /dev/null +++ b/test/bin/data/thanks.txt @@ -0,0 +1,3 @@ +The free fonts in this directory came from http://larabiefonts.com. +Visit http://www.kahvi.org for free Ogg Vorbis files. +I drew the images.. which was probably obvious. \ No newline at end of file diff --git a/test/bin/data/whip.wav b/test/bin/data/whip.wav new file mode 100644 index 0000000..e99ae6f Binary files /dev/null and b/test/bin/data/whip.wav differ diff --git a/test/bin/music.txt b/test/bin/music.txt new file mode 100644 index 0000000..37b8f22 --- /dev/null +++ b/test/bin/music.txt @@ -0,0 +1 @@ +To use the music example program it is necessary to obtain an ogg vorbis file (see http://www.kahvi.org/ for tons of options) and make sure that it is at test/bin/data/music.ogg \ No newline at end of file diff --git a/test/bin/readme.txt b/test/bin/readme.txt new file mode 100644 index 0000000..56b3eb7 --- /dev/null +++ b/test/bin/readme.txt @@ -0,0 +1,14 @@ +These are the test programs for ZEngine, all have the basic controls: +S - Switch Fullscreen/Windowed. +ALT-F4 or ESC- Quit Program + +The ZEngine Config File (tests.zcf) file may be manually edited using a text editor to change certain settings. + +ZMouseTest - Test ZEngine Mouse Capabilities. +ZImageTest - Test ZImage by drawing several images and a string to the screen. +ZFontTest - Test ZFont by outputting text in different formats. +ZTimerTest - Test ZTimer with three different timers. +ZMusicTest - Test ZMusic by playing a song, and allowing settings to be adjusted. + >NOTE: Requires adding an ogg file named music.ogg in data directory. +ZSoundTest - Test ZSound using various sound effects. +ZRectTest - Test Rectangles, and related collision. \ No newline at end of file diff --git a/test/bin/tests.zcf b/test/bin/tests.zcf new file mode 100644 index 0000000..bae3f5f --- /dev/null +++ b/test/bin/tests.zcf @@ -0,0 +1,5 @@ +[ZRectTest] + Width = 1000 + Height = 400 + Fullscreen = FALSE + Title = "If we are out of grapes, who will sell us Apple Juice?" diff --git a/thanks.txt b/thanks.txt new file mode 100644 index 0000000..476afd1 --- /dev/null +++ b/thanks.txt @@ -0,0 +1,17 @@ +The following must be thanked for ZEngine: + +Sam Lantinga and the SDL Crew - Creating and Maintaining such a great library and helping on the mailing list. + http://libsdl.org +Dimitri van Heesch and Everyone Associated with Doxygen - Providing such a great Documentation Tool. + http://doxygen.org +Everybody Associated with ConceptOfZero.net - Keeping Me Working on ZEngine. + http://conceptofzero.net +People on the Opensource.org Mailing list - Helping me figure out what license to use. + http://opensource.org +The people at the Kahvi Collective - Providing tons of free Ogg music. + http://www.kahvi.org/ +Sourceforge.net - Providing hosting for the project and CVS. + http://sourceforge.net + + +Also see the test/bin/Readme.txt file for credits on the data used in the demos. \ No newline at end of file diff --git a/todo.txt b/todo.txt new file mode 100644 index 0000000..7fc5d34 --- /dev/null +++ b/todo.txt @@ -0,0 +1,9 @@ +ZEngine Todo List + +-Proofread, update, clarify documentation. +-Add Support for PhysicsFS with SDL_ttf and SDL_mixer music. (Waiting on other libraries.) +-Write simple games using the library as examples +-Possibly add 3D extensions (Xenicor?) +-Add common game objects, particle system, basic sprites, etc. +-Add rotation-zooming support (SDL_rotozoom?) +-Look into scripting options and networking options. \ No newline at end of file diff --git a/vc7/ZEngine.sln b/vc7/ZEngine.sln new file mode 100644 index 0000000..5347e86 --- /dev/null +++ b/vc7/ZEngine.sln @@ -0,0 +1,72 @@ +Microsoft Visual Studio Solution File, Format Version 7.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZEngine", "ZEngine.vcproj", "{65AA7404-28C1-4B15-979E-4D3A14092CC1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZImageTest", "ZImageTest.vcproj", "{7DA4211A-D6BD-4F3E-8FC6-AA47DC8EBC66}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZFontTest", "ZFontTest.vcproj", "{999F6F58-3518-4F66-AEDD-FAD808DA2878}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZTimerTest", "ZTimerTest.vcproj", "{18BBFFEC-92F0-40C7-BDF9-2C2D5CA62673}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZMusicTest", "ZMusicTest.vcproj", "{C658B38D-B4E7-434D-8431-88BAD8CF0781}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZSoundTest", "ZSoundTest.vcproj", "{1CE76EE8-27D4-41AE-9229-5B09922EBFE9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZMouseTest", "ZMouseTest.vcproj", "{68E3AB20-1BC1-4852-9A91-33DADFCED7CA}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZRectTest", "ZRectTest.vcproj", "{37D500C5-E6C4-4E56-BFAA-33F1303B147C}" +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + ConfigName.0 = Debug + ConfigName.1 = Release + EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution + {7DA4211A-D6BD-4F3E-8FC6-AA47DC8EBC66}.0 = {65AA7404-28C1-4B15-979E-4D3A14092CC1} + {999F6F58-3518-4F66-AEDD-FAD808DA2878}.0 = {65AA7404-28C1-4B15-979E-4D3A14092CC1} + {18BBFFEC-92F0-40C7-BDF9-2C2D5CA62673}.0 = {65AA7404-28C1-4B15-979E-4D3A14092CC1} + {C658B38D-B4E7-434D-8431-88BAD8CF0781}.0 = {65AA7404-28C1-4B15-979E-4D3A14092CC1} + {1CE76EE8-27D4-41AE-9229-5B09922EBFE9}.0 = {65AA7404-28C1-4B15-979E-4D3A14092CC1} + {68E3AB20-1BC1-4852-9A91-33DADFCED7CA}.0 = {65AA7404-28C1-4B15-979E-4D3A14092CC1} + {37D500C5-E6C4-4E56-BFAA-33F1303B147C}.0 = {65AA7404-28C1-4B15-979E-4D3A14092CC1} + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {65AA7404-28C1-4B15-979E-4D3A14092CC1}.Debug.ActiveCfg = Debug|Win32 + {65AA7404-28C1-4B15-979E-4D3A14092CC1}.Debug.Build.0 = Debug|Win32 + {65AA7404-28C1-4B15-979E-4D3A14092CC1}.Release.ActiveCfg = Release|Win32 + {65AA7404-28C1-4B15-979E-4D3A14092CC1}.Release.Build.0 = Release|Win32 + {7DA4211A-D6BD-4F3E-8FC6-AA47DC8EBC66}.Debug.ActiveCfg = Debug|Win32 + {7DA4211A-D6BD-4F3E-8FC6-AA47DC8EBC66}.Debug.Build.0 = Debug|Win32 + {7DA4211A-D6BD-4F3E-8FC6-AA47DC8EBC66}.Release.ActiveCfg = Release|Win32 + {7DA4211A-D6BD-4F3E-8FC6-AA47DC8EBC66}.Release.Build.0 = Release|Win32 + {999F6F58-3518-4F66-AEDD-FAD808DA2878}.Debug.ActiveCfg = Debug|Win32 + {999F6F58-3518-4F66-AEDD-FAD808DA2878}.Debug.Build.0 = Debug|Win32 + {999F6F58-3518-4F66-AEDD-FAD808DA2878}.Release.ActiveCfg = Release|Win32 + {999F6F58-3518-4F66-AEDD-FAD808DA2878}.Release.Build.0 = Release|Win32 + {18BBFFEC-92F0-40C7-BDF9-2C2D5CA62673}.Debug.ActiveCfg = Debug|Win32 + {18BBFFEC-92F0-40C7-BDF9-2C2D5CA62673}.Debug.Build.0 = Debug|Win32 + {18BBFFEC-92F0-40C7-BDF9-2C2D5CA62673}.Release.ActiveCfg = Release|Win32 + {18BBFFEC-92F0-40C7-BDF9-2C2D5CA62673}.Release.Build.0 = Release|Win32 + {C658B38D-B4E7-434D-8431-88BAD8CF0781}.Debug.ActiveCfg = Debug|Win32 + {C658B38D-B4E7-434D-8431-88BAD8CF0781}.Debug.Build.0 = Debug|Win32 + {C658B38D-B4E7-434D-8431-88BAD8CF0781}.Release.ActiveCfg = Release|Win32 + {C658B38D-B4E7-434D-8431-88BAD8CF0781}.Release.Build.0 = Release|Win32 + {1CE76EE8-27D4-41AE-9229-5B09922EBFE9}.Debug.ActiveCfg = Debug|Win32 + {1CE76EE8-27D4-41AE-9229-5B09922EBFE9}.Debug.Build.0 = Debug|Win32 + {1CE76EE8-27D4-41AE-9229-5B09922EBFE9}.Release.ActiveCfg = Release|Win32 + {1CE76EE8-27D4-41AE-9229-5B09922EBFE9}.Release.Build.0 = Release|Win32 + {68E3AB20-1BC1-4852-9A91-33DADFCED7CA}.Debug.ActiveCfg = Debug|Win32 + {68E3AB20-1BC1-4852-9A91-33DADFCED7CA}.Debug.Build.0 = Debug|Win32 + {68E3AB20-1BC1-4852-9A91-33DADFCED7CA}.Release.ActiveCfg = Release|Win32 + {68E3AB20-1BC1-4852-9A91-33DADFCED7CA}.Release.Build.0 = Release|Win32 + {37D500C5-E6C4-4E56-BFAA-33F1303B147C}.Debug.ActiveCfg = Debug|Win32 + {37D500C5-E6C4-4E56-BFAA-33F1303B147C}.Debug.Build.0 = Debug|Win32 + {37D500C5-E6C4-4E56-BFAA-33F1303B147C}.Release.ActiveCfg = Release|Win32 + {37D500C5-E6C4-4E56-BFAA-33F1303B147C}.Release.Build.0 = Release|Win32 + {110FE3E0-9B08-420A-BAF8-06FF3E77EEA1}.Debug.ActiveCfg = Debug|Win32 + {110FE3E0-9B08-420A-BAF8-06FF3E77EEA1}.Release.ActiveCfg = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/vc7/ZEngine.vcproj b/vc7/ZEngine.vcproj new file mode 100644 index 0000000..2a478c7 --- /dev/null +++ b/vc7/ZEngine.vcproj @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vc7/ZFontTest.vcproj b/vc7/ZFontTest.vcproj new file mode 100644 index 0000000..315812f --- /dev/null +++ b/vc7/ZFontTest.vcproj @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vc7/ZImageTest.vcproj b/vc7/ZImageTest.vcproj new file mode 100644 index 0000000..276b041 --- /dev/null +++ b/vc7/ZImageTest.vcproj @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vc7/ZMouseTest.vcproj b/vc7/ZMouseTest.vcproj new file mode 100644 index 0000000..3acc306 --- /dev/null +++ b/vc7/ZMouseTest.vcproj @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vc7/ZMusicTest.vcproj b/vc7/ZMusicTest.vcproj new file mode 100644 index 0000000..17bb9c0 --- /dev/null +++ b/vc7/ZMusicTest.vcproj @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vc7/ZRectTest.vcproj b/vc7/ZRectTest.vcproj new file mode 100644 index 0000000..b853313 --- /dev/null +++ b/vc7/ZRectTest.vcproj @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vc7/ZSoundTest.vcproj b/vc7/ZSoundTest.vcproj new file mode 100644 index 0000000..3812375 --- /dev/null +++ b/vc7/ZSoundTest.vcproj @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vc7/ZTimerTest.vcproj b/vc7/ZTimerTest.vcproj new file mode 100644 index 0000000..752b717 --- /dev/null +++ b/vc7/ZTimerTest.vcproj @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +