Initial revision

This commit is contained in:
Hans Lambermont 2002-10-12 11:37:38 +00:00
commit 12315f4d0e
1699 changed files with 444708 additions and 0 deletions

48
intern/BL-license.txt Normal file

@ -0,0 +1,48 @@
Blender License 1.0 (the "BL", see http://www.blender.org/BL/ ).
Copyright (C) 2002 Blender Foundation. All Rights Reserved.
For teams that don't want to operate under the GPL, we're also offering
this "non-GPL" Blender License option. This means that you can download
the latest sources and tools via FTP or CVS from our site and sign an
additional agreement with the Blender Foundation, so you can keep your
source modifications confidential. Contact the Blender Foundation via
email at license@blender.org so we can discuss how we handle the
practical matters.
A signed agreement allows you to do business with proprietary code, make
special derived versions, sell executables, projects or services,
provided that:
1. The BL-ed code remains copyrighted by the original owners, and cannot
be transferred to other parties
2. The BL-ed code cannot be published or re-distributed in any way, and
only be available for the internal staff that works directly on the
software itself. Employees of partners with which you co-develop on the
projects that include BL-ed code are considered 'internal staff' also.
3. The BL-ed code can be used (sold, distributed) in parts or in its
whole only as an executable or as a compiled library/module and its
header files.
4. The usage of the name Blender or the Blender logo is not included in
this license. Instead 'including Blender Foundation release X' (or
similar) can be used, with 'X' the version number of the initial Blender
Foundation release which you started with.
5. Note that this BL has no authority over some of the external
libraries licenses which Blender links with.
Additionally you get :
1. The right to use Blender Foundation source updates for a 1 year
period.
2. Support. Details to be determined by the additional agreement.
You are invited to donate your proprietary changes back to the open
source community after a reasonable time period. You are of course free
to choose not to do this.
End of BL terms and conditions.

340
intern/GPL-license.txt Normal file

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

38
intern/Makefile Normal file

@ -0,0 +1,38 @@
#
# $Id$
#
# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. The Blender
# Foundation also sells licenses for use in proprietary software under
# the Blender License. See http://www.blender.org/BL/ for information
# about this.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): none yet.
#
# ***** END GPL/BL DUAL LICENSE BLOCK *****
# Bounces make to subdirectories. Intended for future tinderbox tests.
SOURCEDIR = intern
DIRS = ghost guardedalloc bmfont decimation string memutil action moto
DIRS += iksolver keymaker container
include nan_subdirs.mk

@ -0,0 +1,54 @@
#
# $Id$
#
# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. The Blender
# Foundation also sells licenses for use in proprietary software under
# the Blender License. See http://www.blender.org/BL/ for information
# about this.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): none yet.
#
# ***** END GPL/BL DUAL LICENSE BLOCK *****
#
#
include nan_definitions.mk
SOURCEDIR = source/gameengine/SoundSystem
DIR = $(OCGDIR)/SoundSystem
DIRS = intern
DIRS += dummy
ifeq ($(OS),windows)
DIRS += fmod
DIRS += openal
endif
ifeq ($(OS),freebsd)
DIRS += openal
endif
ifeq ($(OS),$(findstring $(OS), "linux"))
ifeq ($(CPU),i386)
DIRS += openal
endif
endif
include nan_subdirs.mk

@ -0,0 +1,356 @@
/**
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef SND_BLENDER_H
#define SND_BLENDER_H
#ifdef __cplusplus
extern "C" {
#endif
#include "SoundDefines.h"
#define SND_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name
SND_DECLARE_HANDLE(SND_AudioDeviceInterfaceHandle);
SND_DECLARE_HANDLE(SND_SceneHandle);
SND_DECLARE_HANDLE(SND_ObjectHandle);
SND_DECLARE_HANDLE(SND_ListenerHandle);
/**
* set the specified type
*/
extern void SND_SetDeviceType(int device_type);
/**
* get an audiodevice
*/
extern SND_AudioDeviceInterfaceHandle SND_GetAudioDevice(void);
/**
* and let go of it
*/
extern void SND_ReleaseDevice(void);
/**
* check if playback is desired
*/
extern int SND_IsPlaybackWanted(SND_SceneHandle scene);
/**
* add memlocation to cache
*/
extern int SND_AddSample(SND_SceneHandle scene,
const char* filename,
void* memlocation,
int size);
/**
* remove all samples
*/
extern void SND_RemoveAllSamples(SND_SceneHandle scene);
/**
* forces the object to check its buffer, and fix it if it's wrong
*/
extern int SND_CheckBuffer(SND_SceneHandle scene, SND_ObjectHandle object);
/**
* Creates a scene, initializes it and returns a handle to that scene.
*
* @param audiodevice: handle to the audiodevice.
*/
extern SND_SceneHandle SND_CreateScene(SND_AudioDeviceInterfaceHandle audiodevice);
/**
* Stops all sounds, suspends the scene (so all resources will be freed) and deletes the scene.
*
* @param scene: handle to the soundscene.
*/
extern void SND_DeleteScene(SND_SceneHandle scene);
/**
* Adds a soundobject to the scene, gets the buffer the sample is loaded into.
*
* @param scene: handle to the soundscene.
* @param object: handle to soundobject.
*/
extern void SND_AddSound(SND_SceneHandle scene, SND_ObjectHandle object);
/**
* Removes a soundobject from the scene.
*
* @param scene: handle to the soundscene.
* @param object: handle to soundobject.
*/
extern void SND_RemoveSound(SND_SceneHandle scene, SND_ObjectHandle object);
/**
* Removes all soundobjects from the scene.
*
* @param scene: handle to the soundscene.
*/
extern void SND_RemoveAllSounds(SND_SceneHandle scene);
/**
* Stopss all soundobjects in the scene.
*
* @param scene: handle to the soundscene.
*/
extern void SND_StopAllSounds(SND_SceneHandle scene);
/**
* Updates the listener, checks the status of all soundobjects, builds a list of all active
* objects, updates the active objects.
*
* @param audiodevice: handle to the audiodevice.
* @param scene: handle to the soundscene.
*/
extern void SND_Proceed(SND_AudioDeviceInterfaceHandle audiodevice, SND_SceneHandle scene);
/**
* Returns a handle to the listener.
*
* @param scene: handle to the soundscene.
*/
extern SND_ListenerHandle SND_GetListener(SND_SceneHandle scene);
/**
* Sets the gain of the listener.
*
* @param scene: handle to the soundscene.
* @param gain: factor the gain gets multiplied with.
*/
extern void SND_SetListenerGain(SND_SceneHandle scene, double gain);
/**
* Sets a scaling to exaggerate or deemphasize the Doppler (pitch) shift resulting from the
* calculation.
* @attention $f' = dopplerfactor * f * frac{dopplervelocity - listener_velocity}{dopplervelocity + object_velocity}$
* @attention f: frequency in sample (soundobject)
* @attention f': effective Doppler shifted frequency
*
* @param object: handle to soundobject.
* @param dopplerfactor: the dopplerfactor.
*/
extern void SND_SetDopplerFactor(SND_SceneHandle scene, double dopplerfactor);
/**
* Sets the value of the propagation speed relative to which the source velocities are interpreted.
* @attention $f' = dopplerfactor * f * frac{dopplervelocity - listener_velocity}{dopplervelocity + object_velocity}$
* @attention f: frequency in sample (soundobject)
* @attention f': effective Doppler shifted frequency
*
* @param object: handle to soundobject.
* @param dopplervelocity: the dopplervelocity.
*/
extern void SND_SetDopplerVelocity(SND_SceneHandle scene, double dopplervelocity);
/**
* Creates a new soundobject and returns a handle to it.
*/
extern SND_ObjectHandle SND_CreateSound(void);
/**
* Deletes a soundobject.
*
* @param object: handle to soundobject.
*/
extern void SND_DeleteSound(SND_ObjectHandle object);
/**
* Sets a soundobject to SND_MUST_PLAY, so with the next proceed it will be updated and played.
*
* @param object: handle to soundobject.
*/
extern void SND_StartSound(SND_SceneHandle scene, SND_ObjectHandle object);
/**
* Sets a soundobject to SND_MUST_STOP, so with the next proceed it will be stopped.
*
* @param object: handle to soundobject.
*/
extern void SND_StopSound(SND_SceneHandle scene, SND_ObjectHandle object);
/**
* Sets a soundobject to SND_MUST_PAUSE, so with the next proceed it will be paused.
*
* @param object: handle to soundobject.
*/
extern void SND_PauseSound(SND_SceneHandle scene, SND_ObjectHandle object);
/**
* Sets the name of the sample to reference the soundobject to it.
*
* @param object: handle to soundobject.
* @param samplename: the name of the sample
*/
extern void SND_SetSampleName(SND_ObjectHandle object, char* samplename);
/**
* Sets the gain of a soundobject.
*
* @param object: handle to soundobject.
* @param gain: factor the gain gets multiplied with.
*/
extern void SND_SetGain(SND_ObjectHandle object, double gain);
/**
* Sets the minimum gain of a soundobject.
*
* @param object: handle to soundobject.
* @param minimumgain: lower threshold for the gain.
*/
extern void SND_SetMinimumGain(SND_ObjectHandle object, double minimumgain);
/**
* Sets the maximum gain of a soundobject.
*
* @param object: handle to soundobject.
* @param maximumgain: upper threshold for the gain.
*/
extern void SND_SetMaximumGain(SND_ObjectHandle object, double maximumgain);
/**
* Sets the rollofffactor. The rollofffactor is a per-Source parameter the application
* can use to increase or decrease the range of a source by decreasing or increasing the
* attenuation, respectively. The default value is 1. The implementation is free to optimize
* for a rollofffactor value of 0, which indicates that the application does not wish any
* distance attenuation on the respective Source.
*
* @param object: handle to soundobject.
* @param rollofffactor: the rollofffactor.
*/
extern void SND_SetRollOffFactor(SND_ObjectHandle object, double rollofffactor);
/**
* Sets the referencedistance at which the listener will experience gain.
* @attention G_dB = gain - 20 * log10(1 + rollofffactor * (dist - referencedistance)/referencedistance);
*
* @param object: handle to soundobject.
* @param distance: the reference distance.
*/
extern void SND_SetReferenceDistance(SND_ObjectHandle object, double referencedistance);
/**
* Sets the pitch of a soundobject.
*
* @param object: handle to soundobject.
* @param pitch: pitchingfactor: 2.0 for doubling the frequency, 0.5 for half the frequency.
*/
extern void SND_SetPitch(SND_ObjectHandle object, double pitch);
/**
* Sets the position a soundobject.
*
* @param object: handle to soundobject.
* @param position: position[3].
*/
extern void SND_SetPosition(SND_ObjectHandle object, double* position);
/**
* Sets the velocity of a soundobject.
*
* @param object: handle to soundobject.
* @param velocity: velocity[3].
*/
extern void SND_SetVelocity(SND_ObjectHandle object, double* velocity);
/**
* Sets the orientation of a soundobject.
*
* @param object: handle to soundobject.
* @param orientation: orientation[9].
*/
extern void SND_SetOrientation(SND_ObjectHandle object, double* orientation);
/**
* Sets the loopmode of a soundobject.
*
* @param object: handle to soundobject.
* @param loopmode type of the loop (SND_LOOP_OFF, SND_LOOP_NORMAL, SND_LOOP_BIDIRECTIONAL);
*/
extern void SND_SetLoopMode(SND_ObjectHandle object, int loopmode);
/**
* Sets the looppoints of a soundobject.
*
* @param object: handle to soundobject.
* @param loopstart startpoint of the loop
* @param loopend endpoint of the loop
*/
extern void SND_SetLoopPoints(SND_ObjectHandle object, unsigned int loopstart, unsigned int loopend);
/**
* Gets the gain of a soundobject.
*
* @param object: handle to soundobject.
*/
extern float SND_GetGain(SND_ObjectHandle object);
/**
* Gets the pitch of a soundobject.
*
* @param object: handle to soundobject.
*/
extern float SND_GetPitch(SND_ObjectHandle object);
/**
* Gets the looping of a soundobject.
* 0: SND_LOOP_OFF
* 1: SND_LOOP_NORMAL
* 2: SND_LOOP_BIDIRECTIONAL
*
* @param object: handle to soundobject.
*/
extern int SND_GetLoopMode(SND_ObjectHandle object);
/**
* Gets the playstate of a soundobject.
* SND_UNKNOWN = -1
* SND_INITIAL
* SND_MUST_PLAY
* SND_PLAYING
* SND_MUST_STOP
* SND_STOPPED
* SND_MUST_PAUSE
* SND_PAUSED
* SND_MUST_BE_DELETED
*
* @param object: handle to soundobject.
*/
extern int SND_GetPlaystate(SND_ObjectHandle object);
#ifdef __cplusplus
}
#endif
#endif

@ -0,0 +1,84 @@
/*
* SND_CDObject.h
*
* Implementation for CD playback
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef __SND_CDOBJECT_H
#define __SND_CDOBJECT_H
#include "SND_Object.h"
class SND_CDObject : public SND_Object
{
private:
/**
* Private to enforce singleton
*/
SND_CDObject();
SND_CDObject(const SND_CDObject&);
static SND_CDObject* m_instance;
MT_Scalar m_gain; /* the gain of the object */
int m_playmode; /* the way CD is played back (all, random, track, trackloop) */
int m_track; /* the track for 'track' and 'trackloop' */
int m_playstate; /* flag for current state of object */
bool m_modified;
bool m_used; /* flag for checking if we used the cd, if not don't
call the stop cd at the end */
public:
static bool CreateSystem();
static bool DisposeSystem();
static SND_CDObject* Instance();
~SND_CDObject();
void SetGain(MT_Scalar gain);
void SetPlaymode(int playmode);
void SetTrack(int track);
void SetPlaystate(int playstate);
void SetModified(bool modified);
void SetUsed();
bool GetUsed();
bool IsModified() const;
int GetTrack() const;
MT_Scalar GetGain() const;
int GetPlaymode() const;
int GetPlaystate() const;
};
#endif //__SND_CDOBJECT_H

@ -0,0 +1,56 @@
/*
* SND_DependKludge.h
*
* who needs what?
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#if defined (_WIN32)
#define USE_FMOD
#else
# if defined (__linux__)
# if defined (__i386__)
# define USE_OPENAL
# endif
# else
# if defined (__FreeBSD__)
# define USE_OPENAL
# endif
# ifdef USE_OPENAL
# undef USE_OPENAL
# endif
# ifdef USE_FMOD
# undef USE_FMOD
# endif
# endif
#endif

@ -0,0 +1,91 @@
/*
* SND_DeviceManager.h
*
* singleton for creating, switching and deleting audiodevices
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef __SND_DEVICEMANAGER_H
#define __SND_DEVICEMANAGER_H
#include "SND_IAudioDevice.h"
class SND_DeviceManager
{
public :
/**
* a subscription is needed before instances are given away
* applications must call subscribe first, get an instance, and
* when they are finished with sound, unsubscribe
*/
static void Subscribe();
static void Unsubscribe();
static SND_IAudioDevice* Instance();
static void SetDeviceType(int device_type);
private :
/**
* Private to enforce singleton
*/
SND_DeviceManager();
SND_DeviceManager(const SND_DeviceManager&);
~SND_DeviceManager();
static SND_IAudioDevice* m_instance;
/**
* The type of device to be created on a call
* to Instance().
*/
static int m_device_type;
/**
* Remember the number of subscriptions.
* if 0, delete the device
*/
static int m_subscriptions;;
};
#endif //__SND_DEVICEMANAGER_H

@ -0,0 +1,346 @@
/**
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef SND_IAUDIODEVICE
#define SND_IAUDIODEVICE
#include "SND_SoundObject.h"
#include "SND_CDObject.h"
#include "SND_WaveCache.h"
#include "SND_WaveSlot.h"
#include "MT_Matrix3x3.h"
class SND_IAudioDevice
{
public:
/**
* constructor
*/
SND_IAudioDevice() {};
/**
* destructor
*/
virtual ~SND_IAudioDevice() {};
/**
* check to see if initialization was successfull
*
* @return indication of succes
*/
virtual bool IsInitialized()=0;
/**
* get the wavecache (which does sample (un)loading)
*
* @return pointer to the wavecache
*/
virtual SND_WaveCache* GetWaveCache() const =0;
/**
* loads a sample into the device
*
* @param samplename the name of the sample
* @param memlocation pointer where the sample is stored
* @param size size of the sample in memory
*
* @return pointer to the slot with sample data
*/
virtual SND_WaveSlot* LoadSample(const STR_String& samplename,
void* memlocation,
int size)=0;
/**
* remove a sample from the wavecache
*
* @param filename pointer to filename
*/
// virtual void RemoveSample(const char* filename)=0;
/**
* remove all samples from the wavecache
*/
virtual void RemoveAllSamples()=0;
/**
* get a new id from the device
*
* @param pObject pointer to soundobject
*
* @return indication of success
*/
virtual bool GetNewId(SND_SoundObject* pObject)=0;
/**
* clear an id
*
* @param pObject pointer to soundobject
*/
virtual void ClearId(SND_SoundObject* pObject)=0;
/**
* initialize the listener
*/
virtual void InitListener()=0;
/**
* set the value of the propagation speed relative to which the
* source velocities are interpreted.
* f' = DOPPLER_FACTOR * f * (DOPPLER_VELOCITY - Vl) / (DOPPLER_VELOCITY + Vo)
* f: frequency in sample (soundobject)
* f': effective Doppler shifted frequency
* Vl: velocity listener
* Vo: velocity soundobject
*
* @param dopplervelocity scaling factor for doppler effect
*/
virtual void SetDopplerVelocity(MT_Scalar dopplervelocity) const =0;
/**
* set a scaling to exaggerate or deemphasize the Doppler (pitch)
* shift resulting from the calculation.
* f' = DOPPLER_FACTOR * f * (DOPPLER_VELOCITY - Listener_velocity )/(DOPPLER_VELOCITY + object_velocity )
*
* @param dopplerfactor scaling factor for doppler effect
*/
virtual void SetDopplerFactor(MT_Scalar dopplerfactor) const =0;
/**
* set the roll-off factor
*
* @param rollofffactor a global volume scaling factor
*/
virtual void SetListenerRollOffFactor(MT_Scalar rollofffactor) const =0;
/**
* make the context the current one
*/
virtual void MakeCurrent() const =0;
/**
* update the device
*/
virtual void NextFrame() const =0;
/**
* set the volume of the listener.
*
* @param gain the mastergain
*/
virtual void SetListenerGain(float gain) const =0;
/**
* connect the buffer with the source
*
* @param id the id of the object
* @param buffer the buffer the sample is stored in
*/
virtual void SetObjectBuffer(int id, unsigned int buffer)=0;
/**
* pause playback of the cd
* @param id the id of the object
*
* @return the state the object is in
*/
virtual int GetPlayState(int id) =0;
/**
* play a sound belonging to an object.
*
* @param id the id of the object
*/
virtual void PlayObject(int id) =0;
/**
* stop a sound belonging to an object.
*
* @param id the id of the object
*/
virtual void StopObject(int id) const =0;
/**
* stop all sounds.
*/
virtual void StopAllObjects()=0;
/**
* pause the sound belonging to an object.
*
* @param id the id of the object
*/
virtual void PauseObject(int id) const =0;
/**
* set the sound to looping or non-looping.
*
* @param id the id of the object
* @param loopmode type of looping (no loop, normal, bidirectional)
*/
virtual void SetObjectLoop(int id, unsigned int loopmode) const =0;
/**
* set the looppoints of a sound
*
* @param id the id of the object
* @param loopstart the startpoint of the loop (in samples)
* @param loopend the endpoint of the loop (in samples)
*/
virtual void SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const =0;
/**
* set the pitch of the sound.
*
* @param id the id of the object
* @param pitch the pitch
*/
virtual void SetObjectPitch(int id, MT_Scalar pitch) const =0;
/**
* set the gain of the sound.
*
* @param id the id of the object
* @param gain the gain
*/
virtual void SetObjectGain(int id, MT_Scalar gain) const =0;
/**
* ROLLOFF_FACTOR is per-Source parameter the application can use to increase or decrease
* the range of a source by decreasing or increasing the attenuation, respectively. The
* default value is 1. The implementation is free to optimize for a ROLLOFF_FACTOR value
* of 0, which indicates that the application does not wish any distance attenuation on
* the respective Source.
*
* @param id the id of the object
* @param rolloff a per-source volume scaling factor
*/
virtual void SetObjectRollOffFactor(int id, MT_Scalar rolloff) const =0;
/**
* min_gain indicates the minimal gain which is always guaranteed for this sound
*
* @param id the id of the object
* @param mingain the minimum gain of the object
*/
virtual void SetObjectMinGain(int id, MT_Scalar mingain) const =0;
/**
* max_gain indicates the maximal gain which is always guaranteed for this sound
*
* @param id the id of the object
* @param maxgain the maximum gain of the object
*/
virtual void SetObjectMaxGain(int id, MT_Scalar maxgain) const =0;
/**
* set the distance at which the Listener will experience gain.
* G_dB = GAIN - 20*log10(1 + ROLLOFF_FACTOR*(dist-REFERENCE_DISTANCE)/REFERENCE_DISTANCE );
*
* @param id the id of the object
* @param referencedistance the distance at which the listener will start hearing
*/
virtual void SetObjectReferenceDistance(int id, MT_Scalar referencedistance) const =0;
/**
* set the position, velocity and orientation of a sound.
*
* @param id the id of the object
* @param position the position of the object
* @param velocity the velocity of the object
* @param orientation the orientation of the object
* @param lisposition the position of the listener
* @param rollofffactor the rollofffactor of the object
*/
virtual void SetObjectTransform(int id,
const MT_Vector3& position,
const MT_Vector3& velocity,
const MT_Matrix3x3& orientation,
const MT_Vector3& lisposition,
const MT_Scalar& rollofffactor) const =0;
/**
* make a sound 2D
*
* @param id the id of the object
*/
virtual void ObjectIs2D(int id) const =0;
/**
* tell the device we want cd suppport
*/
virtual void UseCD() const =0;
/**
* start playback of the cd
*
* @param track the tracknumber to start playback from
*/
virtual void PlayCD(int track) const =0;
/**
* pause playback of the cd (true == pause, false == resume)
*/
virtual void PauseCD(bool pause) const =0;
/**
* stop playback of the cd
*/
virtual void StopCD() const =0;
/**
* set the playbackmode of the cd
* SND_CD_ALL play all tracks
* SND_CD_TRACK play one track
* SND_CD_TRACKLOOP play one track looped
* SND_CD_RANDOM play all tracks in random order
*
* @param playmode playmode
*/
virtual void SetCDPlaymode(int playmode) const =0;
/**
* set the volume playback of the cd
*
* @param gain the gain
*/
virtual void SetCDGain(MT_Scalar gain) const =0;
virtual void StartUsingDSP() =0;
virtual float* GetSpectrum() =0;
virtual void StopUsingDSP() =0;
protected:
virtual void RevokeSoundObject(SND_SoundObject* pObject)=0;
};
#endif //SND_IAUDIODEVICE

@ -0,0 +1,55 @@
/*
* SND_Object.h
*
* Abstract sound object
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef __SND_OBJECT_H
#define __SND_OBJECT_H
#include "GEN_List.h"
#include "MT_Matrix3x3.h"
#include "SoundDefines.h"
/**
* SND_Object is an interface class for soundobjects, listeners and other
* kinds of sound related thingies.
*/
class SND_Object : public GEN_Link
{
public:
SND_Object() {};
virtual ~SND_Object() {};
};
#endif //__SND_OBJECT_H

@ -0,0 +1,106 @@
/*
* SND_Scene.h
*
* The scene for sounds.
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifdef WIN32
#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
#endif //WIN32
#ifndef __SND_SCENE_H
#define __SND_SCENE_H
#include "SoundDefines.h"
#include "SND_SoundObject.h"
#include "SND_CDObject.h"
#include "SND_SoundListener.h"
#include "SND_WaveSlot.h"
#include "MT_Vector3.h"
#include "MT_Matrix3x3.h"
#include "STR_String.h"
#include <set>
class SND_Scene
{
std::set<class SND_SoundObject*> m_soundobjects;
GEN_List m_activeobjects;
class SND_IAudioDevice* m_audiodevice;
class SND_WaveCache* m_wavecache;
class SND_SoundListener m_listener;
bool m_audio; // to check if audio works
bool m_audioplayback; // to check if audioplayback is wanted
void UpdateListener();
void BuildActiveList(MT_Scalar curtime);
void UpdateActiveObects();
void UpdateCD();
public:
SND_Scene(SND_IAudioDevice* adi);
~SND_Scene();
bool IsPlaybackWanted();
void AddActiveObject(SND_SoundObject* pObject, MT_Scalar curtime);
void RemoveActiveObject(SND_SoundObject* pObject);
void DeleteObjectWhenFinished(SND_SoundObject* pObject);
void Proceed();
int LoadSample(const STR_String& samplename,
void* memlocation,
int size);
void RemoveAllSamples();
bool CheckBuffer(SND_SoundObject* pObject);
bool IsSampleLoaded(STR_String& samplename);
void AddObject(SND_SoundObject* pObject);
bool SetCDObject(SND_CDObject* cdobject);
void DeleteObject(SND_SoundObject* pObject);
void RemoveAllObjects();
void StopAllObjects();
int GetObjectStatus(SND_SoundObject* pObject) const;
void SetListenerTransform(const MT_Vector3& pos,
const MT_Vector3& vel,
const MT_Matrix3x3& mat);
SND_SoundListener* GetListener();
};
#endif //__SND_SCENE_H

@ -0,0 +1,84 @@
/*
* SND_SoundListener.h
*
* A SoundListener is for sound what a camera is for vision.
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef __SND_SOUNDLISTENER_H
#define __SND_SOUNDLISTENER_H
#include "SND_Object.h"
class SND_SoundListener : public SND_Object
{
public:
SND_SoundListener();
virtual ~SND_SoundListener();
void SetStateFlag(unsigned int stateflags);
void SetGain(MT_Scalar gain);
void SetPosition(const MT_Vector3& pos);
void SetVelocity(const MT_Vector3& vel);
void SetOrientation(const MT_Matrix3x3& ori);
void SetDopplerFactor(MT_Scalar dopplerfactor);
void SetDopplerVelocity(MT_Scalar dopplervelocity);
void SetScale(MT_Scalar scale);
void SetModified(bool modified);
bool IsModified() const;
unsigned int GetStateFlags() const;
MT_Scalar GetGain() const;
MT_Vector3 GetPosition() const;
MT_Vector3 GetVelocity() const;
MT_Matrix3x3 GetOrientation();
MT_Scalar GetDopplerFactor() const;
MT_Scalar GetDopplerVelocity() const;
MT_Scalar GetScale() const;
private:
void* m_listener;
bool m_modified;
MT_Scalar m_gain; /* overall gain */
MT_Vector3 m_position; /* position; left/right, up/down, in/out */
MT_Vector3 m_velocity; /* velocity of the listener */
MT_Matrix3x3 m_orientation; /* orientation of the listener */
MT_Scalar m_dopplerfactor; /* scaling factor for the Doppler (pitch) shift */
MT_Scalar m_dopplervelocity; /* factor for the reference velocity (for Dopplereffect) */
MT_Scalar m_scale;
};
#endif //__SND_SOUNDLISTENER_H

@ -0,0 +1,162 @@
/*
* SND_SoundObject.h
*
* Implementation of the abstract sound object
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef __SND_SOUNDOBJECT_H
#define __SND_SOUNDOBJECT_H
#include "SND_Object.h"
#include "STR_String.h"
/**
* SND_SoundObject is a class for api independent sounddata storage conected to an actuator
*/
class SND_SoundObject : public SND_Object
{
private:
STR_String m_samplename; /* name of the sample */
STR_String m_objectname; /* name of the object */
unsigned int m_buffer;
bool m_active; /* is the object active or not? */
int m_id;
MT_Scalar m_lifespan; /* the lifespan of the sound seconds */
MT_Scalar m_timestamp;
MT_Scalar m_length; /* length of the sample in seconds */
MT_Scalar m_gain; /* the gain of the object */
MT_Scalar m_rollofffactor; /* the scaling factor to increase or decrease the range
of a source by decreasing or increasing the
attenuation, respectively */
MT_Scalar m_referencedistance;/* the distance at which the listener will experience
gain */
MT_Scalar m_mingain; /* indicates the minimal gain which is always guaranteed
for this source */
MT_Scalar m_maxgain; /* indicates the maximal gain which is always guaranteed
for this source */
MT_Scalar m_pitch; /* the pitch of the object */
MT_Vector3 m_position; /* position; left/right, up/down, in/out */
MT_Vector3 m_velocity; /* velocity of the object */
MT_Matrix3x3 m_orientation; /* orientation of the object */
unsigned int m_loopmode; /* loop normal or bidirectional? */
unsigned int m_loopstart; /* start of looppoint in samples! */
unsigned int m_loopend; /* end of looppoint in samples! */
bool m_is3d; /* is the object 3D or 2D? */
int m_playstate; /* flag for current state of object */
bool m_modified;
unsigned int m_running;
bool m_highpriority; /* may the sound be ditched when we run out of voices? */
public:
SND_SoundObject();
~SND_SoundObject();
void SetBuffer(unsigned int buffer);
void SetActive(bool active);
void StartSound();
void StopSound();
void PauseSound();
void DeleteWhenFinished();
void SetObjectName(STR_String objectname);
void SetSampleName(STR_String samplename);
void SetLength(MT_Scalar length);
void SetPitch(MT_Scalar pitch);
void SetGain(MT_Scalar gain);
void SetMinGain(MT_Scalar mingain);
void SetMaxGain(MT_Scalar maxgain);
void SetRollOffFactor(MT_Scalar rollofffactor);
void SetReferenceDistance(MT_Scalar distance);
void SetPosition(const MT_Vector3& pos);
void SetVelocity(const MT_Vector3& vel);
void SetOrientation(const MT_Matrix3x3& orient);
void SetLoopMode(unsigned int loopmode);
void SetLoopStart(unsigned int loopstart);
void SetLoopEnd(unsigned int loopend);
void Set3D(bool threedee);
void SetPlaystate(int playstate);
void SetHighPriority(bool priority);
void SetId(int id);
void SetLifeSpan();
void SetTimeStamp(MT_Scalar timestamp);
void SetModified(bool modified);
bool IsLifeSpanOver(MT_Scalar curtime) const;
bool IsActive() const;
bool IsModified() const;
bool IsHighPriority() const;
void InitRunning();
bool IsRunning() const;
void AddRunning();
int GetId() const;
MT_Scalar GetLifeSpan() const;
MT_Scalar GetTimestamp() const;
unsigned int GetBuffer();
const STR_String& GetSampleName();
const STR_String& GetObjectName();
MT_Scalar GetLength() const;
MT_Scalar GetGain() const;
MT_Scalar GetPitch() const;
MT_Scalar GetMinGain() const;
MT_Scalar GetMaxGain() const;
MT_Scalar GetRollOffFactor() const;
MT_Scalar GetReferenceDistance() const;
MT_Vector3 GetPosition() const;
MT_Vector3 GetVelocity() const;
MT_Matrix3x3 GetOrientation() const;
unsigned int GetLoopMode() const;
unsigned int GetLoopStart() const;
unsigned int GetLoopEnd() const;
bool Is3D() const;
int GetPlaystate() const;
};
#endif //__SND_SOUNDOBJECT_H

@ -0,0 +1,113 @@
/**
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef SND_UTILS_H
#define SND_UTILS_H
#include "SND_WaveSlot.h"
#ifdef __cplusplus
extern "C"
{
#endif
typedef struct
{
unsigned char riff[4];
signed int size;
unsigned char type[4];
} WavFileHeader;
typedef struct
{
unsigned short format;
unsigned short numberofchannels;
unsigned int samplerate;
unsigned int bytespersec;
unsigned short blockalignment;
unsigned short bitrate;
} WavFmtHeader;
typedef struct
{
unsigned short size;
unsigned short samplesperblock;
} WavFmtExHeader;
typedef struct
{
unsigned int Manufacturer;
unsigned int Product;
unsigned int SamplePeriod;
unsigned int Note;
unsigned int FineTune;
unsigned int SMPTEFormat;
unsigned int SMPTEOffest;
unsigned int loops;
unsigned int SamplerData;
struct
{
unsigned int Identifier;
unsigned int Type;
unsigned int Start;
unsigned int End;
unsigned int Fraction;
unsigned int Count;
} Loop[1];
} WavSampleHeader;
typedef struct
{
unsigned char id[4];
unsigned int size;
} WavChunkHeader;
/**
* loads a sample and returns a pointer
*/
extern void* SND_LoadSample(char *filename);
extern bool SND_IsSampleValid(const STR_String& name, void* memlocation);
extern unsigned int SND_GetSampleFormat(void* sample);
extern unsigned int SND_GetNumberOfChannels(void* sample);
extern unsigned int SND_GetSampleRate(void* sample);
extern unsigned int SND_GetBitRate(void* sample);
extern unsigned int SND_GetNumberOfSamples(void* sample);
extern unsigned int SND_GetHeaderSize(void* sample);
extern unsigned int SND_GetExtraChunk(void* sample);
extern void SND_GetSampleInfo(signed char* sample, SND_WaveSlot* waveslot);
#ifdef __cplusplus
}
#endif
#endif

@ -0,0 +1,68 @@
/*
* SND_WaveCache.h
*
* abstract wavecache, a way to organize samples
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifdef WIN32
#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
#endif //WIN32
#ifndef __SND_WAVECACHE_H
#define __SND_WAVECACHE_H
#include "SND_WaveSlot.h"
#include "SoundDefines.h"
#include "SND_SoundObject.h"
#include <map>
class SND_WaveCache
{
public:
SND_WaveCache();
virtual ~SND_WaveCache();
SND_WaveSlot* GetWaveSlot(const STR_String& samplename);
void RemoveAllSamples();
void RemoveSample(const STR_String& samplename, int buffer);
private:
std::map<STR_String, SND_WaveSlot*> m_samplecache;
SND_WaveSlot* m_bufferList[NUM_BUFFERS];
void FreeSamples();
};
#endif //__SND_WAVECACHE_H

@ -0,0 +1,94 @@
/*
* SND_WaveSlot.cpp
*
* class for storing sample related information
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef __SND_WAVESLOT_H
#define __SND_WAVESLOT_H
#include "STR_String.h"
class SND_WaveSlot
{
STR_String m_samplename;
bool m_loaded;
void* m_data;
unsigned int m_buffer;
unsigned int m_sampleformat;
unsigned int m_numberofchannels;
unsigned int m_samplerate;
unsigned int m_bitrate;
unsigned int m_numberofsamples;
unsigned int m_filesize;
public:
SND_WaveSlot(): m_loaded(false),
m_data(NULL),
m_buffer(0),
m_sampleformat(0),
m_numberofchannels(0),
m_samplerate(0),
m_bitrate(0),
m_numberofsamples(0),
m_filesize(0)
{};
~SND_WaveSlot();
void SetSampleName(STR_String samplename);
void SetLoaded(bool loaded);
void SetData(void* data);
void SetBuffer(unsigned int buffer);
void SetSampleFormat(unsigned int sampleformat);
void SetNumberOfChannels(unsigned int numberofchannels);
void SetSampleRate(unsigned int samplerate);
void SetBitRate(unsigned int bitrate);
void SetNumberOfSamples(unsigned int numberofsamples);
void SetFileSize(unsigned int filesize);
const STR_String& GetSampleName();
bool IsLoaded() const;
void* GetData();
unsigned int GetBuffer() const;
unsigned int GetSampleFormat() const;
unsigned int GetNumberOfChannels() const;
unsigned int GetSampleRate() const;
unsigned int GetBitRate() const;
unsigned int GetNumberOfSamples() const;
unsigned int GetFileSize() const;
};
#endif //__SND_WAVESLOT_H

@ -0,0 +1,53 @@
#
# $Id$
#
# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. The Blender
# Foundation also sells licenses for use in proprietary software under
# the Blender License. See http://www.blender.org/BL/ for information
# about this.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): none yet.
#
# ***** END GPL/BL DUAL LICENSE BLOCK *****
#
#
LIBNAME = SoundSystem
DIR = $(OCGDIR)/gameengine/$(LIBNAME)
ALLTARGETS = $(OBJS) $(DIR)/$(DEBUG_DIR)SoundSystem
include nan_compile.mk
CPPFLAGS += $(NAN_LEVEL_1_WARNINGS)
CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I../../../kernel/gen_system
CPPFLAGS += -I.. -I../SND_BlenderWaveCache -I../SND_OpenAL
TESTLIB = $(OCGDIR)/gameengine/OpenALSoundSystem/$(DEBUG_DIR)libOpenALSoundSystem.a
TESTLIB += $(OCGDIR)/gameengine/BlenderWaveCache/$(DEBUG_DIR)libBlenderWaveCache.a
TESTLIB += $(OCGDIR)/kernel/gen_system/$(DEBUG_DIR)libgen_system.a
TESTLIB += $(OCGDIR)/gameengine/SoundSystem/$(DEBUG_DIR)libSoundSystem.a
TESTLIB += $(NAN_OPENAL)/lib/libopenal.a
$(DIR)/$(DEBUG_DIR)SoundSystem: $(OBJS) $(TESTLIB)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(TESTLIB) -lm -pthread -ldl -lstdc++

@ -0,0 +1,152 @@
/* SND_test.c nov 2000
*
* testfile for the SND module
*
* janco verduin
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "SND_C-api.h"
#include "BlenderWaveCacheCApi.h"
#include "OpenALC-Api.h"
#include <stdio.h>
#include <stdlib.h>
#if defined(WIN32)
#include <io.h>
#else
#include <unistd.h>
#endif
#include <fcntl.h>
static int buf[3];
float oPos[3]={3.0, 0.0,-1.0};
float oVel[3]={0.0, 0.0, 1.0};
float oOri[6]={0.0, 0.0, 1.0, 0.0, 1.0, 0.0};
void* ReadFile(char *filename)
{
int file, filelen;
void *data = NULL;
#if defined(WIN32)
file = open(filename, O_BINARY|O_RDONLY);
#else
file = open(filename, 0|O_RDONLY);
#endif
if (file == -1) {
printf("can't open file.\n");
printf("press q for quit.\n");
}
else {
filelen = lseek(file, 0, SEEK_END);
lseek(file, 0, SEEK_SET);
if (filelen != 0){
data = malloc(filelen);
if (read(file, data, filelen) != filelen) {
free(data);
data = NULL;
}
}
close(file);
}
return (data);
}
int main(int argc, char* argv[])
{
int ch;
char* samplename = NULL;
void* sampleinmemory = NULL;
SND_CacheHandle wavecache = NULL;
SND_SceneHandle scene = NULL;
SND_ObjectHandle object = NULL;
wavecache = SND_GetWaveCache();
scene = SND_CreateOpenALScene(wavecache);
samplename = "2.wav";
sampleinmemory = ReadFile(samplename);
if (sampleinmemory) {
object = SND_CreateObject();
SND_AddMemoryLocation(samplename, sampleinmemory);
SND_SetSampleName(object, samplename);
SND_AddObject(scene, object);
printf("go your gang...\n");
printf("1: play\n");
printf("2: stop\n");
printf("q: quit\n");
}
do
{
ch = getchar();
ch = toupper(ch);
switch (ch)
{
case '1':
{
SND_SetPitch(object, 1.0);
SND_SetGain(object, 1.0);
SND_StartSound(object);
break;
}
case '2':
{
SND_StopSound(object);
break;
}
default:
break;
}
SND_Proceed(scene);
} while (ch != 'Q');
if (object) {
SND_RemoveObject(scene, object);
SND_DeleteObject(object);
}
SND_DeleteScene(scene);
SND_DeleteCache();
return 0;
}

@ -0,0 +1,119 @@
/*
* SoundDefines.h
*
* this is where all kinds of defines are stored
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef __SOUNDDEFINES_H
#define __SOUNDDEFINES_H
/* the types of devices */
enum
{
snd_e_dummydevice = 0,
snd_e_fmoddevice,
snd_e_openaldevice
};
/* general stuff */
#define NUM_BUFFERS 128
#define NUM_SOURCES 16
/* openal related stuff */
#define AL_LOOPING 0x1007
/* fmod related stuff */
#ifdef WIN32
#define MIXRATE 22050
#else
#define MIXRATE 44100
#endif
#define NUM_FMOD_MIN_HW_CHANNELS 16
#define NUM_FMOD_MAX_HW_CHANNELS 16
/* activelist defines */
enum
{
SND_REMOVE_ACTIVE_OBJECT = 0,
SND_ADD_ACTIVE_OBJECT,
SND_DO_NOTHING
};
/* playstate flags */
enum
{
SND_UNKNOWN = -1,
SND_INITIAL,
SND_MUST_PLAY,
SND_PLAYING,
SND_MUST_STOP,
SND_STOPPED,
SND_MUST_PAUSE,
SND_PAUSED,
SND_MUST_RESUME,
SND_MUST_STOP_WHEN_FINISHED,
SND_MUST_BE_DELETED
};
/* loopmodes */
enum
{
SND_LOOP_OFF = 0,
SND_LOOP_NORMAL,
SND_LOOP_BIDIRECTIONAL
};
/* cd playstate flags */
enum
{
SND_CD_ALL = 0,
SND_CD_TRACK,
SND_CD_TRACKLOOP
};
/* sample types */
enum
{
SND_WAVE_FORMAT_UNKNOWN = 0,
SND_WAVE_FORMAT_PCM,
SND_WAVE_FORMAT_ADPCM,
SND_WAVE_FORMAT_ALAW = 6,
SND_WAVE_FORMAT_MULAW,
SND_WAVE_FORMAT_DIALOGIC_OKI_ADPCM = 17,
SND_WAVE_FORMAT_CONTROL_RES_VQLPC = 34,
SND_WAVE_FORMAT_GSM_610 = 49,
SND_WAVE_FORMAT_MPEG3 = 85
};
#endif //__SOUNDDEFINES_H

@ -0,0 +1,46 @@
#
# $Id$
#
# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. The Blender
# Foundation also sells licenses for use in proprietary software under
# the Blender License. See http://www.blender.org/BL/ for information
# about this.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): none yet.
#
# ***** END GPL/BL DUAL LICENSE BLOCK *****
#
#
LIBNAME = DummySoundSystem
DIR = $(OCGDIR)/gameengine/$(LIBNAME)
include nan_compile.mk
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
CPPFLAGS += -I$(NAN_STRING)/include
CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I../../../../kernel/gen_system
CPPFLAGS += -I../intern
CPPFLAGS += -I..
CPPFLAGS += -I.

@ -0,0 +1,53 @@
/*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
* SND_FmodDevice derived from SND_IAudioDevice
*/
#ifdef WIN32
#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
#endif //WIN32
#include "SND_DummyDevice.h"
SND_DummyDevice::SND_DummyDevice()
{
}
SND_DummyDevice::~SND_DummyDevice()
{
#ifdef ONTKEVER
printf("SND_DummyDevice destructor");
#endif
}

@ -0,0 +1,95 @@
/**
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef SND_DUMMYDEVICE
#define SND_DUMMYDEVICE
#include "SND_AudioDevice.h"
class SND_DummyDevice : public SND_AudioDevice
{
public:
SND_DummyDevice();
~SND_DummyDevice();
bool Init() { return false; }
SND_WaveSlot* LoadSample(const STR_String& samplename,
void* memlocation,
int size) { return NULL; }
void InitListener() {};
void SetListenerGain(float gain) const {};
void SetDopplerVelocity(MT_Scalar dopplervelocity) const {};
void SetDopplerFactor(MT_Scalar dopplerfactor) const {};
void SetListenerRollOffFactor(MT_Scalar rollofffactor) const {};
void MakeCurrent() const {};
void NextFrame() const {};
void SetObjectBuffer(int id, unsigned int buffer) {};
int GetPlayState(int id) { return SND_UNKNOWN; }
void PlayObject(int id) {};
void StopObject(int id) const {};
void StopAllObjects() {};
void PauseObject(int id) const {};
void SetObjectLoop(int id, unsigned int loopmode) const {};
void SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const {};
void SetObjectPitch(int id, MT_Scalar pitch) const {};
void SetObjectGain(int id, MT_Scalar gain) const {};
void SetObjectMinGain(int id, MT_Scalar mingain) const {};
void SetObjectMaxGain(int id, MT_Scalar maxgain) const {};
void SetObjectRollOffFactor(int id, MT_Scalar rolloff) const {};
void SetObjectReferenceDistance(int id, MT_Scalar distance) const {};
void SetObjectTransform(int id,
const MT_Vector3& position,
const MT_Vector3& velocity,
const MT_Matrix3x3& orientation,
const MT_Vector3& lisposition,
const MT_Scalar& rollofffactor) const {};
void ObjectIs2D(int id) const {};
void PlayCD(int track) const {};
void PauseCD(bool pause) const {};
void StopCD() const {};
void SetCDPlaymode(int playmode) const {};
void SetCDGain(MT_Scalar gain) const {};
void StartUsingDSP() {};
float* GetSpectrum() { return NULL; }
void StopUsingDSP() {};
};
#endif //SND_DUMMYDEVICE

@ -0,0 +1,47 @@
#
# $Id$
#
# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. The Blender
# Foundation also sells licenses for use in proprietary software under
# the Blender License. See http://www.blender.org/BL/ for information
# about this.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): none yet.
#
# ***** END GPL/BL DUAL LICENSE BLOCK *****
#
#
LIBNAME = FmodSoundSystem
DIR = $(OCGDIR)/gameengine/$(LIBNAME)
include nan_compile.mk
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
CPPFLAGS += -I$(NAN_FMOD)/include
CPPFLAGS += -I$(NAN_STRING)/include
CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I../../../kernel/gen_system
CPPFLAGS += -I../intern
CPPFLAGS += -I..
CPPFLAGS += -I.

@ -0,0 +1,543 @@
/*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
* SND_FmodDevice derived from SND_IAudioDevice
*/
#ifdef WIN32
#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
#endif //WIN32
#include "SND_FmodDevice.h"
#include "SoundDefines.h"
#include "SYS_System.h"
#include "SND_Utils.h"
SND_FmodDevice::SND_FmodDevice()
{
// check if audio is wanted
SYS_SystemHandle syshandle = SYS_GetSystem();
int audio = SYS_GetCommandLineInt(syshandle,"noaudio",0);
m_dspunit = NULL;
if (audio == 1)
m_audio = false;
else
m_audio = true;
// let's check if we can get fmod to initialize...
if (m_audio)
{
signed char MinHardwareChannels = FSOUND_SetMinHardwareChannels(NUM_FMOD_MIN_HW_CHANNELS);
signed char MaxHardwareChannels = FSOUND_SetMaxHardwareChannels(NUM_FMOD_MAX_HW_CHANNELS);
if (FSOUND_Init(MIXRATE, NUM_SOURCES, 0))
{
m_max_channels = FSOUND_GetMaxChannels();
m_num_hardware_channels = FSOUND_GetNumHardwareChannels();
m_num_software_channels = NUM_SOURCES;
// let's get us a wavecache
m_wavecache = new SND_WaveCache();
int i;
for (i = 0; i < NUM_BUFFERS; i++)
m_buffers[i] = NULL;
for (i = 0; i < NUM_SOURCES; i++)
{
m_sources[i] = NULL;
m_frequencies[i] = 0;
m_channels[i] = 0;
}
}
else
{
m_audio = false;
}
}
#ifdef ONTKEVER
int numdrivers = FSOUND_GetNumDrivers();
int output = FSOUND_GetOutput();
int oputputrate = FSOUND_GetOutputRate();
int mixer = FSOUND_GetMixer();
printf("maxchannels is: %d\n", m_max_channels);
printf("num hw channels is: %d\n", m_num_hardware_channels);
printf("num sw channels is: %d\n", m_num_software_channels);
printf("numdrivers is: %d\n", numdrivers);
printf("output is: %d\n", output);
printf("oputputrate is: %d\n", oputputrate);
printf("mixer is: %d\n", mixer);
#endif
}
SND_FmodDevice::~SND_FmodDevice()
{
// let's see if we used the cd. if not, just leave it alone
SND_CDObject* pCD = SND_CDObject::Instance();
if (pCD)
{
this->StopCD();
SND_CDObject::DisposeSystem();
}
StopUsingDSP();
FSOUND_Close();
}
void SND_FmodDevice::UseCD() const
{
// only fmod has CD support, so only create it here
SND_CDObject::CreateSystem();
}
void SND_FmodDevice::MakeCurrent() const
{
// empty
}
SND_WaveSlot* SND_FmodDevice::LoadSample(const STR_String& name,
void* memlocation,
int size)
{
SND_WaveSlot* waveslot = NULL;
STR_String samplename = name;
if (m_audio)
{
/* first check if the sample is supported */
if (SND_IsSampleValid(name, memlocation))
{
/* create the waveslot */
waveslot = m_wavecache->GetWaveSlot(samplename);
if (waveslot)
{
int buffer = waveslot->GetBuffer();
/* load the sample from memory? */
if (size && memlocation)
{
m_buffers[buffer] = FSOUND_Sample_Load(buffer, (char*)memlocation, FSOUND_LOADMEMORY, size);
/* if the loading succeeded, fill the waveslot with info */
if (m_buffers[buffer])
{
int sampleformat = SND_GetSampleFormat(memlocation);
int numberofchannels = SND_GetNumberOfChannels(memlocation);
int samplerate = SND_GetSampleRate(memlocation);
int bitrate = SND_GetBitRate(memlocation);
int numberofsamples = SND_GetNumberOfSamples(memlocation);
waveslot->SetFileSize(size);
waveslot->SetData(memlocation);
waveslot->SetSampleFormat(sampleformat);
waveslot->SetNumberOfChannels(numberofchannels);
waveslot->SetSampleRate(samplerate);
waveslot->SetBitRate(bitrate);
waveslot->SetNumberOfSamples(numberofsamples);
}
}
/* or from file? */
else
{
m_buffers[buffer] = FSOUND_Sample_Load(buffer, samplename.Ptr(), FSOUND_LOOP_NORMAL, NULL);
}
#ifdef ONTKEVER
int error = FSOUND_GetError();
printf("sample load: errornumber is: %d\n", error);
#endif
/* if the loading succeeded, mark the waveslot */
if (m_buffers[buffer])
{
waveslot->SetLoaded(true);
}
/* or when it failed, free the waveslot */
else
{
m_wavecache->RemoveSample(waveslot->GetSampleName(), waveslot->GetBuffer());
waveslot = NULL;
}
}
}
}
return waveslot;
}
// listener's and general stuff //////////////////////////////////////////////////////
/* sets the global dopplervelocity */
void SND_FmodDevice::SetDopplerVelocity(MT_Scalar dopplervelocity) const
{
/* not supported by fmod */
FSOUND_3D_Listener_SetDopplerFactor(dopplervelocity);
}
/* sets the global dopplerfactor */
void SND_FmodDevice::SetDopplerFactor(MT_Scalar dopplerfactor) const
{
FSOUND_3D_Listener_SetDopplerFactor(dopplerfactor);
}
/* sets the global rolloff factor */
void SND_FmodDevice::SetListenerRollOffFactor(MT_Scalar rollofffactor) const
{
// not implemented in openal
}
void SND_FmodDevice::NextFrame() const
{
FSOUND_3D_Update();
}
// set the gain for the listener
void SND_FmodDevice::SetListenerGain(float gain) const
{
int fmod_gain = (int)(gain * 255);
FSOUND_SetSFXMasterVolume(fmod_gain);
}
void SND_FmodDevice::InitListener()
{
// initialize the listener with these values that won't change
// (as long as we can have only one listener)
// now we can superimpose all listeners on each other (for they
// have the same settings)
float lispos[3] = {0,0,0};
float lisvel[3] = {0,0,0};
FSOUND_3D_Listener_SetAttributes(lispos, lisvel, 0, -1, 0, 0, 0, 1);
}
// source playstate stuff ////////////////////////////////////////////////////////////
// check if the sound's still playing
int SND_FmodDevice::GetPlayState(int id)
{
int result = SND_STOPPED;
// klopt niet, fixen
signed char isplaying = FSOUND_IsPlaying(id);
if (isplaying)
{
result = SND_PLAYING;
}
/* hi reevan, just swap // of these 2 lines */
// return result;
return 0;
}
/* sets the buffer */
void SND_FmodDevice::SetObjectBuffer(int id, unsigned int buffer)
{
m_sources[id] = m_buffers[buffer];
}
// make the source play
void SND_FmodDevice::PlayObject(int id)
{
m_channels[id] = FSOUND_PlaySound(FSOUND_FREE, m_sources[id]);
m_frequencies[id] = FSOUND_GetFrequency(m_channels[id]);
// printf("fmod: play \n");
}
// make the source stop
void SND_FmodDevice::StopObject(int id) const
{
FSOUND_StopSound(m_channels[id]);
// printf("fmod: stop \n");
}
// stop all sources
void SND_FmodDevice::StopAllObjects()
{
FSOUND_StopSound(FSOUND_ALL);
}
// pause the source
void SND_FmodDevice::PauseObject(int id) const
{
FSOUND_StopSound(m_channels[id]);
}
// source properties stuff ////////////////////////////////////////////////////////////
// give openal the object's pitch
void SND_FmodDevice::SetObjectPitch(int id, MT_Scalar pitch) const
{
pitch = pitch * m_frequencies[id];
char result = FSOUND_SetFrequency(m_channels[id], (int)pitch);
}
// give openal the object's gain
void SND_FmodDevice::SetObjectGain(int id, MT_Scalar gain) const
{
int vol = (int)(gain * 255);
FSOUND_SetVolume(m_channels[id], vol);
}
// give openal the object's looping
void SND_FmodDevice::SetObjectLoop(int id, unsigned int loopmode) const
{
// printf("loopmode: %d\n", loopmode);
switch (loopmode)
{
case SND_LOOP_OFF:
{
char result = FSOUND_Sample_SetLoopMode(m_sources[id], FSOUND_LOOP_OFF);
// char result = FSOUND_SetLoopMode(m_channels[id], FSOUND_LOOP_OFF);
break;
}
case SND_LOOP_NORMAL:
{
char result = FSOUND_Sample_SetLoopMode(m_sources[id], FSOUND_LOOP_NORMAL);
// char result = FSOUND_SetLoopMode(m_channels[id], FSOUND_LOOP_NORMAL);
break;
}
case SND_LOOP_BIDIRECTIONAL:
{
char result = FSOUND_Sample_SetLoopMode(m_sources[id], FSOUND_LOOP_BIDI);
// char result = FSOUND_SetLoopMode(m_channels[id], FSOUND_LOOP_NORMAL);
break;
}
default:
break;
}
}
void SND_FmodDevice::SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const
{
FSOUND_Sample_SetLoopPoints(m_sources[id], loopstart, loopend);
}
void SND_FmodDevice::SetObjectMinGain(int id, MT_Scalar mingain) const
{
/* not supported by fmod */
}
void SND_FmodDevice::SetObjectMaxGain(int id, MT_Scalar maxgain) const
{
/* not supported by fmod */
}
void SND_FmodDevice::SetObjectRollOffFactor(int id, MT_Scalar rollofffactor) const
{
/* not supported by fmod */
}
void SND_FmodDevice::SetObjectReferenceDistance(int id, MT_Scalar referencedistance) const
{
/* not supported by fmod */
}
// give openal the object's position
void SND_FmodDevice::ObjectIs2D(int id) const
{
float obpos[3] = {0,0,0};
float obvel[3] = {0,0,0};
FSOUND_3D_SetAttributes(m_channels[id], obpos, obvel);
}
void SND_FmodDevice::SetObjectTransform(int id,
const MT_Vector3& position,
const MT_Vector3& velocity,
const MT_Matrix3x3& orientation,
const MT_Vector3& lisposition,
const MT_Scalar& rollofffactor) const
{
float obpos[3];
float obvel[3];
obpos[0] = (float)position[0] * (float)rollofffactor; //x (l/r)
obpos[1] = (float)position[1] * (float)rollofffactor;
obpos[2] = (float)position[2] * (float)rollofffactor;
velocity.getValue(obvel);
FSOUND_3D_SetAttributes(m_channels[id], obpos, obvel);
}
// cd support stuff ////////////////////////////////////////////////////////////
void SND_FmodDevice::PlayCD(int track) const
{
signed char result = FSOUND_CD_Play(track);
#ifdef ONTKEVER
printf("play track %d, result: %c\n", track, result);
#endif
}
void SND_FmodDevice::PauseCD(bool pause) const
{
signed char result = FSOUND_CD_SetPaused(pause);
#ifdef ONTKEVER
printf("pause cd: %d, result: %c\n", pause, result);
#endif
}
void SND_FmodDevice::StopCD() const
{
SND_CDObject* pCD = SND_CDObject::Instance();
if (pCD)
{
if (pCD->GetUsed())
{
signed char result = FSOUND_CD_Stop();
#ifdef ONTKEVER
printf("stop cd, result: %c\n", result);
#endif
}
}
}
void SND_FmodDevice::SetCDPlaymode(int playmode) const
{
FSOUND_CD_SetPlayMode(playmode);
}
void SND_FmodDevice::SetCDGain(MT_Scalar gain) const
{
int volume = gain * 255;
signed char result = FSOUND_CD_SetVolume(volume);
#ifdef ONTKEVER
printf("gain: %f, volume: %d, result: %c\n", gain, volume, result);
#endif
}
void SND_FmodDevice::StartUsingDSP()
{
m_dspunit = FSOUND_DSP_GetFFTUnit();
FSOUND_DSP_SetActive(m_dspunit, true);
}
float* SND_FmodDevice::GetSpectrum()
{
m_spectrum = FSOUND_DSP_GetSpectrum();
return m_spectrum;
}
void SND_FmodDevice::StopUsingDSP()
{
if (m_dspunit)
FSOUND_DSP_SetActive(m_dspunit, false);
}

@ -0,0 +1,105 @@
/**
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef SND_FMODDEVICE
#define SND_FMODDEVICE
#include "fmod.h"
#include "SND_AudioDevice.h"
#include "SoundDefines.h"
class SND_FmodDevice : public SND_AudioDevice
{
public:
SND_FmodDevice();
~SND_FmodDevice();
SND_WaveSlot* LoadSample(const STR_String& samplename,
void* memlocation,
int size);
void InitListener();
void SetListenerGain(float gain) const;
void SetDopplerVelocity(MT_Scalar dopplervelocity) const;
void SetDopplerFactor(MT_Scalar dopplerfactor) const;
void SetListenerRollOffFactor(MT_Scalar rollofffactor) const;
void MakeCurrent() const;
void NextFrame() const;
void UseCD() const;
void SetObjectBuffer(int id, unsigned int buffer);
int GetPlayState(int id);
void PlayObject(int id);
void StopObject(int id) const;
void StopAllObjects();
void PauseObject(int id) const;
void SetObjectLoop(int id, unsigned int loopmode) const;
void SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const;
void SetObjectPitch(int id, MT_Scalar pitch) const;
void SetObjectGain(int id, MT_Scalar gain) const;
void SetObjectMinGain(int id, MT_Scalar mingain) const;
void SetObjectMaxGain(int id, MT_Scalar maxgain) const;
void SetObjectRollOffFactor(int id, MT_Scalar rolloff) const;
void SetObjectReferenceDistance(int id, MT_Scalar distance) const;
void SetObjectTransform(int id,
const MT_Vector3& position,
const MT_Vector3& velocity,
const MT_Matrix3x3& orientation,
const MT_Vector3& lisposition,
const MT_Scalar& rollofffactor) const;
void ObjectIs2D(int id) const;
void PlayCD(int track) const;
void PauseCD(bool pause) const;
void StopCD() const;
void SetCDPlaymode(int playmode) const;
void SetCDGain(MT_Scalar gain) const;
void StartUsingDSP();
float* GetSpectrum();
void StopUsingDSP();
private:
FSOUND_SAMPLE* m_buffers[NUM_BUFFERS];
FSOUND_SAMPLE* m_sources[NUM_SOURCES];
FSOUND_DSPUNIT* m_dspunit;
int m_frequencies[NUM_SOURCES];
int m_max_channels;
int m_num_hardware_channels;
int m_num_software_channels;
int m_channels[NUM_SOURCES];
float* m_spectrum;
};
#endif //SND_FMODDEVICE

@ -0,0 +1,50 @@
#
# $Id$
#
# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. The Blender
# Foundation also sells licenses for use in proprietary software under
# the Blender License. See http://www.blender.org/BL/ for information
# about this.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): none yet.
#
# ***** END GPL/BL DUAL LICENSE BLOCK *****
#
#
LIBNAME = SoundSystem
DIR = $(OCGDIR)/gameengine/$(LIBNAME)
include nan_compile.mk
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
CPPFLAGS += -I$(NAN_FMOD)/include
CPPFLAGS += -I$(NAN_STRING)/include
CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I../../../kernel/gen_system
CPPFLAGS += -I../../../blender/include
CPPFLAGS += -I../dummy
CPPFLAGS += -I../fmod
CPPFLAGS += -I../openal
CPPFLAGS += -I..
CPPFLAGS += -I.

@ -0,0 +1,247 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "SND_AudioDevice.h"
#include "SND_SoundObject.h"
#ifdef WIN32
// This warning tells us about truncation of __long__ stl-generated names.
// It can occasionally cause DevStudio to have internal compiler warnings.
#pragma warning( disable : 4786 )
#endif
SND_AudioDevice::SND_AudioDevice()
{
m_wavecache = NULL;
m_audio = false;
for (int i = 0; i < NUM_SOURCES; i++)
{
m_idObjectArray[i] = new SND_IdObject();
m_idObjectArray[i]->SetId(i);
m_idObjectArray[i]->SetSoundObject(NULL);
m_idObjectList.addTail(m_idObjectArray[i]);
}
}
SND_AudioDevice::~SND_AudioDevice()
{
for (int i = 0; i < NUM_SOURCES; i++)
{
delete m_idObjectArray[i];
m_idObjectArray[i] = NULL;
}
if (m_wavecache)
{
delete m_wavecache;
m_wavecache = NULL;
}
}
bool SND_AudioDevice::IsInitialized()
{
return m_audio;
}
SND_WaveCache* SND_AudioDevice::GetWaveCache() const
{
return m_wavecache;
}
/* seeks an unused id and returns it */
bool SND_AudioDevice::GetNewId(SND_SoundObject* pObject)
{
#ifdef ONTKEVER
printf("SND_AudioDevice::GetNewId\n");
#endif
bool result;
// first, get the oldest (the first) idobject
SND_IdObject* pIdObject = (SND_IdObject*)m_idObjectList.getHead();
if (pIdObject->isTail())
{
result = false;
}
else
{
// find the first id object which doesn't have a high priority soundobject
bool ThisSoundMustStay = false;
bool OutOfIds = false;
do
{
// if no soundobject present, it's seat may be taken
if (pIdObject->GetSoundObject())
{
// and also if it ain't highprio
if (pIdObject->GetSoundObject()->IsHighPriority())
{
ThisSoundMustStay = true;
pIdObject = (SND_IdObject*)pIdObject->getNext();
// if the last one is a priority sound too, then there are no id's left
// and we won't add any new sounds
if (pIdObject->isTail())
OutOfIds = true;
}
else
{
ThisSoundMustStay = false;
}
}
else
{
ThisSoundMustStay = false;
}
} while (ThisSoundMustStay && !OutOfIds);
if (!OutOfIds)
{
SND_SoundObject* oldobject = oldobject = pIdObject->GetSoundObject();
// revoke the old object if present
if (oldobject)
{
#ifdef ONTKEVER
printf("oldobject: %x\n", oldobject);
#endif
RevokeSoundObject(oldobject);
}
// set the new soundobject into the idobject
pIdObject->SetSoundObject(pObject);
// set the id into the soundobject
int id = pIdObject->GetId();
pObject->SetId(id);
// connect the new id to the buffer the sample is stored in
SetObjectBuffer(id, pObject->GetBuffer());
// remove the idobject from the list and add it in the back again
pIdObject->remove();
m_idObjectList.addTail(pIdObject);
result = true;
}
}
return result;
}
void SND_AudioDevice::ClearId(SND_SoundObject* pObject)
{
#ifdef ONTKEVER
printf("SND_AudioDevice::ClearId\n");
#endif
if (pObject)
{
int id = pObject->GetId();
if (id != -1)
{
// lets get the idobject belonging to the soundobject
SND_IdObject* pIdObject = m_idObjectArray[id];
SND_SoundObject* oldobject = pIdObject->GetSoundObject();
if (oldobject)
{
RevokeSoundObject(oldobject);
// clear the idobject from the soundobject
pIdObject->SetSoundObject(NULL);
}
// remove the idobject and place it in front
pIdObject->remove();
m_idObjectList.addHead(pIdObject);
}
}
}
void SND_AudioDevice::RevokeSoundObject(SND_SoundObject* pObject)
{
#ifdef ONTKEVER
printf("SND_AudioDevice::RevokeSoundObject\n");
#endif
// stop the soundobject
int id = pObject->GetId();
if (id >= 0 && id < NUM_SOURCES)
{
StopObject(id);
// remove the object from the 'activelist'
pObject->SetActive(false);
#ifdef ONTKEVER
printf("pObject->remove();\n");
#endif
}
// make sure its id is invalid
pObject->SetId(-1);
}
/*
void SND_AudioDevice::RemoveSample(const char* filename)
{
if (m_wavecache)
m_wavecache->RemoveSample(filename);
}
*/
void SND_AudioDevice::RemoveAllSamples()
{
if (m_wavecache)
m_wavecache->RemoveAllSamples();
}

@ -0,0 +1,118 @@
/**
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef SND_AUDIODEVICE
#define SND_AUDIODEVICE
#include "SND_IAudioDevice.h"
#include "SoundDefines.h"
#include "SND_IdObject.h"
class SND_AudioDevice : public SND_IAudioDevice
{
public:
SND_AudioDevice();
virtual ~SND_AudioDevice();
virtual bool IsInitialized();
SND_WaveCache* GetWaveCache() const;
bool GetNewId(SND_SoundObject* pObject);
void ClearId(SND_SoundObject* pObject);
void UseCD() const {};
/* to be implemented in derived class
virtual SND_WaveSlot* LoadSample(const STR_String& samplename,
void* memlocation,
int size) =0;
*/
// void RemoveSample(const char* filename);
void RemoveAllSamples();
/* to be implemented in derived class
virtual void InitListener()=0;
virtual void SetListenerGain(float gain) const =0;
virtual void SetDopplerVelocity(MT_Scalar dopplervelocity) const =0;
virtual void SetDopplerFactor(MT_Scalar dopplerfactor) const =0;
virtual void SetListenerRollOffFactor(MT_Scalar rollofffactor) const =0;
virtual void MakeCurrent() const =0;
virtual void UpdateDevice() const =0;
virtual void SetObjectBuffer(int id, unsigned int buffer)=0;
virtual int GetPlayState(int id)=0;
virtual void PlayObject(int id)=0;
virtual void StopObject(int id) const =0;
virtual void StopAllObjects()=0;
virtual void PauseObject(int id) const =0;
virtual void SetObjectLoop(int id, bool loop) const =0;
virtual void SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const =0;
virtual void SetObjectPitch(int id, MT_Scalar pitch) const =0;
virtual void SetObjectGain(int id, MT_Scalar gain) const =0;
virtual void SetObjectRollOffFactor(int id, MT_Scalar rolloff) const =0;
virtual void SetObjectMinGain(int id, MT_Scalar mingain) const =0;
virtual void SetObjectMaxGain(int id, MT_Scalar maxgain) const =0;
virtual void SetObjectReferenceDistance(int id, MT_Scalar referencedistance) const =0;
virtual void SetObjectTransform(int id,
const MT_Vector3& position,
const MT_Vector3& velocity,
const MT_Matrix3x3& orientation,
const MT_Vector3& lisposition,
const MT_Scalar& rollofffactor) const =0;
virtual void ObjectIs2D(int id) const =0;
virtual void PlayCD(int track) const =0;
virtual void PauseCD(bool pause) const =0;
virtual void StopCD() const =0;
virtual void SetCDPlaymode(int playmode) const =0;
virtual void SetCDGain(MT_Scalar gain) const =0;
virtual float* GetSpectrum() =0;
*/
protected:
bool m_audio;
GEN_List m_idObjectList;
SND_IdObject* m_idObjectArray[NUM_SOURCES];
SND_WaveCache* m_wavecache;
private:
void RevokeSoundObject(SND_SoundObject* pObject);
};
#endif //SND_AUDIODEVICE

@ -0,0 +1,391 @@
/*
* SND_C-Api.cpp
*
* C Api for soundmodule
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "SND_C-api.h"
#include "SND_DeviceManager.h"
#include "SND_Scene.h"
#ifdef WIN32
#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
#endif //WIN32
void SND_SetDeviceType(int device_type)
{
SND_DeviceManager::SetDeviceType(device_type);
}
SND_AudioDeviceInterfaceHandle SND_GetAudioDevice()
{
SND_IAudioDevice* audiodevice = NULL;
SND_DeviceManager::Subscribe();
audiodevice = SND_DeviceManager::Instance();
if (!audiodevice->IsInitialized())
{
SND_DeviceManager::SetDeviceType(snd_e_dummydevice);
audiodevice = SND_DeviceManager::Instance();
}
return (SND_AudioDeviceInterfaceHandle)audiodevice;
}
void SND_ReleaseDevice()
{
SND_DeviceManager::Unsubscribe();
}
int SND_IsPlaybackWanted(SND_SceneHandle scene)
{
assert(scene);
bool result = ((SND_Scene*)scene)->IsPlaybackWanted();
return (int)result;
}
// create a scene
SND_SceneHandle SND_CreateScene(SND_AudioDeviceInterfaceHandle audiodevice)
{
// initialize sound scene and object
SND_Scene* scene = new SND_Scene((SND_IAudioDevice*)audiodevice);
return (SND_SceneHandle)scene;
}
void SND_DeleteScene(SND_SceneHandle scene)
{
assert(scene);
delete (SND_Scene*)scene;
}
int SND_AddSample(SND_SceneHandle scene,
const char* filename,
void* memlocation,
int size)
{
assert(scene);
assert(memlocation);
int buffer = ((SND_Scene*)scene)->LoadSample(filename, memlocation, size);
return buffer;
}
void SND_RemoveAllSamples(SND_SceneHandle scene)
{
assert(scene);
((SND_Scene*)scene)->RemoveAllSamples();
}
int SND_CheckBuffer(SND_SceneHandle scene, SND_ObjectHandle object)
{
assert(scene);
assert(object);
int result = (int)((SND_Scene*)scene)->CheckBuffer((SND_SoundObject*)object);
return result;
}
void SND_AddSound(SND_SceneHandle scene, SND_ObjectHandle object)
{
assert(scene);
assert(object);
((SND_Scene*)scene)->AddObject((SND_SoundObject *)object);
}
void SND_RemoveSound(SND_SceneHandle scene, SND_ObjectHandle object)
{
assert(scene);
assert(object);
((SND_Scene*)scene)->DeleteObject((SND_SoundObject *)object);
}
void SND_RemoveAllSounds(SND_SceneHandle scene)
{
assert(scene);
((SND_Scene*)scene)->RemoveAllObjects();
}
void SND_StopAllSounds(SND_SceneHandle scene)
{
assert(scene);
((SND_Scene*)scene)->StopAllObjects();
}
void SND_Proceed(SND_AudioDeviceInterfaceHandle audiodevice, SND_SceneHandle scene)
{
assert(scene);
((SND_Scene*)scene)->Proceed();
((SND_IAudioDevice*)audiodevice)->NextFrame();
}
SND_ListenerHandle SND_GetListener(SND_SceneHandle scene)
{
assert(scene);
return (SND_ListenerHandle)((SND_Scene*)scene)->GetListener();
}
void SND_SetListenerGain(SND_SceneHandle scene, double gain)
{
assert(scene);
SND_SoundListener* listener = ((SND_Scene*)scene)->GetListener();
listener->SetGain((MT_Scalar)gain);
}
void SND_SetDopplerFactor(SND_SceneHandle scene, double dopplerfactor)
{
assert(scene);
SND_SoundListener* listener = ((SND_Scene*)scene)->GetListener();
listener->SetDopplerFactor(dopplerfactor);
}
void SND_SetDopplerVelocity(SND_SceneHandle scene, double dopplervelocity)
{
assert(scene);
SND_SoundListener* listener = ((SND_Scene*)scene)->GetListener();
listener->SetDopplerVelocity(dopplervelocity);
}
// Object instantiation
SND_ObjectHandle SND_CreateSound()
{
return (SND_ObjectHandle)new SND_SoundObject();
}
void SND_DeleteSound(SND_ObjectHandle object)
{
assert(object);
delete (SND_SoundObject*)object;
}
// Object control
void SND_StartSound(SND_SceneHandle scene, SND_ObjectHandle object)
{
assert(scene);
assert(object);
((SND_Scene*)scene)->AddActiveObject((SND_SoundObject*)object, 0);
}
void SND_StopSound(SND_SceneHandle scene, SND_ObjectHandle object)
{
assert(scene);
assert(object);
((SND_Scene*)scene)->RemoveActiveObject((SND_SoundObject*)object);
}
void SND_PauseSound(SND_SceneHandle scene, SND_ObjectHandle object)
{
assert(scene);
assert(object);
((SND_Scene*)scene)->RemoveActiveObject((SND_SoundObject*)object);
}
void SND_SetSampleName(SND_ObjectHandle object, char* samplename)
{
assert(object);
STR_String name = samplename;
((SND_SoundObject*)object)->SetSampleName(name);
}
void SND_SetGain(SND_ObjectHandle object, double gain)
{
assert(object);
((SND_SoundObject*)object)->SetGain(gain);
}
void SND_SetMinimumGain(SND_ObjectHandle object, double minimumgain)
{
assert(object);
((SND_SoundObject*)object)->SetMinGain(minimumgain);
}
void SND_SetMaximumGain(SND_ObjectHandle object, double maximumgain)
{
assert(object);
((SND_SoundObject*)object)->SetMaxGain(maximumgain);
}
void SND_SetRollOffFactor(SND_ObjectHandle object, double rollofffactor)
{
assert(object);
((SND_SoundObject*)object)->SetRollOffFactor(rollofffactor);
}
void SND_SetReferenceDistance(SND_ObjectHandle object, double referencedistance)
{
assert(object);
((SND_SoundObject*)object)->SetReferenceDistance(referencedistance);
}
void SND_SetPitch(SND_ObjectHandle object, double pitch)
{
assert(object);
((SND_SoundObject*)object)->SetPitch(pitch);
}
void SND_SetPosition(SND_ObjectHandle object, double* position)
{
assert(object);
((SND_SoundObject*)object)->SetPosition(position);
}
void SND_SetVelocity(SND_ObjectHandle object, double* velocity)
{
assert(object);
((SND_SoundObject*)object)->SetVelocity(velocity);
}
void SND_SetOrientation(SND_ObjectHandle object, double* orientation)
{
assert(object);
((SND_SoundObject*)object)->SetOrientation(orientation);
}
void SND_SetLoopMode(SND_ObjectHandle object, int loopmode)
{
assert(object);
((SND_SoundObject*)object)->SetLoopMode(loopmode);
}
void SND_SetLoopPoints(SND_ObjectHandle object, unsigned int loopstart, unsigned int loopend)
{
assert(object);
((SND_SoundObject*)object)->SetLoopStart(loopstart);
((SND_SoundObject*)object)->SetLoopEnd(loopend);
}
float SND_GetGain(SND_ObjectHandle object)
{
assert(object);
MT_Scalar gain = ((SND_SoundObject*)object)->GetGain();
return (float) gain;
}
float SND_GetPitch(SND_ObjectHandle object)
{
assert(object);
MT_Scalar pitch = ((SND_SoundObject*)object)->GetPitch();
return (float) pitch;
}
int SND_GetLoopMode(SND_ObjectHandle object)
{
assert(object);
return ((SND_SoundObject*)object)->GetLoopMode();
}
int SND_GetPlaystate(SND_ObjectHandle object)
{
assert(object);
return ((SND_SoundObject*)object)->GetPlaystate();
}

@ -0,0 +1,182 @@
/*
* SND_CDObject.cpp
*
* Implementation for CD playback
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "SND_CDObject.h"
SND_CDObject* SND_CDObject::m_instance = NULL;
bool SND_CDObject::CreateSystem()
{
bool result = false;
if (!m_instance)
{
m_instance = new SND_CDObject();
result = true;
}
return result;
}
bool SND_CDObject::DisposeSystem()
{
bool result = false;
if (m_instance)
{
delete m_instance;
m_instance = NULL;
result = true;
}
return result;
}
SND_CDObject* SND_CDObject::Instance()
{
return m_instance;
}
SND_CDObject::SND_CDObject()
{
m_gain = 1;
m_playmode = SND_CD_ALL;
m_track = 1;
m_playstate = SND_STOPPED;
m_used = false;
// don't set the cd standard on modified:
// if not used, we don't wanna touch it (performance)
m_modified = false;
}
SND_CDObject::~SND_CDObject()
{
}
void SND_CDObject::SetGain(MT_Scalar gain)
{
m_gain = gain;
m_modified = true;
}
void SND_CDObject::SetPlaymode(int playmode)
{
m_playmode = playmode;
}
void SND_CDObject::SetPlaystate(int playstate)
{
m_playstate = playstate;
}
void SND_CDObject::SetTrack(int track)
{
m_track = track;
}
int SND_CDObject::GetTrack() const
{
return m_track;
}
MT_Scalar SND_CDObject::GetGain() const
{
return m_gain;
}
int SND_CDObject::GetPlaystate() const
{
return m_playstate;
}
bool SND_CDObject::IsModified() const
{
return m_modified;
}
void SND_CDObject::SetModified(bool modified)
{
m_modified = modified;
}
int SND_CDObject::GetPlaymode() const
{
return m_playmode;
}
void SND_CDObject::SetUsed()
{
m_used = true;
}
bool SND_CDObject::GetUsed()
{
return m_used;
}

@ -0,0 +1,137 @@
/*
* SND_DeviceManager.h
*
* singleton for creating, switching and deleting audiodevices
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "SND_DeviceManager.h"
#include "SND_DependKludge.h"
#include "SND_DummyDevice.h"
#ifdef USE_FMOD
#include "SND_FmodDevice.h"
#endif
#ifdef USE_OPENAL
#include "SND_OpenALDevice.h"
#endif
SND_IAudioDevice* SND_DeviceManager::m_instance = NULL;
int SND_DeviceManager::m_subscriptions = 0;
#ifdef USE_OPENAL
int SND_DeviceManager::m_device_type = snd_e_openaldevice;
#else
# ifdef USE_FMOD
int SND_DeviceManager::m_device_type = snd_e_fmoddevice;
# else
int SND_DeviceManager::m_device_type = snd_e_dummydevice;
# endif
#endif
void SND_DeviceManager::Subscribe()
{
++m_subscriptions;
}
void SND_DeviceManager::Unsubscribe()
{
--m_subscriptions;
// only release memory if there is a m_instance but no subscriptions left
if (m_subscriptions == 0 && m_instance)
{
delete m_instance;
m_instance = NULL;
}
}
SND_IAudioDevice* SND_DeviceManager::Instance()
{
// only give away an instance if there are subscriptions
if (m_subscriptions)
{
// if there's no instance yet, set and create a new one
if (m_instance == NULL)
{
SetDeviceType(m_device_type);
}
return m_instance;
}
else
{
return NULL;
}
}
void SND_DeviceManager::SetDeviceType(int device_type)
{
// if we want to change devicetype, first delete the old one
if (m_instance)
{
delete m_instance;
m_instance = NULL;
}
// let's create the chosen device
switch (device_type)
{
#ifdef USE_FMOD
case snd_e_fmoddevice:
{
m_instance = new SND_FmodDevice();
m_device_type = device_type;
break;
}
#endif
#ifdef USE_OPENAL
case snd_e_openaldevice:
{
m_instance = new SND_OpenALDevice();
m_device_type = device_type;
break;
}
#endif
default:
{
m_instance = new SND_DummyDevice();
m_device_type = device_type;
break;
}
}
}

@ -0,0 +1,75 @@
/*
* SND_IdObject.cpp
*
* Object for storing runtime data, like id's, soundobjects etc
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "SND_IdObject.h"
SND_IdObject::SND_IdObject()
{
}
SND_IdObject::~SND_IdObject()
{
}
SND_SoundObject* SND_IdObject::GetSoundObject()
{
return m_soundObject;
}
void SND_IdObject::SetSoundObject(SND_SoundObject* pObject)
{
m_soundObject = pObject;
}
int SND_IdObject::GetId()
{
return m_id;
}
void SND_IdObject::SetId(int id)
{
m_id = id;
}

@ -0,0 +1,59 @@
/*
* SND_IdObject.h
*
* Object for storing runtime data, like id's, soundobjects etc
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef __SND_IDOBJECT_H
#define __SND_IDOBJECT_H
#include "SND_SoundObject.h"
#include "GEN_List.h"
#include "SoundDefines.h"
class SND_IdObject : public GEN_Link
{
SND_SoundObject* m_soundObject;
int m_id;
public:
SND_IdObject();
virtual ~SND_IdObject();
SND_SoundObject* GetSoundObject();
void SetSoundObject(SND_SoundObject* pObject);
int GetId();
void SetId(int id);
};
#endif //__SND_OBJECT_H

@ -0,0 +1,569 @@
/*
* SND_Scene.cpp
*
* The scene for sounds.
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifdef WIN32
#pragma warning (disable:4786) // Get rid of stupid stl-visual compiler debug warning
#endif //WIN32
#include "SND_Scene.h"
#include "SND_DependKludge.h"
#include "SYS_System.h"
#include "SND_IAudioDevice.h"
#include <stdlib.h>
#include <iostream>
//static unsigned int tijd = 0;
SND_Scene::SND_Scene(SND_IAudioDevice* audiodevice)
: m_audiodevice(audiodevice)
{
if (m_audiodevice)
m_wavecache = m_audiodevice->GetWaveCache();
if (!m_wavecache || !audiodevice)
{
m_audio = false;
}
else
{
//if so, go ahead!
m_audio = true;
#ifdef ONTKEVER
printf("SND_Scene::SND_Scene() m_audio == true\n");
#endif
m_audiodevice->InitListener();
}
IsPlaybackWanted();
}
SND_Scene::~SND_Scene()
{
StopAllObjects();
}
// check if audioplayback is wanted
bool SND_Scene::IsPlaybackWanted()
{
SYS_SystemHandle syshandle = SYS_GetSystem();
int audio = SYS_GetCommandLineInt(syshandle,"noaudio",0);
if ((audio == 0) && m_audiodevice && m_wavecache)
{
m_audioplayback = true;
}
else
{
StopAllObjects();
m_audioplayback = false;
}
return m_audioplayback;
}
int SND_Scene::LoadSample(const STR_String& samplename,
void* memlocation,
int size)
{
int result = -1;
if (m_audiodevice)
{
SND_WaveSlot* waveslot = m_audiodevice->LoadSample(samplename, memlocation, size);
if (waveslot)
result = waveslot->GetBuffer();
}
return result;
}
void SND_Scene::RemoveAllSamples()
{
if (m_audio && m_audiodevice)
m_audiodevice->RemoveAllSamples();
}
bool SND_Scene::CheckBuffer(SND_SoundObject* pObject)
{
bool result = false;
if (pObject && m_wavecache)
{
SND_WaveSlot* waveslot = m_wavecache->GetWaveSlot(pObject->GetSampleName());
if (waveslot)
{
pObject->SetBuffer(waveslot->GetBuffer());
result = true;
}
}
return result;
}
bool SND_Scene::IsSampleLoaded(STR_String& samplename)
{
bool result = false;
if (samplename && m_wavecache)
{
SND_WaveSlot* waveslot = m_wavecache->GetWaveSlot(samplename);
if (waveslot && waveslot->IsLoaded())
result = true;
}
return result;
}
void SND_Scene::AddObject(SND_SoundObject* pObject)
{
if (m_audio)
{
STR_String samplename = pObject->GetSampleName();
SND_WaveSlot* slot = NULL;
// don't add the object if no valid sample is referenced
if (samplename != "")
{
// check if the sample is already loaded
slot = m_wavecache->GetWaveSlot(samplename);
}
if (slot)
{
pObject->SetBuffer(slot->GetBuffer());
// needed for expected lifespan of the sample, but ain't necesary anymore i think
MT_Scalar samplelength = slot->GetNumberOfSamples();
MT_Scalar samplerate = slot->GetSampleRate();
MT_Scalar soundlength = samplelength/samplerate;
pObject->SetLength(soundlength);
// add the object to the list
m_soundobjects.insert((SND_SoundObject*)pObject);
}
}
}
void SND_Scene::SetListenerTransform(const MT_Vector3& pos,
const MT_Vector3& vel,
const MT_Matrix3x3& ori)
{
if (m_audio)
{
GetListener()->SetPosition(pos);
GetListener()->SetVelocity(vel);
GetListener()->SetOrientation(ori);
}
}
void SND_Scene::UpdateListener()
{
// process the listener if modified
if (m_listener.IsModified())
{
m_audiodevice->SetListenerGain(m_listener.GetGain());
// fmod doesn't support dopplervelocity, so just use the dopplerfactor instead
#ifdef USE_FMOD
m_audiodevice->SetDopplerFactor(m_listener.GetDopplerVelocity());
#else
m_audiodevice->SetDopplerVelocity(m_listener.GetDopplerVelocity());
m_audiodevice->SetDopplerFactor(m_listener.GetDopplerFactor());
#endif
m_listener.SetModified(false);
}
}
void SND_Scene::AddActiveObject(SND_SoundObject* pObject, MT_Scalar curtime)
{
if (m_audio)
{
if (pObject)
{
#ifdef ONTKEVER
printf("SND_Scene::AddActiveObject\n");
#endif
// first check if the object is already on the list
if (pObject->IsActive())
{
pObject->SetTimeStamp(curtime);
pObject->StartSound();
}
else
{
pObject->SetTimeStamp(curtime);
// compute the expected lifespan
pObject->SetLifeSpan();
// lets give the new active-to-be object an id
if (m_audiodevice->GetNewId(pObject))
{
// and add the object
m_activeobjects.addTail(pObject);
pObject->StartSound();
pObject->SetActive(true);
}
}
}
}
}
void SND_Scene::RemoveActiveObject(SND_SoundObject* pObject)
{
if (m_audio)
{
if (pObject)
{
#ifdef ONTKEVER
printf("SND_Scene::RemoveActiveObject\n");
#endif
// if inactive, remove it from the list
if (pObject->IsActive())
{
// first make sure it is stopped
m_audiodevice->ClearId(pObject);
}
}
}
}
void SND_Scene::UpdateActiveObects()
{
// ++tijd;
SND_SoundObject* pObject;
// update only the objects that need to be updated
for (pObject = (SND_SoundObject*)m_activeobjects.getHead();
!pObject->isTail();
pObject = (SND_SoundObject*)pObject->getNext())
{
int id = pObject->GetId();
if (id >= 0)
{
bool juststartedplaying = false;
#ifdef USE_FMOD
// fmod wants these set before playing the sample
if (pObject->IsModified())
{
m_audiodevice->SetObjectLoop(id, pObject->GetLoopMode());
m_audiodevice->SetObjectLoopPoints(id, pObject->GetLoopStart(), pObject->GetLoopEnd());
}
// ok, properties Set. now see if it must play
if (pObject->GetPlaystate() == SND_MUST_PLAY)
{
m_audiodevice->PlayObject(id);
pObject->SetPlaystate(SND_PLAYING);
pObject->InitRunning();
// printf("start play: %d\n", tijd);
juststartedplaying = true;
}
#endif
if (pObject->Is3D())
{
// Get the global positions and velocity vectors
// of the listener and soundobject
MT_Vector3 op = pObject->GetPosition();
MT_Vector3 lp = m_listener.GetPosition();
MT_Vector3 position = op - lp;
// Calculate relative velocity in global coordinates
// of the sound with respect to the listener.
MT_Vector3 ov = pObject->GetVelocity();
MT_Vector3 lv = m_listener.GetVelocity();
MT_Vector3 velocity = ov - lv;
// Now map the object position and velocity into
// the local coordinates of the listener.
MT_Matrix3x3 lo = m_listener.GetOrientation();
MT_Vector3 local_sound_pos = position * lo;
MT_Vector3 local_sound_vel = velocity * lo;
m_audiodevice->SetObjectTransform(
id,
local_sound_pos,
local_sound_vel,
pObject->GetOrientation(), // make relative to listener!
lp,
pObject->GetRollOffFactor());
}
else
{
m_audiodevice->ObjectIs2D(id);
}
// update the situation
if (pObject->IsModified())
{
m_audiodevice->SetObjectPitch(id, pObject->GetPitch());
m_audiodevice->SetObjectGain(id, pObject->GetGain());
m_audiodevice->SetObjectMinGain(id, pObject->GetMinGain());
m_audiodevice->SetObjectMaxGain(id, pObject->GetMaxGain());
m_audiodevice->SetObjectReferenceDistance(id, pObject->GetReferenceDistance());
m_audiodevice->SetObjectRollOffFactor(id, pObject->GetRollOffFactor());
m_audiodevice->SetObjectLoop(id, pObject->GetLoopMode());
m_audiodevice->SetObjectLoopPoints(id, pObject->GetLoopStart(), pObject->GetLoopEnd());
pObject->SetModified(false);
}
pObject->AddRunning();
#ifdef ONTKEVER
STR_String naam = pObject->GetObjectName();
STR_String sample = pObject->GetSampleName();
int id = pObject->GetId();
int buffer = pObject->GetBuffer();
float gain = pObject->GetGain();
float pitch = pObject->GetPitch();
float timestamp = pObject->GetTimestamp();
printf("naam: %s, sample: %s \n", naam.Ptr(), sample.Ptr());
printf("id: %d, buffer: %d \n", id, buffer);
printf("gain: %f, pitch: %f, ts: %f \n\n", gain, pitch, timestamp);
#endif
#ifdef USE_OPENAL
// ok, properties Set. now see if it must play
if (pObject->GetPlaystate() == SND_MUST_PLAY)
{
m_audiodevice->PlayObject(id);
pObject->SetPlaystate(SND_PLAYING);
//break;
}
#endif
// check to see if the sound is still playing
// if not: release its id
int playstate = m_audiodevice->GetPlayState(id);
#ifdef ONTKEVER
if (playstate != 2)
printf("%d - ",playstate);
#endif
// if ((playstate == SND_STOPPED && (!juststartedplaying) && !pObject->GetLoopMode() && pObject->IsRunning())
#ifdef WIN32
if ((playstate == SND_STOPPED) && !pObject->GetLoopMode())
#else
if (!pObject->GetLoopMode())
#endif
{
// printf("remove: %d\n", tijd);
RemoveActiveObject(pObject);
}
}
}
}
void SND_Scene::UpdateCD()
{
if (m_audiodevice)
{
SND_CDObject* pCD = SND_CDObject::Instance();
if (pCD)
{
int playstate = pCD->GetPlaystate();
switch (playstate)
{
case SND_MUST_PLAY:
{
// initialize the cd only when you need it
m_audiodevice->SetCDGain(pCD->GetGain());
m_audiodevice->SetCDPlaymode(pCD->GetPlaymode());
m_audiodevice->PlayCD(pCD->GetTrack());
pCD->SetPlaystate(SND_PLAYING);
pCD->SetUsed();
break;
}
case SND_MUST_PAUSE:
{
m_audiodevice->PauseCD(true);
pCD->SetPlaystate(SND_PAUSED);
break;
}
case SND_MUST_RESUME:
{
m_audiodevice->PauseCD(false);
pCD->SetPlaystate(SND_PLAYING);
break;
}
case SND_MUST_STOP:
{
m_audiodevice->StopCD();
pCD->SetPlaystate(SND_STOPPED);
break;
}
default:
{
}
}
// this one is only for realtime modifying settings
if (pCD->IsModified())
{
m_audiodevice->SetCDGain(pCD->GetGain());
pCD->SetModified(false);
}
}
}
}
void SND_Scene::Proceed()
{
if (m_audio && m_audioplayback)
{
m_audiodevice->MakeCurrent();
UpdateListener();
UpdateActiveObects();
UpdateCD();
// m_audiodevice->UpdateDevice();
}
}
void SND_Scene::DeleteObject(SND_SoundObject* pObject)
{
#ifdef ONTKEVER
printf("SND_Scene::DeleteObject\n");
#endif
if (pObject)
{
if (m_audiodevice)
m_audiodevice->ClearId(pObject);
// must remove object from m_activeList
std::set<SND_SoundObject*>::iterator set_it;
set_it = m_soundobjects.find(pObject);
if (set_it != m_soundobjects.end())
m_soundobjects.erase(set_it);
// release the memory
delete pObject;
pObject = NULL;
}
}
void SND_Scene::RemoveAllObjects()
{
#ifdef ONTKEVER
printf("SND_Scene::RemoveAllObjects\n");
#endif
StopAllObjects();
std::set<SND_SoundObject*>::iterator it = m_soundobjects.begin();
while (it != m_soundobjects.end())
{
delete (*it);
it++;
}
m_soundobjects.clear();
}
void SND_Scene::StopAllObjects()
{
if (m_audio)
{
#ifdef ONTKEVER
printf("SND_Scene::StopAllObjects\n");
#endif
SND_SoundObject* pObject;
for (pObject = (SND_SoundObject*)m_activeobjects.getHead();
!pObject->isTail();
pObject = (SND_SoundObject*)pObject->getNext())
{
m_audiodevice->ClearId(pObject);
}
}
}
SND_SoundListener* SND_Scene::GetListener()
{
return &m_listener;
}

@ -0,0 +1,184 @@
/*
* SND_SoundListener.cpp
*
* A SoundListener is for sound what a camera is for vision.
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "SND_SoundListener.h"
SND_SoundListener::SND_SoundListener()
{
m_modified = true;
m_gain = 1.0;
m_dopplerfactor = 1.0;
m_dopplervelocity = 1.0;
m_scale = 1.0;
m_position[0] = 0.0;
m_position[1] = 0.0;
m_position[2] = 0.0;
m_velocity[0] = 0.0;
m_velocity[1] = 0.0;
m_velocity[2] = 0.0;
m_orientation[0][0] = 1.0;
m_orientation[0][1] = 0.0;
m_orientation[0][2] = 0.0;
m_orientation[1][0] = 0.0;
m_orientation[1][1] = 1.0;
m_orientation[1][2] = 0.0;
m_orientation[2][0] = 0.0;
m_orientation[2][1] = 0.0;
m_orientation[2][2] = 1.0;
}
SND_SoundListener::~SND_SoundListener()
{
; /* intentionally empty */
}
void SND_SoundListener::SetGain(MT_Scalar gain)
{
m_gain = gain;
m_modified = true;
}
void SND_SoundListener::SetPosition (const MT_Vector3& pos)
{
m_position = pos;
}
void SND_SoundListener::SetVelocity(const MT_Vector3& vel)
{
m_velocity = vel;
}
void SND_SoundListener::SetOrientation(const MT_Matrix3x3& ori)
{
m_orientation = ori;
}
void SND_SoundListener::SetDopplerFactor(MT_Scalar dopplerfactor)
{
m_dopplerfactor = dopplerfactor;
m_modified = true;
}
void SND_SoundListener::SetDopplerVelocity(MT_Scalar dopplervelocity)
{
m_dopplervelocity = dopplervelocity;
m_modified = true;
}
void SND_SoundListener::SetScale(MT_Scalar scale)
{
m_scale = scale;
m_modified = true;
}
MT_Scalar SND_SoundListener::GetGain() const
{
return m_gain;
}
MT_Vector3 SND_SoundListener::GetPosition() const
{
return m_position;
}
MT_Vector3 SND_SoundListener::GetVelocity() const
{
return m_velocity;
}
MT_Matrix3x3 SND_SoundListener::GetOrientation()
{
return m_orientation;
}
MT_Scalar SND_SoundListener::GetDopplerFactor() const
{
return m_dopplerfactor;
}
MT_Scalar SND_SoundListener::GetDopplerVelocity() const
{
return m_dopplervelocity;
}
MT_Scalar SND_SoundListener::GetScale() const
{
return m_scale;
}
bool SND_SoundListener::IsModified() const
{
return m_modified;
}
void SND_SoundListener::SetModified(bool modified)
{
m_modified = modified;
}

@ -0,0 +1,506 @@
/*
* SND_SoundObject.cpp
*
* Implementation of the abstract sound object
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "SND_SoundObject.h"
SND_SoundObject::SND_SoundObject()// : m_modified(true)
{
m_samplename = "";
m_length = 0;
m_buffer = 0;
m_gain = 0.0;
m_pitch = 1.0;
m_mingain = 0.0;
m_maxgain = 1.0;
m_rollofffactor = 1.0;
m_referencedistance = 1.0;
m_position[0] = 0.0;
m_position[1] = 0.0;
m_position[2] = 0.0;
m_velocity[0] = 0.0;
m_velocity[1] = 0.0;
m_velocity[2] = 0.0;
m_orientation[0][0] = 1.0;
m_orientation[0][1] = 0.0;
m_orientation[0][2] = 0.0;
m_orientation[1][0] = 0.0;
m_orientation[1][1] = 1.0;
m_orientation[1][2] = 0.0;
m_orientation[2][0] = 0.0;
m_orientation[2][1] = 0.0;
m_orientation[2][2] = 1.0;
m_loopstart = 0;
m_loopend = 0;
m_loopmode = SND_LOOP_NORMAL;
m_is3d = true;
m_playstate = SND_INITIAL;
m_active = false;
m_id = -1;
m_lifespan = 0;
m_timestamp = 0;
m_modified = true;
m_running = 0;
m_highpriority = false;
}
SND_SoundObject::~SND_SoundObject()
{
}
void SND_SoundObject::StartSound()
{
m_playstate = SND_MUST_PLAY;
}
void SND_SoundObject::StopSound()
{
m_playstate = SND_MUST_STOP;
}
void SND_SoundObject::PauseSound()
{
m_playstate = SND_MUST_PAUSE;
}
void SND_SoundObject::DeleteWhenFinished()
{
m_playstate = SND_MUST_BE_DELETED;
}
void SND_SoundObject::SetGain(MT_Scalar gain)
{
m_gain = gain;
m_modified = true;
}
void SND_SoundObject::SetMinGain(MT_Scalar mingain)
{
m_mingain = mingain;
m_modified = true;
}
void SND_SoundObject::SetMaxGain(MT_Scalar maxgain)
{
m_maxgain = maxgain;
m_modified = true;
}
void SND_SoundObject::SetRollOffFactor(MT_Scalar rollofffactor)
{
m_rollofffactor = rollofffactor;
m_modified = true;
}
void SND_SoundObject::SetReferenceDistance(MT_Scalar referencedistance)
{
m_referencedistance = referencedistance;
m_modified = true;
}
void SND_SoundObject::SetPitch(MT_Scalar pitch)
{
m_pitch = pitch;
m_modified = true;
}
void SND_SoundObject::SetLoopMode(unsigned int loopmode)
{
m_loopmode = loopmode;
m_modified = true;
}
void SND_SoundObject::SetLoopStart(unsigned int loopstart)
{
m_loopstart = loopstart;
m_modified = true;
}
void SND_SoundObject::SetLoopEnd(unsigned int loopend)
{
m_loopend = loopend;
m_modified = true;
}
void SND_SoundObject::Set3D(bool threedee)
{
m_is3d = threedee;
}
void SND_SoundObject::SetLifeSpan()
{
m_lifespan = m_length / m_pitch;
}
bool SND_SoundObject::IsLifeSpanOver(MT_Scalar curtime) const
{
bool result = false;
if ((curtime - m_timestamp) > m_lifespan)
result = true;
return result;
}
void SND_SoundObject::SetActive(bool active)
{
m_active = active;
if (!active)
{
m_playstate = SND_STOPPED;
(this)->remove();
}
}
void SND_SoundObject::SetBuffer(unsigned int buffer)
{
m_buffer = buffer;
}
void SND_SoundObject::SetObjectName(STR_String objectname)
{
m_objectname = objectname;
}
void SND_SoundObject::SetSampleName(STR_String samplename)
{
m_samplename = samplename;
}
void SND_SoundObject::SetLength(MT_Scalar length)
{
m_length = length;
}
void SND_SoundObject::SetPosition(const MT_Vector3& pos)
{
m_position = pos;
}
void SND_SoundObject::SetVelocity(const MT_Vector3& vel)
{
m_velocity = vel;
}
void SND_SoundObject::SetOrientation(const MT_Matrix3x3& orient)
{
m_orientation = orient;
}
void SND_SoundObject::SetPlaystate(int playstate)
{
m_playstate = playstate;
}
void SND_SoundObject::SetId(int id)
{
m_id = id;
}
void SND_SoundObject::SetTimeStamp(MT_Scalar timestamp)
{
m_timestamp = timestamp;
}
void SND_SoundObject::SetHighPriority(bool priority)
{
m_highpriority = priority;
}
bool SND_SoundObject::IsHighPriority() const
{
return m_highpriority;
}
bool SND_SoundObject::IsActive()const
{
return m_active;
}
int SND_SoundObject::GetId()const
{
return m_id;
}
MT_Scalar SND_SoundObject::GetLifeSpan()const
{
return m_lifespan;
}
MT_Scalar SND_SoundObject::GetTimestamp()const
{
return m_timestamp;
}
unsigned int SND_SoundObject::GetBuffer()
{
return m_buffer;
}
const STR_String& SND_SoundObject::GetSampleName()
{
return m_samplename;
}
const STR_String& SND_SoundObject::GetObjectName()
{
return m_objectname;
}
MT_Scalar SND_SoundObject::GetLength() const
{
return m_length;
}
MT_Scalar SND_SoundObject::GetGain() const
{
return m_gain;
}
MT_Scalar SND_SoundObject::GetPitch() const
{
return m_pitch;
}
MT_Scalar SND_SoundObject::GetMinGain() const
{
return m_mingain;
}
MT_Scalar SND_SoundObject::GetMaxGain() const
{
return m_maxgain;
}
MT_Scalar SND_SoundObject::GetRollOffFactor() const
{
return m_rollofffactor;
}
MT_Scalar SND_SoundObject::GetReferenceDistance() const
{
return m_referencedistance;
}
MT_Vector3 SND_SoundObject::GetPosition() const
{
return m_position;
}
MT_Vector3 SND_SoundObject::GetVelocity() const
{
return m_velocity;
}
MT_Matrix3x3 SND_SoundObject::GetOrientation() const
{
return m_orientation;
}
unsigned int SND_SoundObject::GetLoopMode() const
{
return m_loopmode;
}
unsigned int SND_SoundObject::GetLoopStart() const
{
return m_loopstart;
}
unsigned int SND_SoundObject::GetLoopEnd() const
{
return m_loopend;
}
bool SND_SoundObject::Is3D() const
{
return m_is3d;
}
int SND_SoundObject::GetPlaystate() const
{
return m_playstate;
}
bool SND_SoundObject::IsModified() const
{
return m_modified;
}
void SND_SoundObject::SetModified(bool modified)
{
m_modified = modified;
}
void SND_SoundObject::InitRunning()
{
m_running = 0;
}
bool SND_SoundObject::IsRunning() const
{
bool result = false;
if (m_running > 100)
result = true;
return result;
}
void SND_SoundObject::AddRunning()
{
++m_running;
}

@ -0,0 +1,395 @@
/*
* SND_Utils.cpp
*
* Util functions for soundthingies
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "SND_Utils.h"
#include "SoundDefines.h"
#include "SND_DependKludge.h"
/*
extern "C" {
#include "license_key.h"
}
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <math.h>
#include <string.h>
#if defined(WIN32)
#include <io.h>
#else
#include <unistd.h>
#endif
//extern int LICENSE_KEY_VALID;
#define LICENSE_KEY_VALID true
#define BUFFERSIZE 32
/* loads a file */
void* SND_LoadSample(char *filename)
{
int file, filelen, buffersize = BUFFERSIZE;
void* data = NULL;
#if defined(WIN32)
file = open(filename, O_BINARY|O_RDONLY);
#else
file = open(filename, 0|O_RDONLY);
#endif
if (file == -1)
{
//printf("can't open file.\n");
//printf("press q for quit.\n");
}
else
{
filelen = lseek(file, 0, SEEK_END);
lseek(file, 0, SEEK_SET);
if (filelen != 0)
{
data = malloc(buffersize);
if (read(file, data, buffersize) != buffersize)
{
free(data);
data = NULL;
}
}
close(file);
}
return (data);
}
bool SND_IsSampleValid(const STR_String& name, void* memlocation)
{
bool result = false;
bool loadedsample = false;
char buffer[BUFFERSIZE];
if (!memlocation)
{
STR_String samplename = name;
memlocation = SND_LoadSample(samplename.Ptr());
if (memlocation)
loadedsample = true;
}
if (memlocation)
{
memcpy(&buffer, memlocation, BUFFERSIZE);
if(!(memcmp(buffer, "RIFF", 4) && memcmp(&(buffer[8]), "WAVEfmt ", 8)))
{
int shortbuf = * ((short *) &buffer[20]);
if (shortbuf == SND_WAVE_FORMAT_PCM)
result = true;
/* only fmod supports compressed wav */
#ifdef USE_FMOD
/* and only valid publishers may use compressed wav */
if (LICENSE_KEY_VALID)
{
switch (shortbuf)
{
case SND_WAVE_FORMAT_ADPCM:
case SND_WAVE_FORMAT_ALAW:
case SND_WAVE_FORMAT_MULAW:
case SND_WAVE_FORMAT_DIALOGIC_OKI_ADPCM:
case SND_WAVE_FORMAT_CONTROL_RES_VQLPC:
case SND_WAVE_FORMAT_GSM_610:
case SND_WAVE_FORMAT_MPEG3:
result = true;
break;
default:
{
break;
}
}
}
#endif
}
#ifdef USE_FMOD
/* only valid publishers may use ogg vorbis */
else if (!memcmp(buffer, "OggS", 4) && LICENSE_KEY_VALID)
{
result = true;
}
/* only valid publishers may use mp3 */
else if (((!memcmp(buffer, "ID3", 3)) || (!memcmp(buffer, "ÿû", 2))) && LICENSE_KEY_VALID)
{
result = true;
}
#endif
}
if (loadedsample)
{
free(memlocation);
memlocation = NULL;
}
return result;
}
/* checks if the passed pointer is a valid sample */
bool CheckSample(void* sample)
{
bool valid = false;
char buffer[32];
memcpy(buffer, sample, 16);
if(!(memcmp(buffer, "RIFF", 4) && memcmp(&(buffer[8]), "WAVEfmt ", 8)))
{
valid = true;
}
return valid;
}
/* gets the type of the sample (0 == unknown, 1 == PCM etc */
unsigned int SND_GetSampleFormat(void* sample)
{
short sampletype = 0;
if (CheckSample(sample))
{
memcpy(&sampletype, ((char*)sample) + 20, 2);
}
return (unsigned int)sampletype;
}
/* gets the number of channels in a sample */
unsigned int SND_GetNumberOfChannels(void* sample)
{
short numberofchannels = 0;
if (CheckSample(sample))
{
memcpy(&numberofchannels, ((char*)sample) + 22, 2);
}
return (unsigned int)numberofchannels;
}
/* gets the samplerate of a sample */
unsigned int SND_GetSampleRate(void* sample)
{
unsigned int samplerate = 0;
if (CheckSample(sample))
{
memcpy(&samplerate, ((char*)sample) + 24, 4);
}
return samplerate;
}
/* gets the bitrate of a sample */
unsigned int SND_GetBitRate(void* sample)
{
short bitrate = 0;
if (CheckSample(sample))
{
memcpy(&bitrate, ((char*)sample) + 34, 2);
}
return (unsigned int)bitrate;
}
/* gets the length of the actual sample data (without the header) */
unsigned int SND_GetNumberOfSamples(void* sample)
{
unsigned int chunklength, length = 0, offset = 16;
char data[4];
if (CheckSample(sample))
{
memcpy(&chunklength, ((char*)sample) + offset, 4);
offset = offset + chunklength + 4;
memcpy(data, ((char*)sample) + offset, 4);
// lets find "data"
while (memcmp(data, "data", 4))
{
offset += 4;
memcpy(data, ((char*)sample) + offset, 4);
}
offset += 4;
memcpy(&length, ((char*)sample) + offset, 4);
}
return length;
}
/* gets the size of the entire header (file - sampledata) */
unsigned int SND_GetHeaderSize(void* sample)
{
unsigned int chunklength, headersize = 0, offset = 16;
char data[4];
if (CheckSample(sample))
{
memcpy(&chunklength, ((char*)sample) + offset, 4);
offset = offset + chunklength + 4;
memcpy(data, ((char*)sample) + offset, 4);
// lets find "data"
while (memcmp(data, "data", 4))
{
offset += 4;
memcpy(data, ((char*)sample) + offset, 4);
}
headersize = offset + 8;
}
return headersize;
}
unsigned int SND_GetExtraChunk(void* sample)
{
unsigned int extrachunk = 0, chunklength, offset = 16;
char data[4];
if (CheckSample(sample))
{
memcpy(&chunklength, ((char*)sample) + offset, 4);
offset = offset + chunklength + 4;
memcpy(data, ((char*)sample) + offset, 4);
// lets find "cue"
while (memcmp(data, "cue", 3))
{
offset += 4;
memcpy(data, ((char*)sample) + offset, 4);
}
}
return extrachunk;
}
void SND_GetSampleInfo(signed char* sample, SND_WaveSlot* waveslot)
{
WavFileHeader fileheader;
WavFmtHeader fmtheader;
WavFmtExHeader fmtexheader;
WavSampleHeader sampleheader;
WavChunkHeader chunkheader;
if (CheckSample(sample))
{
memcpy(&fileheader, sample, sizeof(WavFileHeader));
sample += sizeof(WavFileHeader);
fileheader.size = ((fileheader.size+1) & ~1) - 4;
while ((fileheader.size != 0) && (memcpy(&chunkheader, sample, sizeof(WavChunkHeader))))
{
sample += sizeof(WavChunkHeader);
if (!memcmp(chunkheader.id, "fmt ", 4))
{
memcpy(&fmtheader, sample, sizeof(WavFmtHeader));
waveslot->SetSampleFormat(fmtheader.format);
if (fmtheader.format == 0x0001)
{
waveslot->SetNumberOfChannels(fmtheader.numberofchannels);
waveslot->SetBitRate(fmtheader.bitrate);
waveslot->SetSampleRate(fmtheader.samplerate);
sample += chunkheader.size;
}
else
{
memcpy(&fmtexheader, sample, sizeof(WavFmtExHeader));
sample += chunkheader.size;
}
}
else if (!memcmp(chunkheader.id, "data", 4))
{
if (fmtheader.format == 0x0001)
{
waveslot->SetNumberOfSamples(chunkheader.size);
sample += chunkheader.size;
}
else if (fmtheader.format == 0x0011)
{
//IMA ADPCM
}
else if (fmtheader.format == 0x0055)
{
//MP3 WAVE
}
}
else if (!memcmp(chunkheader.id, "smpl", 4))
{
memcpy(&sampleheader, sample, sizeof(WavSampleHeader));
//loop = sampleheader.loops;
sample += chunkheader.size;
}
else
sample += chunkheader.size;
sample += chunkheader.size & 1;
fileheader.size -= (((chunkheader.size + 1) & ~1) + 8);
}
}
}

@ -0,0 +1,134 @@
/*
* SND_WaveCache.cpp
*
* abstract wavecache, a way to organize samples
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifdef WIN32
#pragma warning (disable:4786) // Get rid of stupid stl-visual compiler debug warning
#endif //WIN32
#include "SND_WaveCache.h"
#include <stdio.h>
#ifndef __APPLE__
#include <malloc.h>
#else // __APPLE__
#include <sys/malloc.h>
#endif // __APPLE__
SND_WaveCache::SND_WaveCache()
{
// do the buffer administration
for (int i = 0; i < NUM_BUFFERS; i++)
m_bufferList[i] = NULL;
}
SND_WaveCache::~SND_WaveCache()
{
// clean up the mess
FreeSamples();
RemoveAllSamples();
}
SND_WaveSlot* SND_WaveCache::GetWaveSlot(const STR_String& samplename)
{
SND_WaveSlot* waveslot = NULL;
std::map<STR_String, SND_WaveSlot*>::iterator find_result = m_samplecache.find(samplename);
// let's see if we have already loaded this sample
if (find_result != m_samplecache.end())
{
waveslot = (*find_result).second;
}
else
{
// so the sample wasn't loaded, so do it here
for (int bufnum = 0; bufnum < NUM_BUFFERS; bufnum++)
{
// find an empty buffer
if (m_bufferList[bufnum] == NULL)
{
waveslot = new SND_WaveSlot();
waveslot->SetSampleName(samplename);
waveslot->SetBuffer(bufnum);
m_bufferList[bufnum] = waveslot;
break;
}
}
m_samplecache.insert(std::pair<STR_String, SND_WaveSlot*>(samplename, waveslot));
}
return waveslot;
}
void SND_WaveCache::RemoveAllSamples()
{
// remove all samples
m_samplecache.clear();
// reset the list of buffers
for (int i = 0; i < NUM_BUFFERS; i++)
m_bufferList[i] = NULL;
}
void SND_WaveCache::RemoveSample(const STR_String& samplename, int buffer)
{
m_samplecache.erase(samplename);
m_bufferList[buffer] = NULL;
}
void SND_WaveCache::FreeSamples()
{
// iterate through the bufferlist and delete the waveslot if present
for (int i = 0; i < NUM_BUFFERS; i++)
{
if (m_bufferList[i])
{
delete m_bufferList[i];
m_bufferList[i] = NULL;
}
}
}

@ -0,0 +1,182 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "SND_WaveSlot.h"
SND_WaveSlot::~SND_WaveSlot()
{
#ifdef ONTKEVER
printf("neeeeeee...\n");
#endif
}
void SND_WaveSlot::SetSampleName(STR_String samplename)
{
m_samplename = samplename;
}
void SND_WaveSlot::SetLoaded(bool loaded)
{
m_loaded = loaded;
}
void SND_WaveSlot::SetData(void* data)
{
m_data = data;
}
void SND_WaveSlot::SetBuffer(unsigned int buffer)
{
m_buffer = buffer;
}
void SND_WaveSlot::SetSampleFormat(unsigned int sampleformat)
{
m_sampleformat = sampleformat;
}
void SND_WaveSlot::SetNumberOfChannels(unsigned int numberofchannels)
{
m_numberofchannels = numberofchannels;
}
void SND_WaveSlot::SetSampleRate(unsigned int samplerate)
{
m_samplerate = samplerate;
}
void SND_WaveSlot::SetBitRate(unsigned int bitrate)
{
m_bitrate = bitrate;
}
void SND_WaveSlot::SetNumberOfSamples(unsigned int numberofsamples)
{
m_numberofsamples = numberofsamples;
}
void SND_WaveSlot::SetFileSize(unsigned int filesize)
{
m_filesize = filesize;
}
const STR_String& SND_WaveSlot::GetSampleName()
{
return m_samplename;
}
bool SND_WaveSlot::IsLoaded() const
{
return m_loaded;
}
void* SND_WaveSlot::GetData()
{
return m_data;
}
unsigned int SND_WaveSlot::GetBuffer() const
{
return m_buffer;
}
unsigned int SND_WaveSlot::GetSampleFormat() const
{
return m_sampleformat;
}
unsigned int SND_WaveSlot::GetNumberOfChannels() const
{
return m_numberofchannels;
}
unsigned int SND_WaveSlot::GetSampleRate() const
{
return m_samplerate;
}
unsigned int SND_WaveSlot::GetBitRate() const
{
return m_bitrate;
}
unsigned int SND_WaveSlot::GetNumberOfSamples() const
{
return m_numberofsamples;
}
unsigned int SND_WaveSlot::GetFileSize() const
{
return m_filesize;
}

@ -0,0 +1,47 @@
#
# $Id$
#
# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. The Blender
# Foundation also sells licenses for use in proprietary software under
# the Blender License. See http://www.blender.org/BL/ for information
# about this.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): none yet.
#
# ***** END GPL/BL DUAL LICENSE BLOCK *****
#
#
LIBNAME = OpenALSoundSystem
DIR = $(OCGDIR)/gameengine/$(LIBNAME)
include nan_compile.mk
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
CPPFLAGS += -I$(NAN_OPENAL)/include
CPPFLAGS += -I$(NAN_STRING)/include
CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I../../../kernel/gen_system
CPPFLAGS += -I../intern
CPPFLAGS += -I..
CPPFLAGS += -I.

@ -0,0 +1,661 @@
/*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
* SND_OpenALDevice derived from SND_IAudioDevice
*/
#ifdef WIN32
#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
#endif //WIN32
#include "SND_OpenALDevice.h"
#include "SoundDefines.h"
#include "SYS_System.h"
#include "SND_Utils.h"
#include <AL/al.h>
#include <AL/alc.h>
#include <AL/alut.h>
#include <stdio.h>
#include <stdlib.h>
#if defined(WIN32)
#include <io.h>
#else
#include <unistd.h>
#endif
#include <fcntl.h>
/* untill openal gets unified we need this hack for non-windows systems */
#ifndef WIN32
#include <malloc.h>
ALvoid alutLoadWAVMemory(ALbyte *memory,ALenum *format,ALvoid **data,ALsizei *size,ALsizei *freq,ALboolean *loop);
ALvoid alutUnloadWAV(ALenum format,ALvoid *data,ALsizei size,ALsizei freq);
typedef struct /* WAV File-header */
{
ALubyte Id[4];
ALsizei Size;
ALubyte Type[4];
} WAVFileHdr_Struct;
typedef struct /* WAV Fmt-header */
{
ALushort Format;
ALushort Channels;
ALuint SamplesPerSec;
ALuint BytesPerSec;
ALushort BlockAlign;
ALushort BitsPerSample;
} WAVFmtHdr_Struct;
typedef struct /* WAV FmtEx-header */
{
ALushort Size;
ALushort SamplesPerBlock;
} WAVFmtExHdr_Struct;
typedef struct /* WAV Smpl-header */
{
ALuint Manufacturer;
ALuint Product;
ALuint SamplePeriod;
ALuint Note;
ALuint FineTune;
ALuint SMPTEFormat;
ALuint SMPTEOffest;
ALuint Loops;
ALuint SamplerData;
struct
{
ALuint Identifier;
ALuint Type;
ALuint Start;
ALuint End;
ALuint Fraction;
ALuint Count;
} Loop[1];
} WAVSmplHdr_Struct;
typedef struct /* WAV Chunk-header */
{
ALubyte Id[4];
ALuint Size;
} WAVChunkHdr_Struct;
ALvoid alutLoadWAVMemory(ALbyte *memory,ALenum *format,ALvoid **data,ALsizei *size,ALsizei *freq,ALboolean *loop)
{
WAVChunkHdr_Struct ChunkHdr;
WAVFmtExHdr_Struct FmtExHdr;
WAVFileHdr_Struct FileHdr;
WAVSmplHdr_Struct SmplHdr;
WAVFmtHdr_Struct FmtHdr;
ALbyte *Stream;
*format=AL_FORMAT_MONO16;
*data=NULL;
*size=0;
*freq=22050;
*loop=AL_FALSE;
if (memory)
{
Stream=memory;
if (Stream)
{
memcpy(&FileHdr,Stream,sizeof(WAVFileHdr_Struct));
Stream+=sizeof(WAVFileHdr_Struct);
FileHdr.Size=((FileHdr.Size+1)&~1)-4;
while ((FileHdr.Size!=0)&&(memcpy(&ChunkHdr,Stream,sizeof(WAVChunkHdr_Struct))))
{
Stream+=sizeof(WAVChunkHdr_Struct);
if (!memcmp(ChunkHdr.Id,"fmt ",4))
{
memcpy(&FmtHdr,Stream,sizeof(WAVFmtHdr_Struct));
if (FmtHdr.Format==0x0001)
{
*format=(FmtHdr.Channels==1?
(FmtHdr.BitsPerSample==8?AL_FORMAT_MONO8:AL_FORMAT_MONO16):
(FmtHdr.BitsPerSample==8?AL_FORMAT_STEREO8:AL_FORMAT_STEREO16));
*freq=FmtHdr.SamplesPerSec;
Stream+=ChunkHdr.Size;
}
else
{
memcpy(&FmtExHdr,Stream,sizeof(WAVFmtExHdr_Struct));
Stream+=ChunkHdr.Size;
}
}
else if (!memcmp(ChunkHdr.Id,"data",4))
{
if (FmtHdr.Format==0x0001)
{
*size=ChunkHdr.Size;
*data=malloc(ChunkHdr.Size+31);
if (*data) memcpy(*data,Stream,ChunkHdr.Size);
memset(((char *)*data)+ChunkHdr.Size,0,31);
Stream+=ChunkHdr.Size;
}
else if (FmtHdr.Format==0x0011)
{
//IMA ADPCM
}
else if (FmtHdr.Format==0x0055)
{
//MP3 WAVE
}
}
else if (!memcmp(ChunkHdr.Id,"smpl",4))
{
memcpy(&SmplHdr,Stream,sizeof(WAVSmplHdr_Struct));
*loop = (SmplHdr.Loops ? AL_TRUE : AL_FALSE);
Stream+=ChunkHdr.Size;
}
else Stream+=ChunkHdr.Size;
Stream+=ChunkHdr.Size&1;
FileHdr.Size-=(((ChunkHdr.Size+1)&~1)+8);
}
}
}
}
ALvoid alutUnloadWAV(ALenum format,ALvoid *data,ALsizei size,ALsizei freq)
{
if (data)
free(data);
}
#endif /* WIN32 */
SND_OpenALDevice::SND_OpenALDevice()
{
// check if audio is wanted
SYS_SystemHandle syshandle = SYS_GetSystem();
int audio = SYS_GetCommandLineInt(syshandle,"noaudio",0);
if (audio != 0)
m_audio = false;
else
m_audio = true;
m_buffersinitialized = false;
m_sourcesinitialized = false;
// let's check if we can get openal to initialize...
if (m_audio)
{
#ifdef OUDE_OPENAL
m_audio = true; // openal_2.12
alutInit(NULL, NULL); // openal_2.12
#else
m_audio = false;
ALCdevice *dev = alcOpenDevice(NULL);
if (dev) {
m_context = alcCreateContext(dev, NULL);
if (m_context) {
alcMakeContextCurrent(m_context);
m_audio = true;
}
}
#endif
}
// then try to generate some buffers
if (m_audio)
{
// let openal generate its buffers
alGenBuffers(NUM_BUFFERS, m_buffers);
m_buffersinitialized = true;
for (int i = 0; i < NUM_BUFFERS; i++)
{
if (!alIsBuffer(m_buffers[i]))
{
//printf("\n\n WARNING: OpenAL returned with an error. Continuing without audio.\n\n");
m_audio = false;
break;
}
}
}
// next: the sources
if (m_audio)
{
#ifdef OUDE_OPENAL
ALenum alc_error = ALC_NO_ERROR; // openal_2.12
#else
ALenum alc_error = alcGetError(); // openal_2.14+
#endif
// let openal generate its sources
if (alc_error == ALC_NO_ERROR)
{
alGenSources(NUM_SOURCES, m_sources);
m_sourcesinitialized = true;
}
}
// let's get us a wavecache
if (m_audio)
{
m_wavecache = new SND_WaveCache();
}
}
void SND_OpenALDevice::MakeCurrent() const
{
#ifdef WIN32
alcMakeContextCurrent(m_context);
#endif
}
SND_OpenALDevice::~SND_OpenALDevice()
{
if (m_context) {
alcMakeContextCurrent(m_context);
if (m_buffersinitialized)
alDeleteBuffers(NUM_BUFFERS, m_buffers);
if (m_sourcesinitialized)
alDeleteSources(NUM_SOURCES, m_sources);
}
}
SND_WaveSlot* SND_OpenALDevice::LoadSample(const STR_String& name,
void* memlocation,
int size)
{
SND_WaveSlot* waveslot = NULL;
STR_String samplename = name;
if (m_audio)
{
/* create the waveslot */
waveslot = m_wavecache->GetWaveSlot(samplename);
/* do we support this sample? */
if (SND_IsSampleValid(name, memlocation))
{
if (waveslot)
{
int buffer = waveslot->GetBuffer();
void* data = NULL;
char loop = 'a';
int sampleformat, bitrate, numberofchannels;
ALenum al_error = alGetError();
#ifdef OUDE_OPENAL
unsigned int samplerate, numberofsamples; // openal_2.12
#else
int samplerate, numberofsamples, frequency; // openal_2.14+
#endif
/* load the sample from memory? */
if (size && memlocation)
{
waveslot->SetFileSize(size);
/* what was (our) buffer? */
int buffer = waveslot->GetBuffer();
/* get some info out of the sample */
SND_GetSampleInfo((signed char*)memlocation, waveslot);
numberofchannels = SND_GetNumberOfChannels(memlocation);
bitrate = SND_GetBitRate(memlocation);
/* load the sample into openal */
#ifdef OUDE_OPENAL
alutLoadWAVMemory((char*)memlocation, &sampleformat, &data, &numberofsamples, &samplerate); // openal_2.12
#else
alutLoadWAVMemory((signed char*)memlocation, &sampleformat, &data, &numberofsamples, &samplerate, &loop);// openal_2.14+
#endif
/* put it in the buffer */
alBufferData(m_buffers[buffer], sampleformat, data, numberofsamples, samplerate);
}
/* or from file? */
else
{
#ifdef WIN32
alutLoadWAVFile((signed char*)samplename.Ptr(), &sampleformat, &data, &numberofsamples, &samplerate, &loop);
#else
alutLoadWAV((char*)samplename.Ptr(), &data,
&sampleformat, &numberofsamples,
&samplerate, &frequency);
#endif
/* put it in the buffer */
alBufferData(m_buffers[buffer], sampleformat, data, numberofsamples, samplerate);
}
/* fill the waveslot with info */
al_error = alGetError();
if (al_error == AL_NO_ERROR && m_buffers[buffer])
{
waveslot->SetData(data);
waveslot->SetSampleFormat(sampleformat);
waveslot->SetNumberOfChannels(numberofchannels);
waveslot->SetSampleRate(samplerate);
waveslot->SetBitRate(bitrate);
waveslot->SetNumberOfSamples(numberofsamples);
/* if the loading succeeded, mark the waveslot */
waveslot->SetLoaded(true);
}
else
{
/* or when it failed, free the waveslot */
m_wavecache->RemoveSample(waveslot->GetSampleName(), waveslot->GetBuffer());
waveslot = NULL;
}
/* and free the original stuff (copy was made in openal) */
alutUnloadWAV(sampleformat, data, numberofsamples, samplerate);
}
}
else
{
/* sample not supported, remove waveslot */
m_wavecache->RemoveSample(waveslot->GetSampleName(), waveslot->GetBuffer());
waveslot = NULL;
}
}
return waveslot;
}
// listener's and general stuff //////////////////////////////////////////////////////
/* sets the global dopplervelocity */
void SND_OpenALDevice::SetDopplerVelocity(MT_Scalar dopplervelocity) const
{
alDopplerVelocity ((float)dopplervelocity);
}
/* sets the global dopplerfactor */
void SND_OpenALDevice::SetDopplerFactor(MT_Scalar dopplerfactor) const
{
alDopplerFactor ((float)dopplerfactor);
}
/* sets the global rolloff factor */
void SND_OpenALDevice::SetListenerRollOffFactor(MT_Scalar rollofffactor) const
{
// not implemented in openal
}
void SND_OpenALDevice::NextFrame() const
{
// not needed by openal
}
// set the gain for the listener
void SND_OpenALDevice::SetListenerGain(float gain) const
{
alListenerf (AL_GAIN, gain);
}
void SND_OpenALDevice::InitListener()
{
// initialize the listener with these values that won't change
// (as long as we can have only one listener)
// now we can superimpose all listeners on each other (for they
// have the same settings)
float lispos[3] = {0,0,0};
float lisvel[3] = {0,0,0};
#ifdef WIN32
float lisori[6] = {0,1,0,0,0,1};
#else
float lisori[6] = {0,0,1,0,-1,0};
#endif
alListenerfv(AL_POSITION, lispos);
alListenerfv(AL_VELOCITY, lisvel);
alListenerfv(AL_ORIENTATION, lisori);
}
// source playstate stuff ////////////////////////////////////////////////////////////
/* sets the buffer */
void SND_OpenALDevice::SetObjectBuffer(int id, unsigned int buffer)
{
alSourcei (m_sources[id], AL_BUFFER, m_buffers[buffer]);
}
// check if the sound's still playing
int SND_OpenALDevice::GetPlayState(int id)
{
int alstate = 0;
int result = 0;
alGetSourceiv(m_sources[id], AL_SOURCE_STATE, &alstate);
switch(alstate)
{
case AL_INITIAL:
{
result = SND_INITIAL;
break;
}
case AL_PLAYING:
{
result = SND_PLAYING;
break;
}
case AL_PAUSED:
{
result = SND_PAUSED;
break;
}
case AL_STOPPED:
{
result = SND_STOPPED;
break;
}
default:
result = SND_UNKNOWN;
}
return result;
}
// make the source play
void SND_OpenALDevice::PlayObject(int id)
{
alSourcePlay(m_sources[id]);
}
// make the source stop
void SND_OpenALDevice::StopObject(int id) const
{
float obpos[3] = {0,0,0};
float obvel[3] = {0,0,0};
alSourcefv(m_sources[id], AL_POSITION, obpos);
#ifdef WIN32
alSourcefv(m_sources[id], AL_VELOCITY, obvel);
#endif
alSourcef(m_sources[id], AL_GAIN, 1.0);
alSourcef(m_sources[id], AL_PITCH, 1.0);
alSourcei(m_sources[id], AL_LOOPING, AL_FALSE);
alSourceStop(m_sources[id]);
}
// stop all sources
void SND_OpenALDevice::StopAllObjects()
{
alSourceStopv(NUM_SOURCES, m_sources);
}
// pause the source
void SND_OpenALDevice::PauseObject(int id) const
{
alSourcePause(m_sources[id]);
}
// source properties stuff ////////////////////////////////////////////////////////////
// give openal the object's pitch
void SND_OpenALDevice::SetObjectPitch(int id, MT_Scalar pitch) const
{
alSourcef (m_sources[id], AL_PITCH, (float)pitch);
}
// give openal the object's gain
void SND_OpenALDevice::SetObjectGain(int id, MT_Scalar gain) const
{
alSourcef (m_sources[id], AL_GAIN, (float)gain);
}
// give openal the object's looping
void SND_OpenALDevice::SetObjectLoop(int id, unsigned int loopmode) const
{
if (loopmode == SND_LOOP_OFF)
{
//printf("%d - ", id);
alSourcei (m_sources[id], AL_LOOPING, AL_FALSE);
}
else
alSourcei (m_sources[id], AL_LOOPING, AL_TRUE);
}
void SND_OpenALDevice::SetObjectMinGain(int id, MT_Scalar mingain) const
{
alSourcef (m_sources[id], AL_MIN_GAIN, (float)mingain);
}
void SND_OpenALDevice::SetObjectMaxGain(int id, MT_Scalar maxgain) const
{
alSourcef (m_sources[id], AL_MAX_GAIN, (float)maxgain);
}
void SND_OpenALDevice::SetObjectRollOffFactor(int id, MT_Scalar rollofffactor) const
{
alSourcef (m_sources[id], AL_ROLLOFF_FACTOR, (float)rollofffactor);
}
void SND_OpenALDevice::SetObjectReferenceDistance(int id, MT_Scalar referencedistance) const
{
alSourcef (m_sources[id], AL_REFERENCE_DISTANCE, (float)referencedistance);
}
// give openal the object's position
void SND_OpenALDevice::ObjectIs2D(int id) const
{
float obpos[3] = {0,0,0};
float obvel[3] = {0,0,0};
alSourcefv(m_sources[id], AL_POSITION, obpos);
alSourcefv(m_sources[id], AL_VELOCITY, obvel);
}
void SND_OpenALDevice::SetObjectTransform(int id,
const MT_Vector3& position,
const MT_Vector3& velocity,
const MT_Matrix3x3& orientation,
const MT_Vector3& lisposition,
const MT_Scalar& rollofffactor) const
{
float obpos[3];
float obvel[3];
obpos[0] = (float)position[0] * (float)rollofffactor; //x (l/r)
obpos[1] = (float)position[1] * (float)rollofffactor;
obpos[2] = (float)position[2] * (float)rollofffactor;
alSourcefv(m_sources[id], AL_POSITION, obpos);
#ifdef WIN32
velocity.getValue(obvel);
alSourcefv(m_sources[id], AL_VELOCITY, obvel);
#endif
}

@ -0,0 +1,102 @@
/**
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef SND_OPENALDEVICE
#define SND_OPENALDEVICE
#include "SND_AudioDevice.h"
#include "SoundDefines.h"
class SND_OpenALDevice : public SND_AudioDevice
{
public:
SND_OpenALDevice();
~SND_OpenALDevice();
SND_WaveSlot* LoadSample(const STR_String& samplename,
void* memlocation,
int size);
void InitListener();
void SetListenerGain(float gain) const;
void SetDopplerVelocity(MT_Scalar dopplervelocity) const;
void SetDopplerFactor(MT_Scalar dopplerfactor) const;
void SetListenerRollOffFactor(MT_Scalar rollofffactor) const;
void MakeCurrent() const;
void NextFrame() const;
void SetObjectBuffer(int id, unsigned int buffer);
int GetPlayState(int id);
void PlayObject(int id);
void StopObject(int id) const;
void StopAllObjects();
void PauseObject(int id) const;
void SetObjectLoop(int id, unsigned int loopmode) const;
void SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const {};
void SetObjectPitch(int id, MT_Scalar pitch) const;
void SetObjectGain(int id, MT_Scalar gain) const;
void SetObjectMinGain(int id, MT_Scalar mingain) const;
void SetObjectMaxGain(int id, MT_Scalar maxgain) const;
void SetObjectRollOffFactor(int id, MT_Scalar rolloff) const;
void SetObjectReferenceDistance(int id, MT_Scalar distance) const;
void SetObjectTransform(int id,
const MT_Vector3& position,
const MT_Vector3& velocity,
const MT_Matrix3x3& orientation,
const MT_Vector3& lisposition,
const MT_Scalar& rollofffactor) const;
void ObjectIs2D(int id) const;
void PlayCD(int track) const {};
void PauseCD(bool pause) const {};
void StopCD() const {};
void SetCDPlaymode(int playmode) const {};
void SetCDGain(MT_Scalar gain) const {};
void StartUsingDSP() {};
float* GetSpectrum() { return NULL; }
void StopUsingDSP() {};
private:
void* m_context;
unsigned int m_buffers[NUM_BUFFERS];
unsigned int m_sources[NUM_SOURCES];
bool m_buffersinitialized;
bool m_sourcesinitialized;
};
#endif //SND_OPENALDEVICE

@ -0,0 +1,65 @@
/* $Id$
/*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
* FreeBSD 3.4 does not yet have pthread_cancel (3.5 and above do)
*/
#ifdef __FreeBSD__
#include <osreldate.h>
#if (__FreeBSD_version < 350000)
#include <pthread.h>
#define FD_READ 0x1
#define _FD_LOCK(_fd,_type,_ts) _thread_fd_lock(_fd, _type, _ts)
#define _FD_UNLOCK(_fd,_type) _thread_fd_unlock(_fd, _type)
int pthread_cancel(pthread_t pthread) {
pthread_exit(NULL);
return 0;
}
long fpathconf(int fd, int name)
{
long ret;
if ((ret = _FD_LOCK(fd, FD_READ, NULL)) == 0) {
ret = _thread_sys_fpathconf(fd, name);
_FD_UNLOCK(fd, FD_READ);
}
return ret;
}
#endif
int pthread_atfork(void *a, void *b, void *c) {
return 0;
}
#endif

140
intern/action/ACT_Action.h Normal file

@ -0,0 +1,140 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
/**
* $Id$
* Copyright (C) 2001 NaN Technologies B.V.
* @author Maarten Gribnau
* @date March 31, 2001
*/
#ifndef _H_ACT_ACTION_H_
#define _H_ACT_ACTION_H_
#include "MEM_RefCounted.h"
#include "STR_String.h"
/**
* An action that can be applied or undone.
* Virtual base class for actions with a name.
* An action object inherits the shared object reference count mechanism.
* @author Maarten Gribnau
* @date March 31, 2001
*/
class ACT_Action : public MEM_RefCounted {
public:
/**
* Constructs an action with the given name .
* @param name the name of the action.
* @param applied state of the action after creation.
*/
ACT_Action(const STR_String& name, bool applied = false);
/**
* Returns the name of the action.
* @param name the name of the action.
*/
inline virtual void getName(STR_String& name) const;
/**
* Returns the name of the action as a pointer to the data of the string.
* @return pointer to the name of the action.
*/
inline virtual char* getName();
/**
* Sets the name of the action.
* @param name the name of the action.
*/
inline virtual void setName(const STR_String& name);
/**
* Returns whether this action is applied.
* @return whether this action is applied.
*/
inline virtual bool getIsApplied() const;
/**
* Call this member to apply an action.
* Child classes should override the doApply member to implement apply functionality.
* @see doApply.
*/
virtual void apply();
/**
* Call this member to undo an action .
* Child classes should override the doUndo member to implement undo functionality.
* @see doApply()
*/
virtual void undo();
protected:
/**
* Implementations should overload this method to provide the apply functionality.
*/
virtual void doApply() = 0;
/**
* Implementations should overload this method to provide the undo functionality.
*/
virtual void doUndo() = 0;
/** Name of this action */
STR_String m_name;
/** Is this action already applied? */
bool m_applied;
};
void ACT_Action::getName(STR_String& name) const
{
name = m_name;
}
char* ACT_Action::getName()
{
return m_name.Ptr();
}
void ACT_Action::setName(const STR_String& name)
{
m_name = name;
}
inline bool ACT_Action::getIsApplied() const
{
return m_applied;
}
#endif // _H_ACT_ACTION_H_

@ -0,0 +1,192 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
/**
* $Id$
* Copyright (C) 2001 NaN Technologies B.V.
* Interface for C access to actions.
* @author Maarten Gribnau
* @date April, 25, 2001
*/
#ifndef _H_ACT_ACTION_C_API
#define _H_ACT_ACTION_C_API
#include "MEM_RefCountedC-Api.h"
/** A pointer to an action object. */
typedef MEM_TRefCountedObjectPtr ACT_ActionPtr;
/** A pointer to an action stack object. */
typedef MEM_TObjectPtr ACT_ActionStackPtr;
/** A pointer to user data passed by the callbacks. */
typedef void* ACT_ActionUserDataPtr;
/**
* An action apply callback routine.
* @param action The action that should be applied.
* @param userData The pointer to the user data provided when the action was created.
*/
typedef void (*ACT_ActionApplyProcPtr)(ACT_ActionPtr action, ACT_ActionUserDataPtr userData);
/**
* An action undo callback routine.
* @param action The action that should be undone.
* @param userData The pointer to the user data provided when the action was created.
*/
typedef void (*ACT_ActionUndoProcPtr)(ACT_ActionPtr action, ACT_ActionUserDataPtr userData);
/**
* An action dispose callback routine.
* @param action The action that is disposed.
* @param userData The pointer to the user data provided when the action was created.
*/
typedef void (*ACT_ActionDisposeProcPtr)(ACT_ActionPtr action, ACT_ActionUserDataPtr userData);
#ifdef __cplusplus
extern "C" {
#endif
/**
* An action is a shared object that can be applied or undone.
*/
/**
* Creates a new action.
* This is an action that calls the given callbacks when it needs to be applied or undone.
* @param name The name of the action.
* @param isApplied Indication as to whether the action is already applied (0 = not applied).
* @param userData Pointer passed to the apply/undo callbacks.
* @param applyProc Pointer to the callback invoked when the action needs to be applied.
* @param undoProc Pointer to the callback invoked when the action needs to be undone.
* @return The new action (null in case of error).
*/
extern ACT_ActionPtr ACT_ActionCreate(
char* name,
int isApplied,
ACT_ActionUserDataPtr userData,
ACT_ActionApplyProcPtr applyProc,
ACT_ActionUndoProcPtr undoProc,
ACT_ActionDisposeProcPtr disposeProc);
/**
* Returns the name of an action.
* @return The name of the action (null in case of error).
*/
extern char* ACT_ActionGetName(ACT_ActionPtr action);
/**
* An action stack stores actions and implements undo/redo functionality.
*/
/**
* Creates a new action stack.
* @param stackSize The maximum number of actions on the stack.
* @return The new stack (or NULL in case of error).
*/
extern ACT_ActionStackPtr ACT_ActionStackCreate(unsigned int stackSize);
/**
* Disposes an action stack.
* @param stack The appropriate stack.
*/
extern void ACT_ActionStackDispose(ACT_ActionStackPtr stack);
/**
* Returns the current depth of the stack.
* @param stack The appropriate stack.
* @return the current stack depth.
*/
extern unsigned int ACT_ActionStackGetStackDepth(ACT_ActionStackPtr stack);
/**
* Returns the current maximum depth of the stack.
* @param stack The appropriate stack.
* @return the maximum stack depth.
*/
extern unsigned int ACT_ActionStackGetMaxStackDepth(ACT_ActionStackPtr stack);
/**
* Sets new maximum depth of the stack.
* @param stack The appropriate stack.
* @param maxStackDepth The new stack depth.
*/
extern void ACT_ActionStackSetMaxStackDepth(ACT_ActionStackPtr stack, unsigned int maxStackDepth);
/**
* Pushes an action on the stack.
* If the action has not been applied yet, it will be applied here.
* This will increase the reference count of the action.
* If there is not enough capacity, the action at the bottom of the stack is removed (and its reference count decreased).
* @param stack The appropriate stack.
* @param action the action that is pushed onto the stack.
*/
extern void ACT_ActionStackPush(ACT_ActionStackPtr stack, ACT_ActionPtr action);
/**
* Returns pointer to the current undo item.
* @param stack The appropriate stack.
* @return The action scheduled for undo (0 if there is none).
*/
extern ACT_ActionStackPtr ACT_ActionStackPeekUndo(ACT_ActionStackPtr stack);
/**
* Returns pointer to the current redo item.
* @param stack The appropriate stack.
* @return The action scheduled for redo (0 if there is none).
*/
extern ACT_ActionStackPtr ACT_ActionStackPeekRedo(ACT_ActionStackPtr stack);
/**
* Undos the current action.
* @param stack The appropriate stack.
* This will move the current undo index down (if the stack depth allows it).
*/
extern void ACT_ActionStackUndo(ACT_ActionStackPtr stack);
/**
* Redos the current action.
* @param stack The appropriate stack.
* This will move the action index up (if the stack depth allows it).
*/
extern void ACT_ActionStackRedo(ACT_ActionStackPtr stack);
#ifdef __cplusplus
}
#endif
#endif // _H_ACT_ACTION_C_API

@ -0,0 +1,184 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
/**
* $Id$
* Copyright (C) 2001 NaN Technologies B.V.
* @author Maarten Gribnau
* @date March 31, 2001
*/
#ifndef _H_ACT_ACTIONSTACK
#define _H_ACT_ACTIONSTACK
#include "ACT_Action.h"
#include <deque>
/**
* A stack with actions that implements undo/redo capabilities.
* A stack can grow to a maximum number of actions by pushing actions on the stack.
* By calling undo and redo the apply and undo members of the actions on the stack are called.
* In addition, this will move the stackIndex up and down the stack.
* When a new action is pushed onto the stack, the actions above the current action are removed from the stack.
* Actions pushed onto the stack are applied if they are not applied already.
* @todo implement error handling (e.g. memory errors)
* @author Maarten Gribnau
* @date March 31, 2001
*/
class ACT_ActionStack {
public:
/**
* Constructs an action stack.
*/
ACT_ActionStack(unsigned int maxStackDepth = 1);
/**
* Destructs an action stack.
*/
virtual ~ACT_ActionStack();
/**
* Returns the current depth of the stack.
* @return the current stack depth.
*/
virtual unsigned int getStackDepth() const;
/**
* Returns the current maximum depth of the stack.
* @return the maximum stack depth.
*/
virtual unsigned int getMaxStackDepth() const;
/**
* Sets new maximum depth of the stack.
* @param maxStackDepth The new stack depth.
*/
virtual void setMaxStackDepth(unsigned int maxStackDepth);
/**
* Pushes an action on the stack.
* If the action has not been applied yet, it will be applied here.
* This will increase the reference count of the action.
* If there is not enough capacity, the action at the bottom of the stack is removed (and its reference count decreased).
* @param action the action that is pushed onto the stack.
*/
virtual void push(ACT_Action& action);
/**
* Returns pointer to the current undo item.
* @return The action scheduled for undo (0 if there is none).
*/
virtual ACT_Action* peekUndo();
/**
* Returns pointer to the current redo item.
* @return The action scheduled for redo (0 if there is none).
*/
virtual ACT_Action* peekRedo();
/**
* Flushes the action stack.
* All actions are removed from the stack and their reference counts decreased.
*/
virtual void flush();
/**
* Returns whether we can undo the current action.
* @return Indication of the possibility to undo.
*/
virtual bool canUndo() const;
/**
* Undos the current action.
* This will move the current undo index down (if the stack depth allows it).
*/
virtual void undo();
/**
* Returns whether we can redo the current action.
* @return Indication of the possibility to redo.
*/
virtual bool canRedo() const;
/**
* Redos the current action.
* This will move the action index up (if the stack depth allows it).
*/
virtual void redo();
protected:
/**
* Removes <i>numActions</i> actions from the back of the stack.
* @param numActions number of items to remove.
* @return the number of actions removed.
*/
virtual unsigned int popBack(unsigned int numActions = 1);
/**
* Removes <i>numActions</i> actions from the front of the stack.
* @param numActions number of items to remove.
* @return the number of actions removed.
*/
virtual unsigned int popFront(unsigned int numActions = 1);
/**
* Returns the index of the current undo action.
* @param index The index of the action.
* @return Indication as to whether the index is valid (==true).
*/
virtual bool getUndoIndex(unsigned int& index) const;
/**
* Returns the index of the current redo action.
* @param index The index of the action.
* @return Indication as to whether the index is valid (==true).
*/
virtual bool getRedoIndex(unsigned int& index) const;
/** The maximum depth of this stack. */
unsigned int m_maxStackDepth;
/** The index of the current undo action in the stack. */
unsigned int m_undoIndex;
/** Is the index of the current undo action in the stack valid? */
bool m_undoIndexValid;
/** The index of the current redo action in the stack. */
unsigned int m_redoIndex;
/** Is the index of the current redo action in the stack valid? */
bool m_redoIndexValid;
/** The stack with actions. */
deque<ACT_Action*> m_stack;
};
#endif // _H_ACT_ACTIONSTACK

52
intern/action/Makefile Normal file

@ -0,0 +1,52 @@
#
# $Id$
#
# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. The Blender
# Foundation also sells licenses for use in proprietary software under
# the Blender License. See http://www.blender.org/BL/ for information
# about this.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): none yet.
#
# ***** END GPL/BL DUAL LICENSE BLOCK *****
# action main makefile.
#
include nan_definitions.mk
LIBNAME = action
SOURCEDIR = intern/$(LIBNAME)
DIR = $(OCGDIR)/$(SOURCEDIR)
DIRS = intern
TESTDIRS = test
include nan_subdirs.mk
install: all debug
@[ -d $(NAN_ACTION) ] || mkdir $(NAN_ACTION)
@[ -d $(NAN_ACTION)/include ] || mkdir $(NAN_ACTION)/include
@[ -d $(NAN_ACTION)/lib ] || mkdir $(NAN_ACTION)/lib
@[ -d $(NAN_ACTION)/lib/debug ] || mkdir $(NAN_ACTION)/lib/debug
cp -f $(DIR)/libaction.a $(NAN_ACTION)/lib/
cp -f $(DIR)/debug/libaction.a $(NAN_ACTION)/lib/debug/
cp -f *.h $(NAN_ACTION)/include/

746
intern/action/doc/Doxyfile Normal file

@ -0,0 +1,746 @@
# Doxyfile 1.2.4
# This file describes the settings to be used by doxygen for a project
#
# All text after a hash (#) is considered a comment and will be ignored
# The format is:
# TAG = value [value, ...]
# For lists items can also be appended using:
# TAG += value [value, ...]
# Values that contain spaces should be placed between quotes (" ")
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
PROJECT_NAME = foundation
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER =
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY =
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
# The default language is English, other supported languages are:
# Dutch, French, Italian, Czech, Swedish, German, Finnish, Japanese,
# Korean, Hungarian, Norwegian, Spanish, Romanian, Russian, Croatian,
# Polish, Portuguese and Slovene.
OUTPUT_LANGUAGE = English
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
# documentation are documented, even if no documentation was available.
# Private class members and static file members will be hidden unless
# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
EXTRACT_ALL = YES
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
# will be included in the documentation.
EXTRACT_PRIVATE = YES
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
EXTRACT_STATIC = YES
# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
# undocumented members of documented classes, files or namespaces.
# If set to NO (the default) these members will be included in the
# various overviews, but no documentation section is generated.
# This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_MEMBERS = NO
# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
# undocumented classes that are normally visible in the class hierarchy.
# If set to NO (the default) these class will be included in the various
# overviews. This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_CLASSES = NO
# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
# include brief member descriptions after the members that are listed in
# the file and class documentation (similar to JavaDoc).
# Set to NO to disable this.
BRIEF_MEMBER_DESC = YES
# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
# the brief description of a member or function before the detailed description.
# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
REPEAT_BRIEF = YES
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
# Doxygen will generate a detailed section even if there is only a brief
# description.
ALWAYS_DETAILED_SEC = NO
# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
# path before files name in the file list and in the header files. If set
# to NO the shortest path that makes the file name unique will be used.
FULL_PATH_NAMES = NO
# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
# can be used to strip a user defined part of the path. Stripping is
# only done if one of the specified strings matches the left-hand part of
# the path. It is allowed to use relative paths in the argument list.
STRIP_FROM_PATH =
# The INTERNAL_DOCS tag determines if documentation
# that is typed after a \internal command is included. If the tag is set
# to NO (the default) then the documentation will be excluded.
# Set it to YES to include the internal documentation.
INTERNAL_DOCS = NO
# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
# generate a class diagram (in Html and LaTeX) for classes with base or
# super classes. Setting the tag to NO turns the diagrams off.
CLASS_DIAGRAMS = YES
# If the SOURCE_BROWSER tag is set to YES then a list of source files will
# be generated. Documented entities will be cross-referenced with these sources.
SOURCE_BROWSER = YES
# Setting the INLINE_SOURCES tag to YES will include the body
# of functions and classes directly in the documentation.
INLINE_SOURCES = NO
# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
# doxygen to hide any special comment blocks from generated source code
# fragments. Normal C and C++ comments will always remain visible.
STRIP_CODE_COMMENTS = YES
# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
# file names in lower case letters. If set to YES upper case letters are also
# allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows
# users are adviced to set this option to NO.
CASE_SENSE_NAMES = YES
# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
# will show members with their full class and namespace scopes in the
# documentation. If set to YES the scope will be hidden.
HIDE_SCOPE_NAMES = NO
# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
# will generate a verbatim copy of the header file for each class for
# which an include is specified. Set to NO to disable this.
VERBATIM_HEADERS = YES
# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
# will put list of the files that are included by a file in the documentation
# of that file.
SHOW_INCLUDE_FILES = YES
# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
# will interpret the first line (until the first dot) of a JavaDoc-style
# comment as the brief description. If set to NO, the JavaDoc
# comments will behave just like the Qt-style comments (thus requiring an
# explict @brief command for a brief description.
JAVADOC_AUTOBRIEF = YES
# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
# member inherits the documentation from any documented member that it
# reimplements.
INHERIT_DOCS = YES
# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
# is inserted in the documentation for inline members.
INLINE_INFO = YES
# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
# will sort the (detailed) documentation of file and class members
# alphabetically by member name. If set to NO the members will appear in
# declaration order.
SORT_MEMBER_DOCS = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES, then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
DISTRIBUTE_GROUP_DOC = NO
# The TAB_SIZE tag can be used to set the number of spaces in a tab.
# Doxygen uses this value to replace tabs by spaces in code fragments.
TAB_SIZE = 8
# The ENABLE_SECTIONS tag can be used to enable conditional
# documentation sections, marked by \if sectionname ... \endif.
ENABLED_SECTIONS =
# The GENERATE_TODOLIST tag can be used to enable (YES) or
# disable (NO) the todo list. This list is created by putting \todo
# commands in the documentation.
GENERATE_TODOLIST = YES
# The GENERATE_TESTLIST tag can be used to enable (YES) or
# disable (NO) the test list. This list is created by putting \test
# commands in the documentation.
GENERATE_TESTLIST = YES
# This tag can be used to specify a number of aliases that acts
# as commands in the documentation. An alias has the form "name=value".
# For example adding "sideeffect=\par Side Effects:\n" will allow you to
# put the command \sideeffect (or @sideeffect) in the documentation, which
# will result in a user defined paragraph with heading "Side Effects:".
# You can put \n's in the value part of an alias to insert newlines.
ALIASES =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
# The QUIET tag can be used to turn on/off the messages that are generated
# by doxygen. Possible values are YES and NO. If left blank NO is used.
QUIET = NO
# The WARNINGS tag can be used to turn on/off the warning messages that are
# generated by doxygen. Possible values are YES and NO. If left blank
# NO is used.
WARNINGS = YES
# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
# automatically be disabled.
WARN_IF_UNDOCUMENTED = YES
# The WARN_FORMAT tag determines the format of the warning messages that
# doxygen can produce. The string should contain the $file, $line, and $text
# tags, which will be replaced by the file and line number from which the
# warning originated and the warning text.
WARN_FORMAT = "$file:$line: $text"
# The WARN_LOGFILE tag can be used to specify a file to which warning
# and error messages should be written. If left blank the output is written
# to stderr.
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
# The INPUT tag can be used to specify the files and/or directories that contain
# documented source files. You may enter file names like "myfile.cpp" or
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = ../extern ../intern
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank all files are included.
FILE_PATTERNS = *.h *.cpp *.c
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
# If left blank NO is used.
RECURSIVE = NO
# The EXCLUDE tag can be used to specify files and/or directories that should
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE =
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
# certain files from those directories.
EXCLUDE_PATTERNS =
# The EXAMPLE_PATH tag can be used to specify one or more files or
# directories that contain example code fragments that are included (see
# the \include command).
EXAMPLE_PATH =
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank all files are included.
EXAMPLE_PATTERNS =
# The IMAGE_PATH tag can be used to specify one or more files or
# directories that contain image that are included in the documentation (see
# the \image command).
IMAGE_PATH =
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
# by executing (via popen()) the command <filter> <input-file>, where <filter>
# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
# input file. Doxygen will then use the output that the filter program writes
# to standard output.
INPUT_FILTER =
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER) will be used to filter the input files when producing source
# files to browse.
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
# of all compounds will be generated. Enable this if the project
# contains a lot of classes, structs, unions or interfaces.
ALPHABETICAL_INDEX = NO
# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
# in which this list will be split (can be a number in the range [1..20])
COLS_IN_ALPHA_INDEX = 5
# In case all classes in a project start with a common prefix, all
# classes will be put under the same header in the alphabetical index.
# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
# should be ignored while generating the index headers.
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
# generate HTML output.
GENERATE_HTML = YES
# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `html' will be used as the default path.
HTML_OUTPUT = html
# The HTML_HEADER tag can be used to specify a personal HTML header for
# each generated HTML page. If it is left blank doxygen will generate a
# standard header.
HTML_HEADER =
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
# each generated HTML page. If it is left blank doxygen will generate a
# standard footer.
HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user defined cascading
# style sheet that is used by each HTML page. It can be used to
# fine-tune the look of the HTML output. If the tag is left blank doxygen
# will generate a default style sheet
HTML_STYLESHEET =
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
# files or namespaces will be aligned in HTML using tables. If set to
# NO a bullet list will be used.
HTML_ALIGN_MEMBERS = YES
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
# will be generated that can be used as input for tools like the
# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
# of the generated HTML documentation.
GENERATE_HTMLHELP = NO
# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
# top of each HTML page. The value NO (the default) enables the index and
# the value YES disables it.
DISABLE_INDEX = NO
# This tag can be used to set the number of enum values (range [1..20])
# that doxygen will group on one line in the generated HTML documentation.
ENUM_VALUES_PER_LINE = 4
# If the GENERATE_TREEVIEW tag is set to YES, a side pannel will be
# generated containing a tree-like index structure (just like the one that
# is generated for HTML Help). For this to work a browser that supports
# JavaScript and frames is required (for instance Netscape 4.0+
# or Internet explorer 4.0+).
GENERATE_TREEVIEW = NO
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
# used to set the initial width (in pixels) of the frame in which the tree
# is shown.
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.
GENERATE_LATEX = NO
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `latex' will be used as the default path.
LATEX_OUTPUT = latex
# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
# LaTeX documents. This may be useful for small projects and may help to
# save some trees in general.
COMPACT_LATEX = NO
# The PAPER_TYPE tag can be used to set the paper type that is used
# by the printer. Possible values are: a4, a4wide, letter, legal and
# executive. If left blank a4wide will be used.
PAPER_TYPE = a4wide
# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
# packages that should be included in the LaTeX output.
EXTRA_PACKAGES =
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
# the generated latex document. The header should contain everything until
# the first chapter. If it is left blank doxygen will generate a
# standard header. Notice: only use this tag if you know what you are doing!
LATEX_HEADER =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
# is prepared for conversion to pdf (using ps2pdf). The pdf file will
# contain links (just like the HTML output) instead of page references
# This makes the output suitable for online browsing using a pdf viewer.
PDF_HYPERLINKS = NO
# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
# plain latex in the generated Makefile. Set this option to YES to get a
# higher quality PDF documentation.
USE_PDFLATEX = NO
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
# command to the generated LaTeX files. This will instruct LaTeX to keep
# running if errors occur, instead of asking the user for help.
# This option is also used when generating formulas in HTML.
LATEX_BATCHMODE = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
# The RTF output is optimised for Word 97 and may not look very pretty with
# other RTF readers or editors.
GENERATE_RTF = NO
# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `rtf' will be used as the default path.
RTF_OUTPUT = rtf
# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
# RTF documents. This may be useful for small projects and may help to
# save some trees in general.
COMPACT_RTF = NO
# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
# will contain hyperlink fields. The RTF file will
# contain links (just like the HTML output) instead of page references.
# This makes the output suitable for online browsing using a WORD or other.
# programs which support those fields.
# Note: wordpad (write) and others do not support links.
RTF_HYPERLINKS = NO
# Load stylesheet definitions from file. Syntax is similar to doxygen's
# config file, i.e. a series of assigments. You only have to provide
# replacements, missing definitions are set to their default value.
RTF_STYLESHEET_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
# generate man pages
GENERATE_MAN = NO
# The MAN_OUTPUT tag is used to specify where the man pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `man' will be used as the default path.
MAN_OUTPUT = man
# The MAN_EXTENSION tag determines the extension that is added to
# the generated man pages (default is the subroutine's section .3)
MAN_EXTENSION = .3
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
# If the GENERATE_XML tag is set to YES Doxygen will
# generate an XML file that captures the structure of
# the code including all documentation. Warning: This feature
# is still experimental and very incomplete.
GENERATE_XML = NO
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
# evaluate all C-preprocessor directives found in the sources and include
# files.
ENABLE_PREPROCESSING = YES
# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
# names in the source code. If set to NO (the default) only conditional
# compilation will be performed. Macro expansion can be done in a controlled
# way by setting EXPAND_ONLY_PREDEF to YES.
MACRO_EXPANSION = NO
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
# then the macro expansion is limited to the macros specified with the
# PREDEFINED and EXPAND_AS_PREDEFINED tags.
EXPAND_ONLY_PREDEF = NO
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
# in the INCLUDE_PATH (see below) will be search if a #include is found.
SEARCH_INCLUDES = YES
# The INCLUDE_PATH tag can be used to specify one or more directories that
# contain include files that are not input files but should be processed by
# the preprocessor.
INCLUDE_PATH = ../../generic/extern
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
# directories. If left blank, the patterns specified with FILE_PATTERNS will
# be used.
INCLUDE_FILE_PATTERNS =
# The PREDEFINED tag can be used to specify one or more macro names that
# are defined before the preprocessor is started (similar to the -D option of
# gcc). The argument of the tag is a list of macros of the form: name
# or name=definition (no spaces). If the definition and the = are
# omitted =1 is assumed.
PREDEFINED =
# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
# The macro definition that is found in the sources will be used.
# Use the PREDEFINED tag if you want to use a different macro definition.
EXPAND_AS_DEFINED =
#---------------------------------------------------------------------------
# Configuration::addtions related to external references
#---------------------------------------------------------------------------
# The TAGFILES tag can be used to specify one or more tagfiles.
TAGFILES =
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
# a tag file that is based on the input files it reads.
GENERATE_TAGFILE =
# If the ALLEXTERNALS tag is set to YES all external classes will be listed
# in the class index. If set to NO only the inherited external classes
# will be listed.
ALLEXTERNALS = NO
# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of `which perl').
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz, a graph visualization
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)
HAVE_DOT = NO
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect inheritance relations. Setting this tag to YES will force the
# the CLASS_DIAGRAMS tag to NO.
CLASS_GRAPH = YES
# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect implementation dependencies (inheritance, containment, and
# class references variables) of the class with other documented classes.
COLLABORATION_GRAPH = YES
# If the ENABLE_PREPROCESSING, INCLUDE_GRAPH, and HAVE_DOT tags are set to
# YES then doxygen will generate a graph for each documented file showing
# the direct and indirect include dependencies of the file with other
# documented files.
INCLUDE_GRAPH = YES
# If the ENABLE_PREPROCESSING, INCLUDED_BY_GRAPH, and HAVE_DOT tags are set to
# YES then doxygen will generate a graph for each documented header file showing
# the documented files that directly or indirectly include this file
INCLUDED_BY_GRAPH = YES
# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
# will graphical hierarchy of all classes instead of a textual one.
GRAPHICAL_HIERARCHY = YES
# The tag DOT_PATH can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found on the path.
DOT_PATH =
# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
# (in pixels) of the graphs generated by dot. If a graph becomes larger than
# this value, doxygen will try to truncate the graph, so that it fits within
# the specified constraint. Beware that most browsers cannot cope with very
# large images.
MAX_DOT_GRAPH_WIDTH = 1024
# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
# (in pixels) of the graphs generated by dot. If a graph becomes larger than
# this value, doxygen will try to truncate the graph, so that it fits within
# the specified constraint. Beware that most browsers cannot cope with very
# large images.
MAX_DOT_GRAPH_HEIGHT = 1024
# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
# generate a legend page explaining the meaning of the various boxes and
# arrows in the dot generated graphs.
GENERATE_LEGEND = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to the search engine
#---------------------------------------------------------------------------
# The SEARCHENGINE tag specifies whether or not a search engine should be
# used. If set to NO the values of all tags below this one will be ignored.
SEARCHENGINE = NO
# The CGI_NAME tag should be the name of the CGI script that
# starts the search engine (doxysearch) with the correct parameters.
# A script with this name will be generated by doxygen.
CGI_NAME = search.cgi
# The CGI_URL tag should be the absolute URL to the directory where the
# cgi binaries are located. See the documentation of your http daemon for
# details.
CGI_URL =
# The DOC_URL tag should be the absolute URL to the directory where the
# documentation is located. If left blank the absolute path to the
# documentation, with file:// prepended to it, will be used.
DOC_URL =
# The DOC_ABSPATH tag should be the absolute path to the directory where the
# documentation is located. If left blank the directory on the local machine
# will be used.
DOC_ABSPATH =
# The BIN_ABSPATH tag must point to the directory where the doxysearch binary
# is installed.
BIN_ABSPATH = c:\program files\doxygen\bin
# The EXT_DOC_PATHS tag can be used to specify one or more paths to
# documentation generated for other projects. This allows doxysearch to search
# the documentation for these projects as well.
EXT_DOC_PATHS =

@ -0,0 +1,64 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
/**
* $Id$
* Copyright (C) 2001 NaN Technologies B.V.
* @author Maarten Gribnau
* @date April, 25, 2001
*/
#include "ACT_Action.h"
ACT_Action::ACT_Action(const STR_String& name, bool applied)
: m_name(name), m_applied(applied)
{
}
void ACT_Action::apply()
{
if (!m_applied) {
doApply();
m_applied = true;
}
}
void ACT_Action::undo()
{
if (m_applied) {
doUndo();
m_applied = false;
}
}

@ -0,0 +1,130 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
/**
* $Id$
* Copyright (C) 2001 NaN Technologies B.V.
* @author Maarten Gribnau
* @date April, 25, 2001
*/
#include "ACT_ActionC-Api.h"
#include "ACT_ActionStack.h"
#include "ACT_CallbackAction.h"
ACT_ActionPtr ACT_ActionCreate(
char* name,
int isApplied,
ACT_ActionUserDataPtr data,
ACT_ActionApplyProcPtr applyProc,
ACT_ActionUndoProcPtr undoProc,
ACT_ActionDisposeProcPtr disposeProc)
{
STR_String tmp (name);
ACT_CallbackAction* action = new ACT_CallbackAction(tmp, isApplied != 0, data, applyProc, undoProc, disposeProc);
return (ACT_ActionPtr) action;
}
char* ACT_ActionGetName(ACT_ActionPtr action)
{
return action ? ((ACT_Action*)action)->getName() : 0;
}
ACT_ActionStackPtr ACT_ActionStackCreate(unsigned int stackSize)
{
return ((ACT_ActionStackPtr) (new ACT_ActionStack (stackSize)));
}
void ACT_ActionStackDispose(ACT_ActionStackPtr stack)
{
if (stack) {
delete (ACT_ActionStack*) stack;
}
}
unsigned int ACT_ActionStackGetStackDepth(ACT_ActionStackPtr stack)
{
return stack ? ((ACT_ActionStack*)stack)->getStackDepth() : 0;
}
unsigned int ACT_ActionStackGetMaxStackDepth(ACT_ActionStackPtr stack)
{
return stack ? ((ACT_ActionStack*)stack)->getMaxStackDepth() : 0;
}
void ACT_ActionStackSetMaxStackDepth(ACT_ActionStackPtr stack, unsigned int maxStackDepth)
{
if (stack) {
((ACT_ActionStack*)stack)->setMaxStackDepth(maxStackDepth);
}
}
void ACT_ActionStackPush(ACT_ActionStackPtr stack, ACT_ActionPtr action)
{
if (stack && action) {
((ACT_ActionStack*)stack)->push(*((ACT_Action*)action));
}
}
ACT_ActionStackPtr ACT_ActionStackPeekUndo(ACT_ActionStackPtr stack)
{
return (ACT_ActionStackPtr) (stack ? ((ACT_ActionStack*)stack)->peekUndo() : 0);
}
ACT_ActionStackPtr ACT_ActionStackPeekRedo(ACT_ActionStackPtr stack)
{
return (ACT_ActionStackPtr) (stack ? ((ACT_ActionStack*)stack)->peekRedo() : 0);
}
void ACT_ActionStackUndo(ACT_ActionStackPtr stack)
{
if (stack) {
((ACT_ActionStack*)stack)->undo();
}
}
void ACT_ActionStackRedo(ACT_ActionStackPtr stack)
{
if (stack) {
((ACT_ActionStack*)stack)->redo();
}
}

@ -0,0 +1,241 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
/**
* $Id$
* Copyright (C) 2001 NaN Technologies B.V.
* @author Maarten Gribnau
* @date March 31, 2001
*/
#include "ACT_ActionStack.h"
ACT_ActionStack::ACT_ActionStack(unsigned int maxStackDepth)
: m_maxStackDepth(maxStackDepth),
m_undoIndex(0), m_undoIndexValid(false),
m_redoIndex(0), m_redoIndexValid(false)
{
}
ACT_ActionStack::~ACT_ActionStack()
{
flush();
}
unsigned int ACT_ActionStack::getStackDepth() const
{
return m_stack.size();
}
unsigned int ACT_ActionStack::getMaxStackDepth() const
{
return m_maxStackDepth;
}
void ACT_ActionStack::setMaxStackDepth(unsigned int maxStackDepth)
{
if (maxStackDepth != m_maxStackDepth) {
if (maxStackDepth) {
unsigned int size = m_stack.size();
if (maxStackDepth < size) {
// New max stack size is smaller than current stack size, need to shrink stack
unsigned int numRemove = size - maxStackDepth;
if (m_undoIndex >= maxStackDepth) {
// Pop items from the front (throw away undo steps)
popFront(numRemove);
m_undoIndex -= numRemove;
m_redoIndex = m_undoIndex + 1;
m_redoIndexValid = m_redoIndexValid && (maxStackDepth > 1);
}
else {
// Pop items from the back (throw away redo steps)
popBack(numRemove);
m_redoIndexValid = m_redoIndexValid && (m_redoIndex < maxStackDepth);
}
}
}
else {
// New stack size is zero
flush();
}
m_maxStackDepth = maxStackDepth;
}
}
void ACT_ActionStack::push(ACT_Action& action)
{
if (m_maxStackDepth) {
unsigned int size = m_stack.size();
if (m_redoIndexValid) {
// Remove items after the current action (throw away redo steps)
popBack(size - m_redoIndex);
}
else if (size >= m_maxStackDepth) {
// Remove items from the front (throw away undo steps)
popFront(m_maxStackDepth - size + 1);
}
// Store the action
if (!action.getIsApplied()) {
action.apply();
}
action.incRef();
m_stack.push_back(&action);
// Update action indices
m_redoIndex = m_stack.size();
m_redoIndexValid = false;
m_undoIndex = m_redoIndex - 1;
m_undoIndexValid = true;
}
}
ACT_Action* ACT_ActionStack::peekUndo()
{
unsigned int i;
return getUndoIndex(i) ? m_stack[i] : 0;
}
ACT_Action* ACT_ActionStack::peekRedo()
{
unsigned int i;
return getRedoIndex(i) ? m_stack[i] : 0;
}
void ACT_ActionStack::flush()
{
popBack(m_stack.size());
m_undoIndex = 0;
m_undoIndexValid = false;
m_redoIndex = 0;
m_redoIndexValid = false;
}
bool ACT_ActionStack::canUndo() const
{
unsigned int i;
return getUndoIndex(i);
}
void ACT_ActionStack::undo()
{
ACT_Action* action = peekUndo();
if (action) {
action->undo();
// Update action indices
m_redoIndex = m_undoIndex;
m_redoIndexValid = true;
if (m_undoIndex) {
m_undoIndex--;
}
else {
m_undoIndexValid = false;
}
}
}
bool ACT_ActionStack::canRedo() const
{
unsigned int i;
return getRedoIndex(i);
}
void ACT_ActionStack::redo()
{
ACT_Action* action = peekRedo();
if (action) {
action->apply();
// Update action indices
m_undoIndex = m_redoIndex;
m_undoIndexValid = true;
m_redoIndex++;
m_redoIndexValid = m_redoIndex < m_stack.size();
}
}
unsigned int ACT_ActionStack::popFront(unsigned int numActions)
{
unsigned int numRemoved = 0;
while (numActions-- && m_stack.size()) {
ACT_Action* action = m_stack[0];
action->decRef();
m_stack.pop_front();
numRemoved++;
}
return numRemoved;
}
unsigned int ACT_ActionStack::popBack(unsigned int numActions)
{
unsigned int numRemoved = 0;
unsigned int size;
while (numActions-- && (size = m_stack.size())) {
ACT_Action* action = m_stack[size-1];
action->decRef();
m_stack.pop_back();
numRemoved++;
}
return numRemoved;
}
bool ACT_ActionStack::getUndoIndex(unsigned int& i) const
{
i = m_undoIndex;
return m_undoIndexValid;
}
bool ACT_ActionStack::getRedoIndex(unsigned int& i) const
{
i = m_redoIndex;
return m_redoIndexValid;
}

@ -0,0 +1,124 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
/**
* $Id$
* Copyright (C) 2001 NaN Technologies B.V.
* @author Maarten Gribnau
* @date June 17, 2001
*/
#ifndef _H_ACT_CALLBACK_ACTION_H
#define _H_ACT_CALLBACK_ACTION_H
#include "ACT_Action.h"
#include "ACT_ActionC-Api.h"
/**
* An action implementation that uses callbacks for undo and redo.
* @author Maarten Gribnau
* @date June 17, 2001
*/
class ACT_CallbackAction : public ACT_Action {
public:
/**
* Constructs an action with the given name .
* @param name The name of the action.
* @param applied State of the action after creation.
* @param data Pointer to user data passed to the callbacks.
* @param applyProc Callback invoked for apply action.
* @param undoProc Callback invoked for undo action.
*/
ACT_CallbackAction(
STR_String& name,
bool applied,
ACT_ActionUserDataPtr data,
ACT_ActionApplyProcPtr applyProc,
ACT_ActionUndoProcPtr undoProc,
ACT_ActionDisposeProcPtr disposeProc)
: ACT_Action(name, applied), m_userData(data), m_applyProc(applyProc), m_undoProc(undoProc), m_disposeProc(disposeProc)
{
}
/**
* Default destructor.
* Will call the dispose callback.
*/
virtual ~ACT_CallbackAction()
{
// Should assert
m_disposeProc((ACT_ActionPtr)this, m_userData);
}
protected:
/**
* Calls the appropriate callback.
*/
inline virtual void doApply();
/**
* Calls the appropriate callback.
*/
inline virtual void doUndo();
/** User data supplied at creation and passed to the callbacks. */
ACT_ActionUserDataPtr m_userData;
/** Callback invoked for apply action. */
ACT_ActionApplyProcPtr m_applyProc;
/** Callback invoked for undo action. */
ACT_ActionApplyProcPtr m_undoProc;
/** Callback invoked when the action is disposed. */
ACT_ActionDisposeProcPtr m_disposeProc;
};
inline void ACT_CallbackAction::doApply()
{
// Should assert
m_applyProc((ACT_ActionPtr)this, m_userData);
}
inline void ACT_CallbackAction::doUndo()
{
// Should assert
m_undoProc((ACT_ActionPtr)this, m_userData);
}
#endif // _H_ACT_CALLBACK_ACTION_H

@ -0,0 +1,42 @@
#
# $Id$
#
# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. The Blender
# Foundation also sells licenses for use in proprietary software under
# the Blender License. See http://www.blender.org/BL/ for information
# about this.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): none yet.
#
# ***** END GPL/BL DUAL LICENSE BLOCK *****
# action intern Makefile
#
LIBNAME = action
DIR = $(OCGDIR)/intern/$(LIBNAME)
include nan_compile.mk
CPPFLAGS += -I..
CPPFLAGS += -I$(NAN_STRING)/include
CPPFLAGS += -I$(NAN_MEMUTIL)/include

@ -0,0 +1,128 @@
# Microsoft Developer Studio Project File - Name="action" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=action - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "action.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "action.mak" CFG="action - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "action - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "action - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "action - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../../../../obj/windows/intern/action/"
# PROP Intermediate_Dir "../../../../../obj/windows/intern/action/"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I "../.." /I "../../../../lib/windows/memutil/include/" /I "../../../../lib/windows/string/include/" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ELSEIF "$(CFG)" == "action - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../../../../../obj/windows/intern/action/debug"
# PROP Intermediate_Dir "../../../../../obj/windows/intern/action/debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../.." /I "../../../../lib/windows/memutil/include/" /I "../../../../lib/windows/string/include/" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ENDIF
# Begin Target
# Name "action - Win32 Release"
# Name "action - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\intern\ACT_Action.cpp
# End Source File
# Begin Source File
SOURCE="..\..\intern\ACT_ActionC-Api.cpp"
# End Source File
# Begin Source File
SOURCE=..\..\intern\ACT_ActionStack.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Group "intern"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\intern\ACT_CallbackAction.h
# End Source File
# End Group
# Begin Group "extern"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\ACT_Action.h
# End Source File
# Begin Source File
SOURCE="..\..\ACT_ActionC-Api.h"
# End Source File
# Begin Source File
SOURCE=..\..\ACT_ActionStack.h
# End Source File
# End Group
# End Group
# End Target
# End Project

@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "action"=".\action.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

@ -0,0 +1,83 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
/**
* $Id$
* Copyright (C) 2001 NaN Technologies B.V.
* @author Maarten Gribnau
* @date March 31, 2001
*/
#include "ACT_ActionC-Api.h"
#include "TestAction.h"
int main(int argc, char *argv[])
{
ACT_ActionStackPtr stack = ACT_ActionStackCreate (3);
ACT_ActionPtr action = ACT_ActionCreate("action1", 0, 0, printApplied, printUndone, printDisposed);
ACT_ActionStackPush(stack, action);
MEM_RefCountedDecRef(action);
action = ACT_ActionCreate("action2", 0, 0, printApplied, printUndone, printDisposed);
ACT_ActionStackPush(stack, action);
MEM_RefCountedDecRef(action);
action = ACT_ActionCreate("action3", 0, 0, printApplied, printUndone, printDisposed);
ACT_ActionStackPush(stack, action);
MEM_RefCountedDecRef(action);
ACT_ActionStackUndo(stack);
ACT_ActionStackUndo(stack);
ACT_ActionStackUndo(stack);
ACT_ActionStackRedo(stack);
ACT_ActionStackRedo(stack);
ACT_ActionStackRedo(stack);
ACT_ActionStackSetMaxStackDepth(stack, 1);
ACT_ActionStackUndo(stack);
ACT_ActionStackRedo(stack);
ACT_ActionStackSetMaxStackDepth(stack, 5);
ACT_ActionStackUndo(stack);
ACT_ActionStackRedo(stack);
action = ACT_ActionCreate("action4", 0, 0, printApplied, printUndone, printDisposed);
ACT_ActionStackPush(stack, action);
MEM_RefCountedDecRef(action);
ACT_ActionStackUndo(stack);
action = ACT_ActionCreate("action5", 0, 0, printApplied, printUndone, printDisposed);
ACT_ActionStackPush(stack, action);
MEM_RefCountedDecRef(action);
ACT_ActionStackUndo(stack);
ACT_ActionStackUndo(stack);
ACT_ActionStackRedo(stack);
ACT_ActionStackRedo(stack);
return 0;
}

@ -0,0 +1,59 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
/**
* $Id$
* Copyright (C) 2001 NaN Technologies B.V.
* @author Maarten Gribnau
* @date March 31, 2001
*/
#include <stdio.h>
#include "TestAction.h"
void printApplied(ACT_ActionPtr action, ACT_ActionUserDataPtr userData)
{
printf("%s: applied\n", ACT_ActionGetName(action));
}
void printUndone(ACT_ActionPtr action, ACT_ActionUserDataPtr userData)
{
printf("%s: undone\n", ACT_ActionGetName(action));
}
void printDisposed(ACT_ActionPtr action, ACT_ActionUserDataPtr userData)
{
printf("%s: disposed\n", ACT_ActionGetName(action));
}

@ -0,0 +1,50 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
/**
* $Id$
* Copyright (C) 2001 NaN Technologies B.V.
* @author Maarten Gribnau
* @date March 31, 2001
*/
#ifndef _H_ACT_TESTACTION_C_H_
#define _H_ACT_TESTACTION_C_H_
#include "ACT_ActionC-Api.h"
void printApplied(ACT_ActionPtr action, ACT_ActionUserDataPtr userData);
void printUndone(ACT_ActionPtr action, ACT_ActionUserDataPtr userData);
void printDisposed(ACT_ActionPtr action, ACT_ActionUserDataPtr userData);
#endif // _H_ACT_TESTACTION_C_H_

@ -0,0 +1,109 @@
# Microsoft Developer Studio Project File - Name="action_c_test" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=action_c_test - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "action_c_test.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "action_c_test.mak" CFG="action_c_test - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "action_c_test - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "action_c_test - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "action_c_test - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../../../../../../obj/windows/intern/action/test"
# PROP Intermediate_Dir "../../../../../../../obj/windows/intern/action/test"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I "../../../.." /I "../../../../../../lib/windows/memutil/include/" /I "../../../../../../lib/windows/string/include/" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib string.lib memutil.lib /nologo /subsystem:console /machine:I386 /libpath:"../../../../../../lib/windows/memutil/lib" /libpath:"../../../../../../lib/windows/string/lib"
!ELSEIF "$(CFG)" == "action_c_test - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../../../../../../../obj/windows/intern/action/test/debug"
# PROP Intermediate_Dir "../../../../../../../obj/windows/intern/action/test/debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../.." /I "../../../../../../lib/windows/memutil/include/" /I "../../../../../../lib/windows/string/include/" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib string.lib memutil.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../../../../../../lib/windows/memutil/lib/debug" /libpath:"../../../../../../lib/windows/string/lib/debug"
!ENDIF
# Begin Target
# Name "action_c_test - Win32 Release"
# Name "action_c_test - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\ActionTest.c
# End Source File
# Begin Source File
SOURCE=..\..\TestAction.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\TestAction.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

@ -0,0 +1,44 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "action"="..\..\..\..\make\msvc_6_0\action.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "action_c_test"=".\action_c_test.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name action
End Project Dependency
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

@ -0,0 +1,83 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
/**
* $Id$
* Copyright (C) 2001 NaN Technologies B.V.
* @author Maarten Gribnau
* @date March 31, 2001
*/
#include "ACT_ActionStack.h"
#include "TestAction.h"
int main()
{
ACT_ActionStack testStack (3);
TestAction* testAction = new TestAction (STR_String("action1"));
testStack.push(*testAction);
testAction->decRef();
testAction = new TestAction (STR_String("action2"));
testStack.push(*testAction);
testAction->decRef();
testAction = new TestAction (STR_String("action3"));
testStack.push(*testAction);
testAction->decRef();
testStack.undo();
testStack.undo();
testStack.undo();
testStack.redo();
testStack.redo();
testStack.redo();
testStack.setMaxStackDepth(1);
testStack.undo();
testStack.redo();
testStack.setMaxStackDepth(5);
testStack.undo();
testStack.redo();
testAction = new TestAction (STR_String("action4"));
testStack.push(*testAction);
testAction->decRef();
testStack.undo();
testAction = new TestAction (STR_String("action5"));
testStack.push(*testAction);
testAction->decRef();
testStack.undo();
testStack.undo();
testStack.redo();
testStack.redo();
return 0;
}

@ -0,0 +1,57 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
/**
* $Id$
* Copyright (C) 2001 NaN Technologies B.V.
* @author Maarten Gribnau
* @date March 31, 2001
*/
#ifndef _H_ACT_TESTACTION
#define _H_ACT_TESTACTION
#include "ACT_Action.h"
#include <iostream>
class TestAction : public ACT_Action
{
public:
TestAction(const STR_String& name) : ACT_Action(name) {}
virtual ~TestAction() { cout << m_name.Ptr() << ": deleted\n"; }
protected:
virtual void doApply() { cout << m_name.Ptr() << ": applied\n"; }
virtual void doUndo() { cout << m_name.Ptr() << ": undone\n"; }
};
#endif // _H_ACT_TESTACTION

@ -0,0 +1,105 @@
# Microsoft Developer Studio Project File - Name="action_cpp_test" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=action_cpp_test - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "action_cpp_test.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "action_cpp_test.mak" CFG="action_cpp_test - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "action_cpp_test - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "action_cpp_test - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "action_cpp_test - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../../../../../../obj/windows/intern/action/test"
# PROP Intermediate_Dir "../../../../../../../obj/windows/intern/action/test"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I "../../../.." /I "../../../../../../lib/windows/memutil/include/" /I "../../../../../../lib/windows/string/include/" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib string.lib memutil.lib /nologo /subsystem:console /machine:I386 /libpath:"../../../../../../lib/windows/memutil/lib" /libpath:"../../../../../../lib/windows/string/lib"
!ELSEIF "$(CFG)" == "action_cpp_test - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../../../../../../../obj/windows/intern/action/test/debug"
# PROP Intermediate_Dir "../../../../../../../obj/windows/intern/action/test/debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../.." /I "../../../../../../lib/windows/memutil/include/" /I "../../../../../../lib/windows/string/include/" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib string.lib memutil.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../../../../../../lib/windows/memutil/lib/debug" /libpath:"../../../../../../lib/windows/string/lib/debug"
!ENDIF
# Begin Target
# Name "action_cpp_test - Win32 Release"
# Name "action_cpp_test - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\ActionTest.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\TestAction.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

@ -0,0 +1,44 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "action"="..\..\..\..\make\msvc_6_0\action.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "action_cpp_test"=".\action_cpp_test.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name action
End Project Dependency
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

129
intern/bmfont/BMF_Api.h Normal file

@ -0,0 +1,129 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
/**
* $Id$
* Copyright (C) 2001 NaN Technologies B.V.
*
* API of the OpenGL bitmap font library.
* Currently draws fonts using the glBitmap routine.
* This implies that drawing speed is heavyly dependant on
* the 2D capabilities of the graphics card.
*/
#ifndef __BMF_API_H
#define __BMF_API_H
#ifdef __cplusplus
extern "C" {
#endif
#include "BMF_Fonts.h"
/**
* Returns the font for a given font type.
* @param font The font to retrieve.
* @return The font (or nil if not found).
*/
BMF_Font* BMF_GetFont(BMF_FontType font);
/**
* Draws a character at the current raster position.
* @param font The font to use.
* @param c The character to draw.
* @return Indication of success (0 == error).
*/
int BMF_DrawCharacter(BMF_Font* font, char c);
/**
* Draws a string at the current raster position.
* @param font The font to use.
* @param str The string to draw.
* @return Indication of success (0 == error).
*/
int BMF_DrawString(BMF_Font* font, char* str);
/**
* Returns the width of a character in pixels.
* @param font The font to use.
* @param c The character.
* @return The length.
*/
int BMF_GetCharacterWidth(BMF_Font* font, char c);
/**
* Returns the width of a string of characters.
* @param font The font to use.
* @param str The string.
* @return The length.
*/
int BMF_GetStringWidth(BMF_Font* font, char* str);
/**
* Returns the bounding box of the font. The width and
* height represent the bounding box of the union of
* all glyps. The minimum and maximum values of the
* box represent the extent of the font and its positioning
* about the origin.
*/
void BMF_GetBoundingBox(BMF_Font* font, int *xmin_r, int *ymin_r, int *xmax_r, int *ymax_r);
/**
* Convert the given @a font to a texture, and return the GL texture
* ID of the texture. If the texture ID is bound, text can
* be drawn using the texture by calling DrawStringTexture.
*
* @param font The font to create the texture from.
* @return The GL texture ID of the new texture, or -1 if unable
* to create.
*/
int BMF_GetFontTexture(BMF_Font* font);
/**
* Draw the given @a str at the point @a x, @a y, @a z, using
* texture coordinates. This assumes that an appropriate texture
* has been bound, see BMF_BitmapFont::GetTexture(). The string
* is drawn along the positive X axis.
*
* @param font The font to draw with.
* @param string The c-string to draw.
* @param x The x coordinate to start drawing at.
* @param y The y coordinate to start drawing at.
* @param z The z coordinate to start drawing at.
*/
void BMF_DrawStringTexture(BMF_Font* font, char* string, float x, float y, float z);
#ifdef __cplusplus
}
#endif
#endif /* __BMF_API_H */

76
intern/bmfont/BMF_Fonts.h Normal file

@ -0,0 +1,76 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
/**
* $Id$
* Copyright (C) 2001 NaN Technologies B.V.
* Defines the names of the fonts in the library.
*/
#ifndef __BMF_FONTS_H
#define __BMF_FONTS_H
#include "BMF_Settings.h"
typedef enum
{
BMF_kHelvetica10 = 0,
#if BMF_INCLUDE_HELV12
BMF_kHelvetica12,
#endif
#if BMF_INCLUDE_HELVB8
BMF_kHelveticaBold8,
#endif
#if BMF_INCLUDE_HELVB10
BMF_kHelveticaBold10,
#endif
#if BMF_INCLUDE_HELVB12
BMF_kHelveticaBold12,
#endif
#if BMF_INCLUDE_HELVB14
BMF_kHelveticaBold14,
#endif
#if BMF_INCLUDE_SCR12
BMF_kScreen12,
#endif
#if BMF_INCLUDE_SCR14
BMF_kScreen14,
#endif
#if BMF_INCLUDE_SCR15
BMF_kScreen15,
#endif
BMF_kNumFonts
} BMF_FontType;
typedef struct BMF_Font BMF_Font;
#endif /* __BMF_FONTS_H */

@ -0,0 +1,69 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
/**
* $Id$
* Copyright (C) 2001 NaN Technologies B.V.
* Allows you to determine which fonts to include in the library.
*/
#ifndef __BMF_SETTINGS_H
#define __BMF_SETTINGS_H
/* This font is included always */
#define BMF_INCLUDE_HELV10 1
#ifndef BMF_MINIMAL
/* These fonts are included with the minimal setting defined */
#define BMF_INCLUDE_HELV12 1
#define BMF_INCLUDE_HELVB8 1
#define BMF_INCLUDE_HELVB10 1
#define BMF_INCLUDE_HELVB12 1
#define BMF_INCLUDE_HELVB14 1
#define BMF_INCLUDE_SCR12 1
#define BMF_INCLUDE_SCR14 1
#define BMF_INCLUDE_SCR15 1
#else /* BMF_MINIMAL */
#define BMF_INCLUDE_HELV12 0
#define BMF_INCLUDE_HELVB8 0
#define BMF_INCLUDE_HELVB10 0
#define BMF_INCLUDE_HELVB12 0
#define BMF_INCLUDE_HELVB14 0
#define BMF_INCLUDE_SCR12 0
#define BMF_INCLUDE_SCR14 0
#define BMF_INCLUDE_SCR15 0
#endif /* BMF_MINIMAL */
#endif /* __BMF_SETTINGS_H */

52
intern/bmfont/Makefile Normal file

@ -0,0 +1,52 @@
#
# $Id$
#
# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. The Blender
# Foundation also sells licenses for use in proprietary software under
# the Blender License. See http://www.blender.org/BL/ for information
# about this.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): none yet.
#
# ***** END GPL/BL DUAL LICENSE BLOCK *****
# bmfont main makefile.
#
include nan_definitions.mk
LIBNAME = bmfont
SOURCEDIR = intern/$(LIBNAME)
DIR = $(OCGDIR)/$(SOURCEDIR)
DIRS = intern
#not ready yet TESTDIRS = test
include nan_subdirs.mk
install: all debug
@[ -d $(NAN_BMFONT) ] || mkdir $(NAN_BMFONT)
@[ -d $(NAN_BMFONT)/include ] || mkdir $(NAN_BMFONT)/include
@[ -d $(NAN_BMFONT)/lib ] || mkdir $(NAN_BMFONT)/lib
@[ -d $(NAN_BMFONT)/lib/debug ] || mkdir $(NAN_BMFONT)/lib/debug
cp -f $(DIR)/libbmfont.a $(NAN_BMFONT)/lib/
cp -f $(DIR)/debug/libbmfont.a $(NAN_BMFONT)/lib/debug/
cp -f *.h $(NAN_BMFONT)/include/

@ -0,0 +1,164 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
/**
* $Id$
* Copyright (C) 2001 NaN Technologies B.V.
*
* Implementation of the API of the OpenGL bitmap font library.
*/
#include "BMF_Api.h"
#include "BMF_BitmapFont.h"
#if BMF_INCLUDE_HELV10
extern BMF_FontData BMF_font_helv10;
static BMF_BitmapFont bmfHelv10(&BMF_font_helv10);
#endif // BMF_INCLUDE_HELV10
#if BMF_INCLUDE_HELV12
extern BMF_FontData BMF_font_helv12;
static BMF_BitmapFont bmfHelv12(&BMF_font_helv12);
#endif // BMF_INCLUDE_HELV12
#if BMF_INCLUDE_HELVB8
extern BMF_FontData BMF_font_helvb8;
static BMF_BitmapFont bmfHelvb8(&BMF_font_helvb8);
#endif // BMF_INCLUDE_HELVB8
#if BMF_INCLUDE_HELVB10
extern BMF_FontData BMF_font_helvb10;
static BMF_BitmapFont bmfHelvb10(&BMF_font_helvb10);
#endif // BMF_INCLUDE_HELVB10
#if BMF_INCLUDE_HELVB12
extern BMF_FontData BMF_font_helvb12;
static BMF_BitmapFont bmfHelvb12(&BMF_font_helvb12);
#endif // BMF_INCLUDE_HELVB12
#if BMF_INCLUDE_HELVB14
extern BMF_FontData BMF_font_helvb14;
static BMF_BitmapFont bmfHelvb14(&BMF_font_helvb14);
#endif // BMF_INCLUDE_HELVB14
#if BMF_INCLUDE_SCR12
extern BMF_FontData BMF_font_scr12;
static BMF_BitmapFont bmfScreen12(&BMF_font_scr12);
#endif // BMF_INCLUDE_SCR12
#if BMF_INCLUDE_SCR14
extern BMF_FontData BMF_font_scr14;
static BMF_BitmapFont bmfScreen14(&BMF_font_scr14);
#endif // BMF_INCLUDE_SCR14
#if BMF_INCLUDE_SCR15
extern BMF_FontData BMF_font_scr15;
static BMF_BitmapFont bmfScreen15(&BMF_font_scr15);
#endif // BMF_INCLUDE_SCR15
BMF_Font* BMF_GetFont(BMF_FontType font)
{
switch (font)
{
#if BMF_INCLUDE_HELV10
case BMF_kHelvetica10: return (BMF_Font*) &bmfHelv10;
#endif // BMF_INCLUDE_HELV10
#if BMF_INCLUDE_HELV12
case BMF_kHelvetica12: return (BMF_Font*) &bmfHelv12;
#endif // BMF_INCLUDE_HELV12
#if BMF_INCLUDE_HELVB8
case BMF_kHelveticaBold8: return (BMF_Font*) &bmfHelvb8;
#endif // BMF_INCLUDE_HELVB8
#if BMF_INCLUDE_HELVB10
case BMF_kHelveticaBold10: return (BMF_Font*) &bmfHelvb10;
#endif // BMF_INCLUDE_HELVB10
#if BMF_INCLUDE_HELVB12
case BMF_kHelveticaBold12: return (BMF_Font*) &bmfHelvb12;
#endif // BMF_INCLUDE_HELVB12
#if BMF_INCLUDE_HELVB14
case BMF_kHelveticaBold14: return (BMF_Font*) &bmfHelvb14;
#endif // BMF_INCLUDE_HELVB12
#if BMF_INCLUDE_SCR12
case BMF_kScreen12: return (BMF_Font*) &bmfScreen12;
#endif // BMF_INCLUDE_SCR12
#if BMF_INCLUDE_SCR14
case BMF_kScreen14: return (BMF_Font*) &bmfScreen14;
#endif // BMF_INCLUDE_SCR14
#if BMF_INCLUDE_SCR15
case BMF_kScreen15: return (BMF_Font*) &bmfScreen15;
#endif // BMF_INCLUDE_SCR15
default:
break;
}
return 0;
}
int BMF_DrawCharacter(BMF_Font* font, char c)
{
char str[2] = {c, '\0'};
return BMF_DrawString(font, str);
}
int BMF_DrawString(BMF_Font* font, char* str)
{
if (!font) return 0;
((BMF_BitmapFont*)font)->DrawString(str);
return 1;
}
int BMF_GetCharacterWidth(BMF_Font* font, char c)
{
char str[2] = {c, '\0'};
return BMF_GetStringWidth(font, str);
}
int BMF_GetStringWidth(BMF_Font* font, char* str)
{
if (!font) return 0;
return ((BMF_BitmapFont*)font)->GetStringWidth(str);
}
void BMF_GetBoundingBox(BMF_Font* font, int *xmin_r, int *ymin_r, int *xmax_r, int *ymax_r)
{
if (!font) return;
((BMF_BitmapFont*)font)->GetBoundingBox(*xmin_r, *ymin_r, *xmax_r, *ymax_r);
}
int BMF_GetFontTexture(BMF_Font* font) {
if (!font) return -1;
return ((BMF_BitmapFont*)font)->GetTexture();
}
void BMF_DrawStringTexture(BMF_Font* font, char *string, float x, float y, float z) {
if (!font) return;
((BMF_BitmapFont*)font)->DrawStringTexture(string, x, y, z);
}

@ -0,0 +1,207 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
/**
* $Id$
* Copyright (C) 2001 NaN Technologies B.V.
*/
#include <string.h>
#if defined(WIN32) || defined(__APPLE__)
#ifdef WIN32
#if !defined(__CYGWIN32__)
#pragma warning(disable:4244)
#endif /* __CYGWIN32__ */
#include <windows.h>
#include <GL/gl.h>
#else // WIN32
// __APPLE__ is defined
#include <AGL/gl.h>
#endif // WIN32
#else // defined(WIN32) || defined(__APPLE__)
#include <GL/gl.h>
#endif // defined(WIN32) || defined(__APPLE__)
#include "BMF_BitmapFont.h"
BMF_BitmapFont::BMF_BitmapFont(BMF_FontData* fontData)
: m_fontData(fontData)
{
}
BMF_BitmapFont::~BMF_BitmapFont(void)
{
}
void BMF_BitmapFont::DrawString(char* str)
{
GLint alignment;
unsigned char c;
glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
while (c = (unsigned char) *str++) {
BMF_CharData & cd = m_fontData->chars[c];
if (cd.data_offset==-1) {
GLubyte nullBitmap = 0;
glBitmap(1, 1, 0, 0, cd.advance, 0, &nullBitmap);
} else {
GLubyte *bitmap = &m_fontData->bitmap_data[cd.data_offset];
glBitmap(cd.width, cd.height, cd.xorig, cd.yorig, cd.advance, 0, bitmap);
}
}
glPixelStorei(GL_UNPACK_ALIGNMENT, alignment);
}
int BMF_BitmapFont::GetStringWidth(char* str)
{
unsigned char c;
int length = 0;
while (c = (unsigned char) *str++) {
length += m_fontData->chars[c].advance;
}
return length;
}
void BMF_BitmapFont::GetBoundingBox(int & xMin, int & yMin, int & xMax, int & yMax)
{
xMin = m_fontData->xmin;
yMin = m_fontData->ymin;
xMax = m_fontData->xmax;
yMax = m_fontData->ymax;
}
int BMF_BitmapFont::GetTexture()
{
int fWidth = m_fontData->xmax - m_fontData->xmin;
int fHeight = m_fontData->ymax - m_fontData->ymin;
if (fWidth>=16 || fHeight>=16) {
return -1;
}
int cRows = 16, cCols = 16;
int cWidth = 16, cHeight = 16;
int iWidth = cCols*cWidth;
int iHeight = cRows*cHeight;
GLubyte *img = new GLubyte [iHeight*iWidth];
GLuint texId;
int baseLine = -(m_fontData->ymin);
memset(img, 0, iHeight*iWidth);
for (int i = 0; i<256; i++) {
BMF_CharData & cd = m_fontData->chars[i];
if (cd.data_offset != -1) {
int cellX = i%16;
int cellY = i/16;
for (int y = 0; y<cd.height; y++) {
GLubyte* imgRow = &img[(cellY*cHeight + y + baseLine - cd.yorig)*iWidth];
GLubyte* chrRow = &m_fontData->bitmap_data[cd.data_offset + ((cd.width+7)/8)*y];
for (int x = 0; x<cd.width; x++) {
GLubyte* imgPxl = &imgRow[(cellX*cWidth + x - cd.xorig)];
int byteIdx = x/8;
int bitIdx = 7 - (x%8);
if (chrRow[byteIdx]&(1<<bitIdx)) {
imgPxl[0] = 255;
}
}
}
}
}
glGenTextures(1, &texId);
glBindTexture(GL_TEXTURE_2D, texId);
glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA4, iWidth, iHeight, 0, GL_ALPHA, GL_UNSIGNED_BYTE, img);
if (glGetError()) {
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE4_ALPHA4, iWidth, iHeight, 0, GL_ALPHA, GL_UNSIGNED_BYTE, img);
}
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
delete [] img;
return texId;
}
void BMF_BitmapFont::DrawStringTexture(char *str, float x, float y, float z)
{
unsigned char c;
float pos = 0;
int baseLine = -(m_fontData->ymin);
glBegin(GL_QUADS);
while (c = (unsigned char) *str++) {
BMF_CharData & cd = m_fontData->chars[c];
if (cd.data_offset != -1) {
float cellX = (c%16)/16.0;
float cellY = (c/16)/16.0;
glTexCoord2f(cellX + 1.0/16.0, cellY);
glVertex3f(x + pos + 16.0, -baseLine + y + 0.0, z);
glTexCoord2f(cellX + 1.0/16.0, cellY + 1.0/16.0);
glVertex3f(x + pos + 16.0, -baseLine + y + 16.0, z);
glTexCoord2f(cellX, cellY + 1.0/16.0);
glVertex3f(x + pos + 0.0, -baseLine + y + 16.0, z);
glTexCoord2f(cellX, cellY);
glVertex3f(x + pos + 0.0, -baseLine + y + 0.0, z);
}
pos += cd.advance;
}
glEnd();
}

@ -0,0 +1,109 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
/**
* $Id$
* Copyright (C) 2001 NaN Technologies B.V.
*/
#ifndef __BMF_BITMAP_FONT_H
#define __BMF_BITMAP_FONT_H
#include "BMF_FontData.h"
/**
* Base class for OpenGL bitmap fonts.
*/
class BMF_BitmapFont
{
public:
/**
* Default constructor.
*/
BMF_BitmapFont(BMF_FontData* fontData);
/**
* Destructor.
*/
virtual ~BMF_BitmapFont(void);
/**
* Draws a string at the current raster position.
* @param str The string to draw.
*/
void DrawString(char* str);
/**
* Draws a string at the current raster position.
* @param str The string to draw.
* @return The width of the string.
*/
int GetStringWidth(char* str);
/**
* Returns the bounding box of the font. The width and
* height represent the bounding box of the union of
* all glyps. The minimum and maximum values of the
* box represent the extent of the font and its positioning
* about the origin.
*/
void GetBoundingBox(int & xMin, int & yMin, int & xMax, int & yMax);
/**
* Convert the font to a texture, and return the GL texture
* ID of the texture. If the texture ID is bound, text can
* be drawn using the texture by calling DrawStringTexture.
*
* @return The GL texture ID of the new texture, or -1 if unable
* to create.
*/
int GetTexture();
/**
* Draw the given @a string at the point @a x, @a y, @a z, using
* texture coordinates. This assumes that an appropriate texture
* has been bound, see BMF_BitmapFont::GetTexture(). The string
* is drawn along the positive X axis.
*
* @param string The c-string to draw.
* @param x The x coordinate to start drawing at.
* @param y The y coordinate to start drawing at.
* @param z The z coordinate to start drawing at.
*/
void DrawStringTexture(char* string, float x, float y, float z);
protected:
/** Pointer to the font data. */
BMF_FontData* m_fontData;
};
#endif // __BMF_BITMAP_FONT_H

@ -0,0 +1,57 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
/**
* $Id$
* Copyright (C) 2001 NaN Technologies B.V.
*/
#ifndef __BMF_FONTDATA_H__
#define __BMF_FONTDATA_H__
typedef struct {
signed char width, height;
signed char xorig, yorig;
signed char advance;
short data_offset;
} BMF_CharData;
typedef struct {
int xmin, ymin;
int xmax, ymax;
BMF_CharData chars[256];
unsigned char* bitmap_data;
} BMF_FontData;
#endif

@ -0,0 +1,493 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "BMF_FontData.h"
#include "BMF_Settings.h"
#if BMF_INCLUDE_HELV10
static unsigned char bitmap_data[]= {
0x80,0x00,0x80,0x80,0x80,0x80,0x80,0x80,
0xa0,0xa0,0x50,0x50,0xf8,0x28,0x7c,0x28,
0x28,0x20,0x70,0xa8,0x28,0x70,0xa0,0xa8,
0x70,0x20,0x26,0x29,0x16,0x10,0x08,0x68,
0x94,0x64,0x64,0x98,0x98,0xa4,0x60,0x50,
0x50,0x20,0x80,0x40,0x40,0x20,0x40,0x40,
0x80,0x80,0x80,0x80,0x40,0x40,0x20,0x80,
0x40,0x40,0x20,0x20,0x20,0x20,0x40,0x40,
0x80,0xa0,0x40,0xa0,0x20,0x20,0xf8,0x20,
0x20,0x80,0x40,0x40,0xf8,0x80,0x80,0x80,
0x40,0x40,0x40,0x40,0x20,0x20,0x70,0x88,
0x88,0x88,0x88,0x88,0x88,0x70,0x40,0x40,
0x40,0x40,0x40,0x40,0xc0,0x40,0xf8,0x80,
0x40,0x30,0x08,0x08,0x88,0x70,0x70,0x88,
0x08,0x08,0x30,0x08,0x88,0x70,0x10,0x10,
0xf8,0x90,0x50,0x50,0x30,0x10,0x70,0x88,
0x08,0x08,0xf0,0x80,0x80,0xf8,0x70,0x88,
0x88,0xc8,0xb0,0x80,0x88,0x70,0x40,0x40,
0x20,0x20,0x10,0x10,0x08,0xf8,0x70,0x88,
0x88,0x88,0x70,0x88,0x88,0x70,0x70,0x88,
0x08,0x68,0x98,0x88,0x88,0x70,0x80,0x00,
0x00,0x00,0x00,0x80,0x80,0x40,0x40,0x00,
0x00,0x00,0x00,0x40,0x20,0x40,0x80,0x40,
0x20,0xf0,0x00,0xf0,0x80,0x40,0x20,0x40,
0x80,0x40,0x00,0x40,0x40,0x20,0x10,0x90,
0x60,0x3e,0x00,0x40,0x00,0x9b,0x00,0xa4,
0x80,0xa4,0x80,0xa2,0x40,0x92,0x40,0x4d,
0x40,0x20,0x80,0x1f,0x00,0x82,0x82,0x7c,
0x44,0x28,0x28,0x10,0x10,0xf0,0x88,0x88,
0x88,0xf0,0x88,0x88,0xf0,0x78,0x84,0x80,
0x80,0x80,0x80,0x84,0x78,0xf0,0x88,0x84,
0x84,0x84,0x84,0x88,0xf0,0xf8,0x80,0x80,
0x80,0xf8,0x80,0x80,0xf8,0x80,0x80,0x80,
0x80,0xf0,0x80,0x80,0xf8,0x74,0x8c,0x84,
0x8c,0x80,0x80,0x84,0x78,0x84,0x84,0x84,
0x84,0xfc,0x84,0x84,0x84,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0x60,0x90,0x10,
0x10,0x10,0x10,0x10,0x10,0x88,0x88,0x90,
0x90,0xe0,0xa0,0x90,0x88,0xf0,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0x92,0x92,0x92,
0xaa,0xaa,0xc6,0xc6,0x82,0x8c,0x8c,0x94,
0x94,0xa4,0xa4,0xc4,0xc4,0x78,0x84,0x84,
0x84,0x84,0x84,0x84,0x78,0x80,0x80,0x80,
0x80,0xf0,0x88,0x88,0xf0,0x02,0x7c,0x8c,
0x94,0x84,0x84,0x84,0x84,0x78,0x88,0x88,
0x88,0x88,0xf0,0x88,0x88,0xf0,0x70,0x88,
0x88,0x08,0x70,0x80,0x88,0x70,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0xf8,0x78,0x84,
0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x28,
0x28,0x44,0x44,0x44,0x82,0x82,0x22,0x00,
0x22,0x00,0x22,0x00,0x55,0x00,0x49,0x00,
0x49,0x00,0x88,0x80,0x88,0x80,0x88,0x88,
0x50,0x50,0x20,0x50,0x88,0x88,0x10,0x10,
0x10,0x28,0x28,0x44,0x44,0x82,0xf8,0x80,
0x40,0x20,0x20,0x10,0x08,0xf8,0xc0,0x80,
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0,
0x20,0x20,0x40,0x40,0x40,0x40,0x80,0x80,
0xc0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0xc0,0x88,0x50,0x50,0x20,0x20,0xfc,
0x80,0x80,0x40,0x68,0x90,0x90,0x70,0x10,
0xe0,0xb0,0xc8,0x88,0x88,0xc8,0xb0,0x80,
0x80,0x60,0x90,0x80,0x80,0x90,0x60,0x68,
0x98,0x88,0x88,0x98,0x68,0x08,0x08,0x60,
0x90,0x80,0xf0,0x90,0x60,0x40,0x40,0x40,
0x40,0x40,0xe0,0x40,0x30,0x70,0x08,0x68,
0x98,0x88,0x88,0x98,0x68,0x88,0x88,0x88,
0x88,0xc8,0xb0,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x00,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,0x00,0x80,0x90,0x90,
0xa0,0xc0,0xa0,0x90,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0x80,0x92,0x92,
0x92,0x92,0x92,0xec,0x88,0x88,0x88,0x88,
0xc8,0xb0,0x70,0x88,0x88,0x88,0x88,0x70,
0x80,0x80,0xb0,0xc8,0x88,0x88,0xc8,0xb0,
0x08,0x08,0x68,0x98,0x88,0x88,0x98,0x68,
0x80,0x80,0x80,0x80,0xc0,0xa0,0x60,0x90,
0x10,0x60,0x90,0x60,0x60,0x40,0x40,0x40,
0x40,0xe0,0x40,0x40,0x70,0x90,0x90,0x90,
0x90,0x90,0x20,0x20,0x50,0x50,0x88,0x88,
0x28,0x28,0x54,0x54,0x92,0x92,0x88,0x88,
0x50,0x20,0x50,0x88,0x80,0x40,0x40,0x60,
0xa0,0xa0,0x90,0x90,0xf0,0x80,0x40,0x20,
0x10,0xf0,0x20,0x40,0x40,0x40,0x40,0x80,
0x40,0x40,0x40,0x20,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x40,
0x40,0x40,0x40,0x20,0x40,0x40,0x40,0x80,
0x98,0x64,0x80,0x80,0x80,0x80,0x80,0x80,
0x00,0x80,0x40,0x70,0xa8,0xa0,0xa0,0xa8,
0x70,0x10,0xb0,0x48,0x40,0x40,0xe0,0x40,
0x48,0x30,0x90,0x60,0x90,0x90,0x60,0x90,
0x20,0xf8,0x20,0xf8,0x50,0x50,0x88,0x88,
0x80,0x80,0x80,0x80,0x00,0x00,0x80,0x80,
0x80,0x80,0x70,0x88,0x18,0x70,0xc8,0x98,
0x70,0xc0,0x88,0x70,0xa0,0x38,0x44,0x9a,
0xa2,0x9a,0x44,0x38,0xe0,0x00,0xa0,0x20,
0xe0,0x28,0x50,0xa0,0x50,0x28,0x08,0x08,
0xf8,0xe0,0x38,0x44,0xaa,0xb2,0xba,0x44,
0x38,0xe0,0x60,0x90,0x90,0x60,0xf8,0x00,
0x20,0x20,0xf8,0x20,0x20,0xe0,0x40,0xa0,
0x60,0xc0,0x20,0x40,0xe0,0x80,0x40,0x80,
0x80,0xf0,0x90,0x90,0x90,0x90,0x90,0x28,
0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,
0x7c,0xc0,0xc0,0x40,0x40,0x40,0xc0,0x40,
0xe0,0x00,0xe0,0xa0,0xe0,0xa0,0x50,0x28,
0x50,0xa0,0x21,0x00,0x17,0x80,0x13,0x00,
0x09,0x00,0x48,0x00,0x44,0x00,0xc4,0x00,
0x42,0x00,0x27,0x12,0x15,0x0b,0x48,0x44,
0xc4,0x42,0x21,0x00,0x17,0x80,0x13,0x00,
0x09,0x00,0xc8,0x00,0x24,0x00,0x44,0x00,
0xe2,0x00,0x60,0x90,0x80,0x40,0x20,0x20,
0x00,0x20,0x82,0x82,0x7c,0x44,0x28,0x28,
0x10,0x10,0x00,0x10,0x20,0x82,0x82,0x7c,
0x44,0x28,0x28,0x10,0x10,0x00,0x10,0x08,
0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,
0x00,0x28,0x10,0x82,0x82,0x7c,0x44,0x28,
0x28,0x10,0x10,0x00,0x28,0x14,0x82,0x82,
0x7c,0x44,0x28,0x28,0x10,0x10,0x00,0x28,
0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,
0x10,0x28,0x10,0x8f,0x80,0x88,0x00,0x78,
0x00,0x48,0x00,0x2f,0x80,0x28,0x00,0x18,
0x00,0x1f,0x80,0x30,0x10,0x78,0x84,0x80,
0x80,0x80,0x80,0x84,0x78,0xf8,0x80,0x80,
0x80,0xf8,0x80,0x80,0xf8,0x00,0x20,0x40,
0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,
0x00,0x20,0x10,0xf8,0x80,0x80,0xf8,0x80,
0x80,0x80,0xf8,0x00,0x50,0x20,0xf8,0x80,
0x80,0x80,0xf8,0x80,0x80,0xf8,0x00,0x50,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x00,0x40,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x00,0x80,0x40,0x40,0x40,
0x40,0x40,0x40,0x40,0x40,0x40,0x00,0xa0,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0x00,0xa0,0x78,0x44,0x42,0x42,0xf2,
0x42,0x44,0x78,0x8c,0x8c,0x94,0x94,0xa4,
0xa4,0xc4,0xc4,0x00,0x50,0x28,0x78,0x84,
0x84,0x84,0x84,0x84,0x84,0x78,0x00,0x10,
0x20,0x78,0x84,0x84,0x84,0x84,0x84,0x84,
0x78,0x00,0x10,0x08,0x78,0x84,0x84,0x84,
0x84,0x84,0x84,0x78,0x00,0x28,0x10,0x78,
0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x00,
0x50,0x28,0x78,0x84,0x84,0x84,0x84,0x84,
0x84,0x78,0x00,0x48,0x88,0x50,0x20,0x50,
0x88,0x80,0x78,0xc4,0xa4,0xa4,0x94,0x94,
0x8c,0x78,0x04,0x78,0x84,0x84,0x84,0x84,
0x84,0x84,0x84,0x00,0x10,0x20,0x78,0x84,
0x84,0x84,0x84,0x84,0x84,0x84,0x00,0x20,
0x10,0x78,0x84,0x84,0x84,0x84,0x84,0x84,
0x84,0x00,0x28,0x10,0x78,0x84,0x84,0x84,
0x84,0x84,0x84,0x84,0x00,0x48,0x10,0x10,
0x10,0x28,0x28,0x44,0x44,0x82,0x00,0x10,
0x08,0x80,0x80,0xf0,0x88,0x88,0xf0,0x80,
0x80,0xa0,0x90,0x90,0x90,0xa0,0x90,0x90,
0x60,0x68,0x90,0x90,0x70,0x10,0xe0,0x00,
0x20,0x40,0x68,0x90,0x90,0x70,0x10,0xe0,
0x00,0x20,0x10,0x68,0x90,0x90,0x70,0x10,
0xe0,0x00,0x50,0x20,0x68,0x90,0x90,0x70,
0x10,0xe0,0x00,0xa0,0x50,0x68,0x90,0x90,
0x70,0x10,0xe0,0x00,0x50,0x68,0x90,0x90,
0x70,0x10,0xe0,0x20,0x50,0x20,0x6c,0x92,
0x90,0x7e,0x12,0xec,0x60,0x20,0x60,0x90,
0x80,0x80,0x90,0x60,0x60,0x90,0x80,0xf0,
0x90,0x60,0x00,0x20,0x40,0x60,0x90,0x80,
0xf0,0x90,0x60,0x00,0x40,0x20,0x60,0x90,
0x80,0xf0,0x90,0x60,0x00,0x50,0x20,0x60,
0x90,0x80,0xf0,0x90,0x60,0x00,0x50,0x40,
0x40,0x40,0x40,0x40,0x40,0x00,0x40,0x80,
0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x80,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,
0xa0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x00,0xa0,0x70,0x88,0x88,0x88,0x88,0x78,
0x90,0x60,0x50,0x90,0x90,0x90,0x90,0x90,
0xe0,0x00,0xa0,0x50,0x70,0x88,0x88,0x88,
0x88,0x70,0x00,0x20,0x40,0x70,0x88,0x88,
0x88,0x88,0x70,0x00,0x20,0x10,0x70,0x88,
0x88,0x88,0x88,0x70,0x00,0x50,0x20,0x70,
0x88,0x88,0x88,0x88,0x70,0x00,0x50,0x28,
0x70,0x88,0x88,0x88,0x88,0x70,0x00,0x50,
0x20,0x00,0xf8,0x00,0x20,0x70,0x88,0xc8,
0xa8,0x98,0x74,0x70,0x90,0x90,0x90,0x90,
0x90,0x00,0x20,0x40,0x70,0x90,0x90,0x90,
0x90,0x90,0x00,0x40,0x20,0x70,0x90,0x90,
0x90,0x90,0x90,0x00,0x50,0x20,0x70,0x90,
0x90,0x90,0x90,0x90,0x00,0x50,0x80,0x40,
0x40,0x60,0xa0,0xa0,0x90,0x90,0x00,0x20,
0x10,0x80,0x80,0xb0,0xc8,0x88,0x88,0xc8,
0xb0,0x80,0x80,0x80,0x40,0x40,0x60,0xa0,
0xa0,0x90,0x90,0x00,0x50,
};
BMF_FontData BMF_font_helv10 = {
-1, -2,
10, 11,
{
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0, 0, 0, 0, 12, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0, 0, 0, 0, 3, -1},
{1, 8, -1, 0, 3, 0},
{3, 2, -1, -6, 4, 8},
{6, 7, 0, 0, 6, 10},
{5, 9, 0, 1, 6, 17},
{8, 8, 0, 0, 9, 26},
{6, 8, -1, 0, 8, 34},
{2, 3, -1, -5, 3, 42},
{3, 10, 0, 2, 4, 45},
{3, 10, -1, 2, 4, 55},
{3, 3, 0, -5, 4, 65},
{5, 5, 0, -1, 6, 68},
{2, 3, 0, 2, 3, 73},
{5, 1, -1, -3, 7, 76},
{1, 1, -1, 0, 3, 77},
{3, 8, 0, 0, 3, 78},
{5, 8, 0, 0, 6, 86},
{2, 8, -1, 0, 6, 94},
{5, 8, 0, 0, 6, 102},
{5, 8, 0, 0, 6, 110},
{5, 8, 0, 0, 6, 118},
{5, 8, 0, 0, 6, 126},
{5, 8, 0, 0, 6, 134},
{5, 8, 0, 0, 6, 142},
{5, 8, 0, 0, 6, 150},
{5, 8, 0, 0, 6, 158},
{1, 6, -1, 0, 3, 166},
{2, 8, 0, 2, 3, 172},
{3, 5, -1, -1, 6, 180},
{4, 3, 0, -2, 5, 185},
{3, 5, -1, -1, 6, 188},
{4, 8, -1, 0, 6, 193},
{10, 10, 0, 2, 11, 201},
{7, 8, 0, 0, 7, 221},
{5, 8, -1, 0, 7, 229},
{6, 8, -1, 0, 8, 237},
{6, 8, -1, 0, 8, 245},
{5, 8, -1, 0, 7, 253},
{5, 8, -1, 0, 6, 261},
{6, 8, -1, 0, 8, 269},
{6, 8, -1, 0, 8, 277},
{1, 8, -1, 0, 3, 285},
{4, 8, 0, 0, 5, 293},
{5, 8, -1, 0, 7, 301},
{4, 8, -1, 0, 6, 309},
{7, 8, -1, 0, 9, 317},
{6, 8, -1, 0, 8, 325},
{6, 8, -1, 0, 8, 333},
{5, 8, -1, 0, 7, 341},
{7, 9, -1, 1, 8, 349},
{5, 8, -1, 0, 7, 358},
{5, 8, -1, 0, 7, 366},
{5, 8, 0, 0, 5, 374},
{6, 8, -1, 0, 8, 382},
{7, 8, 0, 0, 7, 390},
{9, 8, 0, 0, 9, 398},
{5, 8, -1, 0, 7, 414},
{7, 8, 0, 0, 7, 422},
{5, 8, -1, 0, 7, 430},
{2, 10, -1, 2, 3, 438},
{3, 8, 0, 0, 3, 448},
{2, 10, 0, 2, 3, 456},
{5, 5, 0, -3, 6, 466},
{6, 1, 0, 2, 6, 471},
{2, 3, 0, -5, 3, 472},
{5, 6, 0, 0, 5, 475},
{5, 8, 0, 0, 6, 481},
{4, 6, 0, 0, 5, 489},
{5, 8, 0, 0, 6, 495},
{4, 6, 0, 0, 5, 503},
{4, 8, 0, 0, 4, 509},
{5, 8, 0, 2, 6, 517},
{5, 8, 0, 0, 6, 525},
{1, 8, 0, 0, 2, 533},
{1, 9, 0, 1, 2, 541},
{4, 8, 0, 0, 5, 550},
{1, 8, 0, 0, 2, 558},
{7, 6, 0, 0, 8, 566},
{5, 6, 0, 0, 6, 572},
{5, 6, 0, 0, 6, 578},
{5, 8, 0, 2, 6, 584},
{5, 8, 0, 2, 6, 592},
{3, 6, 0, 0, 4, 600},
{4, 6, 0, 0, 5, 606},
{3, 8, 0, 0, 4, 612},
{4, 6, 0, 0, 5, 620},
{5, 6, 0, 0, 6, 626},
{7, 6, 0, 0, 8, 632},
{5, 6, 0, 0, 6, 638},
{4, 8, 0, 2, 5, 644},
{4, 6, 0, 0, 5, 652},
{3, 10, 0, 2, 3, 658},
{1, 10, -1, 2, 3, 668},
{3, 10, 0, 2, 3, 678},
{6, 2, 0, -3, 7, 688},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0, 0, 0, 0, 3, -1},
{1, 8, -1, 2, 3, 690},
{5, 8, 0, 1, 6, 698},
{5, 8, 0, 0, 6, 706},
{4, 6, 0, -1, 5, 714},
{5, 8, 0, 0, 6, 720},
{1, 10, -1, 2, 3, 728},
{5, 10, 0, 2, 6, 738},
{3, 1, 0, -7, 3, 748},
{7, 7, -1, 0, 9, 749},
{3, 5, 0, -3, 4, 756},
{5, 5, 0, 0, 6, 761},
{5, 3, -1, -2, 7, 766},
{3, 1, 0, -3, 4, 769},
{7, 7, -1, 0, 9, 770},
{3, 1, 0, -7, 3, 777},
{4, 4, 0, -3, 4, 778},
{5, 7, 0, 0, 6, 782},
{3, 4, 0, -3, 3, 789},
{3, 4, 0, -3, 3, 793},
{2, 2, 0, -6, 3, 797},
{4, 8, 0, 2, 5, 799},
{6, 10, 0, 2, 6, 807},
{2, 1, 0, -3, 3, 817},
{2, 2, 0, 2, 3, 818},
{2, 4, 0, -3, 3, 820},
{3, 5, 0, -3, 4, 824},
{5, 5, 0, 0, 6, 829},
{9, 8, 0, 0, 9, 834},
{8, 8, 0, 0, 9, 850},
{9, 8, 0, 0, 9, 858},
{4, 8, -1, 2, 6, 874},
{7, 11, 0, 0, 7, 882},
{7, 11, 0, 0, 7, 893},
{7, 11, 0, 0, 7, 904},
{7, 11, 0, 0, 7, 915},
{7, 10, 0, 0, 7, 926},
{7, 11, 0, 0, 7, 936},
{9, 8, 0, 0, 10, 947},
{6, 10, -1, 2, 8, 963},
{5, 11, -1, 0, 7, 973},
{5, 11, -1, 0, 7, 984},
{5, 11, -1, 0, 7, 995},
{5, 10, -1, 0, 7, 1006},
{2, 11, 0, 0, 3, 1016},
{2, 11, -1, 0, 3, 1027},
{3, 11, 0, 0, 3, 1038},
{3, 10, 0, 0, 3, 1049},
{7, 8, 0, 0, 8, 1059},
{6, 11, -1, 0, 8, 1067},
{6, 11, -1, 0, 8, 1078},
{6, 11, -1, 0, 8, 1089},
{6, 11, -1, 0, 8, 1100},
{6, 11, -1, 0, 8, 1111},
{6, 10, -1, 0, 8, 1122},
{5, 5, 0, -1, 6, 1132},
{6, 10, -1, 1, 8, 1137},
{6, 11, -1, 0, 8, 1147},
{6, 11, -1, 0, 8, 1158},
{6, 11, -1, 0, 8, 1169},
{6, 10, -1, 0, 8, 1180},
{7, 11, 0, 0, 7, 1190},
{5, 8, -1, 0, 7, 1201},
{4, 8, 0, 0, 5, 1209},
{5, 9, 0, 0, 5, 1217},
{5, 9, 0, 0, 5, 1226},
{5, 9, 0, 0, 5, 1235},
{5, 9, 0, 0, 5, 1244},
{5, 8, 0, 0, 5, 1253},
{5, 9, 0, 0, 5, 1261},
{7, 6, 0, 0, 8, 1270},
{4, 8, 0, 2, 5, 1276},
{4, 9, 0, 0, 5, 1284},
{4, 9, 0, 0, 5, 1293},
{4, 9, 0, 0, 5, 1302},
{4, 8, 0, 0, 5, 1311},
{2, 9, 1, 0, 2, 1319},
{2, 9, 0, 0, 2, 1328},
{3, 9, 1, 0, 2, 1337},
{3, 8, 0, 0, 2, 1346},
{5, 9, 0, 0, 6, 1354},
{4, 9, 0, 0, 5, 1363},
{5, 9, 0, 0, 6, 1372},
{5, 9, 0, 0, 6, 1381},
{5, 9, 0, 0, 6, 1390},
{5, 9, 0, 0, 6, 1399},
{5, 8, 0, 0, 6, 1408},
{5, 5, 0, -1, 6, 1416},
{6, 6, 0, 0, 6, 1421},
{4, 9, 0, 0, 5, 1427},
{4, 9, 0, 0, 5, 1436},
{4, 9, 0, 0, 5, 1445},
{4, 8, 0, 0, 5, 1454},
{4, 11, 0, 2, 5, 1462},
{5, 10, 0, 2, 6, 1473},
{4, 10, 0, 2, 5, 1483},
},
bitmap_data
};
#endif

@ -0,0 +1,525 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "BMF_FontData.h"
#include "BMF_Settings.h"
#if BMF_INCLUDE_HELV12
static unsigned char bitmap_data[]= {
0x80,0x00,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0xa0,0xa0,0xa0,0x50,0x50,0x50,0xfc,
0x28,0xfc,0x28,0x28,0x20,0x70,0xa8,0xa8,
0x28,0x70,0xa0,0xa8,0x70,0x20,0x23,0x00,
0x14,0x80,0x14,0x80,0x13,0x00,0x08,0x00,
0x68,0x00,0x94,0x00,0x94,0x00,0x62,0x00,
0x72,0x8c,0x84,0x8a,0x50,0x30,0x48,0x48,
0x30,0x80,0x40,0xc0,0x20,0x40,0x40,0x80,
0x80,0x80,0x80,0x80,0x80,0x40,0x40,0x20,
0x80,0x40,0x40,0x20,0x20,0x20,0x20,0x20,
0x20,0x40,0x40,0x80,0xa0,0x40,0xa0,0x20,
0x20,0xf8,0x20,0x20,0x80,0x40,0x40,0xf8,
0x80,0x80,0x80,0x40,0x40,0x40,0x20,0x20,
0x10,0x10,0x70,0x88,0x88,0x88,0x88,0x88,
0x88,0x88,0x70,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0xe0,0x20,0xf8,0x80,0x80,0x40,
0x20,0x10,0x08,0x88,0x70,0x70,0x88,0x88,
0x08,0x08,0x30,0x08,0x88,0x70,0x08,0x08,
0xfc,0x88,0x48,0x28,0x28,0x18,0x08,0x70,
0x88,0x88,0x08,0x08,0xf0,0x80,0x80,0xf8,
0x70,0x88,0x88,0x88,0xc8,0xb0,0x80,0x88,
0x70,0x40,0x40,0x20,0x20,0x20,0x10,0x10,
0x08,0xf8,0x70,0x88,0x88,0x88,0x88,0x70,
0x88,0x88,0x70,0x70,0x88,0x08,0x08,0x78,
0x88,0x88,0x88,0x70,0x80,0x00,0x00,0x00,
0x00,0x80,0x80,0x40,0x40,0x00,0x00,0x00,
0x00,0x40,0x0c,0x30,0xc0,0x30,0x0c,0xf8,
0x00,0xf8,0xc0,0x30,0x0c,0x30,0xc0,0x20,
0x00,0x20,0x20,0x10,0x10,0x88,0x88,0x70,
0x3e,0x00,0x40,0x00,0x9b,0x00,0xa6,0x80,
0xa2,0x40,0xa2,0x40,0x92,0x40,0x4d,0x40,
0x60,0x80,0x1f,0x00,0x82,0x82,0x82,0x7c,
0x44,0x44,0x28,0x28,0x10,0xf8,0x84,0x84,
0x84,0xf8,0x84,0x84,0x84,0xf8,0x3c,0x42,
0x80,0x80,0x80,0x80,0x80,0x42,0x3c,0xf8,
0x84,0x82,0x82,0x82,0x82,0x82,0x84,0xf8,
0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,
0xfc,0x80,0x80,0x80,0x80,0xf8,0x80,0x80,
0x80,0xfc,0x3a,0x46,0x82,0x82,0x8e,0x80,
0x80,0x42,0x3c,0x82,0x82,0x82,0x82,0xfe,
0x82,0x82,0x82,0x82,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0x70,0x88,0x88,
0x08,0x08,0x08,0x08,0x08,0x08,0x82,0x84,
0x88,0x90,0xe0,0xa0,0x90,0x88,0x84,0xf8,
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
0x88,0x80,0x88,0x80,0x94,0x80,0x94,0x80,
0xa2,0x80,0xa2,0x80,0xc1,0x80,0xc1,0x80,
0x80,0x80,0x82,0x86,0x8a,0x8a,0x92,0xa2,
0xa2,0xc2,0x82,0x3c,0x42,0x81,0x81,0x81,
0x81,0x81,0x42,0x3c,0x80,0x80,0x80,0x80,
0xf8,0x84,0x84,0x84,0xf8,0x3d,0x42,0x85,
0x89,0x81,0x81,0x81,0x42,0x3c,0x84,0x84,
0x84,0x88,0xf8,0x84,0x84,0x84,0xf8,0x78,
0x84,0x84,0x04,0x18,0x60,0x80,0x84,0x78,
0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
0xfe,0x78,0x84,0x84,0x84,0x84,0x84,0x84,
0x84,0x84,0x10,0x10,0x28,0x28,0x44,0x44,
0x44,0x82,0x82,0x22,0x00,0x22,0x00,0x22,
0x00,0x55,0x00,0x55,0x00,0x49,0x00,0x88,
0x80,0x88,0x80,0x88,0x80,0x82,0x44,0x44,
0x28,0x10,0x28,0x44,0x44,0x82,0x10,0x10,
0x10,0x10,0x28,0x44,0x44,0x82,0x82,0xfe,
0x80,0x40,0x20,0x10,0x08,0x04,0x02,0xfe,
0xc0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0xc0,0x10,0x10,0x20,0x20,
0x20,0x40,0x40,0x80,0x80,0xc0,0x40,0x40,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0xc0,0x88,0x50,0x20,0xfe,0xc0,0x80,0x40,
0x74,0x88,0x88,0x78,0x08,0x88,0x70,0xb0,
0xc8,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80,
0x70,0x88,0x80,0x80,0x80,0x88,0x70,0x68,
0x98,0x88,0x88,0x88,0x98,0x68,0x08,0x08,
0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x40,
0x40,0x40,0x40,0x40,0x40,0xe0,0x40,0x30,
0x70,0x88,0x08,0x68,0x98,0x88,0x88,0x88,
0x98,0x68,0x88,0x88,0x88,0x88,0x88,0xc8,
0xb0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x00,0x80,0x80,0x40,0x40,0x40,
0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x40,
0x88,0x90,0xa0,0xc0,0xc0,0xa0,0x90,0x80,
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x92,0x92,0x92,0x92,0x92,0xda,
0xa4,0x88,0x88,0x88,0x88,0x88,0xc8,0xb0,
0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x80,
0x80,0x80,0xb0,0xc8,0x88,0x88,0x88,0xc8,
0xb0,0x08,0x08,0x08,0x68,0x98,0x88,0x88,
0x88,0x98,0x68,0x80,0x80,0x80,0x80,0x80,
0xc0,0xa0,0x60,0x90,0x10,0x60,0x80,0x90,
0x60,0x60,0x40,0x40,0x40,0x40,0x40,0xe0,
0x40,0x40,0x68,0x98,0x88,0x88,0x88,0x88,
0x88,0x20,0x20,0x50,0x50,0x88,0x88,0x88,
0x22,0x00,0x22,0x00,0x55,0x00,0x49,0x00,
0x49,0x00,0x88,0x80,0x88,0x80,0x84,0x84,
0x48,0x30,0x30,0x48,0x84,0x80,0x40,0x20,
0x20,0x50,0x50,0x90,0x88,0x88,0x88,0xf0,
0x80,0x40,0x40,0x20,0x10,0xf0,0x30,0x40,
0x40,0x40,0x40,0x40,0x80,0x40,0x40,0x40,
0x40,0x30,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0x80,0xc0,0x20,
0x20,0x20,0x20,0x20,0x10,0x20,0x20,0x20,
0x20,0xc0,0x98,0x64,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,0x00,0x80,0x40,0x70,
0xc8,0xa0,0xa0,0xa0,0xa8,0x70,0x10,0xb0,
0x48,0x20,0x20,0xf0,0x40,0x40,0x48,0x30,
0x84,0x78,0x48,0x48,0x78,0x84,0x20,0x20,
0xf8,0x20,0xf8,0x20,0x50,0x88,0x88,0x80,
0x80,0x80,0x80,0x00,0x00,0x00,0x80,0x80,
0x80,0x80,0x70,0x88,0x08,0x30,0x48,0x88,
0x88,0x90,0x60,0x80,0x88,0x70,0xa0,0x3e,
0x00,0x41,0x00,0x9c,0x80,0xa2,0x80,0xa0,
0x80,0xa2,0x80,0x9c,0x80,0x41,0x00,0x3e,
0x00,0xe0,0x00,0xa0,0x20,0xe0,0x28,0x50,
0xa0,0x50,0x28,0x04,0x04,0x04,0xfc,0xf0,
0x3e,0x00,0x41,0x00,0x94,0x80,0x94,0x80,
0x98,0x80,0x94,0x80,0x9c,0x80,0x41,0x00,
0x3e,0x00,0xf0,0x60,0x90,0x90,0x60,0xf8,
0x00,0x20,0x20,0xf8,0x20,0x20,0xf0,0x40,
0x20,0x90,0x60,0xc0,0x20,0x40,0x20,0xe0,
0x80,0x40,0x80,0x80,0x80,0xe8,0x98,0x88,
0x88,0x88,0x88,0x88,0x28,0x28,0x28,0x28,
0x28,0x28,0x68,0xe8,0xe8,0xe8,0x68,0x3c,
0x80,0xc0,0x20,0x20,0x40,0x40,0x40,0x40,
0xc0,0x40,0xe0,0x00,0xe0,0xa0,0xe0,0xa0,
0x50,0x28,0x50,0xa0,0x41,0x00,0x27,0x80,
0x15,0x00,0x13,0x00,0x49,0x00,0x44,0x00,
0x44,0x00,0xc2,0x00,0x41,0x00,0x47,0x80,
0x22,0x00,0x11,0x00,0x14,0x80,0x4b,0x00,
0x48,0x00,0x44,0x00,0xc2,0x00,0x41,0x00,
0x21,0x00,0x17,0x80,0x15,0x00,0x0b,0x00,
0xc9,0x00,0x24,0x00,0x44,0x00,0x22,0x00,
0xe1,0x00,0x70,0x88,0x88,0x40,0x40,0x20,
0x20,0x00,0x20,0x82,0x82,0x82,0x7c,0x44,
0x44,0x28,0x10,0x10,0x00,0x10,0x20,0x82,
0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,
0x00,0x10,0x08,0x82,0x82,0x82,0x7c,0x44,
0x44,0x28,0x10,0x10,0x00,0x28,0x10,0x82,
0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,
0x00,0x28,0x14,0x82,0x82,0x82,0x7c,0x44,
0x44,0x28,0x10,0x10,0x00,0x28,0x82,0x82,
0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x10,
0x28,0x10,0x8f,0x80,0x88,0x00,0x88,0x00,
0x78,0x00,0x4f,0x80,0x48,0x00,0x28,0x00,
0x28,0x00,0x1f,0x80,0x30,0x08,0x08,0x3c,
0x42,0x80,0x80,0x80,0x80,0x80,0x42,0x3c,
0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,
0xfc,0x00,0x10,0x20,0xfc,0x80,0x80,0x80,
0xfc,0x80,0x80,0x80,0xfc,0x00,0x10,0x08,
0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,
0xfc,0x00,0x28,0x10,0xfc,0x80,0x80,0x80,
0xfc,0x80,0x80,0x80,0xfc,0x00,0x28,0x40,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x00,0x40,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,0x00,0x80,0x40,0x40,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x00,0xa0,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0x40,0x40,0x40,0x00,0xa0,0x7c,0x42,
0x41,0x41,0xf1,0x41,0x41,0x42,0x7c,0x82,
0x86,0x8a,0x8a,0x92,0xa2,0xa2,0xc2,0x82,
0x00,0x28,0x14,0x3c,0x42,0x81,0x81,0x81,
0x81,0x81,0x42,0x3c,0x00,0x08,0x10,0x3c,
0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,
0x00,0x08,0x04,0x3c,0x42,0x81,0x81,0x81,
0x81,0x81,0x42,0x3c,0x00,0x14,0x08,0x3c,
0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,
0x00,0x28,0x14,0x3c,0x42,0x81,0x81,0x81,
0x81,0x81,0x42,0x3c,0x00,0x24,0x88,0x50,
0x20,0x50,0x88,0x80,0x00,0x5e,0x00,0x21,
0x00,0x50,0x80,0x48,0x80,0x44,0x80,0x44,
0x80,0x42,0x80,0x21,0x00,0x1e,0x80,0x00,
0x40,0x78,0x84,0x84,0x84,0x84,0x84,0x84,
0x84,0x84,0x00,0x10,0x20,0x78,0x84,0x84,
0x84,0x84,0x84,0x84,0x84,0x84,0x00,0x10,
0x08,0x78,0x84,0x84,0x84,0x84,0x84,0x84,
0x84,0x84,0x00,0x28,0x10,0x78,0x84,0x84,
0x84,0x84,0x84,0x84,0x84,0x84,0x00,0x48,
0x10,0x10,0x10,0x10,0x28,0x44,0x44,0x82,
0x82,0x00,0x10,0x08,0x80,0x80,0xf8,0x84,
0x84,0x84,0xf8,0x80,0x80,0xb0,0x88,0x88,
0x88,0xb0,0x88,0x88,0x88,0x70,0x74,0x88,
0x88,0x78,0x08,0x88,0x70,0x00,0x10,0x20,
0x74,0x88,0x88,0x78,0x08,0x88,0x70,0x00,
0x20,0x10,0x74,0x88,0x88,0x78,0x08,0x88,
0x70,0x00,0x50,0x20,0x74,0x88,0x88,0x78,
0x08,0x88,0x70,0x00,0x50,0x28,0x74,0x88,
0x88,0x78,0x08,0x88,0x70,0x00,0x50,0x74,
0x88,0x88,0x78,0x08,0x88,0x70,0x30,0x48,
0x30,0x77,0x00,0x88,0x80,0x88,0x00,0x7f,
0x80,0x08,0x80,0x88,0x80,0x77,0x00,0x60,
0x10,0x20,0x70,0x88,0x80,0x80,0x80,0x88,
0x70,0x70,0x88,0x80,0xf8,0x88,0x88,0x70,
0x00,0x20,0x40,0x70,0x88,0x80,0xf8,0x88,
0x88,0x70,0x00,0x20,0x10,0x70,0x88,0x80,
0xf8,0x88,0x88,0x70,0x00,0x50,0x20,0x70,
0x88,0x80,0xf8,0x88,0x88,0x70,0x00,0x50,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,
0x40,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x00,0x80,0x40,0x40,0x40,0x40,0x40,
0x40,0x40,0x40,0x00,0xa0,0x40,0x40,0x40,
0x40,0x40,0x40,0x40,0x40,0x00,0xa0,0x70,
0x88,0x88,0x88,0x88,0x78,0x08,0x50,0x30,
0x68,0x88,0x88,0x88,0x88,0x88,0xc8,0xb0,
0x00,0x50,0x28,0x70,0x88,0x88,0x88,0x88,
0x88,0x70,0x00,0x20,0x40,0x70,0x88,0x88,
0x88,0x88,0x88,0x70,0x00,0x20,0x10,0x70,
0x88,0x88,0x88,0x88,0x88,0x70,0x00,0x50,
0x20,0x70,0x88,0x88,0x88,0x88,0x88,0x70,
0x00,0x50,0x28,0x70,0x88,0x88,0x88,0x88,
0x88,0x70,0x00,0x50,0x20,0x00,0xf8,0x00,
0x20,0xb8,0x44,0x64,0x54,0x4c,0x44,0x3a,
0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x00,
0x20,0x40,0x68,0x98,0x88,0x88,0x88,0x88,
0x88,0x00,0x20,0x10,0x68,0x98,0x88,0x88,
0x88,0x88,0x88,0x00,0x50,0x20,0x68,0x98,
0x88,0x88,0x88,0x88,0x88,0x00,0x50,0x80,
0x40,0x20,0x20,0x50,0x50,0x90,0x88,0x88,
0x88,0x00,0x20,0x10,0x80,0x80,0x80,0xb0,
0xc8,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80,
0xc0,0x20,0x20,0x20,0x30,0x50,0x50,0x48,
0x88,0x88,0x00,0x50,
};
BMF_FontData BMF_font_helv12 = {
0, -3,
11, 12,
{
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0, 0, 0, 0, 16, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0, 0, 0, 0, 4, -1},
{1, 9, -1, 0, 3, 0},
{3, 3, -1, -6, 5, 9},
{6, 8, 0, 0, 7, 12},
{5, 10, -1, 1, 7, 20},
{9, 9, -1, 0, 11, 30},
{7, 9, -1, 0, 9, 48},
{2, 3, -1, -6, 3, 57},
{3, 12, -1, 3, 4, 60},
{3, 12, 0, 3, 4, 72},
{3, 3, -1, -6, 5, 84},
{5, 5, -1, -1, 7, 87},
{2, 3, -1, 2, 4, 92},
{5, 1, -1, -3, 8, 95},
{1, 1, -1, 0, 3, 96},
{4, 9, 0, 0, 4, 97},
{5, 9, -1, 0, 7, 106},
{3, 9, -1, 0, 7, 115},
{5, 9, -1, 0, 7, 124},
{5, 9, -1, 0, 7, 133},
{6, 9, 0, 0, 7, 142},
{5, 9, -1, 0, 7, 151},
{5, 9, -1, 0, 7, 160},
{5, 9, -1, 0, 7, 169},
{5, 9, -1, 0, 7, 178},
{5, 9, -1, 0, 7, 187},
{1, 6, -1, 0, 3, 196},
{2, 8, 0, 2, 3, 202},
{6, 5, 0, -1, 7, 210},
{5, 3, -1, -2, 7, 215},
{6, 5, -1, -1, 7, 218},
{5, 9, -1, 0, 7, 223},
{10, 10, -1, 1, 12, 232},
{7, 9, -1, 0, 9, 252},
{6, 9, -1, 0, 8, 261},
{7, 9, -1, 0, 9, 270},
{7, 9, -1, 0, 9, 279},
{6, 9, -1, 0, 8, 288},
{6, 9, -1, 0, 8, 297},
{7, 9, -1, 0, 9, 306},
{7, 9, -1, 0, 9, 315},
{1, 9, -1, 0, 3, 324},
{5, 9, -1, 0, 7, 333},
{7, 9, -1, 0, 8, 342},
{5, 9, -1, 0, 7, 351},
{9, 9, -1, 0, 11, 360},
{7, 9, -1, 0, 9, 378},
{8, 9, -1, 0, 10, 387},
{6, 9, -1, 0, 8, 396},
{8, 9, -1, 0, 10, 405},
{6, 9, -1, 0, 8, 414},
{6, 9, -1, 0, 8, 423},
{7, 9, 0, 0, 7, 432},
{6, 9, -1, 0, 8, 441},
{7, 9, -1, 0, 9, 450},
{9, 9, -1, 0, 11, 459},
{7, 9, -1, 0, 9, 477},
{7, 9, -1, 0, 9, 486},
{7, 9, -1, 0, 9, 495},
{2, 12, -1, 3, 3, 504},
{4, 9, 0, 0, 4, 516},
{2, 12, 0, 3, 3, 525},
{5, 3, 0, -5, 6, 537},
{7, 1, 0, 2, 7, 540},
{2, 3, 0, -6, 3, 541},
{6, 7, -1, 0, 7, 544},
{5, 9, -1, 0, 7, 551},
{5, 7, -1, 0, 7, 560},
{5, 9, -1, 0, 7, 567},
{5, 7, -1, 0, 7, 576},
{4, 9, 0, 0, 3, 583},
{5, 10, -1, 3, 7, 592},
{5, 9, -1, 0, 7, 602},
{1, 9, -1, 0, 3, 611},
{2, 12, 0, 3, 3, 620},
{5, 9, -1, 0, 6, 632},
{1, 9, -1, 0, 3, 641},
{7, 7, -1, 0, 9, 650},
{5, 7, -1, 0, 7, 657},
{5, 7, -1, 0, 7, 664},
{5, 10, -1, 3, 7, 671},
{5, 10, -1, 3, 7, 681},
{3, 7, -1, 0, 4, 691},
{4, 7, -1, 0, 6, 698},
{3, 9, 0, 0, 3, 705},
{5, 7, -1, 0, 7, 714},
{5, 7, -1, 0, 7, 721},
{9, 7, 0, 0, 9, 728},
{6, 7, 0, 0, 6, 742},
{5, 10, -1, 3, 7, 749},
{4, 7, -1, 0, 6, 759},
{4, 12, 0, 3, 4, 766},
{1, 12, -1, 3, 3, 778},
{4, 12, 0, 3, 4, 790},
{6, 2, 0, -3, 7, 802},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0, 0, 0, 0, 4, -1},
{1, 10, -1, 3, 3, 804},
{5, 9, -1, 1, 7, 814},
{5, 9, -1, 0, 7, 823},
{6, 6, 0, -1, 7, 832},
{5, 9, -1, 0, 7, 838},
{1, 11, -1, 2, 3, 847},
{5, 12, 0, 3, 6, 858},
{3, 1, 0, -8, 3, 870},
{9, 9, -1, 0, 11, 871},
{3, 5, -1, -4, 5, 889},
{5, 5, -1, -1, 7, 894},
{6, 4, -1, -2, 8, 899},
{4, 1, 0, -3, 5, 903},
{9, 9, -1, 0, 11, 904},
{4, 1, 0, -8, 4, 922},
{4, 4, 0, -4, 5, 923},
{5, 7, -1, 0, 7, 927},
{4, 5, 0, -3, 4, 934},
{3, 5, 0, -3, 4, 939},
{2, 2, 0, -8, 2, 944},
{5, 10, -1, 3, 7, 946},
{6, 12, 0, 3, 7, 956},
{1, 1, -1, -3, 3, 968},
{3, 4, 0, 3, 3, 969},
{2, 5, -1, -3, 4, 973},
{3, 5, -1, -4, 5, 978},
{5, 5, -1, -1, 7, 983},
{9, 9, 0, 0, 10, 988},
{9, 9, 0, 0, 10, 1006},
{9, 9, 0, 0, 10, 1024},
{5, 9, -1, 3, 7, 1042},
{7, 12, -1, 0, 9, 1051},
{7, 12, -1, 0, 9, 1063},
{7, 12, -1, 0, 9, 1075},
{7, 12, -1, 0, 9, 1087},
{7, 11, -1, 0, 9, 1099},
{7, 12, -1, 0, 9, 1110},
{9, 9, -1, 0, 11, 1122},
{7, 12, -1, 3, 9, 1140},
{6, 12, -1, 0, 8, 1152},
{6, 12, -1, 0, 8, 1164},
{6, 12, -1, 0, 8, 1176},
{6, 11, -1, 0, 8, 1188},
{2, 12, 0, 0, 3, 1199},
{2, 12, -1, 0, 3, 1211},
{3, 12, 0, 0, 3, 1223},
{3, 11, 0, 0, 3, 1235},
{8, 9, 0, 0, 9, 1246},
{7, 12, -1, 0, 9, 1255},
{8, 12, -1, 0, 10, 1267},
{8, 12, -1, 0, 10, 1279},
{8, 12, -1, 0, 10, 1291},
{8, 12, -1, 0, 10, 1303},
{8, 11, -1, 0, 10, 1315},
{5, 5, -1, -1, 7, 1326},
{10, 11, 0, 1, 10, 1331},
{6, 12, -1, 0, 8, 1353},
{6, 12, -1, 0, 8, 1365},
{6, 12, -1, 0, 8, 1377},
{6, 11, -1, 0, 8, 1389},
{7, 12, -1, 0, 9, 1400},
{6, 9, -1, 0, 8, 1412},
{5, 9, -1, 0, 7, 1421},
{6, 10, -1, 0, 7, 1430},
{6, 10, -1, 0, 7, 1440},
{6, 10, -1, 0, 7, 1450},
{6, 10, -1, 0, 7, 1460},
{6, 9, -1, 0, 7, 1470},
{6, 10, -1, 0, 7, 1479},
{9, 7, -1, 0, 11, 1489},
{5, 10, -1, 3, 7, 1503},
{5, 10, -1, 0, 7, 1513},
{5, 10, -1, 0, 7, 1523},
{5, 10, -1, 0, 7, 1533},
{5, 9, -1, 0, 7, 1543},
{2, 10, 0, 0, 3, 1552},
{2, 10, -1, 0, 3, 1562},
{3, 10, 0, 0, 3, 1572},
{3, 9, 0, 0, 3, 1582},
{5, 10, -1, 0, 7, 1591},
{5, 10, -1, 0, 7, 1601},
{5, 10, -1, 0, 7, 1611},
{5, 10, -1, 0, 7, 1621},
{5, 10, -1, 0, 7, 1631},
{5, 10, -1, 0, 7, 1641},
{5, 9, -1, 0, 7, 1651},
{5, 5, -1, -1, 7, 1660},
{7, 7, 0, 0, 7, 1665},
{5, 10, -1, 0, 7, 1672},
{5, 10, -1, 0, 7, 1682},
{5, 10, -1, 0, 7, 1692},
{5, 9, -1, 0, 7, 1702},
{5, 13, -1, 3, 7, 1711},
{5, 12, -1, 3, 7, 1724},
{5, 12, -1, 3, 7, 1736},
},
bitmap_data
};
#endif

@ -0,0 +1,492 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "BMF_FontData.h"
#include "BMF_Settings.h"
#if BMF_INCLUDE_HELVB10
static unsigned char bitmap_data[]= {
0x00,0xc0,0x00,0x80,0x80,0xc0,0xc0,0xc0,
0xc0,0xa0,0xa0,0xa0,0x50,0x50,0xfc,0x28,
0x7e,0x28,0x28,0x20,0x70,0xa8,0x28,0x38,
0x70,0xe0,0xa8,0x70,0x20,0x8c,0x56,0x2c,
0x10,0x10,0x68,0xb4,0x62,0x76,0xdc,0xcc,
0xde,0x70,0xd8,0xd8,0x70,0x80,0x40,0xc0,
0xc0,0x20,0x60,0x40,0xc0,0xc0,0xc0,0xc0,
0x40,0x60,0x20,0x80,0xc0,0x40,0x60,0x60,
0x60,0x60,0x40,0xc0,0x80,0xa0,0x40,0xa0,
0x30,0x30,0xfc,0x30,0x30,0x80,0x40,0xc0,
0xc0,0xf8,0xc0,0xc0,0x80,0x80,0x40,0x40,
0x20,0x20,0x10,0x10,0x70,0xd8,0xd8,0xd8,
0xd8,0xd8,0xd8,0x70,0x60,0x60,0x60,0x60,
0x60,0x60,0xe0,0x60,0xf8,0xc0,0x60,0x30,
0x18,0x18,0xd8,0x70,0x70,0xd8,0x18,0x18,
0x30,0x18,0xd8,0x70,0x18,0x18,0xfc,0x98,
0x58,0x38,0x18,0x08,0x70,0xd8,0x98,0x18,
0xf0,0xc0,0xc0,0xf8,0x70,0xd8,0xd8,0xd8,
0xf0,0xc0,0xd8,0x70,0x60,0x60,0x60,0x30,
0x30,0x18,0x18,0xf8,0x70,0xd8,0xd8,0xd8,
0x70,0xd8,0xd8,0x70,0x70,0xd8,0x18,0x78,
0xd8,0xd8,0xd8,0x70,0xc0,0xc0,0x00,0x00,
0xc0,0xc0,0x80,0x40,0xc0,0xc0,0x00,0x00,
0xc0,0xc0,0x30,0x60,0xc0,0x60,0x30,0xf8,
0x00,0xf8,0xc0,0x60,0x30,0x60,0xc0,0x60,
0x00,0x60,0x60,0x30,0x18,0xd8,0x70,0x3e,
0x00,0x40,0x00,0x9b,0x00,0xa4,0x80,0xa2,
0x40,0x92,0x40,0x4d,0x40,0x60,0x80,0x1f,
0x00,0xc6,0xc6,0xfe,0x6c,0x6c,0x6c,0x38,
0x38,0xf8,0xcc,0xcc,0xcc,0xf8,0xcc,0xcc,
0xf8,0x3c,0x66,0xc2,0xc0,0xc0,0xc2,0x66,
0x3c,0xf0,0xd8,0xcc,0xcc,0xcc,0xcc,0xd8,
0xf0,0xf8,0xc0,0xc0,0xc0,0xf8,0xc0,0xc0,
0xf8,0xc0,0xc0,0xc0,0xc0,0xf0,0xc0,0xc0,
0xf8,0x3a,0x66,0xc6,0xce,0xc0,0xc2,0x66,
0x3c,0xcc,0xcc,0xcc,0xcc,0xfc,0xcc,0xcc,
0xcc,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
0xc0,0x70,0xd8,0x18,0x18,0x18,0x18,0x18,
0x18,0xc6,0xcc,0xd8,0xf0,0xe0,0xf0,0xd8,
0xcc,0xf8,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
0xc0,0xc9,0x80,0xc9,0x80,0xdd,0x80,0xd5,
0x80,0xf7,0x80,0xe3,0x80,0xe3,0x80,0xc1,
0x80,0xc6,0xce,0xce,0xd6,0xd6,0xe6,0xe6,
0xc6,0x38,0x6c,0xc6,0xc6,0xc6,0xc6,0x6c,
0x38,0xc0,0xc0,0xc0,0xf8,0xcc,0xcc,0xcc,
0xf8,0x02,0x3c,0x6c,0xd6,0xc6,0xc6,0xc6,
0x6c,0x38,0xcc,0xcc,0xcc,0xf8,0xcc,0xcc,
0xcc,0xf8,0x78,0xcc,0x8c,0x1c,0x78,0xe0,
0xcc,0x78,0x30,0x30,0x30,0x30,0x30,0x30,
0x30,0xfc,0x78,0xcc,0xcc,0xcc,0xcc,0xcc,
0xcc,0xcc,0x10,0x38,0x38,0x6c,0x6c,0x6c,
0xc6,0xc6,0x33,0x00,0x33,0x00,0x7f,0x80,
0x6d,0x80,0x6d,0x80,0xcc,0xc0,0xcc,0xc0,
0xcc,0xc0,0xc6,0xc6,0x6c,0x38,0x38,0x6c,
0xc6,0xc6,0x18,0x18,0x18,0x3c,0x66,0x66,
0xc3,0xc3,0xfc,0xc0,0x60,0x70,0x30,0x18,
0x0c,0xfc,0xe0,0xc0,0xc0,0xc0,0xc0,0xc0,
0xc0,0xc0,0xc0,0xe0,0x10,0x10,0x20,0x20,
0x40,0x40,0x80,0x80,0xe0,0x60,0x60,0x60,
0x60,0x60,0x60,0x60,0x60,0xe0,0x90,0x90,
0xf0,0x60,0xfc,0xc0,0xc0,0x80,0x40,0x6c,
0xd8,0xd8,0x78,0x98,0x70,0xf0,0xd8,0xd8,
0xd8,0xd8,0xf0,0xc0,0xc0,0x70,0xd0,0xc0,
0xc0,0xd0,0x70,0x78,0xd8,0xd8,0xd8,0xd8,
0x78,0x18,0x18,0x70,0xd8,0xc0,0xf8,0xd8,
0x70,0x60,0x60,0x60,0x60,0x60,0xf0,0x60,
0x38,0x70,0x18,0x78,0xd8,0xd8,0xd8,0xd8,
0x68,0xd8,0xd8,0xd8,0xd8,0xd8,0xf0,0xc0,
0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x00,
0xc0,0xc0,0x60,0x60,0x60,0x60,0x60,0x60,
0x60,0x00,0x60,0xcc,0xd8,0xf0,0xe0,0xf0,
0xd8,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
0xc0,0xc0,0xc0,0xdb,0xdb,0xdb,0xdb,0xdb,
0xb6,0xd8,0xd8,0xd8,0xd8,0xd8,0xb0,0x70,
0xd8,0xd8,0xd8,0xd8,0x70,0xc0,0xc0,0xf0,
0xd8,0xd8,0xd8,0xd8,0xb0,0x18,0x18,0x78,
0xd8,0xd8,0xd8,0xd8,0x68,0xc0,0xc0,0xc0,
0xc0,0xe0,0xb0,0x70,0xd8,0x18,0x70,0xd8,
0x70,0x30,0x60,0x60,0x60,0x60,0xf0,0x60,
0x60,0x68,0xd8,0xd8,0xd8,0xd8,0xd8,0x20,
0x70,0x50,0xd8,0xd8,0xd8,0x6c,0x6c,0x6c,
0xd6,0xd6,0xd6,0xcc,0xcc,0x78,0x30,0x78,
0xcc,0x60,0x30,0x30,0x78,0xd8,0xd8,0xd8,
0xd8,0xf8,0xc0,0x60,0x30,0x18,0xf8,0x30,
0x60,0x60,0x60,0x60,0xc0,0x60,0x60,0x60,
0x30,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0xc0,0x60,0x60,0x60,0x60,
0x30,0x60,0x60,0x60,0xc0,0xb0,0x68,0x00,
0xc0,0xc0,0xc0,0xc0,0x40,0x40,0x00,0xc0,
0x40,0x70,0xd8,0xa0,0xa0,0xd8,0x70,0x10,
0xd8,0x68,0x60,0x60,0xf0,0x60,0x68,0x38,
0x84,0x78,0x48,0x48,0x78,0x84,0x30,0xfc,
0x30,0xfc,0x48,0xcc,0x84,0x84,0x80,0x80,
0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x80,
0x70,0x98,0x38,0x70,0xc8,0x98,0x70,0xe0,
0xc8,0x70,0xa0,0x3c,0x42,0x9d,0xa1,0xa5,
0x99,0x42,0x3c,0xe0,0x00,0xa0,0x20,0xe0,
0x6c,0xd8,0x6c,0x08,0x08,0xf8,0xf0,0x3c,
0x42,0xa5,0xb9,0xa5,0xbd,0x42,0x3c,0xe0,
0xc0,0xa0,0x60,0xfc,0x00,0x30,0x30,0xfc,
0x30,0x30,0xe0,0x40,0xa0,0x60,0xc0,0x20,
0x40,0xe0,0x80,0x40,0xc0,0xc0,0xe8,0xd8,
0xd8,0xd8,0xd8,0xd8,0x28,0x28,0x28,0x28,
0x28,0x68,0xe8,0xe8,0xe8,0x7c,0xc0,0xc0,
0x40,0x40,0x40,0xc0,0x40,0xe0,0x00,0xe0,
0xa0,0xe0,0xd8,0x6c,0xd8,0x42,0x2f,0x26,
0x12,0x48,0x48,0xc4,0x44,0x4e,0x24,0x2a,
0x16,0x48,0x48,0xc4,0x44,0x42,0x2f,0x26,
0x12,0xc8,0x28,0x44,0xe4,0x70,0xd8,0xc0,
0x60,0x30,0x30,0x00,0x30,0xc6,0xc6,0xfe,
0x6c,0x6c,0x6c,0x38,0x38,0x00,0x10,0x20,
0xc6,0xc6,0xfe,0x6c,0x6c,0x6c,0x38,0x38,
0x00,0x10,0x08,0xc6,0xc6,0xfe,0x6c,0x6c,
0x6c,0x38,0x38,0x00,0x28,0x10,0xc6,0xc6,
0xfe,0x6c,0x6c,0x6c,0x38,0x38,0x00,0x28,
0x14,0xc6,0xc6,0xfe,0x6c,0x6c,0x6c,0x38,
0x38,0x00,0x28,0xc6,0xc6,0xfe,0x6c,0x6c,
0x6c,0x38,0x38,0x10,0x28,0x10,0xcf,0x80,
0xcc,0x00,0xfc,0x00,0x6c,0x00,0x6f,0x80,
0x6c,0x00,0x3c,0x00,0x3f,0x80,0x30,0x10,
0x3c,0x66,0xc2,0xc0,0xc0,0xc2,0x66,0x3c,
0xf8,0xc0,0xc0,0xc0,0xf8,0xc0,0xc0,0xf8,
0x00,0x20,0x40,0xf8,0xc0,0xc0,0xc0,0xf8,
0xc0,0xc0,0xf8,0x00,0x20,0x10,0xf8,0xc0,
0xc0,0xc0,0xf8,0xc0,0xc0,0xf8,0x00,0x50,
0x20,0xf8,0xc0,0xc0,0xc0,0xf8,0xc0,0xc0,
0xf8,0x00,0x50,0xc0,0xc0,0xc0,0xc0,0xc0,
0xc0,0xc0,0xc0,0x00,0x40,0x80,0xc0,0xc0,
0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x00,0x80,
0x40,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
0x60,0x00,0xa0,0x40,0x60,0x60,0x60,0x60,
0x60,0x60,0x60,0x60,0x00,0x90,0x78,0x6c,
0x66,0x66,0xf6,0x66,0x6c,0x78,0xc6,0xce,
0xce,0xd6,0xd6,0xe6,0xe6,0xc6,0x00,0x28,
0x14,0x38,0x6c,0xc6,0xc6,0xc6,0xc6,0x6c,
0x38,0x00,0x08,0x10,0x38,0x6c,0xc6,0xc6,
0xc6,0xc6,0x6c,0x38,0x00,0x10,0x08,0x38,
0x6c,0xc6,0xc6,0xc6,0xc6,0x6c,0x38,0x00,
0x28,0x10,0x38,0x6c,0xc6,0xc6,0xc6,0xc6,
0x6c,0x38,0x00,0x28,0x14,0x38,0x6c,0xc6,
0xc6,0xc6,0xc6,0x6c,0x38,0x00,0x28,0xcc,
0x78,0x30,0x78,0xcc,0xb8,0x6c,0xe6,0xd6,
0xd6,0xce,0x6c,0x3a,0x78,0xcc,0xcc,0xcc,
0xcc,0xcc,0xcc,0xcc,0x00,0x10,0x20,0x78,
0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x00,
0x10,0x08,0x78,0xcc,0xcc,0xcc,0xcc,0xcc,
0xcc,0xcc,0x00,0x50,0x20,0x78,0xcc,0xcc,
0xcc,0xcc,0xcc,0xcc,0xcc,0x00,0x48,0x18,
0x18,0x18,0x3c,0x66,0x66,0xc3,0xc3,0x00,
0x08,0x04,0xc0,0xc0,0xf8,0xcc,0xcc,0xcc,
0xf8,0xc0,0xd0,0xc8,0xc8,0xc8,0xd0,0xc8,
0xc8,0x70,0x6c,0xd8,0xd8,0x78,0x98,0x70,
0x00,0x10,0x20,0x6c,0xd8,0xd8,0x78,0x98,
0x70,0x00,0x20,0x10,0x6c,0xd8,0xd8,0x78,
0x98,0x70,0x00,0x50,0x20,0x6c,0xd8,0xd8,
0x78,0x98,0x70,0x00,0x50,0x28,0x6c,0xd8,
0xd8,0x78,0x98,0x70,0x00,0x50,0x6c,0xd8,
0xd8,0x78,0x98,0x70,0x20,0x50,0x20,0x6e,
0xdb,0xd8,0x7f,0x9b,0x7e,0x60,0x20,0x70,
0xd0,0xc0,0xc0,0xd0,0x70,0x70,0xd8,0xc0,
0xf8,0xd8,0x70,0x00,0x20,0x40,0x70,0xd8,
0xc0,0xf8,0xd8,0x70,0x00,0x20,0x10,0x70,
0xd8,0xc0,0xf8,0xd8,0x70,0x00,0x50,0x20,
0x70,0xd8,0xc0,0xf8,0xd8,0x70,0x00,0x50,
0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x00,0x40,
0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x00,
0x80,0x40,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
0x00,0xa0,0x40,0xc0,0xc0,0xc0,0xc0,0xc0,
0xc0,0x00,0xa0,0x70,0xd8,0xd8,0xd8,0xd8,
0x70,0xa0,0x60,0x50,0xd8,0xd8,0xd8,0xd8,
0xd8,0xb0,0x00,0xa0,0x50,0x70,0xd8,0xd8,
0xd8,0xd8,0x70,0x00,0x20,0x40,0x70,0xd8,
0xd8,0xd8,0xd8,0x70,0x00,0x20,0x10,0x70,
0xd8,0xd8,0xd8,0xd8,0x70,0x00,0x50,0x20,
0x70,0xd8,0xd8,0xd8,0xd8,0x70,0x00,0xa0,
0x50,0x70,0xd8,0xd8,0xd8,0xd8,0x70,0x00,
0x50,0x30,0x00,0xfc,0x00,0x30,0xb8,0x6c,
0x6c,0x7c,0x6c,0x3a,0x68,0xd8,0xd8,0xd8,
0xd8,0xd8,0x00,0x20,0x40,0x68,0xd8,0xd8,
0xd8,0xd8,0xd8,0x00,0x20,0x10,0x68,0xd8,
0xd8,0xd8,0xd8,0xd8,0x00,0x50,0x20,0x68,
0xd8,0xd8,0xd8,0xd8,0xd8,0x00,0x50,0x60,
0x30,0x30,0x78,0xd8,0xd8,0xd8,0xd8,0x00,
0x20,0x10,0xc0,0xc0,0xf0,0xd8,0xc8,0xc8,
0xd8,0xf0,0xc0,0xc0,0x60,0x30,0x30,0x78,
0xd8,0xd8,0xd8,0xd8,0x00,0x50,
};
BMF_FontData BMF_font_helvb10 = {
-1, -2,
10, 11,
{
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0, 0, 0, 0, 12, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{1, 1, 0, 0, 3, 0},
{2, 8, -1, 0, 4, 1},
{3, 3, -1, -5, 5, 9},
{7, 7, 1, 0, 6, 12},
{5, 10, 0, 1, 6, 19},
{7, 8, 0, 0, 8, 29},
{7, 8, 0, 0, 8, 37},
{2, 4, 0, -4, 3, 45},
{3, 10, 0, 2, 4, 49},
{3, 10, 0, 2, 4, 59},
{3, 3, 0, -5, 4, 69},
{6, 5, 0, -1, 6, 72},
{2, 4, 0, 2, 3, 77},
{5, 1, -1, -3, 7, 81},
{2, 2, 0, 0, 3, 82},
{4, 8, 0, 0, 4, 84},
{5, 8, 0, 0, 6, 92},
{3, 8, -1, 0, 6, 100},
{5, 8, 0, 0, 6, 108},
{5, 8, 0, 0, 6, 116},
{6, 8, 0, 0, 6, 124},
{5, 8, 0, 0, 6, 132},
{5, 8, 0, 0, 6, 140},
{5, 8, 0, 0, 6, 148},
{5, 8, 0, 0, 6, 156},
{5, 8, 0, 0, 6, 164},
{2, 6, 0, 0, 3, 172},
{2, 8, 0, 2, 3, 178},
{4, 5, 0, -1, 5, 186},
{5, 3, 0, -2, 6, 191},
{4, 5, 0, -1, 5, 194},
{5, 8, 0, 0, 6, 199},
{10, 9, 0, 1, 11, 207},
{7, 8, 0, 0, 8, 225},
{6, 8, 0, 0, 7, 233},
{7, 8, 0, 0, 8, 241},
{6, 8, 0, 0, 7, 249},
{5, 8, 0, 0, 6, 257},
{5, 8, 0, 0, 6, 265},
{7, 8, 0, 0, 8, 273},
{6, 8, 0, 0, 7, 281},
{2, 8, 0, 0, 3, 289},
{5, 8, 0, 0, 6, 297},
{7, 8, 0, 0, 7, 305},
{5, 8, 0, 0, 6, 313},
{9, 8, 0, 0, 10, 321},
{7, 8, 0, 0, 8, 337},
{7, 8, 0, 0, 8, 345},
{6, 8, 0, 0, 7, 353},
{7, 9, 0, 1, 8, 361},
{6, 8, 0, 0, 7, 370},
{6, 8, 0, 0, 7, 378},
{6, 8, 0, 0, 7, 386},
{6, 8, 0, 0, 7, 394},
{7, 8, 0, 0, 8, 402},
{10, 8, 0, 0, 11, 410},
{7, 8, 0, 0, 8, 426},
{8, 8, 0, 0, 9, 434},
{6, 8, 0, 0, 7, 442},
{3, 10, 0, 2, 4, 450},
{4, 8, 0, 0, 4, 460},
{3, 10, 0, 2, 4, 468},
{4, 4, 0, -4, 5, 478},
{6, 1, 0, 2, 6, 482},
{2, 4, 0, -4, 3, 483},
{6, 6, 0, 0, 6, 487},
{5, 8, 0, 0, 6, 493},
{4, 6, 0, 0, 5, 501},
{5, 8, 0, 0, 6, 507},
{5, 6, 0, 0, 6, 515},
{5, 8, 1, 0, 4, 521},
{5, 8, 0, 2, 6, 529},
{5, 8, 0, 0, 6, 537},
{2, 8, 0, 0, 3, 545},
{3, 10, 1, 2, 3, 553},
{6, 8, 0, 0, 6, 563},
{2, 8, 0, 0, 3, 571},
{8, 6, 0, 0, 9, 579},
{5, 6, 0, 0, 6, 585},
{5, 6, 0, 0, 6, 591},
{5, 8, 0, 2, 6, 597},
{5, 8, 0, 2, 6, 605},
{4, 6, 0, 0, 4, 613},
{5, 6, 0, 0, 6, 619},
{4, 8, 1, 0, 4, 625},
{5, 6, 0, 0, 6, 633},
{5, 6, 0, 0, 6, 639},
{7, 6, 0, 0, 8, 645},
{6, 6, 0, 0, 7, 651},
{5, 8, 0, 2, 6, 657},
{5, 6, 0, 0, 6, 665},
{4, 10, 0, 2, 5, 671},
{1, 10, -1, 2, 3, 681},
{4, 10, 0, 2, 5, 691},
{5, 2, 0, -3, 6, 701},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{1, 1, 0, 0, 3, 703},
{2, 8, -1, 2, 4, 704},
{5, 8, 0, 1, 6, 712},
{5, 8, 0, 0, 6, 720},
{6, 6, 0, -1, 6, 728},
{6, 8, 0, 0, 7, 734},
{1, 10, -1, 2, 3, 742},
{5, 10, 0, 2, 6, 752},
{3, 1, 0, -7, 3, 762},
{8, 8, -1, 0, 10, 763},
{3, 5, -1, -3, 5, 771},
{6, 3, 0, -1, 7, 776},
{5, 3, -1, -2, 7, 779},
{4, 1, 0, -3, 5, 782},
{8, 8, -1, 0, 10, 783},
{3, 1, 0, -7, 3, 791},
{3, 3, 0, -5, 4, 792},
{6, 7, 0, 0, 6, 795},
{3, 4, 0, -4, 3, 802},
{3, 4, 0, -4, 3, 806},
{2, 2, 0, -7, 3, 810},
{5, 8, 0, 2, 6, 812},
{6, 10, 0, 2, 6, 820},
{2, 1, 0, -3, 3, 830},
{2, 2, 0, 2, 3, 831},
{2, 4, 0, -4, 3, 833},
{3, 5, -1, -3, 5, 837},
{6, 3, 0, -1, 7, 842},
{8, 8, 0, 0, 9, 845},
{7, 8, 0, 0, 9, 853},
{8, 8, 0, 0, 9, 861},
{5, 8, 0, 2, 6, 869},
{7, 11, 0, 0, 8, 877},
{7, 11, 0, 0, 8, 888},
{7, 11, 0, 0, 8, 899},
{7, 11, 0, 0, 8, 910},
{7, 10, 0, 0, 8, 921},
{7, 11, 0, 0, 8, 931},
{9, 8, 0, 0, 10, 942},
{7, 10, 0, 2, 8, 958},
{5, 11, 0, 0, 6, 968},
{5, 11, 0, 0, 6, 979},
{5, 11, 0, 0, 6, 990},
{5, 10, 0, 0, 6, 1001},
{2, 11, 0, 0, 3, 1011},
{2, 11, 0, 0, 3, 1022},
{3, 11, 1, 0, 3, 1033},
{4, 10, 1, 0, 3, 1044},
{7, 8, 1, 0, 7, 1054},
{7, 11, 0, 0, 8, 1062},
{7, 11, 0, 0, 8, 1073},
{7, 11, 0, 0, 8, 1084},
{7, 11, 0, 0, 8, 1095},
{7, 11, 0, 0, 8, 1106},
{7, 10, 0, 0, 8, 1117},
{6, 5, 0, -1, 6, 1127},
{7, 8, 0, 0, 8, 1132},
{6, 11, 0, 0, 7, 1140},
{6, 11, 0, 0, 7, 1151},
{6, 11, 0, 0, 7, 1162},
{6, 10, 0, 0, 7, 1173},
{8, 11, 0, 0, 9, 1183},
{6, 8, 0, 0, 7, 1194},
{5, 8, 0, 0, 6, 1202},
{6, 9, 0, 0, 6, 1210},
{6, 9, 0, 0, 6, 1219},
{6, 9, 0, 0, 6, 1228},
{6, 9, 0, 0, 6, 1237},
{6, 8, 0, 0, 6, 1246},
{6, 9, 0, 0, 6, 1254},
{8, 6, 0, 0, 9, 1263},
{4, 8, 0, 2, 5, 1269},
{5, 9, 0, 0, 6, 1277},
{5, 9, 0, 0, 6, 1286},
{5, 9, 0, 0, 6, 1295},
{5, 8, 0, 0, 6, 1304},
{2, 9, 0, 0, 3, 1312},
{2, 9, 0, 0, 3, 1321},
{3, 9, 0, 0, 3, 1330},
{3, 8, 0, 0, 3, 1339},
{5, 9, 0, 0, 6, 1347},
{5, 9, 0, 0, 6, 1356},
{5, 9, 0, 0, 6, 1365},
{5, 9, 0, 0, 6, 1374},
{5, 9, 0, 0, 6, 1383},
{5, 9, 0, 0, 6, 1392},
{5, 8, 0, 0, 6, 1401},
{6, 5, 0, -1, 6, 1409},
{7, 6, 1, 0, 6, 1414},
{5, 9, 0, 0, 6, 1420},
{5, 9, 0, 0, 6, 1429},
{5, 9, 0, 0, 6, 1438},
{5, 8, 0, 0, 6, 1447},
{5, 11, 0, 2, 6, 1455},
{5, 10, 0, 2, 6, 1466},
{5, 10, 0, 2, 6, 1476},
},
bitmap_data
};
#endif

@ -0,0 +1,565 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "BMF_FontData.h"
#include "BMF_Settings.h"
#if BMF_INCLUDE_HELVB12
static unsigned char bitmap_data[]= {
0x00,0xc0,0xc0,0x00,0xc0,0xc0,0xc0,0xc0,
0xc0,0xc0,0xc0,0xc0,0xa0,0xa0,0xa0,0x6c,
0x00,0x6c,0x00,0x6c,0x00,0xff,0x00,0x36,
0x00,0x36,0x00,0x36,0x00,0x7f,0x80,0x1b,
0x00,0x1b,0x00,0x1b,0x00,0x30,0x30,0x78,
0xec,0xac,0x3c,0x38,0x70,0xf0,0xd4,0xdc,
0x78,0x30,0x63,0x80,0x37,0xc0,0x36,0xc0,
0x1f,0xc0,0x1b,0x80,0x0c,0x00,0x76,0x00,
0xfe,0x00,0xdb,0x00,0xfb,0x00,0x71,0x80,
0x73,0x80,0xff,0x00,0xce,0x00,0xcf,0x00,
0xdd,0x80,0x79,0x80,0x38,0x00,0x6c,0x00,
0x6c,0x00,0x7c,0x00,0x38,0x00,0x80,0x40,
0xc0,0xc0,0x30,0x60,0x60,0xc0,0xc0,0xc0,
0xc0,0xc0,0xc0,0xc0,0xc0,0x60,0x60,0x30,
0xc0,0x60,0x60,0x30,0x30,0x30,0x30,0x30,
0x30,0x30,0x30,0x60,0x60,0xc0,0xd8,0x70,
0x70,0xf8,0x20,0x30,0x30,0xfc,0xfc,0x30,
0x30,0x80,0x40,0xc0,0xc0,0xfc,0xfc,0xc0,
0xc0,0xc0,0xc0,0xc0,0x60,0x60,0x60,0x20,
0x30,0x30,0x30,0x18,0x18,0x18,0x78,0xfc,
0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xfc,
0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
0x30,0xf0,0xf0,0x30,0xfc,0xfc,0xc0,0x60,
0x70,0x38,0x18,0xcc,0xcc,0xfc,0x78,0x78,
0xfc,0xcc,0xcc,0x0c,0x38,0x38,0x0c,0xcc,
0xfc,0x78,0x0c,0x0c,0xfe,0xfe,0xcc,0x6c,
0x6c,0x3c,0x3c,0x1c,0x1c,0x78,0xfc,0xcc,
0xcc,0x0c,0xfc,0xf8,0xc0,0xc0,0xfc,0xfc,
0x78,0xfc,0xcc,0xcc,0xcc,0xfc,0xf8,0xc0,
0xcc,0xfc,0x78,0x60,0x60,0x60,0x30,0x30,
0x30,0x18,0x18,0x0c,0xfc,0xfc,0x78,0xfc,
0xcc,0xcc,0xcc,0x78,0x78,0xcc,0xcc,0xfc,
0x78,0x78,0xfc,0xcc,0x0c,0x7c,0xfc,0xcc,
0xcc,0xcc,0xfc,0x78,0xc0,0xc0,0x00,0x00,
0x00,0x00,0xc0,0xc0,0x80,0x40,0xc0,0xc0,
0x00,0x00,0x00,0x00,0xc0,0xc0,0x0c,0x38,
0xe0,0xe0,0x38,0x0c,0xfc,0xfc,0x00,0xfc,
0xfc,0xc0,0x70,0x1c,0x1c,0x70,0xc0,0x30,
0x30,0x00,0x30,0x30,0x38,0x1c,0xcc,0xcc,
0xfc,0x78,0x1f,0x00,0x71,0x80,0x40,0x00,
0xdd,0x80,0xb6,0xc0,0xb2,0x40,0xb3,0x60,
0xdb,0x20,0x4d,0xa0,0x60,0x40,0x39,0xc0,
0x0f,0x00,0xc3,0xc3,0xff,0x7e,0x66,0x66,
0x3c,0x3c,0x3c,0x18,0x18,0xf8,0xfc,0xcc,
0xcc,0xcc,0xf8,0xf8,0xcc,0xcc,0xfc,0xf8,
0x78,0xfc,0xcc,0xc0,0xc0,0xc0,0xc0,0xc0,
0xcc,0xfc,0x78,0xf8,0xfc,0xce,0xc6,0xc6,
0xc6,0xc6,0xc6,0xce,0xfc,0xf8,0xfc,0xfc,
0xc0,0xc0,0xc0,0xf8,0xf8,0xc0,0xc0,0xfc,
0xfc,0xc0,0xc0,0xc0,0xc0,0xc0,0xf8,0xf8,
0xc0,0xc0,0xfc,0xfc,0x76,0xfe,0xc6,0xc6,
0xde,0xde,0xc0,0xc0,0xc6,0xfe,0x7c,0xc6,
0xc6,0xc6,0xc6,0xc6,0xfe,0xfe,0xc6,0xc6,
0xc6,0xc6,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
0xc0,0xc0,0xc0,0xc0,0xc0,0x70,0xf8,0xd8,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0xc6,0xce,0xcc,0xd8,0xf8,0xf0,0xf0,0xd8,
0xcc,0xcc,0xc6,0xfc,0xfc,0xc0,0xc0,0xc0,
0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc9,0x80,
0xc9,0x80,0xdd,0x80,0xdd,0x80,0xf7,0x80,
0xf7,0x80,0xe3,0x80,0xe3,0x80,0xe3,0x80,
0xc1,0x80,0xc1,0x80,0xc6,0xc6,0xce,0xce,
0xde,0xd6,0xf6,0xe6,0xe6,0xc6,0xc6,0x7c,
0xfe,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,
0xfe,0x7c,0xc0,0xc0,0xc0,0xc0,0xfc,0xfe,
0xc6,0xc6,0xc6,0xfe,0xfc,0x06,0x7e,0xfc,
0xce,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xfe,
0x7c,0xc6,0xc6,0xc6,0xce,0xfc,0xfc,0xc6,
0xc6,0xc6,0xfe,0xfc,0x78,0xfc,0xcc,0x0c,
0x1c,0x78,0xe0,0xc0,0xcc,0xfc,0x78,0x30,
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
0xfc,0xfc,0x7c,0xfe,0xc6,0xc6,0xc6,0xc6,
0xc6,0xc6,0xc6,0xc6,0xc6,0x18,0x18,0x18,
0x3c,0x3c,0x3c,0x66,0x66,0x66,0xc3,0xc3,
0x33,0x00,0x33,0x00,0x33,0x00,0x3b,0x00,
0x7f,0x80,0x6d,0x80,0x6d,0x80,0x6d,0x80,
0xcc,0xc0,0xcc,0xc0,0xcc,0xc0,0xc3,0xc3,
0x66,0x7e,0x3c,0x18,0x3c,0x7e,0x66,0xc3,
0xc3,0x18,0x18,0x18,0x18,0x18,0x3c,0x3c,
0x66,0x66,0xc3,0xc3,0xfe,0xfe,0xc0,0x60,
0x60,0x30,0x18,0x18,0x0c,0xfe,0xfe,0xe0,
0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
0xc0,0xc0,0xc0,0xc0,0xe0,0x30,0x30,0x30,
0x70,0x60,0x60,0x60,0xe0,0xc0,0xc0,0xc0,
0xe0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
0x60,0x60,0x60,0x60,0x60,0xe0,0x88,0xd8,
0x70,0x70,0x20,0xfe,0xc0,0xc0,0x80,0x40,
0x76,0xfc,0xcc,0xfc,0x7c,0x8c,0xfc,0x78,
0xd8,0xfc,0xcc,0xcc,0xcc,0xcc,0xfc,0xd8,
0xc0,0xc0,0xc0,0x78,0xfc,0xcc,0xc0,0xc0,
0xcc,0xfc,0x78,0x6c,0xfc,0xcc,0xcc,0xcc,
0xcc,0xfc,0x6c,0x0c,0x0c,0x0c,0x78,0xfc,
0xc0,0xfc,0xfc,0xcc,0xfc,0x78,0x60,0x60,
0x60,0x60,0x60,0x60,0xf0,0xf0,0x60,0x70,
0x30,0x78,0xfc,0x0c,0x6c,0xfc,0xcc,0xcc,
0xcc,0xcc,0xfc,0x6c,0xcc,0xcc,0xcc,0xcc,
0xcc,0xec,0xfc,0xd8,0xc0,0xc0,0xc0,0xc0,
0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x00,
0xc0,0xc0,0xc0,0x60,0x60,0x60,0x60,0x60,
0x60,0x60,0x60,0x60,0x60,0x00,0x60,0x60,
0xcc,0xd8,0xd8,0xf0,0xe0,0xf0,0xd8,0xcc,
0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xcc,0xc0,
0xcc,0xc0,0xcc,0xc0,0xcc,0xc0,0xcc,0xc0,
0xee,0xc0,0xff,0xc0,0xbb,0x80,0xcc,0xcc,
0xcc,0xcc,0xcc,0xec,0xfc,0xd8,0x78,0xfc,
0xcc,0xcc,0xcc,0xcc,0xfc,0x78,0xc0,0xc0,
0xc0,0xd8,0xfc,0xcc,0xcc,0xcc,0xcc,0xfc,
0xd8,0x0c,0x0c,0x0c,0x6c,0xfc,0xcc,0xcc,
0xcc,0xcc,0xfc,0x6c,0xc0,0xc0,0xc0,0xc0,
0xc0,0xc0,0xe0,0xb0,0x78,0xfc,0xcc,0x1c,
0x78,0xe0,0xfc,0x78,0x30,0x70,0x60,0x60,
0x60,0x60,0xf0,0xf0,0x60,0x60,0x6c,0xfc,
0xdc,0xcc,0xcc,0xcc,0xcc,0xcc,0x30,0x30,
0x78,0x78,0x78,0xcc,0xcc,0xcc,0x24,0x24,
0x76,0x76,0x7e,0xdb,0xdb,0xdb,0xcc,0xcc,
0x78,0x38,0x70,0x78,0xcc,0xcc,0xe0,0xf0,
0x30,0x30,0x38,0x78,0x78,0x48,0xcc,0xcc,
0xcc,0xfc,0xfc,0x60,0x30,0x30,0x18,0xfc,
0xfc,0x30,0x60,0x60,0x60,0x60,0x60,0x40,
0x80,0x40,0x60,0x60,0x60,0x60,0x30,0x80,
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,0xc0,0x60,0x60,0x60,
0x60,0x60,0x20,0x10,0x20,0x60,0x60,0x60,
0x60,0xc0,0x98,0xfc,0x64,0xc0,0xc0,0xc0,
0xc0,0xc0,0xc0,0xc0,0xc0,0x00,0xc0,0xc0,
0xc0,0x78,0xfc,0xec,0xe0,0xd0,0xd4,0xfc,
0x78,0x0c,0xdc,0xfe,0x60,0x30,0x30,0xfc,
0x30,0x60,0x64,0x7c,0x38,0xcc,0x78,0xcc,
0xcc,0x78,0xcc,0x18,0x18,0x18,0x7e,0x18,
0x7e,0x3c,0x66,0x66,0xc3,0xc3,0x80,0x80,
0x80,0x80,0x80,0x80,0x00,0x00,0x80,0x80,
0x80,0x80,0x80,0x78,0xfc,0xcc,0x1c,0x38,
0x6c,0xcc,0xcc,0xd8,0x70,0xe0,0xcc,0xfc,
0x78,0xd8,0xd8,0x1f,0x00,0x71,0xc0,0x6e,
0xc0,0xdb,0x60,0xdb,0x60,0xd8,0x60,0xdb,
0x60,0xdb,0x60,0x6e,0xc0,0x71,0xc0,0x1f,
0x00,0xf0,0x00,0xd0,0xb0,0x70,0xb0,0x60,
0x36,0x6c,0xd8,0x6c,0x36,0x0c,0x0c,0xfc,
0xfc,0xe0,0xe0,0x1f,0x00,0x71,0xc0,0x7b,
0xc0,0xdb,0x60,0xdf,0x60,0xde,0x60,0xdb,
0x60,0xdb,0x60,0x7e,0xc0,0x71,0xc0,0x1f,
0x00,0xf0,0xf0,0x60,0x90,0x90,0x60,0xfc,
0xfc,0x00,0x30,0x30,0xfc,0xfc,0x30,0x30,
0xf0,0x40,0x20,0x10,0x90,0x60,0x60,0x90,
0x10,0x20,0x90,0x60,0xc0,0x70,0x30,0xc0,
0xc0,0xc0,0xec,0xfc,0xdc,0xcc,0xcc,0xcc,
0xcc,0xcc,0x36,0x36,0x36,0x36,0x36,0x36,
0x36,0x36,0x76,0xf6,0xf6,0xf6,0xfe,0x7e,
0xc0,0xc0,0xc0,0x60,0x40,0x40,0x40,0x40,
0x40,0xc0,0x40,0xf8,0x00,0x70,0xd8,0xd8,
0xd8,0x70,0xd8,0x6c,0x36,0x6c,0xd8,0x20,
0x80,0x27,0xc0,0x12,0x80,0x12,0x80,0x09,
0x80,0x4c,0x80,0x44,0x00,0x42,0x00,0x42,
0x00,0xc1,0x00,0x41,0x00,0x23,0xc0,0x21,
0x00,0x10,0x80,0x10,0x40,0x0a,0x40,0x4d,
0x80,0x44,0x00,0x42,0x00,0x42,0x00,0xc1,
0x00,0x41,0x00,0x20,0x80,0x27,0xc0,0x12,
0x80,0x12,0x80,0x09,0x80,0x6c,0x80,0x94,
0x00,0x12,0x00,0x22,0x00,0x91,0x00,0x61,
0x00,0x78,0xfc,0xcc,0xcc,0xe0,0x70,0x30,
0x30,0x00,0x30,0x30,0xc3,0xc3,0x7e,0x7e,
0x24,0x3c,0x18,0x18,0x00,0x0c,0x38,0x30,
0xc3,0xc3,0x7e,0x7e,0x24,0x3c,0x18,0x18,
0x00,0x30,0x1c,0x0c,0xc3,0xc3,0x7e,0x7e,
0x24,0x3c,0x18,0x18,0x00,0x66,0x3c,0x18,
0xc3,0xc3,0x7e,0x7e,0x24,0x3c,0x18,0x18,
0x00,0x2c,0x3e,0x1a,0xc3,0xc3,0x7e,0x7e,
0x24,0x3c,0x18,0x18,0x00,0x6c,0x6c,0xc3,
0xc3,0x7e,0x7e,0x24,0x3c,0x18,0x18,0x00,
0x18,0x34,0x18,0xc7,0xe0,0xc7,0xe0,0xfe,
0x00,0x7e,0x00,0x66,0x00,0x67,0xc0,0x37,
0xc0,0x36,0x00,0x3e,0x00,0x1f,0xe0,0x1f,
0xe0,0x60,0x30,0x20,0x78,0xfc,0xcc,0xc0,
0xc0,0xc0,0xc0,0xc0,0xcc,0xfc,0x78,0xfc,
0xfc,0xc0,0xf8,0xf8,0xc0,0xfc,0xfc,0x00,
0x18,0x70,0x60,0xfc,0xfc,0xc0,0xf8,0xf8,
0xc0,0xfc,0xfc,0x00,0x60,0x38,0x18,0xfc,
0xfc,0xc0,0xf8,0xf8,0xc0,0xfc,0xfc,0x00,
0xcc,0x78,0x30,0xfc,0xfc,0xc0,0xf8,0xf8,
0xc0,0xfc,0xfc,0x00,0xd8,0xd8,0x60,0x60,
0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x30,
0xe0,0xc0,0x60,0x60,0x60,0x60,0x60,0x60,
0x60,0x60,0x00,0xc0,0x70,0x30,0x30,0x30,
0x30,0x30,0x30,0x30,0x30,0x30,0x00,0xcc,
0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
0x30,0x30,0x00,0xd8,0xd8,0x7c,0x7e,0x67,
0x63,0x63,0xfb,0xfb,0x63,0x67,0x7e,0x7c,
0xc6,0xce,0xce,0xde,0xf6,0xe6,0xe6,0xc6,
0x00,0x58,0x7c,0x34,0x7c,0xfe,0xc6,0xc6,
0xc6,0xc6,0xfe,0x7c,0x00,0x18,0x70,0x60,
0x7c,0xfe,0xc6,0xc6,0xc6,0xc6,0xfe,0x7c,
0x00,0x30,0x1c,0x0c,0x7c,0xfe,0xc6,0xc6,
0xc6,0xc6,0xfe,0x7c,0x00,0xcc,0x78,0x30,
0x7c,0xfe,0xc6,0xc6,0xc6,0xc6,0xfe,0x7c,
0x00,0x58,0x7c,0x34,0x7c,0xfe,0xc6,0xc6,
0xc6,0xc6,0xfe,0x7c,0x00,0x6c,0x6c,0xcc,
0x78,0x30,0x30,0x78,0xcc,0xde,0x00,0x7f,
0x00,0x63,0x00,0x73,0x00,0x7b,0x00,0x6b,
0x00,0x6f,0x00,0x67,0x00,0x63,0x00,0x7f,
0x00,0x3d,0x80,0x7c,0xfe,0xc6,0xc6,0xc6,
0xc6,0xc6,0xc6,0x00,0x18,0x70,0x60,0x7c,
0xfe,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,
0x30,0x1c,0x0c,0x7c,0xfe,0xc6,0xc6,0xc6,
0xc6,0xc6,0xc6,0x00,0xcc,0x78,0x30,0x7c,
0xfe,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,
0x6c,0x6c,0x18,0x18,0x18,0x18,0x3c,0x7e,
0xe7,0xc3,0x00,0x30,0x1c,0x0c,0xc0,0xc0,
0xfc,0xfe,0xc6,0xc6,0xc6,0xfe,0xfc,0xc0,
0xc0,0xd8,0xdc,0xcc,0xcc,0xcc,0xd8,0xd8,
0xcc,0xcc,0xfc,0x78,0x76,0xfc,0xcc,0xfc,
0x7c,0x8c,0xfc,0x78,0x00,0x18,0x70,0x60,
0x76,0xfc,0xcc,0xfc,0x7c,0x8c,0xfc,0x78,
0x00,0x60,0x38,0x18,0x76,0xfc,0xcc,0xfc,
0x7c,0x8c,0xfc,0x78,0x00,0xcc,0x78,0x30,
0x76,0xfc,0xcc,0xfc,0x7c,0x8c,0xfc,0x78,
0x00,0x58,0x7c,0x34,0x76,0xfc,0xcc,0xfc,
0x7c,0x8c,0xfc,0x78,0x00,0xd8,0xd8,0x76,
0xfc,0xcc,0xfc,0x7c,0x8c,0xfc,0x78,0x00,
0x30,0x68,0x30,0x77,0x80,0xff,0xc0,0xcc,
0x00,0xff,0xc0,0x7f,0xc0,0x8c,0xc0,0xff,
0xc0,0x7b,0x80,0x60,0x30,0x20,0x78,0xfc,
0xcc,0xc0,0xc0,0xcc,0xfc,0x78,0x78,0xfc,
0xc0,0xfc,0xfc,0xcc,0xfc,0x78,0x00,0x18,
0x70,0x60,0x78,0xfc,0xc0,0xfc,0xfc,0xcc,
0xfc,0x78,0x00,0x60,0x38,0x18,0x78,0xfc,
0xc0,0xfc,0xfc,0xcc,0xfc,0x78,0x00,0xcc,
0x78,0x30,0x78,0xfc,0xc0,0xfc,0xfc,0xcc,
0xfc,0x78,0x00,0xd8,0xd8,0x60,0x60,0x60,
0x60,0x60,0x60,0x60,0x60,0x00,0x30,0xe0,
0xc0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
0x60,0x00,0xc0,0x70,0x30,0x30,0x30,0x30,
0x30,0x30,0x30,0x30,0x30,0x00,0xcc,0x78,
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
0x30,0x00,0xd8,0xd8,0x78,0xfc,0xcc,0xcc,
0xcc,0xcc,0xfc,0x78,0xb0,0x60,0xd0,0xcc,
0xcc,0xcc,0xcc,0xcc,0xec,0xfc,0xd8,0x00,
0xb0,0xf8,0x68,0x78,0xfc,0xcc,0xcc,0xcc,
0xcc,0xfc,0x78,0x00,0x18,0x70,0x60,0x78,
0xfc,0xcc,0xcc,0xcc,0xcc,0xfc,0x78,0x00,
0x60,0x38,0x18,0x78,0xfc,0xcc,0xcc,0xcc,
0xcc,0xfc,0x78,0x00,0xcc,0x78,0x30,0x78,
0xfc,0xcc,0xcc,0xcc,0xcc,0xfc,0x78,0x00,
0xb0,0xf8,0x68,0x78,0xfc,0xcc,0xcc,0xcc,
0xcc,0xfc,0x78,0x00,0xd8,0xd8,0x30,0x30,
0x00,0xfc,0xfc,0x00,0x30,0x30,0xc0,0x78,
0xfc,0xcc,0xec,0xdc,0xcc,0xfc,0x78,0x0c,
0x6c,0xfc,0xdc,0xcc,0xcc,0xcc,0xcc,0xcc,
0x00,0x18,0x70,0x60,0x6c,0xfc,0xdc,0xcc,
0xcc,0xcc,0xcc,0xcc,0x00,0x60,0x38,0x18,
0x6c,0xfc,0xdc,0xcc,0xcc,0xcc,0xcc,0xcc,
0x00,0xcc,0x78,0x30,0x6c,0xfc,0xdc,0xcc,
0xcc,0xcc,0xcc,0xcc,0x00,0xd8,0xd8,0xe0,
0xf0,0x30,0x30,0x38,0x78,0x78,0x48,0xcc,
0xcc,0xcc,0x00,0x60,0x38,0x18,0xc0,0xc0,
0xc0,0xd8,0xfc,0xcc,0xcc,0xcc,0xcc,0xfc,
0xd8,0xc0,0xc0,0xc0,0xe0,0xf0,0x30,0x30,
0x38,0x78,0x78,0x48,0xcc,0xcc,0xcc,0x00,
0xd8,0xd8,
};
BMF_FontData BMF_font_helvb12 = {
-1, -3,
11, 12,
{
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0, 0, 0, 0, 12, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{1, 1, 0, 0, 3, 0},
{2, 11, -1, 0, 4, 1},
{3, 3, 0, -8, 4, 12},
{9, 11, 1, 0, 7, 15},
{6, 13, 0, 2, 7, 37},
{10, 11, 0, 0, 11, 50},
{9, 11, 0, 0, 9, 72},
{2, 4, 0, -7, 3, 94},
{4, 14, 0, 3, 4, 98},
{4, 14, 1, 3, 4, 112},
{5, 5, 0, -6, 6, 126},
{6, 6, 0, -1, 7, 131},
{2, 4, 0, 2, 3, 137},
{6, 2, -1, -3, 9, 141},
{2, 2, 0, 0, 3, 143},
{5, 13, 1, 2, 4, 145},
{6, 11, 0, 0, 7, 158},
{4, 11, 0, 0, 6, 169},
{6, 11, 0, 0, 7, 180},
{6, 11, 0, 0, 7, 191},
{7, 11, 0, 0, 7, 202},
{6, 11, 0, 0, 7, 213},
{6, 11, 0, 0, 7, 224},
{6, 11, 0, 0, 7, 235},
{6, 11, 0, 0, 7, 246},
{6, 11, 0, 0, 7, 257},
{2, 8, -1, 0, 4, 268},
{2, 10, -1, 2, 4, 276},
{6, 6, 0, -1, 7, 286},
{6, 5, 0, -2, 7, 292},
{6, 6, 0, -1, 7, 297},
{6, 11, 0, 0, 7, 303},
{11, 12, 0, 1, 12, 314},
{8, 11, 0, 0, 8, 338},
{6, 11, -1, 0, 8, 349},
{6, 11, -1, 0, 8, 360},
{7, 11, -1, 0, 9, 371},
{6, 11, -1, 0, 8, 382},
{6, 11, -1, 0, 7, 393},
{7, 11, -1, 0, 9, 404},
{7, 11, -1, 0, 9, 415},
{2, 11, -2, 0, 6, 426},
{5, 11, 0, 0, 6, 437},
{7, 11, -1, 0, 8, 448},
{6, 11, -1, 0, 7, 459},
{9, 11, -1, 0, 11, 470},
{7, 11, -1, 0, 9, 492},
{7, 11, -1, 0, 9, 503},
{7, 11, -1, 0, 9, 514},
{7, 12, -1, 1, 9, 525},
{7, 11, -1, 0, 9, 537},
{6, 11, -1, 0, 8, 548},
{6, 11, 0, 0, 6, 559},
{7, 11, -1, 0, 9, 570},
{8, 11, 0, 0, 8, 581},
{10, 11, 0, 0, 10, 592},
{8, 11, 0, 0, 8, 614},
{8, 11, 0, 0, 8, 625},
{7, 11, 0, 0, 7, 636},
{3, 14, 0, 3, 4, 647},
{4, 11, 0, 0, 5, 661},
{3, 14, 0, 3, 4, 672},
{5, 5, 0, -6, 7, 686},
{7, 1, 0, 2, 7, 691},
{2, 4, 0, -7, 3, 692},
{7, 8, 0, 0, 7, 696},
{6, 11, 0, 0, 7, 704},
{6, 8, 0, 0, 7, 715},
{6, 11, 0, 0, 7, 723},
{6, 8, 0, 0, 7, 734},
{4, 11, 0, 0, 5, 742},
{6, 11, 0, 3, 7, 753},
{6, 11, 0, 0, 7, 764},
{2, 11, -1, 0, 5, 775},
{3, 14, 0, 3, 5, 786},
{6, 11, 0, 0, 6, 800},
{2, 11, -1, 0, 5, 811},
{10, 8, 0, 0, 11, 822},
{6, 8, 0, 0, 7, 838},
{6, 8, 0, 0, 7, 846},
{6, 11, 0, 3, 7, 854},
{6, 11, 0, 3, 7, 865},
{4, 8, 0, 0, 4, 876},
{6, 8, 0, 0, 7, 884},
{4, 10, 0, 0, 5, 892},
{6, 8, 0, 0, 7, 902},
{6, 8, 0, 0, 7, 910},
{8, 8, 0, 0, 9, 918},
{6, 8, 0, 0, 7, 926},
{6, 11, 0, 3, 7, 934},
{6, 8, 0, 0, 7, 945},
{4, 14, 0, 3, 4, 953},
{1, 13, -1, 2, 3, 967},
{4, 14, 0, 3, 4, 980},
{6, 3, 0, -3, 7, 994},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{2, 11, 0, 3, 3, 997},
{6, 10, 0, 1, 7, 1008},
{7, 11, 0, 0, 7, 1018},
{6, 6, 0, -3, 7, 1029},
{8, 11, 1, 0, 7, 1035},
{1, 13, -1, 2, 3, 1046},
{6, 14, 0, 3, 7, 1059},
{5, 2, 0, -9, 5, 1073},
{11, 11, 0, 0, 12, 1075},
{4, 7, 0, -4, 5, 1097},
{7, 5, 0, -2, 8, 1104},
{6, 4, -1, -3, 9, 1109},
{3, 2, 0, -3, 4, 1113},
{11, 11, 0, 0, 12, 1115},
{4, 2, 0, -9, 4, 1137},
{4, 4, -1, -7, 6, 1139},
{6, 9, 0, -1, 7, 1143},
{4, 6, 0, -5, 4, 1152},
{4, 6, 0, -5, 4, 1158},
{4, 3, -1, -9, 4, 1164},
{6, 11, 0, 3, 7, 1167},
{7, 14, -1, 3, 10, 1178},
{2, 2, 0, -5, 3, 1192},
{3, 3, -1, 3, 5, 1194},
{2, 6, 0, -5, 4, 1197},
{5, 7, 0, -4, 6, 1203},
{7, 5, 0, -2, 8, 1210},
{10, 11, 0, 0, 11, 1215},
{10, 11, 0, 0, 11, 1237},
{10, 11, 0, 0, 11, 1259},
{6, 11, 0, 3, 7, 1281},
{8, 12, 0, 0, 8, 1292},
{8, 12, 0, 0, 8, 1304},
{8, 12, 0, 0, 8, 1316},
{8, 12, 0, 0, 8, 1328},
{8, 11, 0, 0, 8, 1340},
{8, 12, 0, 0, 8, 1351},
{11, 11, 0, 0, 12, 1363},
{6, 14, -1, 3, 8, 1385},
{6, 12, -1, 0, 8, 1399},
{6, 12, -1, 0, 8, 1411},
{6, 12, -1, 0, 8, 1423},
{6, 11, -1, 0, 8, 1435},
{4, 12, -1, 0, 6, 1446},
{4, 12, -1, 0, 6, 1458},
{6, 12, 0, 0, 6, 1470},
{5, 11, 0, 0, 6, 1482},
{8, 11, 0, 0, 9, 1493},
{7, 12, -1, 0, 9, 1504},
{7, 12, -1, 0, 9, 1516},
{7, 12, -1, 0, 9, 1528},
{7, 12, -1, 0, 9, 1540},
{7, 12, -1, 0, 9, 1552},
{7, 11, -1, 0, 9, 1564},
{6, 6, 0, -1, 7, 1575},
{9, 11, 0, 0, 9, 1581},
{7, 12, -1, 0, 9, 1603},
{7, 12, -1, 0, 9, 1615},
{7, 12, -1, 0, 9, 1627},
{7, 11, -1, 0, 9, 1639},
{8, 12, 0, 0, 8, 1650},
{7, 11, -1, 0, 9, 1662},
{6, 11, 0, 0, 7, 1673},
{7, 12, 0, 0, 7, 1684},
{7, 12, 0, 0, 7, 1696},
{7, 12, 0, 0, 7, 1708},
{7, 12, 0, 0, 7, 1720},
{7, 11, 0, 0, 7, 1732},
{7, 12, 0, 0, 7, 1743},
{10, 8, 0, 0, 11, 1755},
{6, 11, 0, 3, 7, 1771},
{6, 12, 0, 0, 7, 1782},
{6, 12, 0, 0, 7, 1794},
{6, 12, 0, 0, 7, 1806},
{6, 11, 0, 0, 7, 1818},
{4, 12, 0, 0, 5, 1829},
{4, 12, 0, 0, 5, 1841},
{6, 12, 1, 0, 5, 1853},
{5, 11, 1, 0, 5, 1865},
{6, 11, 0, 0, 7, 1876},
{6, 12, 0, 0, 7, 1887},
{6, 12, 0, 0, 7, 1899},
{6, 12, 0, 0, 7, 1911},
{6, 12, 0, 0, 7, 1923},
{6, 12, 0, 0, 7, 1935},
{6, 11, 0, 0, 7, 1947},
{6, 8, 0, 0, 7, 1958},
{6, 10, 0, 1, 7, 1966},
{6, 12, 0, 0, 7, 1976},
{6, 12, 0, 0, 7, 1988},
{6, 12, 0, 0, 7, 2000},
{6, 11, 0, 0, 7, 2012},
{6, 15, 0, 3, 7, 2023},
{6, 14, 0, 3, 7, 2038},
{6, 14, 0, 3, 7, 2052},
},
bitmap_data
};
#endif

@ -0,0 +1,623 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "BMF_FontData.h"
#include "BMF_Settings.h"
#if BMF_INCLUDE_HELVB14
static unsigned char bitmap_data[]= {
0x00,0xc0,0xc0,0x00,0x00,0x80,0x80,0x80,
0xc0,0xc0,0xc0,0xc0,0xc0,0x90,0xd8,0xd8,
0xd8,0x48,0x48,0x48,0xfe,0xfe,0x24,0x24,
0x7f,0x7f,0x12,0x12,0x12,0x10,0x10,0x38,
0x7c,0xd6,0xd6,0x16,0x3c,0x78,0xd0,0xd6,
0xd6,0x7c,0x38,0x10,0x30,0xc0,0x11,0xe0,
0x19,0x20,0x09,0x20,0x0d,0xe0,0x64,0xc0,
0xf6,0x00,0x92,0x00,0x93,0x00,0xf1,0x00,
0x61,0x80,0x71,0x80,0xff,0x00,0xce,0x00,
0xc6,0x00,0xcf,0x00,0x79,0x00,0x30,0x00,
0x38,0x00,0x6c,0x00,0x6c,0x00,0x7c,0x00,
0x38,0x00,0x80,0x40,0xc0,0xc0,0x30,0x20,
0x60,0x40,0x40,0xc0,0xc0,0xc0,0xc0,0xc0,
0x40,0x40,0x60,0x20,0x30,0xc0,0x40,0x60,
0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x20,
0x20,0x60,0x40,0xc0,0xd8,0x50,0x20,0xf8,
0x20,0x20,0x30,0x30,0x30,0xfc,0xfc,0x30,
0x30,0x30,0x80,0x40,0x40,0xc0,0xc0,0xfe,
0xfe,0xc0,0xc0,0x80,0x80,0xc0,0x40,0x40,
0x60,0x20,0x20,0x30,0x10,0x10,0x30,0x78,
0x48,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x48,
0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
0x30,0x30,0x30,0xf0,0x30,0x10,0xfc,0xfc,
0x60,0x60,0x30,0x18,0x18,0x0c,0xcc,0xcc,
0x78,0x30,0x30,0x78,0xcc,0xcc,0x0c,0x38,
0x38,0x0c,0xcc,0xcc,0x78,0x30,0x18,0x18,
0xfc,0xfc,0x98,0x58,0x58,0x38,0x38,0x38,
0x18,0x18,0x70,0xf8,0xcc,0x0c,0x0c,0xcc,
0xfc,0xd8,0x60,0x60,0x7c,0x7c,0x30,0x78,
0xcc,0xcc,0xcc,0xcc,0xfc,0xd8,0xc0,0x4c,
0x7c,0x38,0x60,0x60,0x60,0x20,0x30,0x30,
0x10,0x18,0x08,0x0c,0xfc,0xfc,0x70,0xf8,
0xcc,0xcc,0xcc,0x78,0x30,0x78,0xcc,0xcc,
0x7c,0x38,0x70,0xf8,0xc8,0x0c,0x6c,0xfc,
0xcc,0xcc,0xcc,0xcc,0x78,0x30,0xc0,0xc0,
0x00,0x00,0x00,0x00,0xc0,0xc0,0x80,0x40,
0x40,0xc0,0xc0,0x00,0x00,0x00,0x00,0xc0,
0xc0,0x02,0x0e,0x3c,0xf0,0xf0,0x3c,0x0e,
0x02,0xfc,0xfc,0x00,0x00,0xfc,0xfc,0x80,
0xe0,0x78,0x1e,0x1e,0x78,0xe0,0x80,0x30,
0x30,0x00,0x30,0x30,0x18,0x18,0x0c,0xcc,
0xcc,0x7c,0x38,0x0f,0x80,0x38,0x60,0x60,
0x00,0x4d,0xc0,0xd3,0x20,0x93,0x30,0x91,
0x10,0x91,0x90,0xc9,0x90,0x46,0x90,0x60,
0x30,0x30,0x20,0x1c,0xc0,0x07,0x80,0xe1,
0xc0,0x61,0x80,0x7f,0x80,0x7f,0x80,0x33,
0x00,0x33,0x00,0x33,0x00,0x1e,0x00,0x1e,
0x00,0x1e,0x00,0x0c,0x00,0x0c,0x00,0xfc,
0xfe,0xc7,0xc3,0xc7,0xfe,0xfc,0xc6,0xc3,
0xc7,0xfe,0xfc,0x3c,0x7e,0x63,0xc3,0xc0,
0xc0,0xc0,0xc0,0xc3,0x63,0x7e,0x3c,0xfc,
0xfe,0xc6,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,
0xc6,0xfe,0xfc,0xfe,0xfe,0xc0,0xc0,0xc0,
0xfe,0xfe,0xc0,0xc0,0xc0,0xfe,0xfe,0xc0,
0xc0,0xc0,0xc0,0xc0,0xfc,0xfc,0xc0,0xc0,
0xc0,0xfe,0xfe,0x3e,0x80,0x7f,0x80,0x63,
0x80,0xc1,0x80,0xc7,0x80,0xc7,0x80,0xc0,
0x00,0xc0,0x00,0xc1,0x80,0x63,0x80,0x7f,
0x00,0x3e,0x00,0xc3,0xc3,0xc3,0xc3,0xc3,
0xff,0xff,0xc3,0xc3,0xc3,0xc3,0xc3,0xc0,
0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
0xc0,0xc0,0xc0,0x78,0xfc,0xcc,0xcc,0xcc,
0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0xc3,
0x80,0xc7,0x00,0xc6,0x00,0xcc,0x00,0xdc,
0x00,0xf8,0x00,0xf0,0x00,0xd8,0x00,0xcc,
0x00,0xce,0x00,0xc7,0x00,0xc3,0x00,0xfe,
0xfe,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
0xc0,0xc0,0xc0,0xcc,0xc0,0xcc,0xc0,0xcc,
0xc0,0xde,0xc0,0xde,0xc0,0xd2,0xc0,0xd2,
0xc0,0xf3,0xc0,0xf3,0xc0,0xe1,0xc0,0xe1,
0xc0,0xe1,0xc0,0xc3,0xc7,0xc7,0xcf,0xcf,
0xdb,0xdb,0xf3,0xf3,0xe3,0xe3,0xc3,0x3e,
0x00,0x7f,0x00,0x63,0x00,0xc1,0x80,0xc1,
0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,
0x80,0x63,0x00,0x7f,0x00,0x3e,0x00,0xc0,
0xc0,0xc0,0xc0,0xf8,0xfc,0xce,0xc6,0xc6,
0xce,0xfc,0xf8,0x01,0x80,0x3d,0x80,0x7f,
0x00,0x67,0x00,0xcd,0x80,0xcd,0x80,0xc1,
0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,
0x00,0x7f,0x00,0x3e,0x00,0xc3,0xc3,0xc3,
0xc3,0xc7,0xfe,0xfe,0xc7,0xc3,0xc7,0xfe,
0xfc,0x3c,0x7e,0xe7,0xc3,0x07,0x1e,0x78,
0xe0,0xc3,0xe7,0x7e,0x3c,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xff,
0xff,0x3c,0x7e,0xe7,0xc3,0xc3,0xc3,0xc3,
0xc3,0xc3,0xc3,0xc3,0xc3,0x18,0x18,0x18,
0x3c,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,
0xc3,0x30,0xc0,0x30,0xc0,0x30,0xc0,0x39,
0xc0,0x79,0xe0,0x69,0x60,0x6f,0x60,0x6f,
0x60,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,
0x30,0xe3,0x80,0x63,0x00,0x63,0x00,0x36,
0x00,0x36,0x00,0x1c,0x00,0x1c,0x00,0x36,
0x00,0x36,0x00,0x63,0x00,0x63,0x00,0xe3,
0x80,0x0c,0x00,0x0c,0x00,0x0c,0x00,0x0c,
0x00,0x0c,0x00,0x1e,0x00,0x1e,0x00,0x33,
0x00,0x33,0x00,0x61,0x80,0x61,0x80,0xe1,
0xc0,0xff,0xff,0x60,0x70,0x30,0x18,0x18,
0x0c,0x0e,0x06,0xff,0xff,0xe0,0xe0,0xc0,
0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
0xc0,0xc0,0xe0,0xe0,0x10,0x10,0x30,0x20,
0x20,0x60,0x40,0x40,0xc0,0x80,0x80,0xe0,
0xe0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
0x60,0x60,0x60,0x60,0xe0,0xe0,0xcc,0xcc,
0x48,0x78,0x78,0x30,0x30,0xfe,0xc0,0xc0,
0x80,0x40,0x6c,0xfc,0xcc,0xcc,0x7c,0x1c,
0xcc,0xfc,0x78,0xd8,0xfc,0xee,0xc6,0xc6,
0xc6,0xee,0xfc,0xd8,0xc0,0xc0,0xc0,0x38,
0x7c,0xec,0xc0,0xc0,0xc0,0xec,0x7c,0x38,
0x36,0x7e,0xee,0xc6,0xc6,0xc6,0xee,0x7e,
0x36,0x06,0x06,0x06,0x38,0x7c,0xcc,0xc0,
0xfc,0xcc,0xcc,0x78,0x30,0x60,0x60,0x60,
0x60,0x60,0x60,0x60,0xf0,0xf0,0x60,0x70,
0x30,0x78,0xfc,0xc6,0x36,0x7e,0xee,0xc6,
0xc6,0xc6,0xee,0x7e,0x36,0xc6,0xc6,0xc6,
0xc6,0xc6,0xc6,0xe6,0xfe,0xdc,0xc0,0xc0,
0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
0xc0,0xc0,0x00,0xc0,0xc0,0xc0,0xe0,0x60,
0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
0x60,0x00,0x60,0x60,0xce,0xcc,0xd8,0xd8,
0xf0,0xf0,0xd8,0xd8,0xcc,0xc0,0xc0,0xc0,
0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
0xc0,0xc0,0xc0,0xc0,0xcc,0xc0,0xcc,0xc0,
0xcc,0xc0,0xcc,0xc0,0xcc,0xc0,0xcc,0xc0,
0xcc,0xc0,0xff,0xc0,0xdb,0x80,0xc6,0xc6,
0xc6,0xc6,0xc6,0xc6,0xe6,0xfe,0xdc,0x38,
0x7c,0xee,0xc6,0xc6,0xc6,0xee,0x7c,0x38,
0xc0,0xc0,0xc0,0xd8,0xfc,0xee,0xc6,0xc6,
0xc6,0xee,0xfc,0xd8,0x06,0x06,0x06,0x36,
0x7e,0xee,0xc6,0xc6,0xc6,0xee,0x7e,0x36,
0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xe0,0xf8,
0xd0,0x78,0xfc,0xcc,0x1c,0x78,0xe0,0xcc,
0xfc,0x78,0x30,0x70,0x60,0x60,0x60,0x60,
0x60,0xf0,0xf0,0x60,0x60,0x76,0xfe,0xce,
0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x30,0x30,
0x30,0x78,0x78,0x48,0xcc,0xcc,0xcc,0x33,
0x00,0x33,0x00,0x33,0x00,0x73,0x80,0x7f,
0x80,0x4c,0x80,0x4c,0x80,0xcc,0xc0,0xcc,
0xc0,0xc6,0xee,0x6c,0x38,0x38,0x38,0x6c,
0xee,0xc6,0x60,0x70,0x10,0x18,0x38,0x38,
0x2c,0x6c,0x6c,0xc6,0xc6,0xc6,0xfc,0xfc,
0x60,0x60,0x30,0x18,0x18,0xfc,0xfc,0x30,
0x70,0x60,0x60,0x60,0x60,0x60,0xc0,0x60,
0x60,0x60,0x60,0x60,0x70,0x30,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0xc0,0xe0,0x60,
0x60,0x60,0x60,0x60,0x30,0x60,0x60,0x60,
0x60,0x60,0xe0,0xc0,0x98,0xfc,0x64,0xc0,
0xc0,0xc0,0xc0,0xc0,0x80,0x80,0x80,0x00,
0x00,0xc0,0xc0,0x20,0x20,0x38,0x7c,0xec,
0xe0,0xd0,0xd0,0xdc,0x7c,0x38,0x08,0x08,
0xcc,0xfe,0x70,0x30,0x30,0xf8,0x60,0xc0,
0xcc,0xcc,0x7c,0x38,0xcc,0x78,0xcc,0xcc,
0xcc,0xcc,0x78,0xcc,0x18,0x18,0x18,0x7e,
0x18,0x7e,0x18,0x3c,0x24,0x66,0x42,0xc3,
0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,
0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x38,
0x7c,0x6c,0x0c,0x18,0x7c,0xe6,0xc6,0xce,
0x7c,0x30,0x60,0x6c,0x7c,0x38,0xd8,0xd8,
0x1e,0x00,0x33,0x00,0x40,0x80,0xde,0xc0,
0xb3,0x40,0xa0,0x40,0xa0,0x40,0xb3,0x40,
0xde,0xc0,0x40,0x80,0x33,0x00,0x1e,0x00,
0xf0,0x00,0xd0,0xb0,0x70,0xb0,0x60,0x24,
0x6c,0xd8,0xd8,0x6c,0x24,0x06,0x06,0x06,
0xfe,0xfe,0xe0,0xe0,0x1e,0x00,0x33,0x00,
0x40,0x80,0xd2,0xc0,0x96,0x40,0x9c,0x40,
0x92,0x40,0x92,0x40,0xdc,0xc0,0x40,0x80,
0x33,0x00,0x1e,0x00,0xf0,0x60,0x90,0x90,
0x90,0x60,0xfc,0xfc,0x00,0x30,0x30,0x30,
0xfc,0xfc,0x30,0x30,0x30,0xf0,0x80,0x40,
0x20,0x90,0xb0,0x60,0x60,0xb0,0x10,0x60,
0x30,0x90,0x60,0xc0,0x60,0xc0,0xc0,0xc0,
0xf6,0xfe,0xce,0xc6,0xc6,0xc6,0xc6,0xc6,
0xc6,0x14,0x14,0x14,0x14,0x14,0x14,0x14,
0x14,0x74,0xf4,0xf4,0xf4,0xf4,0x74,0x3e,
0xc0,0xc0,0xc0,0x60,0x40,0x20,0x20,0x20,
0x20,0x20,0xe0,0x20,0xf0,0x00,0x60,0x90,
0x90,0x90,0x60,0x90,0xd8,0x6c,0x6c,0xd8,
0x90,0x20,0x40,0x10,0x40,0x13,0xe0,0x0a,
0x40,0x09,0x40,0x24,0xc0,0x24,0x40,0x22,
0x00,0x22,0x00,0x21,0x00,0xe1,0x00,0x20,
0x80,0x21,0xe0,0x11,0x00,0x10,0x80,0x08,
0x40,0x09,0x20,0x25,0x60,0x24,0xc0,0x22,
0x00,0x22,0x00,0x21,0x00,0xe1,0x00,0x20,
0x80,0x20,0x40,0x10,0x40,0x13,0xe0,0x0a,
0x40,0x09,0x40,0x64,0xc0,0xb4,0x40,0x12,
0x00,0x62,0x00,0x31,0x00,0x91,0x00,0x60,
0x80,0x70,0xf8,0xcc,0xcc,0xc0,0x60,0x60,
0x30,0x30,0x00,0x30,0x30,0xe1,0xc0,0x61,
0x80,0x7f,0x80,0x3f,0x00,0x33,0x00,0x33,
0x00,0x12,0x00,0x1e,0x00,0x1e,0x00,0x0c,
0x00,0x0c,0x00,0x00,0x00,0x0c,0x00,0x18,
0x00,0xe1,0xc0,0x61,0x80,0x7f,0x80,0x3f,
0x00,0x33,0x00,0x33,0x00,0x12,0x00,0x1e,
0x00,0x1e,0x00,0x0c,0x00,0x0c,0x00,0x00,
0x00,0x0c,0x00,0x06,0x00,0xe1,0xc0,0x61,
0x80,0x7f,0x80,0x3f,0x00,0x33,0x00,0x33,
0x00,0x12,0x00,0x1e,0x00,0x1e,0x00,0x0c,
0x00,0x0c,0x00,0x00,0x00,0x36,0x00,0x1c,
0x00,0xe1,0xc0,0x61,0x80,0x7f,0x80,0x3f,
0x00,0x33,0x00,0x33,0x00,0x12,0x00,0x1e,
0x00,0x1e,0x00,0x0c,0x00,0x0c,0x00,0x00,
0x00,0x16,0x00,0x0d,0x00,0xe1,0xc0,0x61,
0x80,0x7f,0x80,0x3f,0x00,0x33,0x00,0x33,
0x00,0x12,0x00,0x1e,0x00,0x1e,0x00,0x0c,
0x00,0x0c,0x00,0x00,0x00,0x36,0x00,0x36,
0x00,0xe1,0xc0,0x61,0x80,0x7f,0x80,0x3f,
0x00,0x33,0x00,0x33,0x00,0x12,0x00,0x1e,
0x00,0x1e,0x00,0x0c,0x00,0x0c,0x00,0x0c,
0x00,0x0a,0x00,0x06,0x00,0xe3,0xf8,0x63,
0xf8,0x7f,0x00,0x7f,0x00,0x33,0x00,0x33,
0xf8,0x3b,0xf8,0x1b,0x00,0x1b,0x00,0x1f,
0x00,0x0f,0xf8,0x0f,0xf8,0x18,0x0c,0x08,
0x3c,0x7e,0x63,0xc3,0xc0,0xc0,0xc0,0xc0,
0xc3,0x63,0x7e,0x3c,0xfe,0xfe,0xc0,0xc0,
0xc0,0xfe,0xfe,0xc0,0xc0,0xfe,0xfe,0x00,
0x18,0x30,0xfe,0xfe,0xc0,0xc0,0xc0,0xfe,
0xfe,0xc0,0xc0,0xfe,0xfe,0x00,0x18,0x0c,
0xfe,0xfe,0xc0,0xc0,0xc0,0xfe,0xfe,0xc0,
0xc0,0xfe,0xfe,0x00,0x6c,0x38,0xfe,0xfe,
0xc0,0xc0,0xc0,0xfe,0xfe,0xc0,0xc0,0xfe,
0xfe,0x00,0x6c,0x6c,0x60,0x60,0x60,0x60,
0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,
0x60,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
0xc0,0xc0,0xc0,0xc0,0xc0,0x00,0xc0,0x60,
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
0x30,0x30,0x30,0x00,0xd8,0x70,0x30,0x30,
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
0x30,0x00,0xd8,0xd8,0x7e,0x00,0x7f,0x00,
0x63,0x00,0x61,0x80,0x61,0x80,0xf9,0x80,
0xf9,0x80,0x61,0x80,0x61,0x80,0x63,0x00,
0x7f,0x00,0x7e,0x00,0xc3,0xc7,0xc7,0xcf,
0xcb,0xdb,0xd3,0xf3,0xe3,0xe3,0xc3,0x00,
0x2c,0x1a,0x3e,0x00,0x7f,0x00,0x63,0x00,
0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,
0xc1,0x80,0x63,0x00,0x7f,0x00,0x3e,0x00,
0x00,0x00,0x0c,0x00,0x18,0x00,0x3e,0x00,
0x7f,0x00,0x63,0x00,0xc1,0x80,0xc1,0x80,
0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x00,
0x7f,0x00,0x3e,0x00,0x00,0x00,0x18,0x00,
0x0c,0x00,0x3e,0x00,0x7f,0x00,0x63,0x00,
0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,
0xc1,0x80,0x63,0x00,0x7f,0x00,0x3e,0x00,
0x00,0x00,0x36,0x00,0x1c,0x00,0x3e,0x00,
0x7f,0x00,0x63,0x00,0xc1,0x80,0xc1,0x80,
0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x00,
0x7f,0x00,0x3e,0x00,0x00,0x00,0x2c,0x00,
0x1a,0x00,0x3e,0x00,0x7f,0x00,0x63,0x00,
0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,
0xc1,0x80,0x63,0x00,0x7f,0x00,0x3e,0x00,
0x00,0x00,0x36,0x00,0x36,0x00,0x84,0xcc,
0x78,0x30,0x30,0x78,0xcc,0x84,0xbe,0x00,
0xff,0x00,0x63,0x00,0xf1,0x80,0xd1,0x80,
0xc9,0x80,0xc9,0x80,0xc5,0x80,0xc7,0x80,
0x63,0x00,0x7f,0x80,0x3e,0x80,0x3c,0x7e,
0xe7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,
0xc3,0x00,0x18,0x30,0x3c,0x7e,0xe7,0xc3,
0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x00,
0x18,0x0c,0x3c,0x7e,0xe7,0xc3,0xc3,0xc3,
0xc3,0xc3,0xc3,0xc3,0xc3,0x00,0x6c,0x38,
0x3c,0x7e,0xe7,0xc3,0xc3,0xc3,0xc3,0xc3,
0xc3,0xc3,0xc3,0x00,0x6c,0x6c,0x0c,0x00,
0x0c,0x00,0x0c,0x00,0x0c,0x00,0x0c,0x00,
0x1e,0x00,0x1e,0x00,0x33,0x00,0x33,0x00,
0x61,0x80,0xe1,0xc0,0x00,0x00,0x0c,0x00,
0x06,0x00,0xc0,0xc0,0xf8,0xfc,0xce,0xc6,
0xc6,0xce,0xfc,0xf8,0xc0,0xc0,0xd8,0xdc,
0xc6,0xc6,0xc6,0xdc,0xd8,0xcc,0xcc,0xcc,
0x7c,0x38,0x6c,0xfc,0xcc,0xcc,0x7c,0x1c,
0xcc,0xfc,0x78,0x00,0x30,0x60,0x6c,0xfc,
0xcc,0xcc,0x7c,0x1c,0xcc,0xfc,0x78,0x00,
0x30,0x18,0x6c,0xfc,0xcc,0xcc,0x7c,0x1c,
0xcc,0xfc,0x78,0x00,0xd8,0x70,0x6c,0xfc,
0xcc,0xcc,0x7c,0x1c,0xcc,0xfc,0x78,0x00,
0x58,0x34,0x6c,0xfc,0xcc,0xcc,0x7c,0x1c,
0xcc,0xfc,0x78,0x00,0xd8,0xd8,0x6c,0xfc,
0xcc,0xcc,0x7c,0x1c,0xcc,0xfc,0x78,0x00,
0x30,0x28,0x18,0x73,0x80,0xff,0xc0,0xcc,
0xc0,0xcc,0x00,0x7f,0xc0,0x1c,0xc0,0xcc,
0xc0,0xff,0xc0,0x73,0x80,0x30,0x18,0x10,
0x38,0x7c,0xec,0xc0,0xc0,0xc0,0xec,0x7c,
0x38,0x38,0x7c,0xcc,0xc0,0xfc,0xcc,0xcc,
0x78,0x30,0x00,0x30,0x60,0x38,0x7c,0xcc,
0xc0,0xfc,0xcc,0xcc,0x78,0x30,0x00,0x30,
0x18,0x38,0x7c,0xcc,0xc0,0xfc,0xcc,0xcc,
0x78,0x30,0x00,0x6c,0x38,0x38,0x7c,0xcc,
0xc0,0xfc,0xcc,0xcc,0x78,0x30,0x00,0xd8,
0xd8,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
0x60,0x60,0x00,0x60,0xc0,0xc0,0xc0,0xc0,
0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x00,0xc0,
0x60,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
0x30,0x30,0x00,0xd8,0x70,0x30,0x30,0x30,
0x30,0x30,0x30,0x30,0x30,0x30,0x00,0xd8,
0xd8,0x38,0x7c,0xee,0xc6,0xc6,0xc6,0xee,
0x7c,0x3c,0xf8,0x38,0x6c,0xc6,0xc6,0xc6,
0xc6,0xc6,0xc6,0xe6,0xfe,0xdc,0x00,0x58,
0x34,0x38,0x7c,0xee,0xc6,0xc6,0xc6,0xee,
0x7c,0x38,0x00,0x18,0x30,0x38,0x7c,0xee,
0xc6,0xc6,0xc6,0xee,0x7c,0x38,0x00,0x30,
0x18,0x38,0x7c,0xee,0xc6,0xc6,0xc6,0xee,
0x7c,0x38,0x00,0x6c,0x38,0x38,0x7c,0xee,
0xc6,0xc6,0xc6,0xee,0x7c,0x38,0x00,0x58,
0x34,0x38,0x7c,0xee,0xc6,0xc6,0xc6,0xee,
0x7c,0x38,0x00,0x6c,0x6c,0x30,0x30,0x00,
0xfc,0xfc,0x00,0x30,0x30,0xb8,0x7c,0xee,
0xe6,0xd6,0xce,0xee,0x7c,0x3a,0x76,0xfe,
0xce,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,
0x18,0x30,0x76,0xfe,0xce,0xc6,0xc6,0xc6,
0xc6,0xc6,0xc6,0x00,0x30,0x18,0x76,0xfe,
0xce,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,
0x6c,0x38,0x76,0xfe,0xce,0xc6,0xc6,0xc6,
0xc6,0xc6,0xc6,0x00,0x6c,0x6c,0x60,0x70,
0x10,0x18,0x38,0x38,0x2c,0x6c,0x6c,0xc6,
0xc6,0xc6,0x00,0x30,0x18,0xc0,0xc0,0xc0,
0xd8,0xfc,0xee,0xc6,0xc6,0xc6,0xee,0xfc,
0xd8,0xc0,0xc0,0xc0,0x60,0x70,0x10,0x18,
0x38,0x38,0x2c,0x6c,0x6c,0xc6,0xc6,0xc6,
0x00,0x6c,0x6c,
};
BMF_FontData BMF_font_helvb14 = {
-2, -3,
12, 14,
{
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0, 0, 0, 0, 12, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{1, 1, 0, 0, 3, 0},
{2, 12, -1, 0, 4, 1},
{5, 4, 0, -8, 6, 13},
{8, 12, 1, 0, 7, 17},
{7, 15, 0, 2, 7, 29},
{11, 11, 0, 0, 12, 44},
{9, 12, 0, 0, 9, 66},
{2, 4, -1, -8, 4, 90},
{4, 15, 0, 3, 4, 94},
{4, 15, 1, 3, 4, 109},
{5, 6, 0, -6, 5, 124},
{6, 8, -1, 0, 8, 130},
{2, 5, 0, 3, 3, 138},
{7, 2, 0, -3, 8, 143},
{2, 2, 0, 0, 3, 145},
{4, 11, 0, 0, 4, 147},
{6, 12, 0, 0, 7, 158},
{4, 12, 0, 0, 7, 170},
{6, 12, 0, 0, 7, 182},
{6, 12, 0, 0, 7, 194},
{6, 12, 0, 0, 7, 206},
{6, 12, 0, 0, 7, 218},
{6, 12, 0, 0, 7, 230},
{6, 12, 0, 0, 7, 242},
{6, 12, 0, 0, 7, 254},
{6, 12, 0, 0, 7, 266},
{2, 8, -1, 0, 4, 278},
{2, 11, -1, 3, 4, 286},
{7, 8, 0, 0, 8, 297},
{6, 6, -1, -1, 8, 305},
{7, 8, 0, 0, 8, 311},
{6, 12, -1, 0, 8, 319},
{12, 14, 0, 2, 13, 331},
{10, 12, 1, 0, 9, 359},
{8, 12, 0, 0, 9, 383},
{8, 12, 0, 0, 9, 395},
{8, 12, 0, 0, 9, 407},
{7, 12, 0, 0, 8, 419},
{7, 12, -1, 0, 8, 431},
{9, 12, 0, 0, 10, 443},
{8, 12, 0, 0, 9, 467},
{2, 12, -1, 0, 5, 479},
{6, 12, 0, 0, 7, 491},
{9, 12, -1, 0, 10, 503},
{7, 12, -1, 0, 8, 527},
{10, 12, 0, 0, 11, 539},
{8, 12, 0, 0, 9, 563},
{9, 12, 0, 0, 10, 575},
{7, 12, -1, 0, 9, 599},
{9, 13, 0, 1, 10, 611},
{8, 12, 0, 0, 9, 637},
{8, 12, 0, 0, 9, 649},
{8, 12, 0, 0, 9, 661},
{8, 12, 0, 0, 9, 673},
{8, 12, 0, 0, 9, 685},
{12, 12, 0, 0, 13, 697},
{9, 12, 0, 0, 10, 721},
{10, 12, 1, 0, 9, 745},
{8, 12, 0, 0, 9, 769},
{3, 15, 0, 3, 4, 781},
{4, 11, 0, 0, 4, 796},
{3, 15, 0, 3, 4, 807},
{6, 7, -1, -4, 8, 822},
{7, 1, 0, 3, 7, 829},
{2, 4, -1, -8, 4, 830},
{6, 9, 0, 0, 7, 834},
{7, 12, 0, 0, 8, 843},
{6, 9, 0, 0, 7, 855},
{7, 12, 0, 0, 8, 864},
{6, 9, 0, 0, 7, 876},
{4, 12, 0, 0, 5, 885},
{7, 12, 0, 3, 8, 897},
{7, 12, 0, 0, 8, 909},
{2, 12, 0, 0, 3, 921},
{3, 15, 1, 3, 3, 933},
{7, 12, 0, 0, 7, 948},
{2, 12, 0, 0, 3, 960},
{10, 9, 0, 0, 11, 972},
{7, 9, 0, 0, 8, 990},
{7, 9, 0, 0, 8, 999},
{7, 12, 0, 3, 8, 1008},
{7, 12, 0, 3, 8, 1020},
{5, 9, 0, 0, 5, 1032},
{6, 9, 0, 0, 7, 1041},
{4, 11, 0, 0, 5, 1050},
{7, 9, 0, 0, 8, 1061},
{6, 9, 0, 0, 7, 1070},
{10, 9, 0, 0, 11, 1079},
{7, 9, 0, 0, 8, 1097},
{7, 12, 0, 3, 8, 1106},
{6, 9, 0, 0, 7, 1118},
{4, 15, 0, 3, 5, 1127},
{1, 15, -1, 3, 4, 1142},
{4, 15, 0, 3, 5, 1157},
{6, 3, -1, -3, 8, 1172},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{2, 12, -1, 3, 4, 1175},
{6, 13, 0, 2, 7, 1187},
{7, 12, 0, 0, 7, 1200},
{6, 8, 0, -2, 7, 1212},
{8, 12, 1, 0, 7, 1220},
{1, 15, -1, 3, 4, 1232},
{7, 15, 0, 3, 7, 1247},
{5, 2, 1, -10, 4, 1262},
{10, 12, 0, 0, 10, 1264},
{4, 7, 0, -5, 5, 1288},
{6, 6, 0, -1, 7, 1295},
{7, 5, 0, -2, 8, 1301},
{3, 2, 0, -3, 4, 1306},
{10, 12, 0, 0, 10, 1308},
{4, 1, 0, -11, 4, 1332},
{4, 5, 0, -7, 5, 1333},
{6, 11, -1, 0, 8, 1338},
{4, 7, 0, -5, 4, 1349},
{4, 7, 0, -5, 4, 1356},
{3, 2, -1, -10, 4, 1363},
{7, 12, 0, 3, 8, 1365},
{7, 15, 0, 3, 7, 1377},
{2, 2, 0, -5, 3, 1392},
{3, 3, 0, 3, 4, 1394},
{3, 7, 0, -5, 4, 1397},
{4, 7, 0, -5, 5, 1404},
{6, 6, 0, -1, 7, 1411},
{11, 12, 1, 0, 11, 1417},
{11, 12, 1, 0, 11, 1441},
{11, 12, 0, 0, 11, 1465},
{6, 12, -1, 3, 8, 1489},
{10, 14, 1, 0, 9, 1501},
{10, 14, 1, 0, 9, 1529},
{10, 14, 1, 0, 9, 1557},
{10, 14, 1, 0, 9, 1585},
{10, 14, 1, 0, 9, 1613},
{10, 14, 1, 0, 9, 1641},
{13, 12, 1, 0, 13, 1669},
{8, 15, 0, 3, 9, 1693},
{7, 14, 0, 0, 8, 1708},
{7, 14, 0, 0, 8, 1722},
{7, 14, 0, 0, 8, 1736},
{7, 14, 0, 0, 8, 1750},
{3, 14, 0, 0, 5, 1764},
{3, 14, -1, 0, 5, 1778},
{5, 14, 1, 0, 5, 1792},
{5, 14, 1, 0, 5, 1806},
{9, 12, 1, 0, 9, 1820},
{8, 14, 0, 0, 9, 1844},
{9, 14, 0, 0, 10, 1858},
{9, 14, 0, 0, 10, 1886},
{9, 14, 0, 0, 10, 1914},
{9, 14, 0, 0, 10, 1942},
{9, 14, 0, 0, 10, 1970},
{6, 8, -1, 0, 8, 1998},
{9, 12, 0, 0, 10, 2006},
{8, 14, 0, 0, 9, 2030},
{8, 14, 0, 0, 9, 2044},
{8, 14, 0, 0, 9, 2058},
{8, 14, 0, 0, 9, 2072},
{10, 14, 1, 0, 9, 2086},
{7, 12, -1, 0, 9, 2114},
{7, 12, 0, 0, 8, 2126},
{6, 12, 0, 0, 7, 2138},
{6, 12, 0, 0, 7, 2150},
{6, 12, 0, 0, 7, 2162},
{6, 12, 0, 0, 7, 2174},
{6, 12, 0, 0, 7, 2186},
{6, 13, 0, 0, 7, 2198},
{10, 9, 0, 0, 11, 2211},
{6, 12, 0, 3, 7, 2229},
{6, 12, 0, 0, 7, 2241},
{6, 12, 0, 0, 7, 2253},
{6, 12, 0, 0, 7, 2265},
{6, 12, 0, 0, 7, 2277},
{3, 12, 1, 0, 3, 2289},
{3, 12, 0, 0, 3, 2301},
{5, 12, 2, 0, 3, 2313},
{5, 12, 2, 0, 3, 2325},
{7, 12, 0, 0, 8, 2337},
{7, 12, 0, 0, 8, 2349},
{7, 12, 0, 0, 8, 2361},
{7, 12, 0, 0, 8, 2373},
{7, 12, 0, 0, 8, 2385},
{7, 12, 0, 0, 8, 2397},
{7, 12, 0, 0, 8, 2409},
{6, 8, -1, 0, 8, 2421},
{7, 9, 0, 0, 8, 2429},
{7, 12, 0, 0, 8, 2438},
{7, 12, 0, 0, 8, 2450},
{7, 12, 0, 0, 8, 2462},
{7, 12, 0, 0, 8, 2474},
{7, 15, 0, 3, 8, 2486},
{7, 15, 0, 3, 8, 2501},
{7, 15, 0, 3, 8, 2516},
},
bitmap_data
};
#endif

@ -0,0 +1,455 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "BMF_FontData.h"
#include "BMF_Settings.h"
#if BMF_INCLUDE_HELVB8
static unsigned char bitmap_data[]= {
0x00,0x80,0x00,0x80,0x80,0x80,0x80,0xa0,
0xa0,0xa0,0x50,0xf8,0x50,0xf8,0x50,0x40,
0xe0,0x10,0x60,0x80,0x70,0x20,0x5c,0x54,
0x2c,0xd0,0xa8,0xe8,0x58,0xb0,0xa8,0x48,
0xa0,0x40,0x80,0x80,0x80,0x40,0x80,0x80,
0x80,0x80,0x80,0x40,0x80,0x40,0x40,0x40,
0x40,0x40,0x80,0x40,0xe0,0x40,0x20,0x20,
0xf8,0x20,0x20,0x80,0x40,0x40,0xf0,0x80,
0x80,0x80,0x80,0x80,0x40,0x40,0x40,0x60,
0x90,0x90,0x90,0x90,0x60,0x40,0x40,0x40,
0x40,0xc0,0x40,0xf0,0x40,0x20,0x10,0x90,
0x60,0xc0,0x20,0x20,0xc0,0x20,0xc0,0x20,
0x20,0xf0,0x60,0x20,0x20,0xc0,0x20,0x20,
0xc0,0x80,0xe0,0x60,0x90,0x90,0xe0,0x80,
0x70,0x40,0x40,0x40,0x20,0x10,0xf0,0x60,
0x90,0x90,0x60,0x90,0x60,0x60,0x10,0x70,
0x90,0x90,0x60,0x80,0x00,0x00,0x80,0x80,
0x40,0x40,0x00,0x00,0x40,0x20,0x40,0x80,
0x40,0x20,0xe0,0x00,0xe0,0x80,0x40,0x20,
0x40,0x80,0x40,0x00,0x40,0x20,0xc0,0x78,
0x80,0x9e,0xa5,0x99,0x41,0x3e,0x88,0x88,
0x70,0x50,0x20,0x20,0xe0,0x90,0x90,0xe0,
0x90,0xe0,0x70,0x88,0x80,0x80,0x88,0x70,
0xf0,0x88,0x88,0x88,0x88,0xf0,0xf0,0x80,
0x80,0xe0,0x80,0xf0,0x80,0x80,0x80,0xe0,
0x80,0xf0,0x70,0x88,0x88,0x98,0x80,0x70,
0x88,0x88,0x88,0xf8,0x88,0x88,0x80,0x80,
0x80,0x80,0x80,0x80,0x40,0xa0,0x20,0x20,
0x20,0x20,0x90,0x90,0xe0,0xc0,0xa0,0x90,
0xe0,0x80,0x80,0x80,0x80,0x80,0xa8,0xa8,
0xa8,0xa8,0xd8,0x88,0x88,0x98,0xa8,0xa8,
0xc8,0x88,0x70,0x88,0x88,0x88,0x88,0x70,
0x80,0x80,0xe0,0x90,0x90,0xe0,0x10,0x20,
0x70,0x88,0x88,0x88,0x88,0x70,0x90,0x90,
0xe0,0x90,0x90,0xe0,0xe0,0x10,0x10,0xe0,
0x80,0x70,0x40,0x40,0x40,0x40,0x40,0xe0,
0x70,0x88,0x88,0x88,0x88,0x88,0x40,0xa0,
0x90,0x90,0x90,0x90,0x48,0x48,0x6c,0x92,
0x92,0x92,0x90,0x90,0x60,0x60,0x90,0x90,
0x20,0x20,0x30,0x48,0x48,0xc8,0xf0,0x80,
0x40,0x20,0x10,0xf0,0xc0,0x80,0x80,0x80,
0x80,0x80,0xc0,0x40,0x40,0x40,0x40,0x80,
0x80,0x80,0xc0,0x40,0x40,0x40,0x40,0x40,
0xc0,0x88,0x50,0x20,0xf8,0x80,0x80,0x80,
0xd0,0xa0,0xe0,0x20,0xc0,0xe0,0x90,0x90,
0x90,0xe0,0x80,0x80,0x60,0x80,0x80,0x80,
0x60,0x70,0x90,0x90,0x90,0x70,0x10,0x10,
0x60,0x80,0xe0,0xa0,0x40,0x40,0x40,0x40,
0x40,0xe0,0x40,0x20,0x60,0x10,0x70,0x90,
0x90,0x70,0x90,0x90,0x90,0x90,0xe0,0x80,
0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x80,
0x80,0x40,0x40,0x40,0x40,0x40,0x40,0x00,
0x40,0xa0,0xa0,0xc0,0xc0,0xa0,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xa8,
0xa8,0xa8,0xa8,0xf0,0x90,0x90,0x90,0x90,
0xe0,0x60,0x90,0x90,0x90,0x60,0x80,0xe0,
0x90,0x90,0x90,0xe0,0x10,0x70,0x90,0x90,
0x90,0x70,0x80,0x80,0x80,0xc0,0xa0,0xc0,
0x20,0x60,0x80,0x60,0x40,0x40,0x40,0x40,
0xe0,0x40,0x40,0x60,0xa0,0xa0,0xa0,0xa0,
0x40,0xa0,0x90,0x90,0x90,0x50,0x50,0xa8,
0xa8,0xa8,0x90,0x90,0x60,0x90,0x90,0x80,
0x40,0x60,0x90,0x90,0x90,0xe0,0x80,0x40,
0x20,0xe0,0x20,0x40,0x40,0xc0,0x40,0x40,
0x20,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x40,0x40,0x60,0x40,0x40,0x80,0xb0,
0x48,0x00,0x80,0x80,0x80,0x80,0x80,0x00,
0x80,0x40,0x40,0xa0,0x80,0xa0,0x40,0x40,
0xf0,0x40,0x40,0xe0,0x40,0x30,0x88,0x70,
0x50,0x70,0x88,0x20,0x20,0xf8,0x50,0x88,
0x80,0x80,0x80,0x00,0x80,0x80,0x80,0xe0,
0x10,0x30,0x60,0x90,0x60,0x80,0x70,0x90,
0x78,0x84,0xb4,0xa4,0xb4,0x84,0x78,0xe0,
0x00,0xe0,0x20,0xc0,0x50,0xa0,0x50,0x10,
0x10,0xf0,0xc0,0x78,0x84,0xac,0xb4,0xb4,
0x84,0x78,0xe0,0x40,0xa0,0x40,0xf0,0x00,
0x20,0xf0,0x20,0xc0,0x80,0x40,0x80,0xc0,
0x20,0x60,0xe0,0x80,0x40,0x80,0x80,0xe0,
0xa0,0xa0,0xa0,0x50,0x50,0x50,0x50,0xd0,
0xd0,0xd0,0x78,0x80,0x80,0x80,0x40,0x40,
0x40,0xc0,0x40,0xe0,0x00,0xe0,0xa0,0xe0,
0xa0,0x50,0xa0,0x04,0x5e,0x2c,0x54,0x48,
0xc4,0x40,0x0e,0x44,0x22,0x5c,0x48,0xc4,
0x40,0x04,0x5e,0x2c,0xd4,0x28,0x64,0xe0,
0x60,0x90,0x40,0x20,0x00,0x20,0x88,0x88,
0x70,0x50,0x20,0x20,0x00,0x20,0x40,0x88,
0x88,0x70,0x50,0x20,0x20,0x00,0x20,0x10,
0x88,0x88,0x70,0x50,0x20,0x20,0x00,0x50,
0x20,0x88,0x88,0x70,0x50,0x20,0x20,0x00,
0x50,0x28,0x88,0x88,0x70,0x50,0x20,0x20,
0x00,0x50,0x88,0x88,0x70,0x50,0x20,0x20,
0x20,0x50,0x20,0x9e,0x90,0x7c,0x50,0x30,
0x3e,0x80,0x40,0x70,0x88,0x80,0x88,0x88,
0x70,0xf0,0x80,0x80,0xe0,0x80,0xf0,0x00,
0x20,0x40,0xf0,0x80,0x80,0xe0,0x80,0xf0,
0x00,0x40,0x20,0xf0,0x80,0x80,0xe0,0x80,
0xf0,0x00,0xa0,0x40,0xf0,0x80,0x80,0xe0,
0x80,0xf0,0x00,0xa0,0x40,0x40,0x40,0x40,
0x40,0x40,0x00,0x40,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x00,0x80,0x40,0x40,0x40,
0x40,0x40,0x40,0x40,0x00,0xa0,0x40,0x40,
0x40,0x40,0x40,0x40,0x40,0x00,0xa0,0x70,
0x48,0x48,0xe8,0x48,0x70,0x88,0x98,0xa8,
0xa8,0xc8,0x88,0x00,0x50,0x28,0x70,0x88,
0x88,0x88,0x88,0x70,0x00,0x20,0x40,0x70,
0x88,0x88,0x88,0x88,0x70,0x00,0x20,0x10,
0x70,0x88,0x88,0x88,0x88,0x70,0x00,0x50,
0x20,0x70,0x88,0x88,0x88,0x88,0x70,0x00,
0x50,0x28,0x70,0x88,0x88,0x88,0x88,0x70,
0x00,0x50,0x90,0x60,0x60,0x90,0x80,0xf0,
0xc8,0xa8,0x98,0x88,0x78,0x08,0x70,0x88,
0x88,0x88,0x88,0x88,0x00,0x20,0x40,0x70,
0x88,0x88,0x88,0x88,0x88,0x00,0x20,0x10,
0x70,0x88,0x88,0x88,0x88,0x88,0x00,0x50,
0x20,0x70,0x88,0x88,0x88,0x88,0x88,0x00,
0x50,0x20,0x20,0x30,0x48,0x48,0xc8,0x00,
0x10,0x08,0x80,0xf0,0x88,0x88,0xf0,0x80,
0x80,0xa0,0x90,0x90,0xa0,0x90,0x60,0xd0,
0xa0,0xe0,0x20,0xc0,0x00,0x40,0x80,0xd0,
0xa0,0xe0,0x20,0xc0,0x00,0x40,0x20,0xd0,
0xa0,0xe0,0x20,0xc0,0x00,0xa0,0x40,0x68,
0x50,0x70,0x10,0x60,0x00,0xb0,0x68,0xd0,
0xa0,0xe0,0x20,0xc0,0x00,0xa0,0xd0,0xa0,
0xe0,0x20,0xc0,0x40,0xa0,0x40,0xd8,0xa0,
0xf8,0x28,0xd0,0x80,0x40,0x60,0x80,0x80,
0x80,0x60,0x60,0x80,0xe0,0xa0,0x40,0x00,
0x20,0x40,0x60,0x80,0xe0,0xa0,0x40,0x00,
0x40,0x20,0x60,0x80,0xe0,0xa0,0x40,0x00,
0xa0,0x40,0x60,0x80,0xe0,0xa0,0x40,0x00,
0xa0,0x40,0x40,0x40,0x40,0x40,0x00,0x40,
0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x80,
0x40,0x40,0x40,0x40,0x40,0x40,0x00,0xa0,
0x40,0x40,0x40,0x40,0x40,0x40,0x00,0xa0,
0x60,0x90,0x90,0x90,0x70,0xa0,0x60,0x90,
0x90,0x90,0x90,0x90,0xe0,0x00,0xa0,0x50,
0x60,0x90,0x90,0x90,0x60,0x00,0x20,0x40,
0x60,0x90,0x90,0x90,0x60,0x00,0x20,0x10,
0x60,0x90,0x90,0x90,0x60,0x00,0xa0,0x40,
0x60,0x90,0x90,0x90,0x60,0x00,0xa0,0x50,
0x60,0x90,0x90,0x90,0x60,0x00,0x90,0x20,
0x00,0xf0,0x00,0x20,0x80,0x70,0x68,0x58,
0x48,0x3c,0x02,0x60,0xa0,0xa0,0xa0,0xa0,
0x00,0x40,0x80,0x60,0xa0,0xa0,0xa0,0xa0,
0x00,0x40,0x20,0x60,0xa0,0xa0,0xa0,0xa0,
0x00,0xa0,0x40,0x60,0xa0,0xa0,0xa0,0xa0,
0x00,0xa0,0x80,0x40,0x60,0x90,0x90,0x90,
0x00,0x20,0x10,0x80,0xe0,0x90,0x90,0x90,
0xe0,0x80,0x80,0x40,0x60,0x90,0x90,0x90,
0x00,0x50,
};
BMF_FontData BMF_font_helvb8 = {
0, -2,
9, 9,
{
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0, 0, 0, 0, 8, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{1, 1, 0, 0, 2, 0},
{1, 6, -1, 0, 2, 1},
{3, 3, -1, -3, 3, 7},
{5, 5, 0, 0, 5, 10},
{4, 7, -1, 1, 5, 15},
{6, 6, -1, 0, 7, 22},
{5, 6, -1, 0, 6, 28},
{1, 3, -1, -3, 2, 34},
{2, 7, -1, 1, 3, 37},
{2, 7, -1, 1, 3, 44},
{3, 3, -1, -2, 3, 51},
{5, 5, -1, 0, 5, 54},
{2, 3, 0, 2, 2, 59},
{4, 1, -2, -2, 6, 62},
{1, 1, -1, 0, 2, 63},
{2, 7, -1, 1, 2, 64},
{4, 6, -1, 0, 5, 71},
{2, 6, -2, 0, 5, 77},
{4, 6, -1, 0, 5, 83},
{3, 6, -2, 0, 5, 89},
{4, 6, -1, 0, 5, 95},
{3, 6, -2, 0, 5, 101},
{4, 6, -1, 0, 5, 107},
{4, 6, -1, 0, 5, 113},
{4, 6, -1, 0, 5, 119},
{4, 6, -1, 0, 5, 125},
{1, 4, -1, 0, 2, 131},
{2, 6, 0, 2, 2, 135},
{3, 5, -1, 0, 5, 141},
{3, 3, -1, -1, 4, 146},
{3, 5, -2, 0, 5, 149},
{3, 5, -2, 0, 5, 154},
{8, 7, -1, 1, 9, 159},
{5, 6, -1, 0, 6, 166},
{4, 6, -2, 0, 6, 172},
{5, 6, -1, 0, 6, 178},
{5, 6, -1, 0, 6, 184},
{4, 6, -2, 0, 6, 190},
{4, 6, -2, 0, 5, 196},
{5, 6, -1, 0, 6, 202},
{5, 6, -1, 0, 6, 208},
{1, 6, -1, 0, 2, 214},
{3, 6, -1, 0, 4, 220},
{4, 6, -2, 0, 6, 226},
{3, 6, -2, 0, 5, 232},
{5, 6, -2, 0, 7, 238},
{5, 6, -1, 0, 6, 244},
{5, 6, -1, 0, 6, 250},
{4, 6, -2, 0, 6, 256},
{5, 8, -1, 2, 6, 262},
{4, 6, -2, 0, 6, 270},
{4, 6, -2, 0, 6, 276},
{3, 6, -1, 0, 4, 282},
{5, 6, -1, 0, 6, 288},
{4, 6, -2, 0, 6, 294},
{7, 6, -1, 0, 7, 300},
{4, 6, -2, 0, 6, 306},
{5, 6, -1, 0, 6, 312},
{4, 6, -2, 0, 6, 318},
{2, 7, -1, 1, 2, 324},
{2, 7, 0, 1, 2, 331},
{2, 7, 0, 1, 2, 338},
{5, 3, 0, -2, 5, 345},
{5, 1, 0, 1, 5, 348},
{1, 3, -1, -3, 2, 349},
{4, 5, -1, 0, 4, 352},
{4, 7, -1, 0, 5, 357},
{3, 5, -1, 0, 4, 364},
{4, 7, -1, 0, 5, 369},
{3, 5, -1, 0, 4, 376},
{3, 7, -1, 0, 3, 381},
{4, 6, -1, 1, 5, 388},
{4, 7, -1, 0, 5, 394},
{1, 7, -1, 0, 2, 401},
{2, 9, 0, 2, 2, 408},
{3, 7, -1, 0, 4, 417},
{1, 7, -1, 0, 2, 424},
{5, 5, -1, 0, 6, 431},
{4, 5, -1, 0, 5, 436},
{4, 5, -1, 0, 5, 441},
{4, 6, -1, 1, 5, 446},
{4, 6, -1, 1, 5, 452},
{3, 5, -1, 0, 3, 458},
{3, 5, -1, 0, 4, 463},
{3, 7, -1, 0, 3, 468},
{3, 5, -1, 0, 4, 475},
{4, 5, -1, 0, 5, 480},
{5, 5, -1, 0, 6, 485},
{4, 5, -1, 0, 5, 490},
{4, 6, -1, 1, 4, 495},
{3, 5, -1, 0, 4, 501},
{3, 7, 0, 1, 2, 506},
{1, 7, -1, 1, 2, 513},
{3, 7, 0, 1, 2, 520},
{5, 2, -1, -2, 6, 527},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{1, 1, 0, 0, 2, 529},
{1, 7, -1, 2, 2, 530},
{3, 7, -1, 1, 5, 537},
{4, 6, -1, 0, 5, 544},
{5, 5, 0, 0, 4, 550},
{5, 5, -1, 0, 6, 555},
{1, 7, -1, 1, 2, 560},
{4, 8, -1, 2, 5, 567},
{4, 1, 0, -5, 2, 575},
{6, 7, -1, 1, 7, 576},
{3, 5, 0, -1, 3, 583},
{4, 3, -1, -1, 5, 588},
{4, 3, -1, -1, 6, 591},
{2, 1, 0, -2, 3, 594},
{6, 7, -1, 1, 7, 595},
{3, 1, 0, -5, 2, 602},
{3, 3, -1, -3, 3, 603},
{4, 5, -1, 0, 5, 606},
{2, 4, -1, -2, 2, 611},
{3, 4, 0, -2, 2, 615},
{2, 2, 0, -4, 2, 619},
{3, 6, -1, 2, 4, 621},
{5, 8, 0, 2, 5, 627},
{1, 2, -1, -1, 2, 635},
{2, 2, 0, 2, 2, 637},
{2, 4, 0, -2, 2, 639},
{3, 5, 0, -1, 3, 643},
{4, 3, -1, -1, 5, 648},
{7, 7, 0, 1, 7, 651},
{7, 7, 0, 1, 7, 658},
{7, 7, 0, 1, 7, 665},
{4, 6, -1, 1, 5, 672},
{5, 9, -1, 0, 6, 678},
{5, 9, -1, 0, 6, 687},
{5, 9, -1, 0, 6, 696},
{5, 9, -1, 0, 6, 705},
{5, 8, -1, 0, 6, 714},
{5, 9, -1, 0, 6, 722},
{7, 6, -1, 0, 8, 731},
{5, 8, -1, 2, 6, 737},
{4, 9, -2, 0, 6, 745},
{4, 9, -2, 0, 6, 754},
{4, 9, -2, 0, 6, 763},
{4, 8, -2, 0, 6, 772},
{2, 9, 0, 0, 2, 780},
{2, 9, -1, 0, 2, 789},
{3, 9, 0, 0, 2, 798},
{3, 8, 0, 0, 2, 807},
{5, 6, -1, 0, 6, 815},
{5, 9, -1, 0, 6, 821},
{5, 9, -1, 0, 6, 830},
{5, 9, -1, 0, 6, 839},
{5, 9, -1, 0, 6, 848},
{5, 9, -1, 0, 6, 857},
{5, 8, -1, 0, 6, 866},
{4, 4, -1, 0, 5, 874},
{5, 8, -1, 1, 6, 878},
{5, 9, -1, 0, 6, 886},
{5, 9, -1, 0, 6, 895},
{5, 9, -1, 0, 6, 904},
{5, 8, -1, 0, 6, 913},
{5, 9, -1, 0, 6, 921},
{5, 6, -1, 0, 6, 930},
{4, 7, -2, 1, 6, 936},
{4, 8, -1, 0, 4, 943},
{4, 8, -1, 0, 4, 951},
{4, 8, -1, 0, 4, 959},
{5, 8, 0, 0, 4, 967},
{4, 7, -1, 0, 4, 975},
{4, 8, -1, 0, 4, 982},
{5, 5, -1, 0, 6, 990},
{3, 7, -1, 2, 4, 995},
{3, 8, -1, 0, 4, 1002},
{3, 8, -1, 0, 4, 1010},
{3, 8, -1, 0, 4, 1018},
{3, 7, -1, 0, 4, 1026},
{2, 8, 0, 0, 2, 1033},
{2, 8, -1, 0, 2, 1041},
{3, 8, 0, 0, 2, 1049},
{3, 7, 0, 0, 2, 1057},
{4, 8, -1, 0, 5, 1064},
{4, 8, -1, 0, 5, 1072},
{4, 8, -1, 0, 5, 1080},
{4, 8, -1, 0, 5, 1088},
{4, 8, -1, 0, 5, 1096},
{4, 8, -1, 0, 5, 1104},
{4, 7, -1, 0, 5, 1112},
{4, 5, -1, 0, 5, 1119},
{7, 7, 0, 1, 5, 1124},
{3, 8, -1, 0, 4, 1131},
{3, 8, -1, 0, 4, 1139},
{3, 8, -1, 0, 4, 1147},
{3, 7, -1, 0, 4, 1155},
{4, 9, -1, 1, 4, 1162},
{4, 7, -1, 1, 5, 1171},
{4, 8, -1, 1, 4, 1178},
},
bitmap_data
};
#endif

@ -0,0 +1,484 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "BMF_FontData.h"
#include "BMF_Settings.h"
#if BMF_INCLUDE_SCR12
static unsigned char bitmap_data[]= {
0x80,0x80,0x00,0x80,0x80,0x80,0x80,0x80,
0xa0,0xa0,0xa0,0xa0,0x50,0x50,0xfc,0x28,
0x28,0x7e,0x14,0x14,0x20,0x70,0xa8,0x28,
0x70,0xa0,0xa8,0x70,0x20,0x98,0x54,0x54,
0x2c,0xd0,0xa8,0xa8,0x64,0x74,0x88,0x8c,
0x50,0x20,0x50,0x48,0x30,0x80,0x40,0x20,
0x20,0x20,0x40,0x40,0x80,0x80,0x80,0x80,
0x40,0x40,0x20,0x80,0x40,0x40,0x20,0x20,
0x20,0x20,0x40,0x40,0x80,0x20,0xa8,0x70,
0xa8,0x20,0x20,0x20,0xf8,0x20,0x20,0x80,
0x40,0x40,0xc0,0xf8,0x80,0x80,0x80,0x80,
0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,
0x70,0x88,0x88,0xc8,0xa8,0x98,0x88,0x70,
0xe0,0x40,0x40,0x40,0x40,0x40,0xc0,0x40,
0xf8,0x80,0x40,0x20,0x10,0x08,0x88,0x70,
0x70,0x88,0x08,0x08,0x70,0x08,0x88,0x70,
0x10,0x10,0x10,0xf8,0x90,0x50,0x30,0x10,
0x70,0x88,0x08,0x08,0xf0,0x80,0x80,0xf8,
0x70,0x88,0x88,0x88,0xf0,0x80,0x88,0x70,
0x40,0x40,0x20,0x20,0x10,0x10,0x08,0xf8,
0x70,0x88,0x88,0x88,0x70,0x88,0x88,0x70,
0x70,0x88,0x08,0x78,0x88,0x88,0x88,0x70,
0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x40,
0x40,0xc0,0x00,0x00,0x40,0x40,0x08,0x10,
0x20,0x40,0x80,0x40,0x20,0x10,0x08,0xf8,
0x00,0xf8,0x80,0x40,0x20,0x10,0x08,0x10,
0x20,0x40,0x80,0x20,0x00,0x20,0x20,0x10,
0x88,0x88,0x70,0x38,0x40,0x98,0xa8,0xa8,
0x98,0x48,0x30,0x88,0x88,0xf8,0x88,0x50,
0x50,0x20,0x20,0xf0,0x88,0x88,0x88,0xf0,
0x88,0x88,0xf0,0x70,0x88,0x80,0x80,0x80,
0x80,0x88,0x70,0xf0,0x88,0x88,0x88,0x88,
0x88,0x88,0xf0,0xf8,0x80,0x80,0x80,0xf0,
0x80,0x80,0xf8,0x80,0x80,0x80,0x80,0xf0,
0x80,0x80,0xf8,0x68,0x98,0x88,0x88,0x98,
0x80,0x88,0x70,0x88,0x88,0x88,0x88,0xf8,
0x88,0x88,0x88,0xe0,0x40,0x40,0x40,0x40,
0x40,0x40,0xe0,0x70,0x88,0x88,0x08,0x08,
0x08,0x08,0x08,0x88,0x88,0x90,0xa0,0xc0,
0xa0,0x90,0x88,0xf8,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x88,0x88,0xa8,0xa8,0xd8,
0xd8,0x88,0x88,0x88,0x98,0x98,0xa8,0xa8,
0xc8,0xc8,0x88,0x70,0x88,0x88,0x88,0x88,
0x88,0x88,0x70,0x80,0x80,0x80,0x80,0xf0,
0x88,0x88,0xf0,0x08,0x10,0x70,0xa8,0x88,
0x88,0x88,0x88,0x88,0x70,0x88,0x90,0x90,
0xa0,0xf0,0x88,0x88,0xf0,0x70,0x88,0x88,
0x08,0x70,0x80,0x88,0x70,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0xf8,0x70,0x88,0x88,
0x88,0x88,0x88,0x88,0x88,0x20,0x20,0x50,
0x50,0x50,0x88,0x88,0x88,0x50,0x50,0xf8,
0xa8,0xa8,0xa8,0x88,0x88,0x88,0x88,0x50,
0x20,0x20,0x50,0x88,0x88,0x20,0x20,0x20,
0x20,0x50,0x50,0x88,0x88,0xf8,0x80,0x40,
0x40,0x20,0x10,0x08,0xf8,0xe0,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0xe0,0x08,0x08,
0x10,0x10,0x20,0x20,0x40,0x40,0x80,0x80,
0xe0,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0xe0,0x88,0x50,0x20,0xfe,0x20,0x40,0x80,
0x80,0x68,0x98,0x88,0x78,0x08,0x70,0xb0,
0xc8,0x88,0x88,0xc8,0xb0,0x80,0x80,0x70,
0x88,0x80,0x80,0x88,0x70,0x68,0x98,0x88,
0x88,0x98,0x68,0x08,0x08,0x70,0x88,0x80,
0xf8,0x88,0x70,0x40,0x40,0x40,0x40,0x40,
0xf0,0x40,0x38,0xf0,0x08,0x68,0x98,0x88,
0x88,0x98,0x68,0x88,0x88,0x88,0x88,0xc8,
0xb0,0x80,0x80,0x20,0x20,0x20,0x20,0x20,
0xe0,0x00,0x20,0x60,0x90,0x10,0x10,0x10,
0x10,0x10,0x70,0x00,0x10,0x88,0x90,0xa0,
0xc0,0xa0,0x90,0x80,0x80,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0xe0,0xa8,0xa8,0xa8,
0xa8,0xa8,0xd0,0x88,0x88,0x88,0x88,0xc8,
0xb0,0x70,0x88,0x88,0x88,0x88,0x70,0x80,
0x80,0xb0,0xc8,0x88,0x88,0xc8,0xb0,0x08,
0x08,0x68,0x98,0x88,0x88,0x98,0x68,0x80,
0x80,0x80,0x80,0xc8,0xb0,0x70,0x88,0x10,
0x60,0x88,0x70,0x30,0x40,0x40,0x40,0x40,
0xf0,0x40,0x68,0x98,0x88,0x88,0x88,0x88,
0x20,0x20,0x50,0x50,0x88,0x88,0x50,0xa8,
0xa8,0xa8,0x88,0x88,0x88,0x88,0x50,0x20,
0x50,0x88,0xf0,0x08,0x68,0x98,0x88,0x88,
0x88,0x88,0xf8,0x80,0x40,0x20,0x10,0xf8,
0x18,0x20,0x20,0x20,0x20,0xc0,0x20,0x20,
0x20,0x18,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,0xc0,0x20,0x20,0x20,
0x20,0x18,0x20,0x20,0x20,0xc0,0x98,0xb4,
0x64,0x80,0x80,0x80,0x80,0x80,0x00,0x80,
0x80,0x20,0x20,0x70,0x88,0x80,0x88,0x70,
0x20,0x20,0xb0,0x48,0x40,0xf0,0x40,0x40,
0x48,0x30,0x90,0x60,0x90,0x90,0x60,0x90,
0x20,0x70,0x20,0x70,0x20,0x50,0x88,0x88,
0x80,0x80,0x80,0x80,0x00,0x00,0x80,0x80,
0x80,0x80,0x70,0x88,0x10,0x28,0x48,0x90,
0xa0,0x40,0x88,0x70,0xa0,0x78,0x84,0xb4,
0xa4,0xb4,0x84,0x78,0xf0,0x90,0x70,0x10,
0x60,0x14,0x28,0x50,0xa0,0x50,0x28,0x14,
0x08,0xf8,0xf0,0x78,0x84,0xac,0xb4,0xb4,
0x84,0x78,0xe0,0x60,0x90,0x60,0xf8,0x00,
0x20,0x20,0xf8,0x20,0x20,0xe0,0x40,0x20,
0xa0,0x40,0xc0,0x20,0x40,0x20,0xc0,0x80,
0x40,0x80,0xe8,0x90,0x90,0x90,0x90,0x28,
0x28,0x28,0x28,0x68,0xa8,0xa8,0xa8,0x7c,
0x80,0x80,0xc0,0x40,0xe0,0x40,0x40,0xc0,
0x40,0xf0,0x60,0x90,0x90,0x60,0xa0,0x50,
0x28,0x14,0x28,0x50,0xa0,0x08,0x38,0xa8,
0x58,0x28,0xf0,0x48,0x40,0xc0,0x40,0x38,
0x10,0x88,0x68,0x30,0xf0,0x48,0x40,0xc0,
0x40,0x08,0x38,0xa8,0x58,0x28,0xd0,0x28,
0x40,0x20,0xc0,0x70,0x88,0x88,0x40,0x20,
0x20,0x00,0x20,0x88,0x88,0xf8,0x88,0x50,
0x50,0x20,0x00,0x20,0x40,0x88,0x88,0xf8,
0x50,0x50,0x20,0x20,0x00,0x20,0x10,0x88,
0x88,0xf8,0x50,0x50,0x20,0x20,0x00,0x50,
0x20,0x88,0x88,0xf8,0x50,0x50,0x20,0x20,
0x00,0xb0,0x68,0x88,0x88,0xf8,0x50,0x50,
0x20,0x20,0x00,0x50,0x88,0x88,0xf8,0x50,
0x50,0x20,0x20,0x20,0x50,0x20,0x9c,0x90,
0xf0,0x50,0x5c,0x30,0x30,0x1c,0x60,0x20,
0x70,0x88,0x80,0x80,0x80,0x80,0x88,0x70,
0xf8,0x80,0x80,0xf0,0x80,0x80,0xf8,0x00,
0x20,0x40,0xf8,0x80,0x80,0xf0,0x80,0x80,
0xf8,0x00,0x20,0x10,0xf8,0x80,0x80,0xf0,
0x80,0x80,0xf8,0x00,0x50,0x20,0xf8,0x80,
0x80,0xf0,0x80,0x80,0xf8,0x00,0x50,0xe0,
0x40,0x40,0x40,0x40,0x40,0xe0,0x00,0x40,
0x80,0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,
0x00,0x40,0x20,0xe0,0x40,0x40,0x40,0x40,
0x40,0xe0,0x00,0xa0,0x40,0xe0,0x40,0x40,
0x40,0x40,0x40,0xe0,0x00,0xa0,0x78,0x44,
0x44,0xf4,0x44,0x44,0x44,0x78,0x88,0x98,
0x98,0xa8,0xc8,0xc8,0x88,0x00,0xb0,0x68,
0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x00,
0x20,0x40,0x70,0x88,0x88,0x88,0x88,0x88,
0x70,0x00,0x20,0x10,0x70,0x88,0x88,0x88,
0x88,0x88,0x70,0x00,0x50,0x20,0x70,0x88,
0x88,0x88,0x88,0x88,0x70,0x00,0xb0,0x68,
0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x00,
0x50,0x88,0x50,0x20,0x50,0x88,0xb8,0x44,
0x64,0x54,0x4c,0x44,0x3a,0x70,0x88,0x88,
0x88,0x88,0x88,0x88,0x00,0x20,0x40,0x70,
0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x20,
0x10,0x70,0x88,0x88,0x88,0x88,0x88,0x88,
0x00,0x50,0x20,0x70,0x88,0x88,0x88,0x88,
0x88,0x88,0x00,0x50,0x20,0x20,0x20,0x50,
0x50,0x88,0x88,0x00,0x20,0x10,0x80,0x80,
0xf0,0x88,0x88,0x88,0xf0,0x80,0x80,0xb0,
0x88,0x88,0x88,0x90,0xa0,0x90,0x60,0x78,
0x88,0x78,0x08,0x70,0x00,0x20,0x40,0x78,
0x88,0x78,0x08,0x70,0x00,0x20,0x10,0x78,
0x88,0x78,0x08,0x70,0x00,0x50,0x20,0x78,
0x88,0x78,0x08,0x70,0x00,0xb0,0x68,0x78,
0x88,0x78,0x08,0x70,0x00,0x50,0x78,0x88,
0x78,0x08,0x70,0x00,0x20,0x50,0x20,0x6c,
0x90,0x7c,0x12,0x6c,0x60,0x20,0x70,0x88,
0x80,0x80,0x88,0x70,0x78,0x80,0xf8,0x88,
0x70,0x00,0x20,0x40,0x78,0x80,0xf8,0x88,
0x70,0x00,0x20,0x10,0x78,0x80,0xf8,0x88,
0x70,0x00,0x50,0x20,0x78,0x80,0xf8,0x88,
0x70,0x00,0x50,0x20,0x20,0x20,0x20,0xe0,
0x00,0x40,0x80,0x20,0x20,0x20,0x20,0xe0,
0x00,0x40,0x20,0x20,0x20,0x20,0x20,0xe0,
0x00,0xa0,0x40,0x20,0x20,0x20,0x20,0xe0,
0x00,0xa0,0x70,0x88,0x88,0x88,0x78,0x08,
0x90,0x60,0xd0,0x88,0x88,0x88,0xc8,0xb0,
0x00,0xb0,0x68,0x70,0x88,0x88,0x88,0x70,
0x00,0x20,0x40,0x70,0x88,0x88,0x88,0x70,
0x00,0x20,0x10,0x70,0x88,0x88,0x88,0x70,
0x00,0x50,0x20,0x70,0x88,0x88,0x88,0x70,
0x00,0xb0,0x68,0x70,0x88,0x88,0x88,0x70,
0x00,0x50,0x20,0x00,0xf8,0x00,0x20,0xb8,
0x64,0x54,0x4c,0x3a,0x68,0x98,0x88,0x88,
0x88,0x00,0x20,0x40,0x68,0x98,0x88,0x88,
0x88,0x00,0x20,0x10,0x68,0x98,0x88,0x88,
0x88,0x00,0x50,0x20,0x68,0x98,0x88,0x88,
0x88,0x00,0x50,0xf0,0x08,0x68,0x98,0x88,
0x88,0x88,0x00,0x20,0x10,0x80,0x80,0xb0,
0xc8,0x88,0x88,0xc8,0xb0,0x80,0x80,0xf0,
0x08,0x68,0x98,0x88,0x88,0x88,0x00,0xd8,
};
BMF_FontData BMF_font_scr12 = {
0, -2,
7, 10,
{
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0, 0, 0, 0, 16, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0, 0, 0, 0, 7, -1},
{1, 8, -3, 0, 7, 0},
{3, 4, -2, -5, 7, 8},
{7, 8, 0, 0, 7, 12},
{5, 9, -1, 1, 7, 20},
{6, 8, 0, 0, 7, 29},
{6, 8, 0, 0, 7, 37},
{3, 4, -2, -5, 7, 45},
{3, 10, -2, 2, 7, 49},
{3, 10, -2, 2, 7, 59},
{5, 5, -1, -3, 7, 69},
{5, 5, -1, -1, 7, 74},
{2, 4, -2, 2, 7, 79},
{5, 1, -1, -3, 7, 83},
{1, 2, -3, 0, 7, 84},
{5, 10, -1, 1, 7, 86},
{5, 8, -1, 0, 7, 96},
{3, 8, -2, 0, 7, 104},
{5, 8, -1, 0, 7, 112},
{5, 8, -1, 0, 7, 120},
{5, 8, -1, 0, 7, 128},
{5, 8, -1, 0, 7, 136},
{5, 8, -1, 0, 7, 144},
{5, 8, -1, 0, 7, 152},
{5, 8, -1, 0, 7, 160},
{5, 8, -1, 0, 7, 168},
{1, 6, -3, 0, 7, 176},
{2, 8, -2, 2, 7, 182},
{5, 9, -1, 1, 7, 190},
{5, 3, -1, -2, 7, 199},
{5, 9, -1, 1, 7, 202},
{5, 8, -1, 0, 7, 211},
{5, 8, -1, 0, 7, 219},
{5, 8, -1, 0, 7, 227},
{5, 8, -1, 0, 7, 235},
{5, 8, -1, 0, 7, 243},
{5, 8, -1, 0, 7, 251},
{5, 8, -1, 0, 7, 259},
{5, 8, -1, 0, 7, 267},
{5, 8, -1, 0, 7, 275},
{5, 8, -1, 0, 7, 283},
{3, 8, -2, 0, 7, 291},
{5, 8, -1, 0, 7, 299},
{5, 8, -1, 0, 7, 307},
{5, 8, -1, 0, 7, 315},
{5, 8, -1, 0, 7, 323},
{5, 8, -1, 0, 7, 331},
{5, 8, -1, 0, 7, 339},
{5, 8, -1, 0, 7, 347},
{5, 10, -1, 2, 7, 355},
{5, 8, -1, 0, 7, 365},
{5, 8, -1, 0, 7, 373},
{5, 8, -1, 0, 7, 381},
{5, 8, -1, 0, 7, 389},
{5, 8, -1, 0, 7, 397},
{5, 8, -1, 0, 7, 405},
{5, 8, -1, 0, 7, 413},
{5, 8, -1, 0, 7, 421},
{5, 8, -1, 0, 7, 429},
{3, 9, -2, 1, 7, 437},
{5, 10, -1, 1, 7, 446},
{3, 9, -2, 1, 7, 456},
{5, 3, -1, -5, 7, 465},
{7, 1, 0, 1, 7, 468},
{3, 4, -2, -5, 7, 469},
{5, 6, -1, 0, 7, 473},
{5, 8, -1, 0, 7, 479},
{5, 6, -1, 0, 7, 487},
{5, 8, -1, 0, 7, 493},
{5, 6, -1, 0, 7, 501},
{5, 8, -1, 0, 7, 507},
{5, 8, -1, 2, 7, 515},
{5, 8, -1, 0, 7, 523},
{3, 8, -2, 0, 7, 531},
{4, 10, -1, 2, 7, 539},
{5, 8, -1, 0, 7, 549},
{3, 8, -2, 0, 7, 557},
{5, 6, -1, 0, 7, 565},
{5, 6, -1, 0, 7, 571},
{5, 6, -1, 0, 7, 577},
{5, 8, -1, 2, 7, 583},
{5, 8, -1, 2, 7, 591},
{5, 6, -1, 0, 7, 599},
{5, 6, -1, 0, 7, 605},
{4, 7, -1, 0, 7, 611},
{5, 6, -1, 0, 7, 618},
{5, 6, -1, 0, 7, 624},
{5, 6, -1, 0, 7, 630},
{5, 6, -1, 0, 7, 636},
{5, 8, -1, 2, 7, 642},
{5, 6, -1, 0, 7, 650},
{5, 10, -1, 2, 7, 656},
{1, 10, -3, 1, 7, 666},
{5, 10, -1, 2, 7, 676},
{6, 3, 0, -2, 7, 686},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{1, 8, -3, 2, 7, 689},
{5, 9, -1, 0, 7, 697},
{5, 8, -1, 0, 7, 706},
{4, 6, -1, -2, 7, 714},
{5, 8, -1, 0, 7, 720},
{1, 10, -3, 1, 7, 728},
{5, 10, -1, 1, 7, 738},
{3, 1, -2, -7, 7, 748},
{6, 7, 0, 0, 7, 749},
{4, 5, -1, -4, 7, 756},
{6, 7, 0, 0, 7, 761},
{5, 2, -1, -3, 7, 768},
{4, 1, -1, -3, 7, 770},
{6, 7, 0, 0, 7, 771},
{3, 1, -2, -7, 7, 778},
{4, 3, -1, -4, 7, 779},
{5, 7, -1, 0, 7, 782},
{3, 5, -2, -4, 7, 789},
{3, 5, -2, -4, 7, 794},
{2, 2, -2, -7, 7, 799},
{5, 6, -1, 1, 7, 801},
{6, 9, 0, 1, 7, 807},
{1, 2, -3, -3, 7, 816},
{2, 2, -2, 2, 7, 818},
{3, 5, -2, -4, 7, 820},
{4, 5, -1, -4, 7, 825},
{6, 7, 0, 0, 7, 830},
{5, 10, -1, 1, 7, 837},
{5, 10, -1, 1, 7, 847},
{5, 10, -1, 1, 7, 857},
{5, 8, -1, 2, 7, 867},
{5, 10, -1, 0, 7, 875},
{5, 10, -1, 0, 7, 885},
{5, 10, -1, 0, 7, 895},
{5, 10, -1, 0, 7, 905},
{5, 9, -1, 0, 7, 915},
{5, 10, -1, 0, 7, 924},
{6, 8, 0, 0, 7, 934},
{5, 10, -1, 2, 7, 942},
{5, 10, -1, 0, 7, 952},
{5, 10, -1, 0, 7, 962},
{5, 10, -1, 0, 7, 972},
{5, 9, -1, 0, 7, 982},
{3, 10, -2, 0, 7, 991},
{3, 10, -2, 0, 7, 1001},
{3, 10, -2, 0, 7, 1011},
{3, 9, -2, 0, 7, 1021},
{6, 8, 0, 0, 7, 1030},
{5, 10, -1, 0, 7, 1038},
{5, 10, -1, 0, 7, 1048},
{5, 10, -1, 0, 7, 1058},
{5, 10, -1, 0, 7, 1068},
{5, 10, -1, 0, 7, 1078},
{5, 9, -1, 0, 7, 1088},
{5, 5, -1, -1, 7, 1097},
{7, 7, 0, 0, 7, 1102},
{5, 10, -1, 0, 7, 1109},
{5, 10, -1, 0, 7, 1119},
{5, 10, -1, 0, 7, 1129},
{5, 9, -1, 0, 7, 1139},
{5, 10, -1, 0, 7, 1148},
{5, 9, -1, 0, 7, 1158},
{5, 8, -1, 0, 7, 1167},
{5, 8, -1, 0, 7, 1175},
{5, 8, -1, 0, 7, 1183},
{5, 8, -1, 0, 7, 1191},
{5, 8, -1, 0, 7, 1199},
{5, 7, -1, 0, 7, 1207},
{5, 9, -1, 0, 7, 1214},
{7, 5, 0, 0, 7, 1223},
{5, 8, -1, 2, 7, 1228},
{5, 8, -1, 0, 7, 1236},
{5, 8, -1, 0, 7, 1244},
{5, 8, -1, 0, 7, 1252},
{5, 7, -1, 0, 7, 1260},
{3, 8, -2, 0, 7, 1267},
{3, 8, -2, 0, 7, 1275},
{3, 8, -2, 0, 7, 1283},
{3, 7, -2, 0, 7, 1291},
{5, 9, -1, 0, 7, 1298},
{5, 8, -1, 0, 7, 1307},
{5, 8, -1, 0, 7, 1315},
{5, 8, -1, 0, 7, 1323},
{5, 8, -1, 0, 7, 1331},
{5, 8, -1, 0, 7, 1339},
{5, 7, -1, 0, 7, 1347},
{5, 5, -1, -1, 7, 1354},
{7, 5, 0, 0, 7, 1359},
{5, 8, -1, 0, 7, 1364},
{5, 8, -1, 0, 7, 1372},
{5, 8, -1, 0, 7, 1380},
{5, 7, -1, 0, 7, 1388},
{5, 10, -1, 2, 7, 1395},
{5, 10, -1, 2, 7, 1405},
{5, 9, -1, 2, 7, 1415},
},
bitmap_data
};
#endif

@ -0,0 +1,510 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "BMF_FontData.h"
#include "BMF_Settings.h"
#if BMF_INCLUDE_SCR14
static unsigned char bitmap_data[]= {
0x80,0x80,0x00,0x80,0x80,0x80,0x80,0x80,
0x80,0xa0,0xa0,0xa0,0xa0,0x50,0x50,0xfc,
0x28,0x28,0x28,0x7e,0x14,0x14,0x20,0x70,
0xa8,0x28,0x30,0x60,0xa0,0xa8,0x70,0x20,
0x98,0x54,0x54,0x2c,0x10,0x68,0x54,0x54,
0x32,0x74,0x88,0x8c,0x90,0x60,0x20,0x50,
0x48,0x30,0x80,0x40,0x20,0x20,0x20,0x40,
0x40,0x80,0x80,0x80,0x80,0x80,0x40,0x40,
0x20,0x80,0x40,0x40,0x20,0x20,0x20,0x20,
0x20,0x40,0x40,0x80,0x20,0xa8,0x70,0x70,
0xa8,0x20,0x20,0x20,0xf8,0x20,0x20,0x80,
0x40,0x40,0xc0,0xf8,0x80,0x80,0x80,0x80,
0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,
0x70,0x88,0x88,0xc8,0xa8,0x98,0x88,0x88,
0x70,0xe0,0x40,0x40,0x40,0x40,0x40,0x40,
0xc0,0x40,0xf8,0x80,0x40,0x20,0x10,0x08,
0x88,0x88,0x70,0x70,0x88,0x08,0x08,0x70,
0x08,0x08,0x88,0x70,0x10,0x10,0x10,0xf8,
0x90,0x50,0x50,0x30,0x10,0x70,0x88,0x08,
0x08,0x08,0xf0,0x80,0x80,0xf8,0x70,0x88,
0x88,0x88,0x88,0xf0,0x80,0x88,0x70,0x40,
0x40,0x40,0x20,0x20,0x10,0x10,0x08,0xf8,
0x70,0x88,0x88,0x88,0x70,0x88,0x88,0x88,
0x70,0x70,0x88,0x08,0x08,0x78,0x88,0x88,
0x88,0x70,0x80,0x80,0x00,0x00,0x80,0x80,
0x80,0x40,0x40,0xc0,0x00,0x00,0x40,0x40,
0x08,0x10,0x20,0x40,0x80,0x40,0x20,0x10,
0x08,0xf8,0x00,0xf8,0x80,0x40,0x20,0x10,
0x08,0x10,0x20,0x40,0x80,0x20,0x20,0x00,
0x20,0x20,0x10,0x88,0x88,0x70,0x38,0x40,
0x98,0xa8,0xa8,0x98,0x88,0x48,0x30,0x88,
0x88,0xf8,0x88,0x50,0x50,0x50,0x20,0x20,
0xf0,0x88,0x88,0x88,0xf0,0x88,0x88,0x88,
0xf0,0x70,0x88,0x80,0x80,0x80,0x80,0x80,
0x88,0x70,0xf0,0x88,0x88,0x88,0x88,0x88,
0x88,0x88,0xf0,0xf8,0x80,0x80,0x80,0xf0,
0x80,0x80,0x80,0xf8,0x80,0x80,0x80,0x80,
0xf0,0x80,0x80,0x80,0xf8,0x68,0x98,0x88,
0x88,0x98,0x80,0x80,0x88,0x70,0x88,0x88,
0x88,0x88,0xf8,0x88,0x88,0x88,0x88,0xe0,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xe0,
0x70,0x88,0x88,0x08,0x08,0x08,0x08,0x08,
0x08,0x88,0x88,0x90,0xa0,0xc0,0xa0,0x90,
0x88,0x88,0xf8,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x88,0x88,0x88,0xa8,0xa8,
0xd8,0xd8,0x88,0x88,0x88,0x98,0x98,0xa8,
0xa8,0xc8,0xc8,0x88,0x88,0x70,0x88,0x88,
0x88,0x88,0x88,0x88,0x88,0x70,0x80,0x80,
0x80,0x80,0xf0,0x88,0x88,0x88,0xf0,0x08,
0x10,0x70,0xa8,0x88,0x88,0x88,0x88,0x88,
0x88,0x70,0x88,0x88,0x90,0xa0,0xf0,0x88,
0x88,0x88,0xf0,0x70,0x88,0x08,0x08,0x70,
0x80,0x80,0x88,0x70,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0xf8,0x70,0x88,0x88,
0x88,0x88,0x88,0x88,0x88,0x88,0x20,0x20,
0x50,0x50,0x50,0x88,0x88,0x88,0x88,0x50,
0x50,0xf8,0xa8,0xa8,0x88,0x88,0x88,0x88,
0x88,0x88,0x50,0x50,0x20,0x50,0x50,0x88,
0x88,0x20,0x20,0x20,0x20,0x20,0x50,0x50,
0x88,0x88,0xf8,0x80,0x40,0x40,0x20,0x10,
0x10,0x08,0xf8,0xf0,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0xf0,0x08,0x08,
0x10,0x10,0x20,0x20,0x40,0x40,0x80,0x80,
0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
0x10,0x10,0xf0,0x88,0x50,0x20,0xfe,0x20,
0x40,0x80,0x80,0x68,0x98,0x88,0x78,0x08,
0x88,0x70,0xb0,0xc8,0x88,0x88,0x88,0xc8,
0xb0,0x80,0x80,0x70,0x88,0x80,0x80,0x80,
0x88,0x70,0x68,0x98,0x88,0x88,0x88,0x98,
0x68,0x08,0x08,0x70,0x88,0x80,0xf8,0x88,
0x88,0x70,0x40,0x40,0x40,0x40,0x40,0x40,
0xf0,0x40,0x38,0x70,0x88,0x08,0x68,0x98,
0x88,0x88,0x88,0x98,0x68,0x88,0x88,0x88,
0x88,0x88,0xc8,0xb0,0x80,0x80,0x20,0x20,
0x20,0x20,0x20,0x20,0xe0,0x00,0x20,0x60,
0x90,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
0x70,0x00,0x10,0x88,0x88,0x90,0xe0,0xa0,
0x90,0x88,0x80,0x80,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0xe0,0xa8,0xa8,0xa8,
0xa8,0xa8,0xa8,0xd0,0x88,0x88,0x88,0x88,
0x88,0xc8,0xb0,0x70,0x88,0x88,0x88,0x88,
0x88,0x70,0x80,0x80,0x80,0xb0,0xc8,0x88,
0x88,0x88,0xc8,0xb0,0x08,0x08,0x08,0x68,
0x98,0x88,0x88,0x88,0x98,0x68,0x80,0x80,
0x80,0x80,0x80,0xc8,0xb0,0x70,0x88,0x08,
0x70,0x80,0x88,0x70,0x30,0x40,0x40,0x40,
0x40,0x40,0xf0,0x40,0x40,0x68,0x98,0x88,
0x88,0x88,0x88,0x88,0x20,0x20,0x50,0x50,
0x88,0x88,0x88,0x50,0xa8,0xa8,0xa8,0xa8,
0x88,0x88,0x88,0x88,0x50,0x20,0x50,0x88,
0x88,0x70,0x88,0x08,0x68,0x98,0x88,0x88,
0x88,0x88,0x88,0xf8,0x80,0x40,0x20,0x10,
0x08,0xf8,0x18,0x20,0x20,0x20,0x20,0x20,
0xc0,0x20,0x20,0x20,0x20,0x18,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0xc0,0x20,0x20,0x20,0x20,0x20,
0x18,0x20,0x20,0x20,0x20,0xc0,0x98,0xb4,
0x64,0x80,0x80,0x80,0x80,0x80,0x80,0x00,
0x80,0x80,0x20,0x20,0x70,0x88,0x80,0x80,
0x88,0x70,0x20,0x20,0xb0,0x48,0x40,0x40,
0xf0,0x40,0x40,0x48,0x30,0x88,0x70,0x88,
0x88,0x70,0x88,0x70,0x20,0xf8,0x20,0xf8,
0x50,0x50,0x88,0x88,0x80,0x80,0x80,0x80,
0x80,0x00,0x00,0x80,0x80,0x80,0x80,0x80,
0x70,0x88,0x10,0x28,0x48,0x88,0x90,0xa0,
0x40,0x88,0x70,0xd8,0x38,0x44,0x92,0xaa,
0xa2,0xaa,0x92,0x44,0x38,0xf8,0x00,0x68,
0x90,0x70,0x10,0x60,0x12,0x24,0x48,0x90,
0x48,0x24,0x12,0x08,0x08,0xf8,0xf0,0x38,
0x44,0xaa,0xaa,0xb2,0xaa,0xb2,0x44,0x38,
0xe0,0x60,0x90,0x90,0x60,0xf8,0x00,0x20,
0x20,0xf8,0x20,0x20,0xe0,0x40,0x20,0xa0,
0x40,0xc0,0x20,0x40,0x20,0xc0,0x80,0x40,
0x80,0x80,0xb4,0xc8,0x88,0x88,0x88,0x88,
0x28,0x28,0x28,0x28,0x28,0x68,0xa8,0xa8,
0xa8,0x7c,0x80,0x80,0xc0,0x20,0x40,0xe0,
0x40,0x40,0xc0,0x40,0xf8,0x00,0x70,0x88,
0x88,0x88,0x70,0x90,0x48,0x24,0x12,0x24,
0x48,0x90,0x04,0x9e,0x54,0x2c,0x14,0xe8,
0x44,0x40,0xc0,0x40,0x1c,0x08,0x84,0x54,
0x28,0x10,0xe8,0x44,0x40,0xc0,0x40,0x04,
0x9e,0x54,0x2c,0xd4,0x28,0x44,0x20,0xc0,
0x70,0x88,0x80,0x40,0x20,0x20,0x00,0x00,
0x20,0x20,0x88,0x88,0xf8,0x88,0x50,0x50,
0x20,0x20,0x00,0x20,0x40,0x88,0x88,0xf8,
0x88,0x50,0x50,0x20,0x20,0x00,0x20,0x10,
0x88,0x88,0xf8,0x88,0x50,0x50,0x20,0x20,
0x00,0x50,0x20,0x88,0x88,0xf8,0x88,0x50,
0x50,0x20,0x20,0x00,0xb0,0x68,0x88,0x88,
0xf8,0x88,0x50,0x50,0x20,0x20,0x00,0xd8,
0x88,0x88,0xf8,0x88,0x50,0x50,0x20,0x20,
0x20,0x50,0x20,0x9c,0x90,0xf0,0x90,0x5c,
0x50,0x30,0x30,0x1c,0x60,0x10,0x20,0x70,
0x88,0x80,0x80,0x80,0x80,0x80,0x88,0x70,
0xf8,0x80,0x80,0x80,0xf0,0x80,0x80,0xf8,
0x00,0x20,0x40,0xf8,0x80,0x80,0x80,0xf0,
0x80,0x80,0xf8,0x00,0x20,0x10,0xf8,0x80,
0x80,0x80,0xf0,0x80,0x80,0xf8,0x00,0x50,
0x20,0xf8,0x80,0x80,0x80,0xf0,0x80,0x80,
0xf8,0x00,0xd8,0xe0,0x40,0x40,0x40,0x40,
0x40,0x40,0xe0,0x00,0x40,0x80,0xe0,0x40,
0x40,0x40,0x40,0x40,0x40,0xe0,0x00,0x40,
0x20,0xe0,0x40,0x40,0x40,0x40,0x40,0x40,
0xe0,0x00,0xa0,0x40,0x70,0x20,0x20,0x20,
0x20,0x20,0x20,0x70,0x00,0xd8,0x78,0x44,
0x44,0x44,0xf4,0x44,0x44,0x44,0x78,0x88,
0x98,0x98,0xa8,0xa8,0xc8,0xc8,0x88,0x00,
0xb0,0x68,0x70,0x88,0x88,0x88,0x88,0x88,
0x88,0x70,0x00,0x20,0x40,0x70,0x88,0x88,
0x88,0x88,0x88,0x88,0x70,0x00,0x20,0x10,
0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x70,
0x00,0x50,0x20,0x70,0x88,0x88,0x88,0x88,
0x88,0x88,0x70,0x00,0xb0,0x68,0x70,0x88,
0x88,0x88,0x88,0x88,0x88,0x70,0x00,0xd8,
0x88,0x50,0x20,0x50,0x88,0xb8,0x44,0x64,
0x64,0x54,0x4c,0x4c,0x44,0x3a,0x70,0x88,
0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x20,
0x40,0x70,0x88,0x88,0x88,0x88,0x88,0x88,
0x88,0x00,0x20,0x10,0x70,0x88,0x88,0x88,
0x88,0x88,0x88,0x88,0x00,0x50,0x20,0x70,
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,
0xd8,0x20,0x20,0x20,0x20,0x50,0x50,0x88,
0x88,0x00,0x20,0x10,0xe0,0x40,0x78,0x44,
0x44,0x44,0x78,0x40,0xe0,0xb0,0x88,0x88,
0x88,0x90,0xa0,0x90,0x90,0x60,0x68,0x98,
0x88,0x78,0x08,0x88,0x70,0x00,0x20,0x40,
0x68,0x98,0x88,0x78,0x08,0x88,0x70,0x00,
0x20,0x10,0x68,0x98,0x88,0x78,0x08,0x88,
0x70,0x00,0x50,0x20,0x68,0x98,0x88,0x78,
0x08,0x88,0x70,0x00,0xb0,0x68,0x68,0x98,
0x88,0x78,0x08,0x88,0x70,0x00,0xd8,0x68,
0x98,0x88,0x78,0x08,0x88,0x70,0x00,0x20,
0x50,0x20,0x6c,0x92,0x90,0x7e,0x12,0x92,
0x6c,0x60,0x10,0x20,0x70,0x88,0x80,0x80,
0x80,0x88,0x70,0x70,0x88,0x80,0xf8,0x88,
0x88,0x70,0x00,0x20,0x40,0x70,0x88,0x80,
0xf8,0x88,0x88,0x70,0x00,0x20,0x10,0x70,
0x88,0x80,0xf8,0x88,0x88,0x70,0x00,0x50,
0x20,0x70,0x88,0x80,0xf8,0x88,0x88,0x70,
0x00,0xd8,0x20,0x20,0x20,0x20,0x20,0x20,
0xe0,0x00,0x20,0x40,0x20,0x20,0x20,0x20,
0x20,0x20,0xe0,0x00,0x20,0x10,0x20,0x20,
0x20,0x20,0x20,0x20,0xe0,0x00,0xa0,0x40,
0x20,0x20,0x20,0x20,0x20,0x20,0xe0,0x00,
0xd8,0x70,0x88,0x88,0x88,0x88,0x88,0x78,
0x10,0xd0,0x20,0xd0,0x88,0x88,0x88,0x88,
0x88,0xc8,0xb0,0x00,0xb0,0x68,0x70,0x88,
0x88,0x88,0x88,0x88,0x70,0x00,0x20,0x40,
0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x00,
0x20,0x10,0x70,0x88,0x88,0x88,0x88,0x88,
0x70,0x00,0x50,0x20,0x70,0x88,0x88,0x88,
0x88,0x88,0x70,0x00,0xb0,0x68,0x70,0x88,
0x88,0x88,0x88,0x88,0x70,0x00,0xd8,0x10,
0x10,0x00,0xfe,0x00,0x10,0x10,0xb8,0x44,
0x64,0x54,0x4c,0x44,0x3a,0x68,0x98,0x88,
0x88,0x88,0x88,0x88,0x00,0x20,0x40,0x68,
0x98,0x88,0x88,0x88,0x88,0x88,0x00,0x20,
0x10,0x68,0x98,0x88,0x88,0x88,0x88,0x88,
0x00,0x50,0x20,0x68,0x98,0x88,0x88,0x88,
0x88,0x88,0x00,0xd8,0x70,0x88,0x08,0x68,
0x98,0x88,0x88,0x88,0x88,0x88,0x00,0x20,
0x10,0xe0,0x40,0x58,0x64,0x44,0x44,0x44,
0x64,0x58,0x40,0xc0,0x70,0x88,0x08,0x68,
0x98,0x88,0x88,0x88,0x88,0x88,0x00,0xd8,
};
BMF_FontData BMF_font_scr14 = {
0, -3,
7, 11,
{
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0, 0, 0, 0, 16, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0, 0, 0, 0, 7, -1},
{1, 9, -3, 0, 7, 0},
{3, 4, -2, -5, 7, 9},
{7, 9, 0, 0, 7, 13},
{5, 10, -1, 1, 7, 22},
{7, 9, 0, 0, 7, 32},
{6, 9, 0, 0, 7, 41},
{3, 4, -2, -5, 7, 50},
{3, 11, -2, 1, 7, 54},
{3, 11, -2, 1, 7, 65},
{5, 6, -1, -2, 7, 76},
{5, 5, -1, -2, 7, 82},
{2, 4, -2, 2, 7, 87},
{5, 1, -1, -4, 7, 91},
{1, 2, -3, 0, 7, 92},
{5, 10, -1, 0, 7, 94},
{5, 9, -1, 0, 7, 104},
{3, 9, -2, 0, 7, 113},
{5, 9, -1, 0, 7, 122},
{5, 9, -1, 0, 7, 131},
{5, 9, -1, 0, 7, 140},
{5, 9, -1, 0, 7, 149},
{5, 9, -1, 0, 7, 158},
{5, 9, -1, 0, 7, 167},
{5, 9, -1, 0, 7, 176},
{5, 9, -1, 0, 7, 185},
{1, 6, -3, 0, 7, 194},
{2, 8, -2, 1, 7, 200},
{5, 9, -1, 0, 7, 208},
{5, 3, -1, -3, 7, 217},
{5, 9, -1, 0, 7, 220},
{5, 9, -1, 0, 7, 229},
{5, 9, -1, 0, 7, 238},
{5, 9, -1, 0, 7, 247},
{5, 9, -1, 0, 7, 256},
{5, 9, -1, 0, 7, 265},
{5, 9, -1, 0, 7, 274},
{5, 9, -1, 0, 7, 283},
{5, 9, -1, 0, 7, 292},
{5, 9, -1, 0, 7, 301},
{5, 9, -1, 0, 7, 310},
{3, 9, -2, 0, 7, 319},
{5, 9, -1, 0, 7, 328},
{5, 9, -1, 0, 7, 337},
{5, 9, -1, 0, 7, 346},
{5, 9, -1, 0, 7, 355},
{5, 9, -1, 0, 7, 364},
{5, 9, -1, 0, 7, 373},
{5, 9, -1, 0, 7, 382},
{5, 11, -1, 2, 7, 391},
{5, 9, -1, 0, 7, 402},
{5, 9, -1, 0, 7, 411},
{5, 9, -1, 0, 7, 420},
{5, 9, -1, 0, 7, 429},
{5, 9, -1, 0, 7, 438},
{5, 9, -1, 0, 7, 447},
{5, 9, -1, 0, 7, 456},
{5, 9, -1, 0, 7, 465},
{5, 9, -1, 0, 7, 474},
{4, 11, -2, 1, 7, 483},
{5, 10, -1, 0, 7, 494},
{4, 11, -1, 1, 7, 504},
{5, 3, -1, -6, 7, 515},
{7, 1, 0, 2, 7, 518},
{3, 4, -2, -5, 7, 519},
{5, 7, -1, 0, 7, 523},
{5, 9, -1, 0, 7, 530},
{5, 7, -1, 0, 7, 539},
{5, 9, -1, 0, 7, 546},
{5, 7, -1, 0, 7, 555},
{5, 9, -1, 0, 7, 562},
{5, 10, -1, 3, 7, 571},
{5, 9, -1, 0, 7, 581},
{3, 9, -2, 0, 7, 590},
{4, 12, -1, 3, 7, 599},
{5, 9, -1, 0, 7, 611},
{3, 9, -2, 0, 7, 620},
{5, 7, -1, 0, 7, 629},
{5, 7, -1, 0, 7, 636},
{5, 7, -1, 0, 7, 643},
{5, 10, -1, 3, 7, 650},
{5, 10, -1, 3, 7, 660},
{5, 7, -1, 0, 7, 670},
{5, 7, -1, 0, 7, 677},
{4, 9, -1, 0, 7, 684},
{5, 7, -1, 0, 7, 693},
{5, 7, -1, 0, 7, 700},
{5, 7, -1, 0, 7, 707},
{5, 7, -1, 0, 7, 714},
{5, 10, -1, 3, 7, 721},
{5, 7, -1, 0, 7, 731},
{5, 12, -1, 2, 7, 738},
{1, 12, -3, 2, 7, 750},
{5, 12, -1, 2, 7, 762},
{6, 3, 0, -3, 7, 774},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{1, 9, -3, 2, 7, 777},
{5, 10, -1, 0, 7, 786},
{5, 9, -1, 0, 7, 796},
{5, 6, -1, -3, 7, 805},
{5, 9, -1, 0, 7, 811},
{1, 12, -3, 2, 7, 820},
{5, 11, -1, 2, 7, 832},
{5, 1, -1, -8, 7, 843},
{7, 9, 0, 0, 7, 844},
{5, 7, -1, -2, 7, 853},
{7, 7, 0, 0, 7, 860},
{5, 3, -1, -3, 7, 867},
{4, 1, -1, -4, 7, 870},
{7, 9, 0, 0, 7, 871},
{3, 1, -2, -8, 7, 880},
{4, 4, -1, -4, 7, 881},
{5, 7, -1, 0, 7, 885},
{3, 5, -2, -5, 7, 892},
{3, 5, -2, -5, 7, 897},
{2, 2, -3, -8, 7, 902},
{6, 8, -1, 2, 7, 904},
{6, 10, 0, 1, 7, 912},
{1, 2, -3, -3, 7, 922},
{3, 3, -2, 3, 7, 924},
{3, 5, -2, -5, 7, 927},
{5, 7, -1, -2, 7, 932},
{7, 7, 0, 0, 7, 939},
{7, 10, 0, 0, 7, 946},
{6, 11, 0, 1, 7, 956},
{7, 9, 0, -1, 7, 967},
{5, 10, -1, 3, 7, 976},
{5, 11, -1, 0, 7, 986},
{5, 11, -1, 0, 7, 997},
{5, 11, -1, 0, 7, 1008},
{5, 11, -1, 0, 7, 1019},
{5, 10, -1, 0, 7, 1030},
{5, 11, -1, 0, 7, 1040},
{6, 9, 0, 0, 7, 1051},
{5, 12, -1, 3, 7, 1060},
{5, 11, -1, 0, 7, 1072},
{5, 11, -1, 0, 7, 1083},
{5, 11, -1, 0, 7, 1094},
{5, 10, -1, 0, 7, 1105},
{3, 11, -2, 0, 7, 1115},
{3, 11, -2, 0, 7, 1126},
{3, 11, -2, 0, 7, 1137},
{5, 10, -1, 0, 7, 1148},
{6, 9, 0, 0, 7, 1158},
{5, 11, -1, 0, 7, 1167},
{5, 11, -1, 0, 7, 1178},
{5, 11, -1, 0, 7, 1189},
{5, 11, -1, 0, 7, 1200},
{5, 11, -1, 0, 7, 1211},
{5, 10, -1, 0, 7, 1222},
{5, 5, -1, -1, 7, 1232},
{7, 9, 0, 0, 7, 1237},
{5, 11, -1, 0, 7, 1246},
{5, 11, -1, 0, 7, 1257},
{5, 11, -1, 0, 7, 1268},
{5, 10, -1, 0, 7, 1279},
{5, 11, -1, 0, 7, 1289},
{6, 9, 0, 0, 7, 1300},
{5, 9, -1, 0, 7, 1309},
{5, 10, -1, 0, 7, 1318},
{5, 10, -1, 0, 7, 1328},
{5, 10, -1, 0, 7, 1338},
{5, 10, -1, 0, 7, 1348},
{5, 9, -1, 0, 7, 1358},
{5, 11, -1, 0, 7, 1367},
{7, 7, 0, 0, 7, 1378},
{5, 10, -1, 3, 7, 1385},
{5, 10, -1, 0, 7, 1395},
{5, 10, -1, 0, 7, 1405},
{5, 10, -1, 0, 7, 1415},
{5, 9, -1, 0, 7, 1425},
{3, 10, -2, 0, 7, 1434},
{4, 10, -2, 0, 7, 1444},
{3, 10, -2, 0, 7, 1454},
{5, 9, -2, 0, 7, 1464},
{5, 11, -1, 0, 7, 1473},
{5, 10, -1, 0, 7, 1484},
{5, 10, -1, 0, 7, 1494},
{5, 10, -1, 0, 7, 1504},
{5, 10, -1, 0, 7, 1514},
{5, 10, -1, 0, 7, 1524},
{5, 9, -1, 0, 7, 1534},
{7, 7, 0, 0, 7, 1543},
{7, 7, 0, 0, 7, 1550},
{5, 10, -1, 0, 7, 1557},
{5, 10, -1, 0, 7, 1567},
{5, 10, -1, 0, 7, 1577},
{5, 9, -1, 0, 7, 1587},
{5, 13, -1, 3, 7, 1596},
{6, 11, 0, 2, 7, 1609},
{5, 12, -1, 3, 7, 1620},
},
bitmap_data
};
#endif

@ -0,0 +1,525 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "BMF_FontData.h"
#include "BMF_Settings.h"
#if BMF_INCLUDE_SCR15
static unsigned char bitmap_data[]= {
0x80,0x80,0x00,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x90,0x90,0x90,0x90,0x48,0x48,
0x48,0xfe,0x24,0x24,0x24,0x7f,0x12,0x12,
0x20,0x70,0xa8,0xa8,0x28,0x30,0x60,0xa0,
0xa8,0xa8,0x70,0x20,0x8c,0x52,0x52,0x2c,
0x10,0x10,0x68,0x94,0x94,0x62,0x72,0x8c,
0x84,0x8a,0x50,0x20,0x30,0x48,0x48,0x30,
0x80,0x40,0x60,0x60,0x10,0x20,0x40,0x40,
0x80,0x80,0x80,0x80,0x80,0x40,0x40,0x20,
0x10,0x80,0x40,0x20,0x20,0x10,0x10,0x10,
0x10,0x10,0x20,0x20,0x40,0x80,0x20,0xa8,
0x70,0x70,0xa8,0x20,0x10,0x10,0x10,0xfe,
0x10,0x10,0x10,0x80,0x40,0x20,0x60,0x60,
0xfc,0xc0,0xc0,0x80,0x80,0x40,0x40,0x20,
0x20,0x10,0x10,0x08,0x08,0x04,0x04,0x78,
0x84,0x84,0xc4,0xa4,0x94,0x8c,0x84,0x84,
0x78,0xe0,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0xc0,0x40,0xfc,0x80,0x40,0x20,0x10,
0x08,0x04,0x84,0x84,0x78,0x78,0x84,0x04,
0x04,0x04,0x38,0x04,0x04,0x84,0x78,0x08,
0x08,0x08,0xfc,0x88,0x48,0x48,0x28,0x18,
0x08,0x78,0x84,0x04,0x04,0x04,0xf8,0x80,
0x80,0x80,0xfc,0x78,0x84,0x84,0x84,0x84,
0xf8,0x80,0x80,0x84,0x78,0x20,0x20,0x20,
0x10,0x10,0x08,0x08,0x04,0x04,0xfc,0x78,
0x84,0x84,0x84,0x84,0x78,0x84,0x84,0x84,
0x78,0x78,0x84,0x04,0x04,0x7c,0x84,0x84,
0x84,0x84,0x78,0xc0,0xc0,0x00,0x00,0x00,
0xc0,0xc0,0x80,0x40,0xc0,0xc0,0x00,0x00,
0x00,0xc0,0xc0,0x04,0x08,0x10,0x20,0x40,
0x80,0x40,0x20,0x10,0x08,0x04,0xfc,0x00,
0x00,0xfc,0x80,0x40,0x20,0x10,0x08,0x04,
0x08,0x10,0x20,0x40,0x80,0x10,0x10,0x00,
0x10,0x10,0x08,0x04,0x84,0x84,0x78,0x38,
0x44,0x80,0x98,0xa4,0xa4,0x9c,0x84,0x48,
0x30,0x84,0x84,0xfc,0x84,0x48,0x48,0x48,
0x30,0x30,0x30,0xf8,0x84,0x84,0x84,0x84,
0xf8,0x84,0x84,0x84,0xf8,0x78,0x84,0x84,
0x80,0x80,0x80,0x80,0x84,0x84,0x78,0xf0,
0x88,0x84,0x84,0x84,0x84,0x84,0x84,0x88,
0xf0,0xfc,0x80,0x80,0x80,0x80,0xf8,0x80,
0x80,0x80,0xfc,0x80,0x80,0x80,0x80,0x80,
0xf8,0x80,0x80,0x80,0xfc,0x74,0x8c,0x84,
0x84,0x84,0x9c,0x80,0x80,0x84,0x78,0x84,
0x84,0x84,0x84,0x84,0xfc,0x84,0x84,0x84,
0x84,0xe0,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0x40,0xe0,0x70,0x88,0x88,0x08,0x08,
0x08,0x08,0x08,0x08,0x08,0x84,0x84,0x88,
0x90,0xa0,0xc0,0xa0,0x90,0x88,0x84,0xfc,
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x82,0x82,0x92,0x92,0xaa,0xaa,0xc6,
0xc6,0x82,0x82,0x84,0x8c,0x8c,0x94,0x94,
0xa4,0xa4,0xc4,0xc4,0x84,0x78,0x84,0x84,
0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x80,
0x80,0x80,0x80,0xf8,0x84,0x84,0x84,0x84,
0xf8,0x04,0x08,0x10,0x78,0xa4,0x84,0x84,
0x84,0x84,0x84,0x84,0x84,0x78,0x84,0x84,
0x88,0x90,0xf8,0x84,0x84,0x84,0x84,0xf8,
0x78,0x84,0x84,0x04,0x18,0x60,0x80,0x84,
0x84,0x78,0x10,0x10,0x10,0x10,0x10,0x10,
0x10,0x10,0x10,0xfe,0x78,0x84,0x84,0x84,
0x84,0x84,0x84,0x84,0x84,0x84,0x30,0x30,
0x30,0x48,0x48,0x48,0x84,0x84,0x84,0x84,
0x44,0x44,0x44,0xaa,0xaa,0xaa,0x92,0x92,
0x92,0x82,0x84,0x84,0x48,0x48,0x30,0x30,
0x48,0x48,0x84,0x84,0x10,0x10,0x10,0x10,
0x10,0x28,0x44,0x44,0x82,0x82,0xfc,0x80,
0x40,0x40,0x20,0x10,0x08,0x08,0x04,0xfc,
0xf0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,0xf0,0x04,0x04,0x08,
0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x80,
0x80,0xf0,0x10,0x10,0x10,0x10,0x10,0x10,
0x10,0x10,0x10,0x10,0x10,0xf0,0x88,0x50,
0x20,0xff,0x20,0x40,0xc0,0xc0,0x74,0x88,
0x88,0x78,0x08,0x88,0x70,0xb8,0xc4,0x84,
0x84,0x84,0xc4,0xb8,0x80,0x80,0x80,0x78,
0x84,0x80,0x80,0x80,0x84,0x78,0x74,0x8c,
0x84,0x84,0x84,0x8c,0x74,0x04,0x04,0x04,
0x78,0x84,0x80,0xfc,0x84,0x84,0x78,0x20,
0x20,0x20,0x20,0x20,0x20,0xf8,0x20,0x20,
0x1c,0x78,0x84,0x04,0x04,0x74,0x8c,0x84,
0x84,0x84,0x8c,0x74,0x84,0x84,0x84,0x84,
0x84,0xc4,0xb8,0x80,0x80,0x80,0x20,0x20,
0x20,0x20,0x20,0x20,0xe0,0x00,0x20,0x20,
0x70,0x88,0x08,0x08,0x08,0x08,0x08,0x08,
0x08,0x08,0x38,0x00,0x08,0x08,0x84,0x88,
0x90,0xe0,0xa0,0x90,0x88,0x80,0x80,0x80,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0xe0,0x92,0x92,0x92,0x92,0x92,0x92,
0xec,0x84,0x84,0x84,0x84,0x84,0xc4,0xb8,
0x78,0x84,0x84,0x84,0x84,0x84,0x78,0x80,
0x80,0x80,0x80,0xb8,0xc4,0x84,0x84,0x84,
0xc4,0xb8,0x04,0x04,0x04,0x04,0x74,0x8c,
0x84,0x84,0x84,0x8c,0x74,0x80,0x80,0x80,
0x80,0x80,0xc4,0xb8,0x78,0x84,0x04,0x78,
0x80,0x84,0x78,0x1c,0x20,0x20,0x20,0x20,
0x20,0xf8,0x20,0x20,0x74,0x8c,0x84,0x84,
0x84,0x84,0x84,0x30,0x30,0x48,0x48,0x84,
0x84,0x84,0x6c,0x92,0x92,0x92,0x92,0x82,
0x82,0x84,0x84,0x48,0x30,0x48,0x84,0x84,
0x78,0x84,0x04,0x04,0x74,0x8c,0x84,0x84,
0x84,0x84,0x84,0xfc,0x80,0x40,0x20,0x10,
0x08,0xfc,0x1c,0x20,0x20,0x20,0x20,0x20,
0xc0,0x20,0x20,0x20,0x20,0x20,0x1c,0x80,
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0xe0,0x10,0x10,
0x10,0x10,0x10,0x0c,0x10,0x10,0x10,0x10,
0x10,0xe0,0x98,0xb4,0x64,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,0x00,0x80,0x80,0x20,
0x20,0x70,0x88,0x80,0x80,0x88,0x70,0x20,
0x20,0xb8,0x44,0x40,0x40,0xf0,0x40,0x40,
0x40,0x48,0x30,0x84,0x78,0x84,0x84,0x84,
0x78,0x84,0x38,0x10,0x7c,0x10,0x7c,0x28,
0x44,0x44,0x82,0x82,0x80,0x80,0x80,0x80,
0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x80,
0x80,0x80,0x78,0x84,0x04,0x18,0x24,0x44,
0x84,0x88,0x90,0x60,0x80,0x84,0x78,0xd8,
0x38,0x44,0x92,0xaa,0xa2,0xaa,0x92,0x44,
0x38,0xf8,0x00,0x68,0x90,0x70,0x10,0x60,
0x09,0x12,0x24,0x48,0x90,0x48,0x24,0x12,
0x09,0x04,0x04,0xfc,0xfc,0x38,0x44,0xaa,
0xaa,0xb2,0xaa,0xb2,0x44,0x38,0xf0,0x60,
0x90,0x90,0x60,0xfe,0x00,0x10,0x10,0x10,
0xfe,0x10,0x10,0x10,0xf0,0x40,0x20,0x90,
0x60,0xe0,0x10,0x60,0x10,0xe0,0x80,0x40,
0x80,0x80,0x80,0xb4,0xc8,0x88,0x88,0x88,
0x88,0x88,0x24,0x24,0x24,0x24,0x24,0x24,
0x64,0xa4,0xa4,0xa4,0xa4,0x7e,0xc0,0xc0,
0x20,0x40,0xe0,0x40,0x40,0xc0,0x40,0xf8,
0x00,0x70,0x88,0x88,0x88,0x70,0x90,0x48,
0x24,0x12,0x09,0x12,0x24,0x48,0x90,0x04,
0x9e,0x54,0x2c,0x14,0xe8,0x44,0x42,0xc0,
0x40,0x1e,0x08,0x84,0x52,0x2c,0x10,0xe8,
0x44,0x42,0xc0,0x40,0x04,0x9e,0x54,0x2c,
0xd4,0x28,0x44,0x22,0xc0,0x78,0x84,0x84,
0x80,0x40,0x20,0x20,0x00,0x20,0x20,0x84,
0x84,0xfc,0x84,0x48,0x48,0x30,0x30,0x00,
0x20,0x40,0x84,0x84,0xfc,0x84,0x48,0x48,
0x30,0x30,0x00,0x10,0x08,0x84,0x84,0xfc,
0x84,0x48,0x48,0x30,0x30,0x00,0x48,0x30,
0x84,0x84,0xfc,0x84,0x48,0x48,0x30,0x30,
0x00,0x98,0x64,0x84,0x84,0xfc,0x84,0x48,
0x48,0x30,0x30,0x00,0x6c,0x84,0x84,0xfc,
0x84,0x48,0x48,0x30,0x30,0x30,0x48,0x30,
0x9e,0x90,0x90,0xf0,0x90,0x5c,0x50,0x50,
0x30,0x1e,0x30,0x08,0x10,0x78,0x84,0x84,
0x80,0x80,0x80,0x80,0x84,0x84,0x78,0xfc,
0x80,0x80,0x80,0xf8,0x80,0x80,0xfc,0x00,
0x20,0x40,0xfc,0x80,0x80,0x80,0xf8,0x80,
0x80,0xfc,0x00,0x10,0x08,0xfc,0x80,0x80,
0x80,0xf8,0x80,0x80,0xfc,0x00,0x48,0x30,
0xfc,0x80,0x80,0x80,0xf8,0x80,0x80,0xfc,
0x00,0x6c,0xe0,0x40,0x40,0x40,0x40,0x40,
0x40,0xe0,0x00,0x40,0x80,0xe0,0x40,0x40,
0x40,0x40,0x40,0x40,0xe0,0x00,0x40,0x20,
0xe0,0x40,0x40,0x40,0x40,0x40,0x40,0xe0,
0x00,0x90,0x60,0x70,0x20,0x20,0x20,0x20,
0x20,0x20,0x70,0x00,0xd8,0x78,0x44,0x42,
0x42,0x42,0xf2,0x42,0x42,0x44,0x78,0x84,
0x8c,0x94,0x94,0xa4,0xa4,0xc4,0x84,0x00,
0x98,0x64,0x78,0x84,0x84,0x84,0x84,0x84,
0x84,0x78,0x00,0x20,0x40,0x78,0x84,0x84,
0x84,0x84,0x84,0x84,0x78,0x00,0x10,0x08,
0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,
0x00,0x48,0x30,0x78,0x84,0x84,0x84,0x84,
0x84,0x84,0x78,0x00,0x98,0x64,0x78,0x84,
0x84,0x84,0x84,0x84,0x84,0x78,0x00,0x6c,
0x84,0x48,0x30,0x30,0x48,0x84,0xbc,0x42,
0x62,0x52,0x52,0x4a,0x4a,0x46,0x42,0x3d,
0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,
0x00,0x20,0x40,0x78,0x84,0x84,0x84,0x84,
0x84,0x84,0x84,0x00,0x10,0x08,0x78,0x84,
0x84,0x84,0x84,0x84,0x84,0x84,0x00,0x48,
0x30,0x78,0x84,0x84,0x84,0x84,0x84,0x84,
0x84,0x00,0x6c,0x10,0x10,0x10,0x10,0x28,
0x44,0x44,0x82,0x00,0x10,0x08,0xe0,0x40,
0x7c,0x42,0x42,0x42,0x42,0x7c,0x40,0xe0,
0x98,0xa4,0x84,0x84,0x84,0x88,0xb0,0x88,
0x88,0x70,0x74,0x88,0x88,0x78,0x08,0x88,
0x70,0x00,0x20,0x40,0x74,0x88,0x88,0x78,
0x08,0x88,0x70,0x00,0x20,0x10,0x74,0x88,
0x88,0x78,0x08,0x88,0x70,0x00,0x48,0x30,
0x74,0x88,0x88,0x78,0x08,0x88,0x70,0x00,
0x98,0x64,0x74,0x88,0x88,0x78,0x08,0x88,
0x70,0x00,0xd8,0x74,0x88,0x88,0x78,0x08,
0x88,0x70,0x00,0x30,0x48,0x30,0x6c,0x92,
0x90,0x7e,0x12,0x92,0x6c,0x30,0x08,0x10,
0x78,0x84,0x80,0x80,0x80,0x84,0x78,0x78,
0x84,0x80,0xfc,0x84,0x84,0x78,0x00,0x20,
0x40,0x78,0x84,0x80,0xfc,0x84,0x84,0x78,
0x00,0x10,0x08,0x78,0x84,0x80,0xfc,0x84,
0x84,0x78,0x00,0x48,0x30,0x78,0x84,0x80,
0xfc,0x84,0x84,0x78,0x00,0x6c,0x20,0x20,
0x20,0x20,0x20,0x20,0xe0,0x00,0x40,0x80,
0x20,0x20,0x20,0x20,0x20,0x20,0xe0,0x00,
0x40,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0xe0,0x00,0x90,0x60,0x10,0x10,0x10,0x10,
0x10,0x10,0x70,0x00,0xd8,0x78,0x84,0x84,
0x84,0x84,0x84,0x7c,0x04,0xc8,0x30,0xc8,
0x84,0x84,0x84,0x84,0x84,0xc4,0xb8,0x00,
0x98,0x64,0x78,0x84,0x84,0x84,0x84,0x84,
0x78,0x00,0x20,0x40,0x78,0x84,0x84,0x84,
0x84,0x84,0x78,0x00,0x10,0x08,0x78,0x84,
0x84,0x84,0x84,0x84,0x78,0x00,0x48,0x30,
0x78,0x84,0x84,0x84,0x84,0x84,0x78,0x00,
0x98,0x64,0x78,0x84,0x84,0x84,0x84,0x84,
0x78,0x00,0x00,0x6c,0x30,0x00,0x00,0xfc,
0x00,0x00,0x30,0xbc,0x62,0x52,0x4a,0x46,
0x42,0x3d,0x74,0x8c,0x84,0x84,0x84,0x84,
0x84,0x00,0x20,0x40,0x74,0x8c,0x84,0x84,
0x84,0x84,0x84,0x00,0x20,0x10,0x74,0x8c,
0x84,0x84,0x84,0x84,0x84,0x00,0x48,0x30,
0x74,0x8c,0x84,0x84,0x84,0x84,0x84,0x00,
0x00,0x6c,0x78,0x84,0x04,0x04,0x74,0x8c,
0x84,0x84,0x84,0x84,0x84,0x00,0x20,0x10,
0xe0,0x40,0x40,0x5c,0x62,0x42,0x42,0x42,
0x62,0x5c,0x40,0x40,0xc0,0x78,0x84,0x04,
0x04,0x74,0x8c,0x84,0x84,0x84,0x84,0x84,
0x00,0x00,0x6c,
};
BMF_FontData BMF_font_scr15 = {
0, -4,
8, 11,
{
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0, 0, 0, 0, 8, -1},
{1, 10, -3, 0, 8, 0},
{4, 4, -2, -6, 8, 10},
{8, 10, 0, 0, 8, 14},
{5, 12, -1, 1, 8, 24},
{7, 10, 0, 0, 8, 36},
{7, 10, 0, 0, 8, 46},
{3, 4, -2, -6, 8, 56},
{4, 13, -2, 2, 8, 60},
{4, 13, -2, 2, 8, 73},
{5, 6, -1, -2, 8, 86},
{7, 7, 0, -1, 8, 92},
{3, 5, -2, 3, 8, 99},
{6, 1, -1, -4, 8, 104},
{2, 2, -3, 0, 8, 105},
{6, 12, -1, 1, 8, 107},
{6, 10, -1, 0, 8, 119},
{3, 10, -3, 0, 8, 129},
{6, 10, -1, 0, 8, 139},
{6, 10, -1, 0, 8, 149},
{6, 10, -1, 0, 8, 159},
{6, 10, -1, 0, 8, 169},
{6, 10, -1, 0, 8, 179},
{6, 10, -1, 0, 8, 189},
{6, 10, -1, 0, 8, 199},
{6, 10, -1, 0, 8, 209},
{2, 7, -3, 0, 8, 219},
{2, 9, -3, 2, 8, 226},
{6, 11, -1, 1, 8, 235},
{6, 4, -1, -3, 8, 246},
{6, 11, -1, 1, 8, 250},
{6, 10, -1, 0, 8, 261},
{6, 10, -1, 0, 8, 271},
{6, 10, -1, 0, 8, 281},
{6, 10, -1, 0, 8, 291},
{6, 10, -1, 0, 8, 301},
{6, 10, -1, 0, 8, 311},
{6, 10, -1, 0, 8, 321},
{6, 10, -1, 0, 8, 331},
{6, 10, -1, 0, 8, 341},
{6, 10, -1, 0, 8, 351},
{3, 10, -2, 0, 8, 361},
{5, 10, -1, 0, 8, 371},
{6, 10, -1, 0, 8, 381},
{6, 10, -1, 0, 8, 391},
{7, 10, 0, 0, 8, 401},
{6, 10, -1, 0, 8, 411},
{6, 10, -1, 0, 8, 421},
{6, 10, -1, 0, 8, 431},
{6, 13, -1, 3, 8, 441},
{6, 10, -1, 0, 8, 454},
{6, 10, -1, 0, 8, 464},
{7, 10, 0, 0, 8, 474},
{6, 10, -1, 0, 8, 484},
{6, 10, -1, 0, 8, 494},
{7, 10, 0, 0, 8, 504},
{6, 10, -1, 0, 8, 514},
{7, 10, 0, 0, 8, 524},
{6, 10, -1, 0, 8, 534},
{4, 13, -2, 2, 8, 544},
{6, 12, -1, 1, 8, 557},
{4, 13, -2, 2, 8, 569},
{5, 3, -1, -6, 8, 582},
{8, 1, 0, 3, 8, 585},
{3, 4, -2, -6, 8, 586},
{6, 7, -1, 0, 8, 590},
{6, 10, -1, 0, 8, 597},
{6, 7, -1, 0, 8, 607},
{6, 10, -1, 0, 8, 614},
{6, 7, -1, 0, 8, 624},
{6, 10, -1, 0, 8, 631},
{6, 11, -1, 4, 8, 641},
{6, 10, -1, 0, 8, 652},
{3, 10, -2, 0, 8, 662},
{5, 14, -1, 4, 8, 672},
{6, 10, -1, 0, 8, 686},
{3, 10, -2, 0, 8, 696},
{7, 7, 0, 0, 8, 706},
{6, 7, -1, 0, 8, 713},
{6, 7, -1, 0, 8, 720},
{6, 11, -1, 4, 8, 727},
{6, 11, -1, 4, 8, 738},
{6, 7, -1, 0, 8, 749},
{6, 7, -1, 0, 8, 756},
{6, 9, -1, 0, 8, 763},
{6, 7, -1, 0, 8, 772},
{6, 7, -1, 0, 8, 779},
{7, 7, 0, 0, 8, 786},
{6, 7, -1, 0, 8, 793},
{6, 11, -1, 4, 8, 800},
{6, 7, -1, 0, 8, 811},
{6, 13, -1, 2, 8, 818},
{1, 14, -3, 3, 8, 831},
{6, 13, -1, 2, 8, 845},
{6, 3, -1, -3, 8, 858},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{0,0,0,0,0, -1},
{1, 10, -3, 3, 8, 861},
{5, 10, -1, 0, 8, 871},
{6, 10, -1, 0, 8, 881},
{6, 7, -1, -2, 8, 891},
{7, 10, 0, 0, 8, 898},
{1, 14, -3, 3, 8, 908},
{6, 13, -1, 3, 8, 922},
{5, 1, -1, -9, 8, 935},
{7, 9, 0, 0, 8, 936},
{5, 7, -1, -3, 8, 945},
{8, 9, 0, 0, 8, 952},
{6, 3, -1, -3, 8, 961},
{6, 1, -1, -4, 8, 964},
{7, 9, 0, 0, 8, 965},
{4, 1, -2, -9, 8, 974},
{4, 4, -2, -4, 8, 975},
{7, 9, 0, 0, 8, 979},
{4, 5, -2, -5, 8, 988},
{4, 5, -2, -5, 8, 993},
{2, 2, -3, -9, 8, 998},
{6, 10, -1, 3, 8, 1000},
{7, 12, 0, 2, 8, 1010},
{2, 1, -3, -4, 8, 1022},
{3, 3, -3, 3, 8, 1023},
{3, 5, -3, -5, 8, 1026},
{5, 7, -1, -3, 8, 1031},
{8, 9, 0, 0, 8, 1038},
{7, 10, 0, 0, 8, 1047},
{7, 11, 0, 1, 8, 1057},
{7, 9, 0, -1, 8, 1068},
{6, 10, -1, 2, 8, 1077},
{6, 11, -1, 0, 8, 1087},
{6, 11, -1, 0, 8, 1098},
{6, 11, -1, 0, 8, 1109},
{6, 11, -1, 0, 8, 1120},
{6, 10, -1, 0, 8, 1131},
{6, 11, -1, 0, 8, 1141},
{7, 10, 0, 0, 8, 1152},
{6, 13, -1, 3, 8, 1162},
{6, 11, -1, 0, 8, 1175},
{6, 11, -1, 0, 8, 1186},
{6, 11, -1, 0, 8, 1197},
{6, 10, -1, 0, 8, 1208},
{3, 11, -2, 0, 8, 1218},
{3, 11, -2, 0, 8, 1229},
{4, 11, -2, 0, 8, 1240},
{5, 10, -1, 0, 8, 1251},
{7, 10, 0, 0, 8, 1261},
{6, 11, -1, 0, 8, 1271},
{6, 11, -1, 0, 8, 1282},
{6, 11, -1, 0, 8, 1293},
{6, 11, -1, 0, 8, 1304},
{6, 11, -1, 0, 8, 1315},
{6, 10, -1, 0, 8, 1326},
{6, 6, -1, -1, 8, 1336},
{8, 10, 0, 0, 8, 1342},
{6, 11, -1, 0, 8, 1352},
{6, 11, -1, 0, 8, 1363},
{6, 11, -1, 0, 8, 1374},
{6, 10, -1, 0, 8, 1385},
{7, 11, 0, 0, 8, 1395},
{7, 10, 0, 0, 8, 1406},
{6, 10, -1, 0, 8, 1416},
{6, 10, -1, 0, 8, 1426},
{6, 10, -1, 0, 8, 1436},
{6, 10, -1, 0, 8, 1446},
{6, 10, -1, 0, 8, 1456},
{6, 9, -1, 0, 8, 1466},
{6, 11, -1, 0, 8, 1475},
{7, 7, 0, 0, 8, 1486},
{6, 10, -1, 3, 8, 1493},
{6, 10, -1, 0, 8, 1503},
{6, 10, -1, 0, 8, 1513},
{6, 10, -1, 0, 8, 1523},
{6, 9, -1, 0, 8, 1533},
{3, 10, -2, 0, 8, 1542},
{3, 10, -2, 0, 8, 1552},
{4, 10, -2, 0, 8, 1562},
{5, 9, -1, 0, 8, 1572},
{6, 11, -1, 0, 8, 1581},
{6, 10, -1, 0, 8, 1592},
{6, 10, -1, 0, 8, 1602},
{6, 10, -1, 0, 8, 1612},
{6, 10, -1, 0, 8, 1622},
{6, 10, -1, 0, 8, 1632},
{6, 10, -1, 0, 8, 1642},
{6, 7, -1, 0, 8, 1652},
{8, 7, 0, 0, 8, 1659},
{6, 10, -1, 0, 8, 1666},
{6, 10, -1, 0, 8, 1676},
{6, 10, -1, 0, 8, 1686},
{6, 10, -1, 0, 8, 1696},
{6, 14, -1, 4, 8, 1706},
{7, 13, 0, 3, 8, 1720},
{6, 14, -1, 4, 8, 1733},
},
bitmap_data
};
#endif

@ -0,0 +1,44 @@
#
# $Id$
#
# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. The Blender
# Foundation also sells licenses for use in proprietary software under
# the Blender License. See http://www.blender.org/BL/ for information
# about this.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): none yet.
#
# ***** END GPL/BL DUAL LICENSE BLOCK *****
# bmfont intern Makefile
#
LIBNAME = bmfont
DIR = $(OCGDIR)/intern/$(LIBNAME)
include nan_compile.mk
CCFLAGS += $(LEVEL_2_CPP_WARNINGS)
CPPFLAGS += -I.
CPPFLAGS += -I..
CPPFLAGS += -I$(OPENGL_HEADERS)

@ -0,0 +1,174 @@
# Microsoft Developer Studio Project File - Name="BMF_bmfont" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=BMF_bmfont - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "BMF_bmfont.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "BMF_bmfont.mak" CFG="BMF_bmfont - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "BMF_bmfont - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "BMF_bmfont - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "BMF_bmfont - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../../../../obj/windows/intern/BMF_bmfont/"
# PROP Intermediate_Dir "../../../../../obj/windows/intern/BMF_bmfont/"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../.." /I "../../intern" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Desc=Copying BMFONT files library (release target) to lib tree.
PostBuild_Cmds=ECHO Copying header files COPY "..\..\*.h" "..\..\..\..\..\develop\lib\windows\bmfont\include\" ECHO Copying lib COPY "..\..\..\..\..\obj\windows\intern\BMF_bmfont\BMF_bmfont.lib" "..\..\..\..\..\develop\lib\windows\bmfont\lib\libbmfont.a" ECHO Done
# End Special Build Tool
!ELSEIF "$(CFG)" == "BMF_bmfont - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../../../../../obj/windows/intern/BMF_bmfont/debug"
# PROP Intermediate_Dir "../../../../../obj/windows/intern/BMF_bmfont/debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../.." /I "../../intern" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Desc=Copying BMFONT files library (debug target) to lib tree.
PostBuild_Cmds=ECHO Copying header files COPY "..\..\*.h" "..\..\..\..\..\develop\lib\windows\bmfont\include" ECHO Copying lib COPY "..\..\..\..\..\obj\windows\intern\BMF_bmfont\debug\BMF_bmfont.lib" "..\..\..\..\..\develop\lib\windows\bmfont\lib\debug\libbmfont.a" ECHO Done
# End Special Build Tool
!ENDIF
# Begin Target
# Name "BMF_bmfont - Win32 Release"
# Name "BMF_bmfont - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\intern\BMF_Api.cpp
# End Source File
# Begin Source File
SOURCE=..\..\intern\BMF_BitmapFont.cpp
# End Source File
# Begin Source File
SOURCE=..\..\intern\BMF_font_helv10.cpp
# End Source File
# Begin Source File
SOURCE=..\..\intern\BMF_font_helv12.cpp
# End Source File
# Begin Source File
SOURCE=..\..\intern\BMF_font_helvb10.cpp
# End Source File
# Begin Source File
SOURCE=..\..\intern\BMF_font_helvb12.cpp
# End Source File
# Begin Source File
SOURCE=..\..\intern\BMF_font_helvb14.cpp
# End Source File
# Begin Source File
SOURCE=..\..\intern\BMF_font_helvb8.cpp
# End Source File
# Begin Source File
SOURCE=..\..\intern\BMF_font_scr12.cpp
# End Source File
# Begin Source File
SOURCE=..\..\intern\BMF_font_scr14.cpp
# End Source File
# Begin Source File
SOURCE=..\..\intern\BMF_font_scr15.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Group "intern"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\intern\BMF_BitmapFont.h
# End Source File
# Begin Source File
SOURCE=..\..\intern\BMF_FontData.h
# End Source File
# End Group
# Begin Group "extern"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\BMF_Api.h
# End Source File
# Begin Source File
SOURCE=..\..\BMF_Fonts.h
# End Source File
# Begin Source File
SOURCE=..\..\BMF_Settings.h
# End Source File
# End Group
# End Group
# End Target
# End Project

@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "BMF_bmfont"=.\BMF_bmfont.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

@ -0,0 +1,225 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
/**
* $Id$
* Copyright (C) 2001 NaN Technologies B.V.
* Simple test file for the bitmap font library using GHOST.
* @author Maarten Gribnau
* @date November 15, 2001
*/
#include <iostream>
#if defined(WIN32) || defined(__APPLE__)
#ifdef WIN32
#include <windows.h>
#include <GL/gl.h>
#else // WIN32
// __APPLE__ is defined
#include <AGL/gl.h>
#endif // WIN32
#else // defined(WIN32) || defined(__APPLE__)
#include <GL/gl.h>
#endif // defined(WIN32) || defined(__APPLE__)
#include "STR_String.h"
#include "GHOST_Rect.h"
#include "GHOST_ISystem.h"
#include "GHOST_IEvent.h"
#include "GHOST_IEventConsumer.h"
#include "BMF_Api.h"
static class Application* fApp;
static GHOST_ISystem* fSystem = 0;
static void drawGL()
{
GLint x = 10, y = 10;
::glRasterPos2i(x, y);
BMF_FontPtr font = BMF_GetFont(BMF_kHelvetica10);
BMF_DrawString(font, "Helvetica 10 point");
y += 14;
::glRasterPos2i(x, y);
font = BMF_GetFont(BMF_kHelvetica12);
BMF_DrawString(font, "Helvetica 12 point");
y += 16;
::glRasterPos2i(x, y);
font = BMF_GetFont(BMF_kHelveticaBold8);
BMF_DrawString(font, "Helvetica Bold 8 point");
y += 12;
::glRasterPos2i(x, y);
font = BMF_GetFont(BMF_kHelveticaBold10);
BMF_DrawString(font, "Helvetica Bold 10 point");
y += 14;
::glRasterPos2i(x, y);
font = BMF_GetFont(BMF_kHelveticaBold12);
BMF_DrawString(font, "Helvetica Bold 12 point");
y += 16;
::glRasterPos2i(x, y);
font = BMF_GetFont(BMF_kHelveticaBold14);
BMF_DrawString(font, "Helvetica Bold 14 point");
y += 18;
::glRasterPos2i(x, y);
font = BMF_GetFont(BMF_kScreen12);
BMF_DrawString(font, "Screen 12 point");
y += 16;
::glRasterPos2i(x, y);
font = BMF_GetFont(BMF_kScreen14);
BMF_DrawString(font, "Screen 14 point");
y += 18;
::glRasterPos2i(x, y);
font = BMF_GetFont(BMF_kScreen15);
BMF_DrawString(font, "Screen 15 point");
}
static void setViewPortGL(GHOST_IWindow* window)
{
window->activateDrawingContext();
GHOST_Rect bnds;
window->getClientBounds(bnds);
::glViewport(0, 0, bnds.getWidth(), bnds.getHeight());
::glMatrixMode(GL_PROJECTION);
::glLoadIdentity();
::glOrtho(0, bnds.getWidth(), 0, bnds.getHeight(), -10, 10);
::glClearColor(.2f,0.0f,0.0f,0.0f);
::glClear(GL_COLOR_BUFFER_BIT);
}
class Application : public GHOST_IEventConsumer {
public:
Application(GHOST_ISystem* system);
virtual bool processEvent(GHOST_IEvent* event);
GHOST_ISystem* m_system;
GHOST_IWindow* m_mainWindow;
bool m_exitRequested;
};
Application::Application(GHOST_ISystem* system)
: m_system(system), m_mainWindow(0), m_exitRequested(false)
{
fApp = this;
// Create the main window
STR_String title1 ("gears - main window");
m_mainWindow = system->createWindow(title1, 10, 64, 320, 200, GHOST_kWindowStateNormal, GHOST_kDrawingContextTypeOpenGL);
if (!m_mainWindow) {
std::cout << "could not create main window\n";
exit(-1);
}
}
bool Application::processEvent(GHOST_IEvent* event)
{
bool handled = true;
switch (event->getType()) {
case GHOST_kEventWindowClose:
{
GHOST_TEventWindowData* windowData = (GHOST_TEventWindowData*)((GHOST_IEvent*)event)->getData();
GHOST_IWindow* window = windowData->window;
if (window == m_mainWindow) {
exit(0);
}
else {
m_system->disposeWindow(window);
}
}
break;
case GHOST_kEventWindowActivate:
handled = false;
break;
case GHOST_kEventWindowDeactivate:
handled = false;
break;
case GHOST_kEventWindowUpdate:
{
GHOST_TEventWindowData* windowData = (GHOST_TEventWindowData*)((GHOST_IEvent*)event)->getData();
GHOST_IWindow* window = windowData->window;
if (!m_system->validWindow(window)) break;
{
setViewPortGL(window);
drawGL();
window->swapBuffers();
}
}
break;
default:
handled = false;
break;
}
return handled;
}
int main(int /*argc*/, char** /*argv*/)
{
// Create the system
GHOST_ISystem::createSystem();
fSystem = GHOST_ISystem::getSystem();
if (fSystem) {
// Create an application object
Application app (fSystem);
// Add the application as event consumer
fSystem->addEventConsumer(&app);
// Enter main loop
while (!app.m_exitRequested) {
fSystem->processEvents();
fSystem->dispatchEvents();
}
}
// Dispose the system
GHOST_ISystem::disposeSystem();
return 0;
}

@ -0,0 +1,109 @@
# Microsoft Developer Studio Project File - Name="BMF_Test" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=BMF_Test - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "BMF_Test.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "BMF_Test.mak" CFG="BMF_Test - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "BMF_Test - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "BMF_Test - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "BMF_Test - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../../../../../obj/windows/intern/BMF_bmfont/test"
# PROP Intermediate_Dir "../../../../../../obj/windows/intern/BMF_bmfont/test"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I "../../../" /I "../../../../../lib/windows/string/include" /I "../../../../../lib/windows/ghost/include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libstring.a libghost.a glu32.lib opengl32.lib user32.lib gdi32.lib /nologo /subsystem:console /machine:I386 /libpath:"../../../../../lib/windows/string/lib" /libpath:"../../../../../lib/windows/ghost/lib"
!ELSEIF "$(CFG)" == "BMF_Test - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../../../../../../obj/windows/intern/BMF_bmfont/test/debug"
# PROP Intermediate_Dir "../../../../../../obj/windows/intern/BMF_bmfont/test/debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../" /I "../../../../../lib/windows/string/include" /I "../../../../../lib/windows/ghost/include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 glu32.lib opengl32.lib libstring.a libghost.a user32.lib gdi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../../../../../lib/windows/string/lib" /libpath:"../../../../../lib/windows/ghost/lib"
!ENDIF
# Begin Target
# Name "BMF_Test - Win32 Release"
# Name "BMF_Test - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\..\intern\BMF_glut_helb8.c
# End Source File
# Begin Source File
SOURCE=..\..\..\intern\BMF_glut_helb8.cpp
# End Source File
# Begin Source File
SOURCE=..\..\BMF_Test.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

@ -0,0 +1,44 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "BMF_Test"=.\BMF_Test.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name BMF_bmfont
End Project Dependency
}}}
###############################################################################
Project: "BMF_bmfont"=..\..\..\make\msvc_6_0\BMF_bmfont.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

55
intern/bsp/Makefile Normal file

@ -0,0 +1,55 @@
#
# $Id$
#
# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. The Blender
# Foundation also sells licenses for use in proprietary software under
# the Blender License. See http://www.blender.org/BL/ for information
# about this.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): none yet.
#
# ***** END GPL/BL DUAL LICENSE BLOCK *****
# bsp main makefile.
#
include nan_definitions.mk
LIBNAME = bsp
SOURCEDIR = intern/$(LIBNAME)
DIR = $(OCGDIR)/$(SOURCEDIR)
DIRS = intern
# not yet TESTDIRS = test
include nan_subdirs.mk
install: all debug
@[ -d $(NAN_BSP) ] || mkdir $(NAN_BSP)
@[ -d $(NAN_BSP)/include ] || mkdir $(NAN_BSP)/include
@[ -d $(NAN_BSP)/lib ] || mkdir $(NAN_BSP)/lib
@[ -d $(NAN_BSP)/lib/debug ] || mkdir $(NAN_BSP)/lib/debug
cp -f $(DIR)/libbsp.a $(NAN_BSP)/lib/
cp -f $(DIR)/debug/libbsp.a $(NAN_BSP)/lib/debug/
cp -f extern/*.h $(NAN_BSP)/include/

428
intern/bsp/extern/CSG_BooleanOps.h vendored Executable file

@ -0,0 +1,428 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef CSG_BOOLEANOPS_H
#define CSG_BOOLEANOPS_H
/**
* @section Interface structures for CSG module.
* This interface falls into 2 categories.
* The first section deals with an abstract mesh description
* between blender and this module. The second deals with
* the module functions.
* The CSG module needs to know about the following entities:
*/
/**
* CSG_IFace -- an interface polygon structure.
* vertex_index is a fixed size array of 4 elements containing indices into
* an abstract vertex container. 3 or 4 of these elements may be used to
* describe either quads or triangles.
* vertex_number is the number of vertices in this face - either 3 or 4.
* vertex_colors is an array of {r,g,b} triplets one for each vertex index.
* tex_coords is an array of {u,v} triplets one for each vertex index.
* user_data is a pointer to arbitary data of fixed width ,
* this data is copied around with the face, and duplicated if a face is
* split. Contains things like material index.
*/
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
int vertex_index[4];
int vertex_number;
void *user_face_vertex_data[4];
void *user_face_data;
} CSG_IFace;
/**
* CSG_IVertex -- an interface vertex structure.
* position is the location of the vertex in 3d space.
*/
typedef struct {
float position[3];
} CSG_IVertex;
/**
* The actual useful data contained in a group of faces is
* described by the following struct
*/
/**
* Descibes the data stored in a mesh available through the
* CSG_IFace interface.
* user_data_size is the number of bytes of user_data associated with each CSG_IFace
* user_face_vertex_data size is the number of bytes of user data associated with
* every face vertex tuple.
* .
*/
typedef struct CSG_MeshPropertyDescriptor{
unsigned int user_face_vertex_data_size;
unsigned int user_data_size;
} CSG_MeshPropertyDescriptor;
/**
* @section Iterator abstraction.
*
* The CSG module asks blender to fill in an instance of the above
* structure, and requests blender to move up and down (iterate) through
* it's face and vertex containers.
*
* An iterator supports the following functions.
* int IsDone(iterator *it) -- returns true if the iterator has reached
* the end of it's container.
*
* void Fill(iterator *it,DataType *data) -- Return the contents of the
* container at the current iterator position.
*
* void Step(iterator *it) -- increment the iterator to the next position
* in the container.
*
* The iterator is used in the following manner.
*
* MyIterator * iterator = ...
* DataType data;
*
* while (!IsDone(iterator)) {
* Fill(iterator,&data);
* //process information pointed to by data
* ...
* Step(iterator);
* }
*
* The CSG module does not want to know about the implementation of these
* functions so we use the c function ptr mechanism to hide them. Our
* iterator descriptor now looks like this.
*/
typedef void* CSG_IteratorPtr;
typedef int (*CSG_FaceItDoneFunc)(CSG_IteratorPtr it);
typedef void (*CSG_FaceItFillFunc)(CSG_IteratorPtr it,CSG_IFace *face);
typedef void (*CSG_FaceItStepFunc)(CSG_IteratorPtr it);
typedef void (*CSG_FaceItResetFunc)(CSG_IteratorPtr it);
typedef struct CSG_FaceIteratorDescriptor {
CSG_IteratorPtr it;
CSG_FaceItDoneFunc Done;
CSG_FaceItFillFunc Fill;
CSG_FaceItStepFunc Step;
CSG_FaceItResetFunc Reset;
unsigned int num_elements;
} CSG_FaceIteratorDescriptor;
/**
* Similarly to walk through the vertex arrays we have.
*/
typedef int (*CSG_VertexItDoneFunc)(CSG_IteratorPtr it);
typedef void (*CSG_VertexItFillFunc)(CSG_IteratorPtr it,CSG_IVertex *face);
typedef void (*CSG_VertexItStepFunc)(CSG_IteratorPtr it);
typedef void (*CSG_VertexItResetFunc)(CSG_IteratorPtr it);
typedef struct CSG_VertexIteratorDescriptor {
CSG_IteratorPtr it;
CSG_VertexItDoneFunc Done;
CSG_VertexItFillFunc Fill;
CSG_VertexItStepFunc Step;
CSG_VertexItResetFunc Reset;
unsigned int num_elements;
} CSG_VertexIteratorDescriptor;
/**
* The actual iterator structures are not exposed to the CSG module, they
* will contain datatypes specific to blender.
*/
/**
* @section CSG Module interface functions.
*
* The functions below are to be used in the following way:
*
* // Create a boolean operation handle
* CSG_BooleanOperation *operation = CSG_NewBooleanFunction();
* if (operation == NULL) {
* // deal with low memory exception
* }
*
* // Describe each mesh operand to the module.
* // NOTE: example properties!
* CSG_MeshPropertyDescriptor propA,propB;
* propA.user_data_size = 0;
* propA.user_face_vertex_data = 0;
* propB.user_face_vertex_data = 0;
* propB.user_data_size = 0;
*
* // Get the output properties of the mesh.
* CSG_MeshPropertyDescriptor output_properties;
* output_properties = CSG_DescibeOperands(
* operation,
* propA,
* propB
* );
*
* // Report to the user if they will loose any data!
* ...
*
* // Get some mesh iterators for your mesh data structures
* CSG_FaceIteratorDescriptor obA_faces = ...
* CSG_VertexIteratorDescriptor obA_verts = ...
*
* // same for object B
* CSG_FaceIteratorDescriptor obB_faces = ...
* CSG_VertexIteratorDescriptor obB_verts = ...
*
* // perform the operation...!
*
* int success = CSG_PerformBooleanOperation(
* operation,
* e_csg_intersection,
* obA_faces,
* obA_vertices,
* obB_faces,
* obB_vertices
* );
*
* // if the operation failes report miserable faiulre to user
* // and clear up data structures.
* if (!success) {
* ...
* CSG_FreeBooleanOperation(operation);
* return;
* }
*
* // read the new mesh vertices back from the module
* // and assign to your own mesh structure.
*
* // First we need to create a CSG_IVertex so the module can fill it in.
* CSG_IVertex vertex;
* CSG_VertexIteratorDescriptor * verts_it = CSG_OutputVertexDescriptor(operation);
*
* // initialize your vertex container with the number of verts (verts_it->num_elements)
*
* while (!verts_it->Done(verts_it->it)) {
* verts_it->Fill(verts_it->it,&vertex);
*
* // create a new vertex of your own type and add it
* // to your mesh structure.
* verts_it->Step(verts_it->it);
* }
* // Free the vertex iterator
* CSG_FreeVertexDescriptor(verts_it);
*
* // similarly for faces.
* CSG_IFace face;
*
* // you may need to reserve some memory in face->user_data here.
*
* // initialize your face container with the number of faces (faces_it->num_elements)
*
* CSG_FaceIteratorDescriptor * faces_it = CSG_OutputFaceDescriptor(operation);
*
* while (!faces_it->Done(faces_it->it)) {
* faces_it->Fill(faces_it->it,&face);
*
* // create a new face of your own type and add it
* // to your mesh structure.
* faces_it->Step(&faces_it->it);
* }
*
* // Free the face iterator
* CSG_FreeVertexDescriptor(faces_it);
*
* // that's it free the operation.
*
* CSG_FreeBooleanOperation(operation);
* return;
*
*/
/**
* Description of boolean operation type.
*/
typedef enum {
e_csg_union,
e_csg_intersection,
e_csg_difference,
e_csg_classify
} CSG_OperationType;
/**
* 'Handle' into the CSG module that identifies a particular CSG operation.
* the pointer CSG_info containers module specific data, and should not
* be touched in anyway outside of the module.
*/
typedef struct {
void *CSG_info;
} CSG_BooleanOperation;
/**
* Return a ptr to a CSG_BooleanOperation object allocated
* on the heap. The CSG module owns the memory associated with
* the returned ptr, use CSG_FreeBooleanOperation() to free this memory.
*/
CSG_BooleanOperation *
CSG_NewBooleanFunction(
void
);
/**
* Describe the operands of a boolean function to the module.
* The description takes the form of a pair of CSG_MeshPropertyDescriptors
* one for each input mesh. The operands do not have to have the same
* properties, for example operandA may have vertex colours but operandB none.
* In this case the CSG module will choose the lowest common denominator in
* mesh properies. The function returns a description of
* the output mesh. You can use this to warn the user that certain properties
* will be lost. Of course it also describes what fields in the output mesh
* will contain valid data.
*/
CSG_MeshPropertyDescriptor
CSG_DescibeOperands(
CSG_BooleanOperation * operation,
CSG_MeshPropertyDescriptor operandA_desciption,
CSG_MeshPropertyDescriptor operandB_desciption
);
/**
* The user data is handled by the BSP modules through
* the following function which is called whenever the
* module needs new face vertex properties (when a face is split).
* d1,d2 are pointers to existing vertex face data. dnew is
* a pointer to an allocated but unfilled area of user data of
* size user_face_vertex_data_size in the CSG_MeshPropertyDescriptor
* returned by a call to the above function. Epsilon is the relative
* distance (between [0,1]) of the new vertex and the vertex associated
* with d1. Use epsilon to interpolate the face vertex data in d1 and d2
* and fill dnew
*/
typedef int (*CSG_InterpolateUserFaceVertexDataFunc)(void *d1, void * d2, void *dnew, float epsilon);
/**
* Attempt to perform a boolean operation between the 2 objects of the
* desired type. This may fail due to an internal error or lack of memory.
* In this case 0 is returned, otehrwise 1 is returned indicating success.
* @param operation is a 'handle' into the CSG_Module created by CSG_NewBooleanFunction()
* @param op_type is the operation to perform.
* @param obAFaces is an iterator over the faces of objectA,
* @param obAVertices is an iterator over the vertices of objectA
* @param obAFaces is an iterator over the faces of objectB,
* @param obAVertices is an iterator over the vertices of objectB
* @param interp_func the face_vertex data interpolation function.(see above)
*
* All iterators must be valid and pointing to the first element in their
* respective containers.
*/
int
CSG_PerformBooleanOperation(
CSG_BooleanOperation * operation,
CSG_OperationType op_type,
CSG_FaceIteratorDescriptor obAFaces,
CSG_VertexIteratorDescriptor obAVertices,
CSG_FaceIteratorDescriptor obBFaces,
CSG_VertexIteratorDescriptor obBVertices,
CSG_InterpolateUserFaceVertexDataFunc interp_func
);
/**
* If the a boolean operation was successful, you may access the results
* through the following functions.
*
* CSG_OuputFaceDescriptor() returns a ptr to a CSG_FaceIteratorDesciptor
* allocated on the heap and owned by the CSG module. The iterator is
* positioned at the start of the internal face container.
* CSG_OutputVertexDescriptor() returns a ptr to a CSG_VertexIteratorDescriptor
* allocated on the heap and owned by the CSG module. The iterator is
* positioned at the start of the internal vertex container.
* There is no function to rewind an iterator but you may obtain more
* than one
* iterator at a time. Please use the function CSG_FreeFaceIterator()
* and CSG_FreeVertexIterator to free internal memory allocated for these
* iterators.
*
* If the last operation was not successful, these functions return NULL.
*/
int
CSG_OutputFaceDescriptor(
CSG_BooleanOperation * operation,
CSG_FaceIteratorDescriptor * output
);
int
CSG_OutputVertexDescriptor(
CSG_BooleanOperation * operation,
CSG_VertexIteratorDescriptor *output
);
/**
* Clean up functions.
* Free internal memory associated with CSG interface structures. You must
* call these functions on any structures created by the module, even if
* subsequent operations did not succeed.
*/
void
CSG_FreeVertexDescriptor(
CSG_VertexIteratorDescriptor * v_descriptor
);
void
CSG_FreeFaceDescriptor(
CSG_FaceIteratorDescriptor * f_descriptor
);
/**
* Free the memory associated with a boolean operation.
* NOTE any iterator descriptor describing the output will become
* invalid after this call and should be freed immediately.
*/
void
CSG_FreeBooleanOperation(
CSG_BooleanOperation *operation
);
#ifdef __cplusplus
}
#endif
#endif

@ -0,0 +1,58 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef NAN_INCLUDED_CSGException_h
#define NAN_INCLUDED_CSGException_h
// stick in more error types as you think of them
enum BSP_ExceptionType{
e_split_error,
e_mesh_error,
e_mesh_input_error,
e_param_error,
e_tree_build_error
};
class BSP_CSGException {
public :
BSP_ExceptionType m_e_type;
BSP_CSGException (
BSP_ExceptionType type
) : m_e_type (type)
{
}
};
#endif

@ -0,0 +1,430 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "BSP_CSGHelper.h"
#include "BSP_CSGMesh.h"
#include "BSP_MeshFragment.h"
#include "BSP_FragTree.h"
#include "BSP_CSGMeshSplitter.h"
#include "BSP_CSGNCMeshSplitter.h"
#include "BSP_Triangulate.h"
#include "MEM_SmartPtr.h"
using namespace std;
BSP_CSGHelper::
BSP_CSGHelper(
)
{
// nothing to do
}
bool
BSP_CSGHelper::
ComputeOp(
BSP_CSGMesh * obA,
BSP_CSGMesh * obB,
BSP_OperationType op_type,
BSP_CSGMesh & output,
CSG_InterpolateUserFaceVertexDataFunc fv_func
){
// First work out which parts of polygons we want to keep as we pass stuff
// down the tree.
BSP_Classification e_ATreeB,e_BTreeA;
bool invertA(false),invertB(false);
switch (op_type) {
case e_intern_csg_union :
e_ATreeB = e_classified_out;
e_BTreeA = e_classified_out;
break;
case e_intern_csg_intersection :
e_ATreeB = e_classified_in;
e_BTreeA = e_classified_in;
break;
case e_intern_csg_difference :
invertA = true;
e_ATreeB = e_classified_in;
e_BTreeA = e_classified_in;
break;
default :
return false;
}
if (invertA) {
obA->Invert();
}
if (invertB) {
obB->Invert();
}
MEM_SmartPtr<BSP_CSGMesh> obA_copy = obA->NewCopy();
MEM_SmartPtr<BSP_CSGMesh> obB_copy = obB->NewCopy();
// ok we need yet another copy...
MEM_SmartPtr<BSP_CSGMesh> obA_copy2 = obA->NewCopy();
MEM_SmartPtr<BSP_CSGMesh> obB_copy2 = obB->NewCopy();
obA_copy->BuildEdges();
obB_copy->BuildEdges();
// Create a splitter to help chop up the mesh and preserrve.
// mesh connectivity
MEM_SmartPtr<BSP_CSGMeshSplitter> splitter = new BSP_CSGMeshSplitter(fv_func);
if (splitter == NULL) return false;
// Create a splitter to help chop the mesh for tree building.
MEM_SmartPtr<BSP_CSGNCMeshSplitter> nc_splitter = new BSP_CSGNCMeshSplitter();
if (splitter == NULL || nc_splitter == NULL) return false;
// Create a tree for both meshes.
MEM_SmartPtr<BSP_FragTree> treeA = treeA->New(obA,nc_splitter.Ref());
MEM_SmartPtr<BSP_FragTree> treeB = treeB->New(obB,nc_splitter.Ref());
if (treeA == NULL || treeB == NULL) {
return false;
}
// Classify each object wrt the other tree.
MEM_SmartPtr<BSP_MeshFragment> AinB = new BSP_MeshFragment(obA_copy2,e_classified_in);
MEM_SmartPtr<BSP_MeshFragment> AoutB = new BSP_MeshFragment(obA_copy2,e_classified_out);
MEM_SmartPtr<BSP_MeshFragment> AonB = new BSP_MeshFragment(obA_copy2,e_classified_on);
treeB->Classify(obA_copy2,AinB,AoutB,AonB,nc_splitter.Ref());
MEM_SmartPtr<BSP_MeshFragment> BinA = new BSP_MeshFragment(obB_copy2,e_classified_in);
MEM_SmartPtr<BSP_MeshFragment> BoutA = new BSP_MeshFragment(obB_copy2,e_classified_out);
MEM_SmartPtr<BSP_MeshFragment> BonA = new BSP_MeshFragment(obB_copy2,e_classified_on);
treeA->Classify(obB_copy2,BinA,BoutA,BonA,nc_splitter.Ref());
// Now we need to work what were the spanning polygons from the original mesh.
// Build a spanning fragment from them and pass split those mothers.
MEM_SmartPtr<BSP_MeshFragment> frag_BTreeA2 = new BSP_MeshFragment(obA_copy,e_BTreeA);
MEM_SmartPtr<BSP_MeshFragment> AspanningB = new BSP_MeshFragment(obA_copy,e_classified_spanning);
TranslateSplitFragments(AinB.Ref(),AoutB.Ref(),AonB.Ref(),e_BTreeA,AspanningB.Ref(),frag_BTreeA2.Ref());
MEM_SmartPtr<BSP_MeshFragment> frag_ATreeB2 = new BSP_MeshFragment(obB_copy,e_ATreeB);
MEM_SmartPtr<BSP_MeshFragment> BspanningA = new BSP_MeshFragment(obB_copy,e_classified_spanning);
TranslateSplitFragments(BinA.Ref(),BoutA.Ref(),BonA.Ref(),e_ATreeB,BspanningA.Ref(),frag_ATreeB2.Ref());
MEM_SmartPtr<BSP_MeshFragment> frag_ATreeB = new BSP_MeshFragment(obB_copy,e_ATreeB);
MEM_SmartPtr<BSP_MeshFragment> frag_BTreeA = new BSP_MeshFragment(obA_copy,e_BTreeA);
if (frag_ATreeB == NULL || frag_BTreeA == NULL) return false;
// Pass the spanning polygons of copyB through the tree of copyA.
treeA->Push(BspanningA,frag_ATreeB,e_ATreeB,e_classified_spanning,true,splitter.Ref());
// Add the result of the push to the fragments we are interested in.
MergeFrags(frag_ATreeB2.Ref(),frag_ATreeB.Ref());
// Pass the spanning polygons of copyA through the tree of copyB
treeB->Push(AspanningB,frag_BTreeA,e_BTreeA,e_classified_spanning,false,splitter.Ref());
MergeFrags(frag_BTreeA2.Ref(),frag_BTreeA.Ref());
// Copy the fragments into a new mesh.
DuplicateMesh(frag_ATreeB.Ref(),output);
DuplicateMesh(frag_BTreeA.Ref(),output);
return true;
};
void
BSP_CSGHelper::
TranslateSplitFragments(
const BSP_MeshFragment & in_frag,
const BSP_MeshFragment & out_frag,
const BSP_MeshFragment & on_frag,
BSP_Classification keep,
BSP_MeshFragment & spanning_frag,
BSP_MeshFragment & output
){
// iterate through the 3 input fragments
// tag the polygons in the output fragments according to
// the classification of the input frags.
const BSP_CSGMesh *i_mesh = in_frag.Mesh();
BSP_CSGMesh *o_mesh = output.Mesh();
const vector<BSP_MFace> &i_faces = i_mesh->FaceSet();
vector<BSP_MFace> &o_faces = o_mesh->FaceSet();
vector<BSP_FaceInd>::const_iterator if_it = in_frag.FaceSet().begin();
vector<BSP_FaceInd>::const_iterator if_end = in_frag.FaceSet().end();
for (;if_it != if_end; ++if_it) {
int original_index = i_faces[*if_it].OpenTag();
if (original_index == -1) {
// then this face was never split and the original_index is
// the actual face index.
original_index = *if_it;
}
// tag the output faces with the in flag.
if (o_faces[original_index].OpenTag() == -1) {
o_faces[original_index].SetOpenTag(0);
}
o_faces[original_index].SetOpenTag(
o_faces[original_index].OpenTag() | e_classified_in
);
}
// same for out fragments.
if_it = out_frag.FaceSet().begin();
if_end = out_frag.FaceSet().end();
for (;if_it != if_end; ++if_it) {
int original_index = i_faces[*if_it].OpenTag();
if (original_index == -1) {
// then this face was never split and the original_index is
// the actual face index.
original_index = *if_it;
}
// tag the output faces with the in flag.
if (o_faces[original_index].OpenTag() == -1) {
o_faces[original_index].SetOpenTag(0);
}
o_faces[original_index].SetOpenTag(
o_faces[original_index].OpenTag() | e_classified_out
);
}
// on fragments just get set as spanning for now.
if_it = on_frag.FaceSet().begin();
if_end = on_frag.FaceSet().end();
for (;if_it != if_end; ++if_it) {
int original_index = i_faces[*if_it].OpenTag();
if (original_index == -1) {
// then this face was never split and the original_index is
// the actual face index.
original_index = *if_it;
}
// tag the output faces with the in flag.
if (o_faces[original_index].OpenTag() == -1) {
o_faces[original_index].SetOpenTag(0);
}
o_faces[original_index].SetOpenTag(
o_faces[original_index].OpenTag() | e_classified_spanning
);
}
// now run through the output faces.
// collect the ones we are interested in into output
// and collect the spanning faces.
int of_it = 0;
int of_size = o_faces.size();
for (;of_it < of_size; ++of_it) {
int p_class = o_faces[of_it].OpenTag();
if (p_class == int(keep)) {
output.FaceSet().push_back(BSP_FaceInd(of_it));
} else
if (
(p_class == (e_classified_in | e_classified_out)) ||
p_class == e_classified_spanning
) {
spanning_frag.FaceSet().push_back(BSP_FaceInd(of_it));
}
}
}
void
BSP_CSGHelper::
MergeFrags(
const BSP_MeshFragment & in,
BSP_MeshFragment & out
){
// Add the 2 frags together.
out.FaceSet().insert(
out.FaceSet().end(),
in.FaceSet().begin(),
in.FaceSet().end()
);
}
BSP_CSGHelper::
~BSP_CSGHelper(
){
// nothing to do
}
void
BSP_CSGHelper::
DuplicateMesh(
const BSP_MeshFragment & frag,
BSP_CSGMesh & output
){
// This stuff is a real waste of time.
// much better to create an output iterator based upon
// the 2 mesh fragments alone.
vector<BSP_MVertex> & o_verts = output.VertexSet();
BSP_CSGUserData & o_fv_data = output.FaceVertexData();
BSP_CSGUserData & o_f_data = output.FaceData();
// A temporary buffer containing the triangulated
// vertex indices.
vector<int> triangle_indices;
BSP_CSGMesh * i_mesh = frag.Mesh();
if (i_mesh == NULL) return;
vector<BSP_MVertex> & i_verts = i_mesh->VertexSet();
const vector<BSP_MFace> & i_faces = i_mesh->FaceSet();
BSP_CSGUserData & i_fv_data = i_mesh->FaceVertexData();
BSP_CSGUserData & i_f_data = i_mesh->FaceData();
// iterate through the fragment's face set
const vector<BSP_FaceInd> & frag_faces = frag.FaceSet();
vector<BSP_FaceInd>::const_iterator f_faces_it = frag_faces.begin();
vector<BSP_FaceInd>::const_iterator f_faces_end = frag_faces.end();
// We need to keep track of which vertices we are selecting.
vector<int> selected_vi;
BSP_Triangulate triangulator;
for (; f_faces_it != f_faces_end; ++f_faces_it) {
BSP_FaceInd fi = *f_faces_it;
const BSP_MFace &face = i_faces[fi];
// duplicate the face
BSP_MFace dup_face(face);
// iterate through the face's vertex indices.
vector<BSP_VertexInd>::iterator dup_f_verts_it = dup_face.m_verts.begin();
vector<BSP_VertexInd>::const_iterator dup_f_verts_end = dup_face.m_verts.end();
for (; dup_f_verts_it != dup_f_verts_end; ++dup_f_verts_it) {
if (i_verts[*dup_f_verts_it].SelectTag() == false) {
// copy this vertex onto the output mesh vertex array.
BSP_VertexInd new_vi(o_verts.size());
o_verts.push_back(i_verts[*dup_f_verts_it]);
// should kill the old vertices edge ptrs.
o_verts[new_vi].m_edges.clear();
// set the open tag in the old vert to the new one.
i_verts[*dup_f_verts_it].SetOpenTag(new_vi);
// select the old vertex
i_verts[*dup_f_verts_it].SetSelectTag(true);
selected_vi.push_back(*dup_f_verts_it);
}
// we have been to this vertex before and there should be
// a corresponding vertex in the new mesh vertex set.
*dup_f_verts_it = i_verts[*dup_f_verts_it].OpenTag();
}
// duplicate the face vertex data for this polygon.
vector<BSP_UserFVInd>::iterator dup_fv_it = dup_face.m_fv_data.begin();
vector<BSP_UserFVInd>::const_iterator dup_fv_end = dup_face.m_fv_data.end();
for (;dup_fv_it != dup_fv_end; ++dup_fv_it) {
*dup_fv_it = o_fv_data.Duplicate(i_fv_data[int(*dup_fv_it)]);
}
triangle_indices.clear();
// Now triangulate the polygon.
if (!triangulator.Process(
o_verts,
dup_face.m_verts,
dup_face.m_plane,
triangle_indices
)) {
// Sometimes the triangulator can fail for very small
// polygons or very thing polygons. This should be
// handled more elegantly but for now we just leave out the
// polygon from the mesh.
continue;
}
// Run through the result and add in the triangle faces.
int i;
for (i = 0; i < triangle_indices.size(); i+=3) {
// duplicate the face data for this face.
o_f_data.Duplicate(i_f_data[*f_faces_it]);
output.AddSubTriangle(dup_face,triangle_indices.begin() + i);
}
}
// of course we have to deselect the vertices again.
vector<int>::const_iterator selected_vi_it = selected_vi.begin();
vector<int>::const_iterator selected_vi_end = selected_vi.end();
for (; selected_vi_it != selected_vi_end; ++selected_vi_it) {
i_verts[*selected_vi_it].SetSelectTag(false);
}
}

@ -0,0 +1,99 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef BSP_CSGHELPER_H
#define BSP_CSGHELPER_H
class BSP_CSGMesh;
class BSP_MeshFragment;
#include "../extern/CSG_BooleanOps.h"
#include "BSP_MeshPrimitives.h"
enum BSP_OperationType{
e_intern_csg_union,
e_intern_csg_intersection,
e_intern_csg_difference
};
class BSP_CSGHelper {
public :
BSP_CSGHelper(
);
bool
ComputeOp(
BSP_CSGMesh * obA,
BSP_CSGMesh * obB,
BSP_OperationType op_type,
BSP_CSGMesh & output,
CSG_InterpolateUserFaceVertexDataFunc fv_func
);
~BSP_CSGHelper(
);
private:
// Iterate through the fragment,
// add new vertices to output,
// map polygons to new vertices.
void
DuplicateMesh(
const BSP_MeshFragment & frag,
BSP_CSGMesh & output
);
void
TranslateSplitFragments(
const BSP_MeshFragment & in_frag,
const BSP_MeshFragment & out_frag,
const BSP_MeshFragment & on_frag,
BSP_Classification keep,
BSP_MeshFragment & spanning_frag,
BSP_MeshFragment & output
);
void
MergeFrags(
const BSP_MeshFragment & in,
BSP_MeshFragment & out
);
};
#endif

@ -0,0 +1,118 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef BSP_CSGISplitter_h
#define BSP_CSGISplitter_h
class BSP_MeshFragment;
class BSP_CSGMesh;
class MT_Plane3;
/**
* This class defines a mesh splitter interface.
* It embodies the action of splitting a mesh by a plane.
* Depending on the context of the operation subclasses
* may wish to define different implementations. For example
* with building a BSP tree from a mesh, the mesh does not
* need to be kept consistent, it doesn't matter if the edges
* are maintained etc. However when pushing polygons through
* a BSP tree (say for CSG operations)it is important to
* try and maintain mesh connectivity and thus a different
* splitter implementation may be needed.
*
* This is an abstract interface class.
*/
class BSP_CSGISplitter
{
public:
/**
* Split the incoming mesh fragment (frag)
* by the plane, put the output into (in,out and on)
* Subclasses should clear the contents of the
* in_coming fragment.
*/
virtual
void
Split(
const MT_Plane3& plane,
BSP_MeshFragment *frag,
BSP_MeshFragment *in_frag,
BSP_MeshFragment *out_frag,
BSP_MeshFragment *on_frag,
BSP_MeshFragment *spanning_frag
)= 0;
/**
* Split the entire mesh with respect to the plane.
* and place ouput into (in,out and on).
* Subclasses should clear the contents of the
* in_coming fragment.
*/
virtual
void
Split(
BSP_CSGMesh & mesh,
const MT_Plane3& plane,
BSP_MeshFragment *in_frag,
BSP_MeshFragment *out_frag,
BSP_MeshFragment *on_frag,
BSP_MeshFragment *spanning_frag
)=0;
virtual
~BSP_CSGISplitter(
){
};
protected :
BSP_CSGISplitter(
) {
//nothing to do
}
BSP_CSGISplitter(
const BSP_CSGISplitter &
) {
//nothing to do
}
};
#endif

883
intern/bsp/intern/BSP_CSGMesh.cpp Executable file

@ -0,0 +1,883 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "BSP_CSGMesh.h"
#include "MT_assert.h"
#include "CTR_TaggedSetOps.h"
#include "BSP_MeshFragment.h"
#include "MT_Plane3.h"
#include "BSP_CSGException.h"
// for vector reverse
#include <algorithm>
using namespace std;
BSP_CSGMesh::
BSP_CSGMesh(
) :
MEM_RefCountable()
{
// nothing to do
}
BSP_CSGMesh *
BSP_CSGMesh::
New(
){
return new BSP_CSGMesh();
}
BSP_CSGMesh *
BSP_CSGMesh::
NewCopy(
) const {
MEM_SmartPtr<BSP_CSGMesh> mesh = New();
if (mesh == NULL) return NULL;
mesh->m_bbox_max = m_bbox_max;
mesh->m_bbox_min = m_bbox_min;
if (m_edges != NULL) {
mesh->m_edges = new vector<BSP_MEdge>(m_edges.Ref());
if (mesh->m_edges == NULL) return NULL;
}
if (m_verts != NULL) {
mesh->m_verts = new vector<BSP_MVertex>(m_verts.Ref());
if (mesh->m_verts == NULL) return NULL;
}
if (m_faces != NULL) {
mesh->m_faces = new vector<BSP_MFace>(m_faces.Ref());
if (mesh->m_faces == NULL) return NULL;
}
if (m_fv_data != NULL) {
mesh->m_fv_data = new BSP_CSGUserData(m_fv_data.Ref());
if (mesh->m_fv_data == NULL) return NULL;
}
if (m_face_data != NULL) {
mesh->m_face_data = new BSP_CSGUserData(m_face_data.Ref());
if (mesh->m_face_data == NULL) return NULL;
}
return mesh.Release();
}
void
BSP_CSGMesh::
Invert(
){
vector<BSP_MFace> & faces = FaceSet();
vector<BSP_MFace>::const_iterator faces_end = faces.end();
vector<BSP_MFace>::iterator faces_it = faces.begin();
for (; faces_it != faces_end; ++faces_it) {
faces_it->Invert();
}
}
bool
BSP_CSGMesh::
SetVertices(
MEM_SmartPtr<vector<BSP_MVertex> > verts
){
if (verts == NULL) return false;
// create polygon and edge arrays and reserve some space.
m_faces = new vector<BSP_MFace>;
if (!m_faces) return false;
m_faces->reserve(verts->size()/2);
// previous verts get deleted here.
m_verts = verts;
return true;
}
void
BSP_CSGMesh::
SetFaceVertexData(
MEM_SmartPtr<BSP_CSGUserData> fv_data
){
m_fv_data = fv_data;
}
void
BSP_CSGMesh::
SetFaceData(
MEM_SmartPtr<BSP_CSGUserData> f_data
) {
m_face_data = f_data;
}
void
BSP_CSGMesh::
AddPolygon(
const int * verts,
int num_verts
){
MT_assert(verts != NULL);
MT_assert(num_verts >=3);
if (verts == NULL || num_verts <3) return;
const int vertex_num = m_verts->size();
// make a polyscone from these vertex indices.
const BSP_FaceInd fi = m_faces->size();
m_faces->push_back(BSP_MFace());
BSP_MFace & face = m_faces->back();
insert_iterator<vector<BSP_VertexInd> > insert_point(face.m_verts,face.m_verts.end());
copy (verts,verts + num_verts,insert_point);
// compute and store the plane equation for this face.
MT_Plane3 face_plane = FacePlane(fi);
face.m_plane = face_plane;
};
void
BSP_CSGMesh::
AddPolygon(
const int * verts,
const int * fv_indices,
int num_verts
){
// This creates a new polygon on the end of the face list.
AddPolygon(verts,num_verts);
BSP_MFace & face = m_faces->back();
// now we just fill in the fv indices
if (fv_indices) {
insert_iterator<vector<BSP_UserFVInd> > insert_point(face.m_fv_data,face.m_fv_data.end());
copy(fv_indices,fv_indices + num_verts,insert_point);
} else {
face.m_fv_data.insert(face.m_fv_data.end(),num_verts,BSP_UserFVInd::Empty());
}
}
void
BSP_CSGMesh::
AddSubTriangle(
const BSP_MFace &iface,
const int * index_info
){
// This creates a new polygon on the end of the face list.
const BSP_FaceInd fi = m_faces->size();
m_faces->push_back(BSP_MFace());
BSP_MFace & face = m_faces->back();
face.m_verts.push_back(iface.m_verts[index_info[0]]);
face.m_verts.push_back(iface.m_verts[index_info[1]]);
face.m_verts.push_back(iface.m_verts[index_info[2]]);
face.m_fv_data.push_back(iface.m_fv_data[index_info[0]]);
face.m_fv_data.push_back(iface.m_fv_data[index_info[1]]);
face.m_fv_data.push_back(iface.m_fv_data[index_info[2]]);
face.m_plane = iface.m_plane;
}
// assumes that the face already has a plane equation
void
BSP_CSGMesh::
AddPolygon(
const BSP_MFace &face
){
m_faces->push_back(face);
};
bool
BSP_CSGMesh::
BuildEdges(
){
if (m_faces == NULL) return false;
if (m_edges != NULL) {
DestroyEdges();
}
m_edges = new vector<BSP_MEdge>;
if (m_edges == NULL) {
return false;
}
//iterate through the face set and add edges for all polygon
//edges
vector<BSP_MFace>::const_iterator f_it_end = FaceSet().end();
vector<BSP_MFace>::const_iterator f_it_begin = FaceSet().begin();
vector<BSP_MFace>::iterator f_it = FaceSet().begin();
vector<BSP_MVertex> & vertex_set = VertexSet();
vector<BSP_EdgeInd> dummy;
for (;f_it != f_it_end; ++f_it) {
BSP_MFace & face = *f_it;
int vertex_num = face.m_verts.size();
BSP_VertexInd prev_vi(face.m_verts[vertex_num-1]);
for (int vert = 0; vert < vertex_num; ++vert) {
BSP_FaceInd fi(f_it - f_it_begin);
InsertEdge(prev_vi,face.m_verts[vert],fi,dummy);
prev_vi = face.m_verts[vert];
}
}
dummy.clear();
return true;
}
void
BSP_CSGMesh::
DestroyEdges(
){
m_edges.Delete();
// Run through the vertices
// and clear their edge arrays.
if (m_verts){
vector<BSP_MVertex>::const_iterator vertex_end = VertexSet().end();
vector<BSP_MVertex>::iterator vertex_it = VertexSet().begin();
for (; vertex_it != vertex_end; ++vertex_it) {
vertex_it->m_edges.clear();
}
}
}
BSP_EdgeInd
BSP_CSGMesh::
FindEdge(
const BSP_VertexInd & v1,
const BSP_VertexInd & v2
) const {
vector<BSP_MVertex> &verts = VertexSet();
vector<BSP_MEdge> &edges = EdgeSet();
BSP_MEdge e;
e.m_verts[0] = v1;
e.m_verts[1] = v2;
vector<BSP_EdgeInd> &v1_edges = verts[v1].m_edges;
vector<BSP_EdgeInd>::const_iterator v1_end = v1_edges.end();
vector<BSP_EdgeInd>::const_iterator v1_begin = v1_edges.begin();
for (; v1_begin != v1_end; ++v1_begin) {
if (edges[*v1_begin] == e) return *v1_begin;
}
return BSP_EdgeInd::Empty();
}
void
BSP_CSGMesh::
InsertEdge(
const BSP_VertexInd & v1,
const BSP_VertexInd & v2,
const BSP_FaceInd & f,
vector<BSP_EdgeInd> &new_edges
){
MT_assert(!v1.IsEmpty());
MT_assert(!v2.IsEmpty());
MT_assert(!f.IsEmpty());
if (v1.IsEmpty() || v2.IsEmpty() || f.IsEmpty()) {
BSP_CSGException e(e_mesh_error);
throw (e);
}
vector<BSP_MVertex> &verts = VertexSet();
vector<BSP_MEdge> &edges = EdgeSet();
BSP_EdgeInd e;
e = FindEdge(v1,v2);
if (e.IsEmpty()) {
// This edge does not exist -- make a new one
BSP_MEdge temp_e;
temp_e.m_verts[0] = v1;
temp_e.m_verts[1] = v2;
e = m_edges->size();
// set the face index from the edge back to this polygon.
temp_e.m_faces.push_back(f);
m_edges->push_back(temp_e);
// add the edge index to it's vertices
verts[v1].AddEdge(e);
verts[v2].AddEdge(e);
new_edges.push_back(e);
} else {
// edge already exists
// insure that there is no polygon already
// attached to the other side of this edge
// swap the empty face pointer in edge with f
BSP_MEdge &edge = edges[e];
// set the face index from the edge back to this polygon.
edge.m_faces.push_back(f);
}
}
// geometry access
//////////////////
vector<BSP_MVertex> &
BSP_CSGMesh::
VertexSet(
) const {
return m_verts.Ref();
}
vector<BSP_MFace> &
BSP_CSGMesh::
FaceSet(
) const {
return m_faces.Ref();
}
vector<BSP_MEdge> &
BSP_CSGMesh::
EdgeSet(
) const {
return m_edges.Ref();
}
BSP_CSGUserData &
BSP_CSGMesh::
FaceVertexData(
) const {
return m_fv_data.Ref();
}
BSP_CSGUserData &
BSP_CSGMesh::
FaceData(
) const {
return m_face_data.Ref();
}
BSP_CSGMesh::
~BSP_CSGMesh(
){
// member deletion handled by smart ptr;
}
// local geometry queries.
/////////////////////////
// face queries
///////////////
void
BSP_CSGMesh::
FaceVertices(
const BSP_FaceInd & f,
vector<BSP_VertexInd> &output
){
vector<BSP_MFace> & face_set = FaceSet();
output.insert(
output.end(),
face_set[f].m_verts.begin(),
face_set[f].m_verts.end()
);
}
void
BSP_CSGMesh::
FaceEdges(
const BSP_FaceInd & fi,
vector<BSP_EdgeInd> &output
){
// take intersection of the edges emminating from all the vertices
// of this polygon;
vector<BSP_MFace> &faces = FaceSet();
vector<BSP_MEdge> &edges = EdgeSet();
const BSP_MFace & f = faces[fi];
// collect vertex edges;
vector<BSP_VertexInd>::const_iterator face_verts_it = f.m_verts.begin();
vector<BSP_VertexInd>::const_iterator face_verts_end = f.m_verts.end();
vector< vector<BSP_EdgeInd> > vertex_edges(f.m_verts.size());
int vector_slot = 0;
for (;face_verts_it != face_verts_end; ++face_verts_it, ++vector_slot) {
VertexEdges(*face_verts_it,vertex_edges[vector_slot]);
}
int prev = vector_slot - 1;
// intersect pairs of edge sets
for (int i = 0; i < vector_slot;i++) {
CTR_TaggedSetOps<BSP_EdgeInd,BSP_MEdge>::IntersectPair(vertex_edges[prev],vertex_edges[i],edges,output);
prev = i;
}
// should always have 3 or more unique edges per face.
MT_assert(output.size() >=3);
if (output.size() < 3) {
BSP_CSGException e(e_mesh_error);
throw(e);
}
};
// edge queries
///////////////
void
BSP_CSGMesh::
EdgeVertices(
const BSP_EdgeInd & e,
vector<BSP_VertexInd> &output
){
const vector<BSP_MEdge> &edges = EdgeSet();
output.push_back(edges[e].m_verts[0]);
output.push_back(edges[e].m_verts[1]);
}
void
BSP_CSGMesh::
EdgeFaces(
const BSP_EdgeInd & e,
vector<BSP_FaceInd> &output
){
vector<BSP_MEdge> & edge_set = EdgeSet();
output.insert(
output.end(),
edge_set[e].m_faces.begin(),
edge_set[e].m_faces.end()
);
}
// vertex queries
/////////////////
void
BSP_CSGMesh::
VertexEdges(
const BSP_VertexInd &v,
vector<BSP_EdgeInd> &output
){
vector<BSP_MVertex> & vertex_set = VertexSet();
output.insert(
output.end(),
vertex_set[v].m_edges.begin(),
vertex_set[v].m_edges.end()
);
}
void
BSP_CSGMesh::
VertexFaces(
const BSP_VertexInd &vi,
vector<BSP_FaceInd> &output
) {
vector<BSP_MEdge> &edges = EdgeSet();
vector<BSP_MFace> &faces = FaceSet();
vector<BSP_MVertex> &verts = VertexSet();
const vector<BSP_EdgeInd> &v_edges = verts[vi].m_edges;
vector<BSP_EdgeInd>::const_iterator e_it = v_edges.begin();
for (; e_it != v_edges.end(); ++e_it) {
BSP_MEdge &e = edges[*e_it];
// iterate through the faces of this edge - push unselected
// edges to ouput and then select the edge
vector<BSP_FaceInd>::const_iterator e_faces_end = e.m_faces.end();
vector<BSP_FaceInd>::iterator e_faces_it = e.m_faces.begin();
for (;e_faces_it != e_faces_end; ++e_faces_it) {
if (!faces[*e_faces_it].SelectTag()) {
output.push_back(*e_faces_it);
faces[*e_faces_it].SetSelectTag(true);
}
}
}
// deselect selected faces.
vector<BSP_FaceInd>::iterator f_it = output.begin();
for (; f_it != output.end(); ++f_it) {
faces[*f_it].SetSelectTag(false);
}
}
void
BSP_CSGMesh::
InsertVertexIntoFace(
BSP_MFace & face,
const BSP_VertexInd & v1,
const BSP_VertexInd & v2,
const BSP_VertexInd & vi,
CSG_InterpolateUserFaceVertexDataFunc fv_split_func,
MT_Scalar epsilon
){
// We assume that the face vertex data indices
// are consistent with the vertex inidex data.
// look for v1
vector<BSP_VertexInd>::iterator result =
find(face.m_verts.begin(),face.m_verts.end(),v1);
MT_assert(result != face.m_verts.end());
BSP_CSGUserData & fv_data = m_fv_data.Ref();
// now we have to check on either side of the result for the
// other vertex
vector<BSP_VertexInd>::iterator prev = result - 1;
if (prev < face.m_verts.begin()) {
prev = face.m_verts.end() -1;
}
if (*prev == v2) {
// so result <=> v2 and prev <=> v1
// create space for new face vertex data
int vf_i = fv_data.Size();
fv_data.IncSize();
int vf_i2 = prev - face.m_verts.begin();
int vf_i1 = result - face.m_verts.begin();
(*fv_split_func)(
fv_data[int(face.m_fv_data[vf_i1])],
fv_data[int(face.m_fv_data[vf_i2])],
fv_data[vf_i],
epsilon
);
// insert vertex data index.
face.m_fv_data.insert(face.m_fv_data.begin() + vf_i1,vf_i);
face.m_verts.insert(result,vi);
return;
}
vector<BSP_VertexInd>::iterator next = result + 1;
if (next >= face.m_verts.end()) {
next = face.m_verts.begin();
}
if (*next == v2) {
// so result <=> v1 and next <=> v2
int vf_i = fv_data.Size();
fv_data.IncSize();
int vf_i2 = int(next - face.m_verts.begin());
int vf_i1 = int(result - face.m_verts.begin());
(*fv_split_func)(
fv_data[int(face.m_fv_data[vf_i1])],
fv_data[int(face.m_fv_data[vf_i2])],
fv_data[vf_i],
epsilon
);
// insert vertex data index.
face.m_fv_data.insert(face.m_fv_data.begin() + vf_i2,vf_i);
face.m_verts.insert(next,vi);
return;
}
// if we get here we are in trouble.
MT_assert(false);
BSP_CSGException e(e_mesh_error);
throw(e);
}
void
BSP_CSGMesh::
SetBBox(
const MT_Vector3 & min,
const MT_Vector3 & max
){
m_bbox_min = min;
m_bbox_max = max;
}
void
BSP_CSGMesh::
BBox(
MT_Vector3 &min,
MT_Vector3 &max
) const {
min = m_bbox_min;
max = m_bbox_max;
}
// Update the BBox
//////////////////
void
BSP_CSGMesh::
UpdateBBox(
){
// TODO
};
void
BSP_CSGMesh::
SC_Classification(
BSP_FaceInd f,
const MT_Plane3& plane
){
const BSP_MFace & face = FaceSet()[f];
vector<BSP_VertexInd>::const_iterator f_verts_it = face.m_verts.begin();
vector<BSP_VertexInd>::const_iterator f_verts_end = face.m_verts.end();
for (;f_verts_it != f_verts_end; ++f_verts_it) {
const BSP_MVertex & vert = VertexSet()[*f_verts_it];
MT_Scalar dist = plane.signedDistance(
vert.m_pos
);
if (fabs(dist) <= BSP_SPLIT_EPSILON ){
MT_assert(BSP_Classification(vert.OpenTag()) == e_classified_on);
} else
if (dist > BSP_SPLIT_EPSILON) {
MT_assert(BSP_Classification(vert.OpenTag()) == e_classified_out);
} else
if (dist < BSP_SPLIT_EPSILON) {
MT_assert(BSP_Classification(vert.OpenTag()) == e_classified_in);
}
}
}
bool
BSP_CSGMesh::
SC_Face(
BSP_FaceInd f
){
#if 0
{
// check area is greater than zero.
vector<BSP_MVertex> & verts = VertexSet();
vector<BSP_VertexInd> f_verts;
FaceVertices(f,f_verts);
MT_assert(f_verts.size() >= 3);
BSP_VertexInd root = f_verts[0];
MT_Scalar area = 0;
for (int i=2; i < f_verts.size(); i++) {
MT_Vector3 a = verts[root].m_pos;
MT_Vector3 b = verts[f_verts[i-1]].m_pos;
MT_Vector3 c = verts[f_verts[i]].m_pos;
MT_Vector3 l1 = b-a;
MT_Vector3 l2 = c-b;
area += (l1.cross(l2)).length()/2;
}
MT_assert(!MT_fuzzyZero(area));
}
#endif
// Check coplanarity
#if 0
MT_Plane3 plane = FacePlane(f);
const BSP_MFace & face = FaceSet()[f];
vector<BSP_VertexInd>::const_iterator f_verts_it = face.m_verts.begin();
vector<BSP_VertexInd>::const_iterator f_verts_end = face.m_verts.end();
for (;f_verts_it != f_verts_end; ++f_verts_it) {
MT_Scalar dist = plane.signedDistance(
VertexSet()[*f_verts_it].m_pos
);
MT_assert(fabs(dist) < BSP_SPLIT_EPSILON);
}
#endif
// Check connectivity
vector<BSP_EdgeInd> f_edges;
FaceEdges(f,f_edges);
MT_assert(f_edges.size() == FaceSet()[f].m_verts.size());
unsigned int i;
for (i = 0; i < f_edges.size(); ++i) {
int matches = 0;
for (unsigned int j = 0; j < EdgeSet()[f_edges[i]].m_faces.size(); j++) {
if (EdgeSet()[f_edges[i]].m_faces[j] == f) matches++;
}
MT_assert(matches == 1);
}
return true;
}
MT_Plane3
BSP_CSGMesh::
FacePlane(
const BSP_FaceInd & fi
) const{
const BSP_MFace & f0 = FaceSet()[fi];
// Have to be a bit careful here coz the poly may have
// a lot of parallel edges. Should walk round the polygon
// and check length of cross product.
const MT_Vector3 & p1 = VertexSet()[f0.m_verts[0]].m_pos;
const MT_Vector3 & p2 = VertexSet()[f0.m_verts[1]].m_pos;
int face_size = f0.m_verts.size();
MT_Vector3 n;
for (int i = 2 ; i <face_size; i++) {
const MT_Vector3 & pi = VertexSet()[f0.m_verts[i]].m_pos;
MT_Vector3 l1 = p2-p1;
MT_Vector3 l2 = pi-p2;
n = l1.cross(l2);
MT_Scalar length = n.length();
if (!MT_fuzzyZero(length)) {
n = n * (1/length);
break;
}
}
return MT_Plane3(n,p1);
}
void
BSP_CSGMesh::
ComputeFacePlanes(
){
int fsize = FaceSet().size();
int i=0;
for (i = 0; i < fsize; i++) {
FaceSet()[i].m_plane = FacePlane(i);
}
};
int
BSP_CSGMesh::
CountTriangles(
) const {
// Each polygon of n sides can be partitioned into n-3 triangles.
// So we just go through and sum this function of polygon size.
vector<BSP_MFace> & face_set = FaceSet();
vector<BSP_MFace>::const_iterator face_it = face_set.begin();
vector<BSP_MFace>::const_iterator face_end = face_set.end();
int sum = 0;
for (;face_it != face_end; face_it++) {
// Should be careful about degenerate faces here.
sum += face_it->m_verts.size() - 2;
}
return sum;
}

345
intern/bsp/intern/BSP_CSGMesh.h Executable file

@ -0,0 +1,345 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef NAN_INCLUDED_BSP_CSGMesh_h
#define NAN_INCLUDED_BSP_CSGMesh_h
#include "BSP_MeshPrimitives.h"
#include "MEM_SmartPtr.h"
#include "MEM_RefCountPtr.h"
#include "MEM_NonCopyable.h"
#include "BSP_CSGUserData.h"
#include "../extern/CSG_BooleanOps.h"
class MT_Plane3;
class BSP_MeshFragment;
class BSP_CSGMesh :
public MEM_NonCopyable,
public MEM_RefCountable
{
public :
static
BSP_CSGMesh *
New(
);
bool
SetVertices(
MEM_SmartPtr<std::vector<BSP_MVertex> > verts
);
void
SetFaceVertexData(
MEM_SmartPtr<BSP_CSGUserData> fv_data
);
void
SetFaceData(
MEM_SmartPtr<BSP_CSGUserData> f_data
);
void
AddPolygon(
const int * verts,
int num_verts
);
void
AddPolygon(
const int * verts,
const int * fv_indices,
int num_verts
);
void
AddSubTriangle(
const BSP_MFace &iface,
const int * index_info
);
// assumes that the face already has a plane equation
void
AddPolygon(
const BSP_MFace &face
);
// Allocate and build the mesh edges.
////////////////////////////////////
bool
BuildEdges(
);
// Clean the mesh of edges. and edge pointers
// This removes the circular connectivity information
/////////////////////////////////////////////
void
DestroyEdges(
);
// return a new seperate copy of the
// mesh allocated on the heap.
BSP_CSGMesh *
NewCopy(
) const;
// Reverse the winding order of every polygon
// in the mesh and swap the planes around.
void
Invert(
);
// geometry access
//////////////////
std::vector<BSP_MVertex> &
VertexSet(
) const ;
std::vector<BSP_MFace> &
FaceSet(
) const ;
std::vector<BSP_MEdge> &
EdgeSet(
) const;
BSP_CSGUserData &
FaceVertexData(
) const;
BSP_CSGUserData &
FaceData(
) const;
~BSP_CSGMesh(
);
// local geometry queries.
/////////////////////////
// face queries
///////////////
void
FaceVertices(
const BSP_FaceInd & f,
std::vector<BSP_VertexInd> &output
);
void
FaceEdges(
const BSP_FaceInd & f,
std::vector<BSP_EdgeInd> &output
);
// edge queries
///////////////
void
EdgeVertices(
const BSP_EdgeInd & e,
std::vector<BSP_VertexInd> &output
);
void
EdgeFaces(
const BSP_EdgeInd & e,
std::vector<BSP_FaceInd> &output
);
// vertex queries
/////////////////
void
VertexEdges(
const BSP_VertexInd & v,
std::vector<BSP_EdgeInd> &output
);
void
VertexFaces(
const BSP_VertexInd & v,
std::vector<BSP_FaceInd> &output
);
// Returns the edge index of the edge from v1 to v2.
// Does this by searching the edge sets of v1 - but not v2.
// If you are paranoid you should check both and make sure the
// indices are the same. If the edge doe not exist edgeInd is empty.
BSP_EdgeInd
FindEdge(
const BSP_VertexInd &v1,
const BSP_VertexInd &v2
) const;
// Bounding box methods
///////////////////////
void
SetBBox(
const MT_Vector3 & min,
const MT_Vector3 & max
);
void
BBox(
MT_Vector3 &min,
MT_Vector3 &max
) const ;
// Update the BBox
//////////////////
void
UpdateBBox(
);
/**
* Sanity checkers
*/
// make sure the edge faces have a pointer to f
bool
SC_Face(
BSP_FaceInd f
);
/**
* Make sure the polygons vertex classification is correct
*/
void
SC_Classification(
BSP_FaceInd f,
const MT_Plane3&plane
);
/**
* Return the face plane equation
*/
MT_Plane3
FacePlane(
const BSP_FaceInd &fi
)const;
/**
* Recompute Face plane equations.
* essential if you have been messing with the object.
*/
void
ComputeFacePlanes(
);
/**
* Count the number of trinagles in the mesh.
* This is not the same as the number of polygons.
*/
int
CountTriangles(
) const;
/**
* Insert a vertex index into a polygon
* and call the external splitting function to
* generate a new face vertex property.
*/
void
InsertVertexIntoFace(
BSP_MFace & face,
const BSP_VertexInd & v1,
const BSP_VertexInd & v2,
const BSP_VertexInd & vi,
CSG_InterpolateUserFaceVertexDataFunc fv_split_func,
MT_Scalar epsilon
);
private :
void
InsertEdge(
const BSP_VertexInd &v1,
const BSP_VertexInd &v2,
const BSP_FaceInd &f,
std::vector<BSP_EdgeInd> &new_edges
);
// Private to insure heap instantiation.
BSP_CSGMesh(
);
MEM_SmartPtr< std::vector<BSP_MVertex> > m_verts;
MEM_SmartPtr< std::vector<BSP_MFace> > m_faces;
MEM_SmartPtr< std::vector<BSP_MEdge> > m_edges;
// The face_vertex user data associated with this mesh
MEM_SmartPtr<BSP_CSGUserData> m_fv_data;
// The face user data associated with this mesh -
// This is a buffer that maps directly to the face buffer.
// An index into the faces is alos an index into m_face_data
// for that face
MEM_SmartPtr<BSP_CSGUserData> m_face_data;
MT_Vector3 m_bbox_min;
MT_Vector3 m_bbox_max;
};
#endif

@ -0,0 +1,152 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "BSP_CSGMeshBuilder.h"
using namespace std;
MEM_SmartPtr<BSP_CSGMesh>
BSP_CSGMeshBuilder::
NewMesh(
CSG_MeshPropertyDescriptor &props,
CSG_FaceIteratorDescriptor &face_it,
CSG_VertexIteratorDescriptor &vertex_it
) {
MEM_SmartPtr<BSP_CSGMesh> mesh = BSP_CSGMesh::New();
if (mesh == NULL) return NULL;
MEM_SmartPtr<BSP_CSGUserData> fv_data = new BSP_CSGUserData(props.user_face_vertex_data_size);
MEM_SmartPtr<BSP_CSGUserData> face_data = new BSP_CSGUserData(props.user_data_size);
MEM_SmartPtr<vector<BSP_MVertex> > vertices(new vector<BSP_MVertex>);
if (vertices == NULL || fv_data == NULL || face_data == NULL) return NULL;
// The size of the vertex data array will be at least the number of faces.
fv_data->Reserve(face_it.num_elements);
face_data->Reserve(face_it.num_elements);
vertices->reserve(vertex_it.num_elements);
CSG_IVertex vertex;
while (!vertex_it.Done(vertex_it.it)) {
vertex_it.Fill(vertex_it.it,&vertex);
MT_Point3 pos(vertex.position);
vertices->push_back(BSP_MVertex(pos));
vertex_it.Step(vertex_it.it);
}
// pass ownership of the vertices to the mesh.
mesh->SetVertices(vertices);
// now for the polygons.
CSG_IFace face;
// we may need to decalare some memory for user defined face properties.
if (props.user_data_size) {
face.user_face_data = new char[props.user_data_size];
} else {
face.user_face_data = NULL;
}
if (props.user_face_vertex_data_size) {
char * fv_data = NULL;
fv_data = new char[4 * props.user_face_vertex_data_size];
face.user_face_vertex_data[0] = fv_data;
face.user_face_vertex_data[1] = fv_data + props.user_face_vertex_data_size;
face.user_face_vertex_data[2] = fv_data + 2*props.user_face_vertex_data_size;
face.user_face_vertex_data[3] = fv_data + 3*props.user_face_vertex_data_size;
} else {
face.user_face_vertex_data[0] = NULL;
face.user_face_vertex_data[1] = NULL;
face.user_face_vertex_data[2] = NULL;
face.user_face_vertex_data[3] = NULL;
}
int tri_index[3];
int fv_index[3];
while (!face_it.Done(face_it.it)) {
face_it.Fill(face_it.it,&face);
// Let's not rely on quads being coplanar - especially if they
// are coming out of that soup of code from blender...
if (face.vertex_number == 4) {
tri_index[0] = face.vertex_index[2];
tri_index[1] = face.vertex_index[3];
tri_index[2] = face.vertex_index[0];
fv_index[0] = fv_data->Duplicate(face.user_face_vertex_data[2]);
fv_index[1] = fv_data->Duplicate(face.user_face_vertex_data[3]);
fv_index[2] = fv_data->Duplicate(face.user_face_vertex_data[0]);
mesh->AddPolygon(tri_index,fv_index,3);
// bit of an unspoken relationship between mesh face buffer
// and the face data which I guess should be changed.
face_data->Duplicate(face.user_face_data);
}
fv_index[0] = fv_data->Duplicate(face.user_face_vertex_data[0]);
fv_index[1] = fv_data->Duplicate(face.user_face_vertex_data[1]);
fv_index[2] = fv_data->Duplicate(face.user_face_vertex_data[2]);
mesh->AddPolygon(face.vertex_index,fv_index,3);
// bit of an unspoken relationship between mesh face buffer
// and the face data which I guess should be changed.
face_data->Duplicate(face.user_face_data);
face_it.Step(face_it.it);
}
// give the user face vertex data over to the mesh.
mesh->SetFaceVertexData(fv_data);
mesh->SetFaceData(face_data);
// that's it
delete[] static_cast<char *>(face.user_face_data);
delete[] static_cast<char *>(face.user_face_vertex_data[0]);
return mesh;
}

@ -0,0 +1,74 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef BSP_CSGMeshBuilder_h
#define BSP_CSGMeshBuilder_h
#include "../extern/CSG_BooleanOps.h"
#include "BSP_CSGMesh.h"
#include "MEM_NonCopyable.h"
#include "MEM_SmartPtr.h"
/**
* This class helps you to build a mesh from 2 seperate vertex/face
* iterators defined in the external interface of the bsp module.
* This code should really become party of a generic C++ mesh interface
* but later...
*/
class BSP_CSGMeshBuilder : public MEM_NonCopyable{
public :
/**
* Return a new BSP_CSGMesh with the desired props
* built from the given face and vertex iterators.
* The iterators are exhausted by this action.
*/
static
MEM_SmartPtr<BSP_CSGMesh>
NewMesh(
CSG_MeshPropertyDescriptor &props,
CSG_FaceIteratorDescriptor &face_it,
CSG_VertexIteratorDescriptor &vertex_it
);
private :
BSP_CSGMeshBuilder(
);
};
#endif

@ -0,0 +1,715 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "BSP_CSGMeshSplitter.h"
#include "BSP_CSGMesh.h"
#include "BSP_MeshFragment.h"
#include "BSP_CSGException.h"
#include "MT_MinMax.h"
#include "MT_assert.h"
using namespace std;
BSP_CSGMeshSplitter::
BSP_CSGMeshSplitter(
CSG_InterpolateUserFaceVertexDataFunc fv_split_func
) : m_fv_func(fv_split_func)
{
// nothing to do
};
void
BSP_CSGMeshSplitter::
Split(
const MT_Plane3& plane,
BSP_MeshFragment *frag,
BSP_MeshFragment *in_frag,
BSP_MeshFragment *out_frag,
BSP_MeshFragment *on_frag,
BSP_MeshFragment *spanning_frag
){
// First classify the vertices and the polygons of the
// incoming fragment.
frag->Classify(plane,in_frag,out_frag,on_frag,m_spanning_faces,m_tagged_verts);
SplitImp(*(frag->Mesh()),plane,m_spanning_faces,in_frag,out_frag,on_frag,m_tagged_verts);
m_spanning_faces.clear();
m_tagged_verts.clear();
}
void
BSP_CSGMeshSplitter::
Split(
BSP_CSGMesh & mesh,
const MT_Plane3& plane,
BSP_MeshFragment *in_frag,
BSP_MeshFragment *out_frag,
BSP_MeshFragment *on_frag,
BSP_MeshFragment *spanning_frag
){
BSP_MeshFragment::Classify(mesh, plane,in_frag,out_frag,on_frag,m_spanning_faces,m_tagged_verts);
SplitImp(mesh,plane,m_spanning_faces,in_frag,out_frag,on_frag,m_tagged_verts);
m_spanning_faces.clear();
m_tagged_verts.clear();
}
BSP_CSGMeshSplitter::
~BSP_CSGMeshSplitter(
){
// nothing to do
}
void
BSP_CSGMeshSplitter::
SplitImp(
BSP_CSGMesh & mesh,
const MT_Plane3& plane,
const std::vector<BSP_FaceInd> & spanning_faces,
BSP_MeshFragment *in_frag,
BSP_MeshFragment *out_frag,
BSP_MeshFragment *on_frag,
std::vector<BSP_VertexInd> & classified_verts
){
// Assumes you have already classified the vertices.
// and generated a set of spanning faces.
vector<BSP_MEdge> & edge_set = mesh.EdgeSet();
vector<BSP_MVertex> & vertex_set = mesh.VertexSet();
vector<BSP_MFace> & face_set = mesh.FaceSet();
// Now identify the spanning edges.
// These can be computed in many ways but probably the most
// efficient is to select all edges from the vertices of the
// spanning polygons that cross the plane.
vector<BSP_FaceInd>::const_iterator sface_end = m_spanning_faces.end();
vector<BSP_FaceInd>::const_iterator sface_it = m_spanning_faces.begin();
for (;sface_it != sface_end; ++sface_it) {
BSP_MFace & sface = face_set[*sface_it];
vector<BSP_VertexInd>::const_iterator sf_vert_end = sface.m_verts.end();
vector<BSP_VertexInd>::iterator sf_vert_it = sface.m_verts.begin();
for (;sf_vert_it != sf_vert_end; ++sf_vert_it) {
BSP_MVertex & vert = vertex_set[*sf_vert_it];
if (!vert.SelectTag()) {
// what classification does this vertex have?
BSP_Classification root_vert_class = BSP_Classification(vert.OpenTag());
// we are only interested in edges whose vertices are in and out.
if (root_vert_class != e_classified_on) {
BSP_Classification opp_class = e_classified_out;
if (root_vert_class == e_classified_out) {
opp_class = e_classified_in;
}
// we haven't visited this vertex before so lets
// analyse it's edges.
vector<BSP_EdgeInd>::const_iterator v_edge_end = vert.m_edges.end();
vector<BSP_EdgeInd>::iterator v_edge_it = vert.m_edges.begin();
for (; v_edge_it != v_edge_end; ++v_edge_it) {
BSP_MEdge & edge = edge_set[*v_edge_it];
if (!edge.SelectTag()) {
// we haven't visited this edge before so check it's
// end points
// we know that a spanning polygon can have at most
// 2 on vertices (even at this point where we haven't
// yet split the edge!) We are interested in edges whose
// vertices are in and out the plane.
BSP_VertexInd opp_vi = edge.OpVertex(*sf_vert_it);
if (vertex_set[opp_vi].OpenTag() == opp_class) {
// we have found an edge !!!!
m_spanning_edges.push_back(*v_edge_it);
}
edge.SetSelectTag(true);
m_visited_edges.push_back(*v_edge_it);
}
}
}
vert.SetSelectTag(true);
m_visited_verts.push_back(*sf_vert_it);
}
}
}
// clear the tags we used in the above
unsigned int i;
for (i = 0; i < m_visited_edges.size(); ++i) {
edge_set[m_visited_edges[i]].SetSelectTag(false);
}
for (i=0;i < m_visited_verts.size(); ++i) {
vertex_set[m_visited_verts[i]].SetSelectTag(false);
}
for (i=0; i < m_spanning_faces.size(); ++i) {
face_set[m_spanning_faces[i]].SetSelectTag(false);
}
// The spanning edge set constains unique edges. Next we run
// through the edge set and compute the intersection with the
// plane --- the edge is guarenteed not to be parallel to the plane!
// we then split the edge with the new vertex.
// We identify the polygons affected by the split
vector<BSP_EdgeInd>::const_iterator s_edge_end = m_spanning_edges.end();
vector<BSP_EdgeInd>::iterator s_edge_it = m_spanning_edges.begin();
for (;s_edge_it != s_edge_end; ++s_edge_it) {
const BSP_MEdge & edge = edge_set[*s_edge_it];
const BSP_MVertex &v1 = vertex_set[edge.m_verts[0]];
const BSP_MVertex &v2 = vertex_set[edge.m_verts[1]];
const MT_Vector3 & ptA = v1.m_pos;
const MT_Vector3 & ptB = v2.m_pos;
// compute the intersection point of plane and ptA->ptB
MT_Vector3 v = ptB - ptA;
MT_Scalar sideA = plane.signedDistance(ptA);
MT_Scalar epsilon = -sideA/plane.Normal().dot(v);
MT_Vector3 new_p = ptA + (v * epsilon);
// so new_p is the intersection of the plane and the edge.
// split the edge at new_p
BSP_MVertex new_vert;
new_vert.m_pos = new_p;
BSP_VertexInd new_vi = SplitEdge(mesh,*s_edge_it,new_vert,epsilon);
// tag the new vertex as 'on' the plane - we use this information
// to split the affected polygons below.
vertex_set[new_vi].SetOpenTag(e_classified_on);
// We add it to the tagged verts so we can remove the tag later.
classified_verts.push_back(new_vi);
}
// We start with the spanning polygons...
// not forgetting to add the new polygon fragments to the correct fragment bins.
sface_end = m_spanning_faces.end();
sface_it = m_spanning_faces.begin();
for (;sface_it != sface_end; ++sface_it) {
BSP_FaceInd f_in,f_out;
SplitPolygon(mesh,*sface_it,f_in,f_out);
in_frag->FaceSet().push_back(f_in);
out_frag->FaceSet().push_back(f_out);
}
// Finally we have to clean up the vertex tags we set on all the vertices
// There will be some overlap between the vertex sets, so this operation
// is a tiny bit inefficient.
vector<BSP_VertexInd>::const_iterator v_end = classified_verts.end();
vector<BSP_VertexInd>::const_iterator v_it = classified_verts.begin();
for (; v_it != v_end; ++v_it) {
vertex_set[*v_it].SetOpenTag(e_unclassified);
}
// tidy up the cached arrays.
m_spanning_edges.clear();
m_visited_edges.clear();
m_visited_verts.clear();
// le fin.
}
BSP_VertexInd
BSP_CSGMeshSplitter::
SplitEdge(
BSP_CSGMesh & mesh,
BSP_EdgeInd ei,
BSP_MVertex &vertex,
MT_Scalar epsilon
){
vector<BSP_MEdge> & edge_set = mesh.EdgeSet();
vector<BSP_MVertex> & vertex_set = mesh.VertexSet();
vector<BSP_MFace> & face_set = mesh.FaceSet();
MT_assert(edge_set.size() > (unsigned int)(ei));
if (edge_set.size() <= (unsigned int)(ei)) {
BSP_CSGException e(e_param_error);
throw(e);
}
// push the vertex onto the vertex array
BSP_VertexInd new_vi = vertex_set.size();
vertex_set.push_back(vertex);
BSP_MVertex & new_v = vertex_set[new_vi];
// copy the edge because the new edge will have
// exactly the same face set.
BSP_EdgeInd new_ei = edge_set.size();
// Note never use set.push_back(set[i])
// coz push_back excepts a reference which may become
// invalid if the set is resized
edge_set.push_back(BSP_MEdge());
edge_set[new_ei] = edge_set[ei];
BSP_MEdge & new_e = edge_set[new_ei];
BSP_MEdge &e = edge_set[ei];
// get the edge vertices.
BSP_MVertex & e_v2 = vertex_set[e.m_verts[1]];
// Remove the split edge from vertex 2.
// Let's hope that the vertex isn't using this edge for
// its' open tag!!
BSP_Classification v2_class = BSP_Classification(e_v2.OpenTag());
e_v2.RemoveEdge(ei);
// add the split edge to the new vertex.
new_v.AddEdge(ei);
// add the new edge to the new vertex.
new_v.AddEdge(new_ei);
// add the new edge to vertex 2
e_v2.AddEdge(new_ei);
// Reset the tags for modified vertex.
e_v2.SetOpenTag(v2_class);
// Replace the old vertex indices in the new edge.
new_e.m_verts[0] = new_vi;
e.m_verts[1] = new_vi;
// Finally add the vertex in the correct position to the
// neighbouring polygons.
vector<BSP_FaceInd>::iterator neighbour_face_it = e.m_faces.begin();
vector<BSP_FaceInd>::const_iterator neighbour_face_end = e.m_faces.end();
for (; neighbour_face_it != neighbour_face_end; ++neighbour_face_it) {
mesh.InsertVertexIntoFace(
face_set[*neighbour_face_it],
new_e.m_verts[1],
e.m_verts[0],
new_vi,
m_fv_func,
epsilon
);
}
// That should be it (cough)
return new_vi;
}
void
BSP_CSGMeshSplitter::
SplitPolygon(
BSP_CSGMesh & mesh,
BSP_FaceInd fi,
BSP_FaceInd &fin,
BSP_FaceInd &fout
){
vector<BSP_MEdge> & edge_set = mesh.EdgeSet();
vector<BSP_MVertex> & vertex_set = mesh.VertexSet();
vector<BSP_MFace> & face_set = mesh.FaceSet();
MT_assert(face_set.size() > (unsigned int)(fi));
if (face_set.size() <= (unsigned int)(fi)) {
BSP_CSGException e(e_param_error);
throw(e);
}
BSP_MFace & face = face_set[fi];
// Walk throught the vertices of this polygon.
// generate inside and outside loops.
vector<BSP_VertexInd>::const_iterator f_verts_end = face.m_verts.end();
vector<BSP_VertexInd>::iterator f_verts_it = face.m_verts.begin();
vector<BSP_UserFVInd>::const_iterator f_fv_data_it = face.m_fv_data.begin();
// NOTE we don't actually duplicate fv data for this face
// we just duplicate the indices, so both on vertices
// will share the fv data.
for (;f_verts_it != f_verts_end; ++f_verts_it, ++f_fv_data_it) {
BSP_MVertex & vert = vertex_set[*f_verts_it];
BSP_Classification v_class = BSP_Classification(vert.OpenTag());
if (v_class == e_classified_in) {
m_in_loop.push_back(*f_verts_it);
m_fv_in_loop.push_back(*f_fv_data_it);
} else
if (v_class == e_classified_out) {
m_out_loop.push_back(*f_verts_it);
m_fv_out_loop.push_back(*f_fv_data_it);
} else
if (v_class == e_classified_on) {
m_in_loop.push_back(*f_verts_it);
m_out_loop.push_back(*f_verts_it);
m_on_loop.push_back(*f_verts_it);
m_fv_in_loop.push_back(*f_fv_data_it);
m_fv_out_loop.push_back(*f_fv_data_it);
} else {
// The vertex is unclassified this is an error!
MT_assert(false);
BSP_CSGException e(e_split_error);
throw(e);
}
}
if ((m_in_loop.size() == 1) || (m_out_loop.size() == 1)) {
// Then there was only 1 tagged vertex I guess this is fine
// but should be reviewed!
// NOT fine - we only ever split spanning polygons.
MT_assert(false);
BSP_CSGException e(e_split_error);
throw(e);
}
MT_assert(m_in_loop.size() >=3 && m_out_loop.size() >=3 && m_on_loop.size() == 2);
if (m_in_loop.size() <3 || m_out_loop.size() <3 || m_on_loop.size() !=2) {
BSP_CSGException e(e_split_error);
throw(e);
}
// Now we have 2 seperate vertex loops representing the polygon
// halves.
// create a new polygon for the out_loop of vertices.
////////////////////////////////////////////////////
// Duplicate face data.
mesh.FaceData().Duplicate(fi);
BSP_FaceInd new_fi = face_set.size();
face_set.push_back(BSP_MFace());
BSP_MFace & new_f = face_set[new_fi];
// assign plane equation for new face - this is the same as the
// original of course.
new_f.m_plane = face_set[fi].m_plane;
// note that face may have become invalid because we just been adding
// more polygons to the array. We can't assign a new reference to the old
// invlaid one! It will call try and call the assignment operator on
// the original face!!!! The joys of references! We just use face_set[fi]
// from now on to be safe
// We need to insert an edge between m_on_loop[0] and m_on_loop[1]
// Make sure the edge does not already exist between these 2 vertices!
// This can happen if the original mesh has duplicate polygons.
// We still wire up the new polygons to this edge, which will
// lead to duplicate polygons in the output -- but algorithm
// should still work.
BSP_EdgeInd new_ei = mesh.FindEdge(m_on_loop[0],m_on_loop[1]);
if (new_ei.IsEmpty()) {
// create a new edge.
new_ei = edge_set.size();
edge_set.push_back(BSP_MEdge());
BSP_MEdge & new_e = edge_set[new_ei];
new_e.m_verts[0] = m_on_loop[0];
new_e.m_verts[1] = m_on_loop[1];
// Now tie the edge to it's vertices.
vertex_set[m_on_loop[0]].AddEdge(new_ei);
vertex_set[m_on_loop[1]].AddEdge(new_ei);
}
edge_set[new_ei].m_faces.push_back(fi);
// This next line is a trick we are going to replace it in a moment
// with new_fi. It means that all the edges of the new polygon have
// pointers to the old polygon which we can replace.
edge_set[new_ei].m_faces.push_back(fi);
// Replace the old polygons vertex loop with the in_loop of vertices.
face_set[fi].m_verts = m_in_loop;
new_f.m_verts = m_out_loop;
// Replace the olf fv loops.
face_set[fi].m_fv_data = m_fv_in_loop;
new_f.m_fv_data = m_fv_out_loop;
// That should be it for the old polygon;
// For the new polygon we just need to iterate around it's
// edges and replace pointers to the old polygon with pointers
// to the new one.
f_verts_end = new_f.m_verts.end();
f_verts_it = new_f.m_verts.begin();
BSP_VertexInd prev = new_f.m_verts.back();
for (;f_verts_it != f_verts_end; ++f_verts_it) {
BSP_EdgeInd new_f_ei = mesh.FindEdge(prev,*f_verts_it);
MT_assert(!new_f_ei.IsEmpty());
if (new_f_ei.IsEmpty()) {
BSP_CSGException e(e_split_error);
throw(e);
}
edge_set[new_f_ei].SwapFace(fi,new_fi);
prev = *f_verts_it;
}
// That should be everything.
fin = fi;
fout = new_fi;
// clear up cached helpers.
m_in_loop.clear();
m_on_loop.clear();
m_out_loop.clear();
m_fv_in_loop.clear();
m_fv_out_loop.clear();
}
BSP_FaceInd
BSP_CSGMeshSplitter::
TriangulateConvexQuad(
BSP_CSGMesh & mesh,
const BSP_FaceInd fi
){
// we assume that the fi points to a face with
// exactly 4 vertices.
// We are definately going to create a new face
// so lets make space for it in the face array.
vector<BSP_MFace> & face_set = mesh.FaceSet();
vector<BSP_MVertex> & vertex_set = mesh.VertexSet();
vector<BSP_MEdge> & edge_set = mesh.EdgeSet();
if (face_set[fi].m_verts.size() == 3) {
return BSP_FaceInd::Empty();
}
// duplicate face data
mesh.FaceData().Duplicate(fi);
const BSP_FaceInd new_fi = face_set.size();
face_set.push_back(BSP_MFace());
BSP_MFace & new_face = face_set[new_fi];
BSP_MFace & face = face_set[fi];
new_face.m_plane = face.m_plane;
// The internal edges are [0,2] and [1,3]
// these split the quad into the triangles
// [0,1,2],[2,3,0] and [0,1,3],[1,2,3] respectively
const MT_Point3 & p0 = vertex_set[face.m_verts[0]].m_pos;
const MT_Point3 & p1 = vertex_set[face.m_verts[1]].m_pos;
const MT_Point3 & p2 = vertex_set[face.m_verts[2]].m_pos;
const MT_Point3 & p3 = vertex_set[face.m_verts[3]].m_pos;
MT_Vector3 e0 = p1 - p0;
MT_Vector3 e1 = p2 - p1;
MT_Vector3 e2 = p3 - p2;
MT_Vector3 e3 = p0 - p3;
MT_Scalar A = (e0.cross(e1)).length2();
MT_Scalar B = (e2.cross(e3)).length2();
MT_Scalar C = (e3.cross(e0)).length2();
MT_Scalar D = (e1.cross(e2)).length2();
MT_Scalar minab = MT_min(A,B);
MT_Scalar maxab = MT_max(A,B);
MT_Scalar mincd = MT_min(C,D);
MT_Scalar maxcd = MT_max(C,D);
MT_Scalar ratioab = minab/maxab;
MT_Scalar ratiocd = mincd/maxcd;
ratioab = MT_abs(1-ratioab);
ratiocd = MT_abs(1-ratiocd);
vector<BSP_VertexInd> loop1(3),loop2(3);
vector<BSP_UserFVInd> fv_loop1(3),fv_loop2(3);
if (ratioab < ratiocd) {
// then use [0,2] as splitting edge.
loop1[0] = face.m_verts[1];
loop1[1] = face.m_verts[2];
loop1[2] = face.m_verts[0];
loop2[0] = face.m_verts[2];
loop2[1] = face.m_verts[3];
loop2[2] = face.m_verts[0];
// same for fv indices.
fv_loop1[0] = face.m_fv_data[1];
fv_loop1[1] = face.m_fv_data[2];
fv_loop1[2] = face.m_fv_data[0];
fv_loop2[0] = face.m_fv_data[2];
fv_loop2[1] = face.m_fv_data[3];
fv_loop2[2] = face.m_fv_data[0];
} else {
// use [1,3] as splitting edge
loop1[0] = face.m_verts[0];
loop1[1] = face.m_verts[1];
loop1[2] = face.m_verts[3];
loop2[0] = face.m_verts[1];
loop2[1] = face.m_verts[2];
loop2[2] = face.m_verts[3];
// same for fv indices.
fv_loop1[0] = face.m_fv_data[0];
fv_loop1[1] = face.m_fv_data[1];
fv_loop1[2] = face.m_fv_data[3];
fv_loop2[0] = face.m_fv_data[1];
fv_loop2[1] = face.m_fv_data[2];
fv_loop2[2] = face.m_fv_data[3];
}
// TODO factor out commmon code between here and SplitPolygon.
BSP_EdgeInd new_ei = mesh.FindEdge(loop1[1],loop1[2]);
if (new_ei.IsEmpty()) {
// create a new edge.
new_ei = edge_set.size();
edge_set.push_back(BSP_MEdge());
BSP_MEdge & new_e = edge_set[new_ei];
new_e.m_verts[0] = loop1[1];
new_e.m_verts[1] = loop1[2];
// Now tie the edge to it's vertices.
vertex_set[loop1[1]].AddEdge(new_ei);
vertex_set[loop1[2]].AddEdge(new_ei);
}
edge_set[new_ei].m_faces.push_back(fi);
// This next line is a trick we are going to replace it in a moment
// with new_fi. It means that all the edges of the new polygon have
// pointers to the old polygon which we can replace.
edge_set[new_ei].m_faces.push_back(fi);
// Replace the old polygons vertex loop with the in_loop of vertices.
face.m_verts = loop1;
face.m_fv_data = fv_loop1;
new_face.m_verts = loop2;
new_face.m_fv_data = fv_loop2;
// That should be it for the old polygon;
// For the new polygon we just need to iterate around it's
// edges and replace pointers to the old polygon with pointers
// to the new one.
vector<BSP_VertexInd>::const_iterator f_verts_end = new_face.m_verts.end();
vector<BSP_VertexInd>::const_iterator f_verts_it = new_face.m_verts.begin();
BSP_VertexInd prev = new_face.m_verts.back();
for (;f_verts_it != f_verts_end; ++f_verts_it) {
BSP_EdgeInd new_f_ei = mesh.FindEdge(prev,*f_verts_it);
MT_assert(!new_f_ei.IsEmpty());
if (new_f_ei.IsEmpty()) {
BSP_CSGException e(e_split_error);
throw(e);
}
edge_set[new_f_ei].SwapFace(fi,new_fi);
prev = *f_verts_it;
}
return new_fi;
}

@ -0,0 +1,208 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef BSP_CSGMeshSplitter_h
#define BSP_CSGMeshSplitter_h
class BSP_MeshFragment;
class MT_Plane3;
class BSP_CSGMesh;
#include "BSP_MeshPrimitives.h"
#include "../extern/CSG_BooleanOps.h"
#include "BSP_CSGISplitter.h"
/**
* This class contains splitting functions for a CSGMesh.
* The atomic operation of a bsp CSG algorithm is to split
* a mesh fragment (connected collection of polygons contained
* in a convex cell) by a plane. It is vital to leave the
* CSGMesh in a valid state after each such operation
* this class insures this (or tries it's best!).
*/
class BSP_CSGMeshSplitter : public BSP_CSGISplitter
{
public :
/// construction
BSP_CSGMeshSplitter(
CSG_InterpolateUserFaceVertexDataFunc fv_split_func
);
BSP_CSGMeshSplitter(
const BSP_CSGMeshSplitter & other
);
/**
* @section BSP specific mesh operations.
* Inherited from BSP_CSGISplitter
*/
/**
* Split a mesh fragment wrt plane. Generates 3 mesh fragments,
* in, out and on. Makes sure the mesh is coherent after the
* operation. The contents of frag are consumed by this oepration.
*/
void
Split(
const MT_Plane3& plane,
BSP_MeshFragment *frag,
BSP_MeshFragment *in_frag,
BSP_MeshFragment *out_frag,
BSP_MeshFragment *on_frag,
BSP_MeshFragment *spanning_frag
);
/// Split the entire mesh with respect to the plane.
void
Split(
BSP_CSGMesh & mesh,
const MT_Plane3& plane,
BSP_MeshFragment *in_frag,
BSP_MeshFragment *out_frag,
BSP_MeshFragment *on_frag,
BSP_MeshFragment *spanning_frag
);
~BSP_CSGMeshSplitter(
);
private :
void
SplitImp(
BSP_CSGMesh & mesh,
const MT_Plane3& plane,
const std::vector<BSP_FaceInd> & spanning_faces,
BSP_MeshFragment *in_frag,
BSP_MeshFragment *out_frag,
BSP_MeshFragment *on_frag,
std::vector<BSP_VertexInd> & classified_verts
);
/**
* @section Atomic mesh operations.
*/
/**
* Add a vertex to the mesh, along
* a given edge. Leaves the mesh in a valid state.
* The vertex gets copied onto the back of the
* current vertex array. It's upto you to insure
* that the vertex actually lies on the edge and leaves
* the neighbouring faces convex. Returns the vertex index
* of the new vertex.
*
* epsilon is the relative distance [0,1] of the new
* vertex from the first vertex of the edge. This is
* used to intepolate face properties.
*/
BSP_VertexInd
SplitEdge(
BSP_CSGMesh & mesh,
BSP_EdgeInd ei,
BSP_MVertex &vertex,
MT_Scalar epsilon
);
/**
* Split a polygon along an edge connecting the
* two tagged (on) vertices of the polygon. It assumes
* that you have already introduced two new vertex indices
* into the polygon that point to vertices tagged with
* {in,out,on} information. It creates a new edge from the
* 2 on vertices that must be present. It then splits up
* the polygon into 2 fragments on the inside and outside.
* It returns 2 indices into the face list. 1 for the inside
* polygon and 1 for the outside polygon.
*/
void
SplitPolygon(
BSP_CSGMesh & mesh,
BSP_FaceInd fi,
BSP_FaceInd &fin,
BSP_FaceInd &fout
);
/**
* Triangulate a convex quad (the maximum size polygon
* resulting from splitting a triangle). This can create up
* to one new face - which is added to the mesh. Note
* that this method does not preserve references. It uses
* the edge which divides the quad into roughly equal triangular
* areas as the splitting edge. - This should avoid creating
* degenerate triangles.
*/
BSP_FaceInd
TriangulateConvexQuad(
BSP_CSGMesh & mesh,
const BSP_FaceInd fi
);
private :
// The function pointer used to split face vertex properties.
CSG_InterpolateUserFaceVertexDataFunc m_fv_func;
/// Cached helpers
/// Split function responsibe for:
std::vector<BSP_FaceInd> m_spanning_faces;
std::vector<BSP_VertexInd> m_tagged_verts;
/// SplitImp responsible for:
std::vector<BSP_EdgeInd> m_spanning_edges;
// The list of faces affected by splitting the spanning edge set.
std::vector<BSP_EdgeInd> m_visited_edges;
std::vector<BSP_VertexInd> m_visited_verts;
/// SplitPolygon responsible for:
std::vector<BSP_FaceInd> m_in_loop,m_out_loop,m_on_loop;
std::vector<BSP_UserFVInd> m_fv_in_loop,m_fv_out_loop;
};
#endif

@ -0,0 +1,272 @@
/**
* $Id$
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef BSP_CSGMesh_CFIterator_h
#define BSP_CSGMesh_CFIterator_h
#include "BSP_CSGMesh.h"
#include "../extern/CSG_BooleanOps.h"
/**
* This class defines 2 C style iterators over a CSG mesh, one for
* vertices and 1 for faces. They conform to the iterator interface
* defined in CSG_BooleanOps.h
*/
struct BSP_CSGMesh_VertexIt {
MEM_RefCountPtr<BSP_CSGMesh> mesh;
BSP_MVertex * pos;
};
static
void
BSP_CSGMesh_VertexIt_Destruct(
CSG_VertexIteratorDescriptor * iterator
) {
delete ((BSP_CSGMesh_VertexIt *)(iterator->it));
iterator->it = NULL;
iterator->Done = NULL;
iterator->Fill = NULL;
iterator->Reset = NULL;
iterator->Step = NULL;
iterator->num_elements = 0;
};
static
int
BSP_CSGMesh_VertexIt_Done(
CSG_IteratorPtr it
) {
// assume CSG_IteratorPtr is of the correct type.
BSP_CSGMesh_VertexIt * vertex_it = (BSP_CSGMesh_VertexIt *)it;
if (vertex_it->pos < vertex_it->mesh->VertexSet().end()) return 0;
return 1;
};
static
void
BSP_CSGMesh_VertexIt_Fill(
CSG_IteratorPtr it,
CSG_IVertex *vert
) {
// assume CSG_IteratorPtr is of the correct type.
BSP_CSGMesh_VertexIt * vertex_it = (BSP_CSGMesh_VertexIt *)it;
vertex_it->pos->m_pos.getValue(vert->position);
};
static
void
BSP_CSGMesh_VertexIt_Step(
CSG_IteratorPtr it
) {
// assume CSG_IteratorPtr is of the correct type.
BSP_CSGMesh_VertexIt * vertex_it = (BSP_CSGMesh_VertexIt *)it;
++(vertex_it->pos);
};
static
void
BSP_CSGMesh_VertexIt_Reset(
CSG_IteratorPtr it
) {
// assume CSG_IteratorPtr is of the correct type.
BSP_CSGMesh_VertexIt * vertex_it = (BSP_CSGMesh_VertexIt *)it;
vertex_it->pos = vertex_it->mesh->VertexSet().begin();
};
static
void
BSP_CSGMeshVertexIt_Construct(
BSP_CSGMesh *mesh,
CSG_VertexIteratorDescriptor *output
){
// user should have insured mesh is not equal to NULL.
output->Done = BSP_CSGMesh_VertexIt_Done;
output->Fill = BSP_CSGMesh_VertexIt_Fill;
output->Step = BSP_CSGMesh_VertexIt_Step;
output->Reset = BSP_CSGMesh_VertexIt_Reset;
output->num_elements = mesh->VertexSet().size();
BSP_CSGMesh_VertexIt * v_it = new BSP_CSGMesh_VertexIt;
v_it->mesh = mesh;
v_it->pos = mesh->VertexSet().begin();
output->it = v_it;
};
/**
* Face iterator.
*/
struct BSP_CSGMesh_FaceIt {
MEM_RefCountPtr<BSP_CSGMesh> mesh;
BSP_MFace *pos;
int face_triangle;
};
static
void
BSP_CSGMesh_FaceIt_Destruct(
CSG_FaceIteratorDescriptor *iterator
) {
delete ((BSP_CSGMesh_FaceIt *)(iterator->it));
iterator->it = NULL;
iterator->Done = NULL;
iterator->Fill = NULL;
iterator->Reset = NULL;
iterator->Step = NULL;
iterator->num_elements = 0;
};
static
int
BSP_CSGMesh_FaceIt_Done(
CSG_IteratorPtr it
) {
// assume CSG_IteratorPtr is of the correct type.
BSP_CSGMesh_FaceIt * face_it = (BSP_CSGMesh_FaceIt *)it;
if (face_it->pos < face_it->mesh->FaceSet().end()) {
if (face_it->face_triangle + 3 <= face_it->pos->m_verts.size()) {
return 0;
}
}
return 1;
};
static
void
BSP_CSGMesh_FaceIt_Fill(
CSG_IteratorPtr it,
CSG_IFace *face
){
// assume CSG_IteratorPtr is of the correct type.
BSP_CSGMesh_FaceIt * face_it = (BSP_CSGMesh_FaceIt *)it;
// essentially iterating through a triangle fan here.
const int tri_index = face_it->face_triangle;
face->vertex_index[0] = int(face_it->pos->m_verts[0]);
face->vertex_index[1] = int(face_it->pos->m_verts[tri_index + 1]);
face->vertex_index[2] = int(face_it->pos->m_verts[tri_index + 2]);
// Copy the user face data across - this does nothing
// if there was no mesh user data.
// time to change the iterator type to an integer...
face_it->mesh->FaceData().Copy(
face->user_face_data,
int(face_it->pos - face_it->mesh->FaceSet().begin())
);
// Copy face vertex data across...
face_it->mesh->FaceVertexData().Copy(
face->user_face_vertex_data[0],
face_it->pos->m_fv_data[0]
);
face_it->mesh->FaceVertexData().Copy(
face->user_face_vertex_data[1],
face_it->pos->m_fv_data[tri_index + 1]
);
face_it->mesh->FaceVertexData().Copy(
face->user_face_vertex_data[2],
face_it->pos->m_fv_data[tri_index + 2]
);
face->vertex_number = 3;
};
static
void
BSP_CSGMesh_FaceIt_Step(
CSG_IteratorPtr it
) {
// assume CSG_IteratorPtr is of the correct type.
BSP_CSGMesh_FaceIt * face_it = (BSP_CSGMesh_FaceIt *)it;
// safety guard
if (face_it->pos < face_it->mesh->FaceSet().end()) {
if (face_it->face_triangle + 3 < face_it->pos->m_verts.size()) {
(face_it->face_triangle)++;
} else {
face_it->face_triangle = 0;
(face_it->pos) ++;
}
}
};
static
void
BSP_CSGMesh_FaceIt_Reset(
CSG_IteratorPtr it
) {
// assume CSG_IteratorPtr is of the correct type.
BSP_CSGMesh_FaceIt * f_it = (BSP_CSGMesh_FaceIt *)it;
f_it->pos = f_it->mesh->FaceSet().begin();
f_it->face_triangle = 0;
};
static
void
BSP_CSGMesh_FaceIt_Construct(
BSP_CSGMesh * mesh,
CSG_FaceIteratorDescriptor *output
) {
output->Done = BSP_CSGMesh_FaceIt_Done;
output->Fill = BSP_CSGMesh_FaceIt_Fill;
output->Step = BSP_CSGMesh_FaceIt_Step;
output->Reset = BSP_CSGMesh_FaceIt_Reset;
output->num_elements = mesh->CountTriangles();
BSP_CSGMesh_FaceIt * f_it = new BSP_CSGMesh_FaceIt;
f_it->mesh = mesh;
f_it->pos = mesh->FaceSet().begin();
f_it->face_triangle = 0;
output->it = f_it;
};
#endif

Some files were not shown because too many files have changed in this diff Show More