jdk/src/share/native/sun/font/layout/SunLayoutEngine.cpp
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
/* Header for class sun_font_SunLayoutEngine */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
#include <jni_util.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#include <stdlib.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
#include "FontInstanceAdapter.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
#include "LayoutEngine.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
#include "sun_font_SunLayoutEngine.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
#include "sunfontids.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
void getFloat(JNIEnv* env, jobject pt, jfloat &x, jfloat &y) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
    x = env->GetFloatField(pt, sunFontIDs.xFID);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
    y = env->GetFloatField(pt, sunFontIDs.yFID);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
void putFloat(JNIEnv* env, jobject pt, jfloat x, jfloat y) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
    env->SetFloatField(pt, sunFontIDs.xFID, x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
    env->SetFloatField(pt, sunFontIDs.yFID, y);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
static jclass gvdClass = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
static const char* gvdClassName = "sun/font/GlyphLayout$GVData";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
static jfieldID gvdCountFID = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
static jfieldID gvdFlagsFID = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
static jfieldID gvdGlyphsFID = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
static jfieldID gvdPositionsFID = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
static jfieldID gvdIndicesFID = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
#define TYPO_RTL 0x80000000
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
#define TYPO_MASK 0x7
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
JNIEXPORT void JNICALL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
Java_sun_font_SunLayoutEngine_initGVIDs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    (JNIEnv *env, jclass cls) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    gvdClass = env->FindClass(gvdClassName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    if (!gvdClass) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
        JNU_ThrowClassNotFoundException(env, gvdClassName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
        return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    gvdClass = (jclass)env->NewGlobalRef(gvdClass);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
      if (!gvdClass) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        JNU_ThrowInternalError(env, "could not create global ref");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    gvdCountFID = env->GetFieldID(gvdClass, "_count", "I");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    if (!gvdCountFID) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
      gvdClass = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
      JNU_ThrowNoSuchFieldException(env, "_count");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
      return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    gvdFlagsFID = env->GetFieldID(gvdClass, "_flags", "I");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    if (!gvdFlagsFID) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
      gvdClass = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
      JNU_ThrowNoSuchFieldException(env, "_flags");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
      return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    gvdGlyphsFID = env->GetFieldID(gvdClass, "_glyphs", "[I");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    if (!gvdGlyphsFID) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
      gvdClass = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
      JNU_ThrowNoSuchFieldException(env, "_glyphs");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
      return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    gvdPositionsFID = env->GetFieldID(gvdClass, "_positions", "[F");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    if (!gvdPositionsFID) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
      gvdClass = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
      JNU_ThrowNoSuchFieldException(env, "_positions");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
      return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    gvdIndicesFID = env->GetFieldID(gvdClass, "_indices", "[I");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    if (!gvdIndicesFID) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
      gvdClass = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
      JNU_ThrowNoSuchFieldException(env, "_indices");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
      return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
int putGV(JNIEnv* env, jint gmask, jint baseIndex, jobject gvdata, const LayoutEngine* engine, int glyphCount) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    int count = env->GetIntField(gvdata, gvdCountFID);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    jarray glyphArray = (jarray)env->GetObjectField(gvdata, gvdGlyphsFID);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    if (IS_NULL(glyphArray)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
      JNU_ThrowInternalError(env, "glypharray null");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
      return 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    jint capacity = env->GetArrayLength(glyphArray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    if (count + glyphCount > capacity) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
      JNU_ThrowArrayIndexOutOfBoundsException(env, "");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
      return 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    jarray posArray = (jarray)env->GetObjectField(gvdata, gvdPositionsFID);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    if (IS_NULL(glyphArray)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
      JNU_ThrowInternalError(env, "positions array null");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
      return 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    jarray inxArray = (jarray)env->GetObjectField(gvdata, gvdIndicesFID);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    if (IS_NULL(inxArray)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
      JNU_ThrowInternalError(env, "indices array null");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
      return 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    int countDelta = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    // le_uint32 is the same size as jint... forever, we hope
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    le_uint32* glyphs = (le_uint32*)env->GetPrimitiveArrayCritical(glyphArray, NULL);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    if (glyphs) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
      jfloat* positions = (jfloat*)env->GetPrimitiveArrayCritical(posArray, NULL);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
      if (positions) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        jint* indices = (jint*)env->GetPrimitiveArrayCritical(inxArray, NULL);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        if (indices) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
          LEErrorCode status = (LEErrorCode)0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
          engine->getGlyphs(glyphs + count, gmask, status);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
          engine->getGlyphPositions(positions + (count * 2), status);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
          engine->getCharIndices((le_int32*)(indices + count), baseIndex, status);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
          countDelta = glyphCount;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
          // !!! need engine->getFlags to signal positions, indices data
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
          /* "0" arg used instead of JNI_COMMIT as we want the carray
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
           * to be freed by any VM that actually passes us a copy.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
           */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
          env->ReleasePrimitiveArrayCritical(inxArray, indices, 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        env->ReleasePrimitiveArrayCritical(posArray, positions, 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
      env->ReleasePrimitiveArrayCritical(glyphArray, glyphs, 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    if (countDelta) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
      count += countDelta;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
      env->SetIntField(gvdata, gvdCountFID, count);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
  return 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
 * Class:     sun_font_SunLayoutEngine
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
 * Method:    nativeLayout
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
 * Signature: (Lsun/font/FontStrike;[CIIIIZLjava/awt/geom/Point2D$Float;Lsun/font/GlyphLayout$GVData;)V
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
JNIEXPORT void JNICALL Java_sun_font_SunLayoutEngine_nativeLayout
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
   (JNIEnv *env, jclass cls, jobject font2d, jobject strike, jfloatArray matrix, jint gmask,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
   jint baseIndex, jcharArray text, jint start, jint limit, jint min, jint max,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
   jint script, jint lang, jint typo_flags, jobject pt, jobject gvdata,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
   jlong upem, jlong layoutTables)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    //  fprintf(stderr, "nl font: %x strike: %x script: %d\n", font2d, strike, script); fflush(stderr);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
  float mat[4];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
  env->GetFloatArrayRegion(matrix, 0, 4, mat);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
  FontInstanceAdapter fia(env, font2d, strike, mat, 72, 72, (le_int32) upem, (TTLayoutTableCache *) layoutTables);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
  LEErrorCode success = LE_NO_ERROR;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
  LayoutEngine *engine = LayoutEngine::layoutEngineFactory(&fia, script, lang, typo_flags & TYPO_MASK, success);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
  if (min < 0) min = 0; if (max < min) max = min; /* defensive coding */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
  // have to copy, yuck, since code does upcalls now.  this will be soooo slow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
  jint len = max - min;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
  jchar buffer[256];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
  jchar* chars = buffer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
  if (len > 256) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    chars = (jchar*)malloc(len * sizeof(jchar));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
    if (chars == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
      return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
  //  fprintf(stderr, "nl chars: %x text: %x min %d len %d typo %x\n", chars, text, min, len, typo_flags); fflush(stderr);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
  env->GetCharArrayRegion(text, min, len, chars);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
  jfloat x, y;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
  getFloat(env, pt, x, y);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
  jboolean rtl = (typo_flags & TYPO_RTL) != 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
  int glyphCount = engine->layoutChars(chars, start - min, limit - start, len, rtl, x, y, success);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
  //   fprintf(stderr, "sle nl len %d -> gc: %d\n", len, glyphCount); fflush(stderr);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
  engine->getGlyphPosition(glyphCount, x, y, success);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
  //  fprintf(stderr, "layout glyphs: %d x: %g y: %g\n", glyphCount, x, y); fflush(stderr);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
  if (putGV(env, gmask, baseIndex, gvdata, engine, glyphCount)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    // !!! hmmm, could use current value in positions array of GVData...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    putFloat(env, pt, x, y);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
  if (chars != buffer) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    free(chars);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
  delete engine;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
}