void CResourceManager::LoadAllGraphics()
{

    short k, j;
    for (k = 0; k < MAX_PLAYERS; k++) {
        spr_player[k] = new gfxSprite * [PGFX_LAST];
        spr_shyguy[k] = new gfxSprite * [PGFX_LAST];
        spr_chocobo[k] = new gfxSprite * [PGFX_LAST];
        spr_bobomb[k] = new gfxSprite * [PGFX_LAST];

        for (j = 0; j < PGFX_LAST; j++) {
            spr_player[k][j] = new gfxSprite();
            spr_shyguy[k][j] = new gfxSprite();
            spr_chocobo[k][j] = new gfxSprite();
            spr_bobomb[k][j] = new gfxSprite();

            spr_player[k][j]->SetWrap(true);
            spr_shyguy[k][j]->SetWrap(true);
            spr_chocobo[k][j]->SetWrap(true);
            spr_bobomb[k][j]->SetWrap(true);
        }
    }

    LoadMenuGraphics();
    LoadWorldGraphics();
    LoadGameGraphics();

    gfx_loadimagenocolorkey(&spr_backmap[0], convertPath("gfx/packs/backgrounds/Land_Classic.png", gamegraphicspacklist->current_name()));
    gfx_loadimagenocolorkey(&spr_backmap[1], convertPath("gfx/packs/backgrounds/Land_Classic.png", gamegraphicspacklist->current_name()));
    gfx_loadimagenocolorkey(&spr_frontmap[0], convertPath("gfx/packs/backgrounds/Land_Classic.png", gamegraphicspacklist->current_name()));
    gfx_loadimagenocolorkey(&spr_frontmap[1], convertPath("gfx/packs/backgrounds/Land_Classic.png", gamegraphicspacklist->current_name()));

    gfx_loadimage(&spr_overlay, convertPath("gfx/packs/menu/menu_shade.png", gamegraphicspacklist->current_name()), false, false);
}
Example #2
0
static void convertPath(btstring_t *data, int32_t x, int32_t y)
{
	uint32_t		index;
	uint32_t		i;
	int32_t			saveX, saveY;
	uint32_t		numPaths;

	index	= xy2index(x, y);
	data->buf[index] = 0xff;

	while (countPaths(data, x, y) == 1) {
		move(data, &x, &y);
		data->buf[xy2index(x, y)] = 0xff;
	}

	if (!countPaths(data, x, y)) {
		return;
	}

	saveX	= x;
	saveY	= y;
	numPaths = countPaths(data, x, y);
	for (i = 0; i < numPaths; i++) {
		move(data, &x, &y);
		convertPath(data, x, y);
		x = saveX;
		y = saveY;
	}
}
Example #3
0
int
main (int argc, char* argv[])
{
  int  justPrint = 0;
  int  idx;
  int  returnCode;

  for (idx = 1; idx < argc; idx++)
  {
    convertPath (argv [idx]);

    if (justPrint)
    {
      printf ("remove %s\n", argv [idx]);
    }
    else
    {
      returnCode = rmdir (argv [idx]);
      if (returnCode != 0 && errno != ENOENT)
      {
      /* Continue even if there is errors */
#if 0
        printf ("Rmdir of %s failed.  Rmdir returned %d.\n",
                argv [idx],
                returnCode);
        return  returnCode;
#endif
      }
    }
  }

  return  0;
}
void CTilesetManager::Init(const char * szGfxPack)
{
	//Remove all existing tilesets
	std::vector<CTileset*>::iterator iter = tilesetlist.begin(), lim = tilesetlist.end();
    while (iter != lim) {
		delete (*iter);

		iter = tilesetlist.erase(iter);
		lim = tilesetlist.end();
	}

	//Add in tilesets from the new gfxpack (if the gfxpack isn't "Classic")
    if (strcmp(getFileFromPath(szGfxPack).c_str(), "Classic")) {
		std::string s = convertPath("gfx/packs/tilesets", szGfxPack) + getDirectorySeperator();
		SimpleDirectoryList dirlist(s);

		short iLength = dirlist.GetCount();
        for (short i = 0; i < iLength; i++) {
			CTileset * tileset = new CTileset(dirlist.current_name());
			tilesetlist.push_back(tileset);

			//If the tileset is "classic" then keep it's index for common operations
            if (!strcmp(tileset->GetName(), "Classic")) {
				tClassicTileset = tileset;
				iClassicTilesetIndex = i;
			}

			dirlist.next();
		}
	}

	//Add in tilesets from the classic tileset to fill the gaps
	short iLength = filelist.size();
	char szTilesetName[128];
    for (short i = 0; i < iLength; i++) {
		strncpy(szTilesetName, getFileFromPath(filelist[i]).c_str(), 128);
		szTilesetName[127] = 0;

		//See if the new tileset already exists and if it does, skip it
		short iTilesetSize = tilesetlist.size();
		bool fFound = false;
        for (short iTileset = 0; iTileset < iTilesetSize; iTileset++) {
            if (!strcmp(tilesetlist[iTileset]->GetName(), szTilesetName)) {
				fFound = true;
				break;
			}
		}

		//Add the tileset if another one by the same name isn't already in the tileset
        if (!fFound) {
			CTileset * tileset = new CTileset(filelist[i].c_str());
			tilesetlist.push_back(tileset);

            if (!strcmp(tileset->GetName(), "Classic")) {
				tClassicTileset = tileset;
				iClassicTilesetIndex = i;
			}
		}
	}
}
Example #5
0
    // Convert a soundId to file name, and modify the volume
    // according to the sounds local volume setting, minRange and
    // maxRange.
    std::string lookup(const std::string &soundId,
                       float &volume, float &min, float &max)
    {
      const ESM::Sound *snd = store.sounds.search(soundId);
      if(snd == NULL) return "";

      if(snd->data.volume == 0)
          volume = 0.0f;
      else
          volume *= pow(10.0, (snd->data.volume/255.0f*3348.0 - 3348.0) / 2000.0);

      if(snd->data.minRange == 0 && snd->data.maxRange == 0)
      {
        min = 100.0f;
        max = 2000.0f;
      }
      else
      {
        min = snd->data.minRange * 20.0f;
        max = snd->data.maxRange * 50.0f;
        min = std::max(min, 1.0f);
        max = std::max(min, max);
      }

      return convertPath(snd->sound);
    }
Example #6
0
void loadmap(char * szMapFile)
{
	g_map.loadMap(szMapFile, read_type_full);

	char filename[128];
	sprintf(filename, "gfx/packs/Classic/backgrounds/%s", g_map.szBackgroundFile);
	std::string path = convertPath(filename);
	backgroundlist.SetCurrentName(filename);
	
	if(!File_Exists(path))
	{
		path = convertPath("gfx/packs/Classic/backgrounds/Land_Classic.png");
		backgroundlist.SetCurrentName("gfx/packs/Classic/backgrounds/Land_Classic.png");
	}
	
	spr_background.init(path);

	g_iNumPlatforms = g_map.iNumPlatforms;

	for(short iPlatform = 0; iPlatform < g_iNumPlatforms; iPlatform++)
	{
		for(short iCol = 0; iCol < MAPWIDTH; iCol++)
		{
			for(short iRow = 0; iRow < MAPHEIGHT; iRow++)
			{
				if(iCol < g_map.platforms[iPlatform]->iTileWidth && iRow < g_map.platforms[iPlatform]->iTileHeight)
				{
					g_Platforms[iPlatform].tiles[iCol][iRow] = g_map.platforms[iPlatform]->iTileData[iCol][iRow];
				}
				else
				{
					g_Platforms[iPlatform].tiles[iCol][iRow] = TILESETSIZE;
				}
			}
		}

		g_Platforms[iPlatform].iVelocity = (int)(g_map.platforms[iPlatform]->pPath->fVelocity * 4.0f);
		g_Platforms[iPlatform].iStartX = (int)(g_map.platforms[iPlatform]->pPath->fStartX - g_map.platforms[iPlatform]->iHalfWidth + 1) / TILESIZE;
		g_Platforms[iPlatform].iStartY = (int)(g_map.platforms[iPlatform]->pPath->fStartY - g_map.platforms[iPlatform]->iHalfHeight + 1) / TILESIZE;
		g_Platforms[iPlatform].iEndX = (int)(g_map.platforms[iPlatform]->pPath->fEndX - g_map.platforms[iPlatform]->iHalfWidth + 1) / TILESIZE;
		g_Platforms[iPlatform].iEndY = (int)(g_map.platforms[iPlatform]->pPath->fEndY - g_map.platforms[iPlatform]->iHalfHeight + 1) / TILESIZE;
	}
}
bool CResourceManager::LoadGameGraphics()
{
    const char * graphicspack = gamegraphicspacklist->current_name();

    g_tilesetmanager->Init(graphicspack);

    bool loadok = true;
    loadok &= game_font_small.init(convertPath("gfx/packs/fonts/font_small.png", graphicspack));
    loadok &= game_font_large.init(convertPath("gfx/packs/fonts/font_large.png", graphicspack));

    if (!loadok) {
        _load_drawmsg("ERROR: error loading the fonts!\n");
        _load_waitforkey();
        return false;
    }

    LoadAllSprites();

    return true;
}
void QOutlineMapper::clipElements(const QPointF *elements,
                                    const QPainterPath::ElementType *types,
                                    int element_count)
{
    // We could save a bit of time by actually implementing them fully
    // instead of going through convenience functionallity, but since
    // this part of code hardly every used, it shouldn't matter.

    m_in_clip_elements = true;

    QPainterPath path;

    if (!(m_outline.flags & QT_FT_OUTLINE_EVEN_ODD_FILL))
        path.setFillRule(Qt::WindingFill);

    if (types) {
        for (int i=0; i<element_count; ++i) {
            switch (types[i]) {
            case QPainterPath::MoveToElement:
                path.moveTo(elements[i]);
                break;

            case QPainterPath::LineToElement:
                path.lineTo(elements[i]);
                break;

            case QPainterPath::CurveToElement:
                path.cubicTo(elements[i], elements[i+1], elements[i+2]);
                i += 2;
                break;
            default:
                break;
            }
        }
    } else {
        path.moveTo(elements[0]);
        for (int i=1; i<element_count; ++i)
            path.lineTo(elements[i]);
    }

    QPainterPath clipPath;
    clipPath.addRect(m_clip_rect);
    QPainterPath clippedPath = path.intersected(clipPath);
    uint old_txop = m_txop;
    m_txop = QTransform::TxNone;
    if (clippedPath.isEmpty())
        m_valid = false;
    else
        convertPath(clippedPath);
    m_txop = old_txop;

    m_in_clip_elements = false;
}
QPixmap LoadPDF(QString fn, int Page, int w)
{
	QString tmp, cmd1, cmd2;
	const QString pdfFile = convertPath(fn);
	const QString tmpFile = convertPath(QDir::homePath()+"/sctodaytmps.png");
	const QString qttmpFile = QDir::homePath()+"/sctodaytmps.png";
	QPixmap pm;
	tmp.setNum(Page);
	int ret = -1;
	tmp.setNum(Page);
	QStringList args;
	args.append("-sDEVICE=png16m");
	args.append("-r72");
	args.append("-dGraphicsAlphaBits=4");
	args.append("-o");
	args.append(tmpFile);
	args.append("-dFirstPage="+tmp);
	args.append("-dLastPage="+tmp);
	args.append(pdfFile);
	ret = callGS(args);
	////////qDebug() << "### ret " << ret;
	if (ret == 0)
	{
		QPixmap tmpimage(qttmpFile);
		QPixmap penna = tmpimage.scaledToWidth(w);
		tmpimage.detach();
		QFile lastaction(qttmpFile);
		lastaction.remove();
		QPainter p;
		p.begin(&penna);
		p.setBrush(Qt::NoBrush);
		p.setPen(QPen(QBrush(Qt::black),2,Qt::SolidLine));
		p.drawRect(0, 0, penna.width(), penna.height());
		p.end();
		return penna;
	}
	return pm;
}
Example #10
0
QPixmap LoadPS(QString fn , const QString arguments_append)
{
	const QString pdfFile = convertPath(fn);
	QChar letter('A' + (qrand() % 26));
	QDateTime timer1(QDateTime::currentDateTime());
	const QString qttmpFile = _GSCACHE_+QString("%2_%1.png").arg(timer1.toString("yyyy-MM-dd-HH-mm-ss-zzz")).arg(letter);
	QFileInfo fitmp(qttmpFile);
	const int VersionGS = getGSVersion();

	QFile lastaction(fitmp.absoluteFilePath());
	lastaction.remove();

	QPixmap pm;
	int ret = -1;
	QStringList args;

	if (arguments_append.size() > 3)
	{
		args.append(arguments_append);
	}

	if (VersionGS >=8)
	{
		args.append("-sDEVICE=png16m");
		args.append("-dGraphicsAlphaBits=4");
		args.append("-r72");
		args.append("-o");
		args.append(fitmp.fileName());
		args.append(pdfFile);
	}
	else
	{
		args.append("-sDEVICE=pnggray");
		args.append("-r72x72");
		args.append("-sOutputFile="+fitmp.fileName());
		args.append("-q");
		args.append(pdfFile);
	}
	ret = callGS(args);
	//////////qDebug() << "### ret " << ret << " VersionGS->" << VersionGS;
	if (ret == 0)
	{
		QPixmap tmpimage(fitmp.absoluteFilePath());
		lastaction.remove();
		return tmpimage;
	}
	return pm;
}
CTilesetManager::CTilesetManager() :
	SimpleDirectoryList(convertPath("gfx/packs/Classic/tilesets/"))
{
	short y1 = 0, y2 = 0, y3 = 0;
    for (short i = 0; i < 32; i++) {
		short x1 = 0, x2 = 0, x3 = 0;
        for (short j = 0; j < 32; j++) {
			gfx_setrect(&rRects[0][j][i], x1, y1, TILESIZE, TILESIZE);
			gfx_setrect(&rRects[1][j][i], x2, y2, PREVIEWTILESIZE, PREVIEWTILESIZE);
			gfx_setrect(&rRects[2][j][i], x3, y3, THUMBTILESIZE, THUMBTILESIZE);

			x1 += TILESIZE;
			x2 += PREVIEWTILESIZE;
			x3 += THUMBTILESIZE;
		}

		y1 += TILESIZE;
		y2 += PREVIEWTILESIZE;
		y3 += THUMBTILESIZE;
	}

	tClassicTileset = NULL;
}
Example #12
0
void QOutlineMapper::endOutline()
{
    closeSubpath();

    if (m_elements.isEmpty()) {
        memset(&m_outline, 0, sizeof(m_outline));
        return;
    }

    QPointF *elements = m_elements.data();

    // Transform the outline
    if (m_txop == QTransform::TxNone) {
        // Nothing to do.
    } else if (m_txop == QTransform::TxTranslate) {
        for (int i = 0; i < m_elements.size(); ++i) {
            QPointF &e = elements[i];
            e = QPointF(e.x() + m_dx, e.y() + m_dy);
        }
    } else if (m_txop == QTransform::TxScale) {
        for (int i = 0; i < m_elements.size(); ++i) {
            QPointF &e = elements[i];
            e = QPointF(m_m11 * e.x() + m_dx, m_m22 * e.y() + m_dy);
        }
    } else if (m_txop < QTransform::TxProject) {
        for (int i = 0; i < m_elements.size(); ++i) {
            QPointF &e = elements[i];
            e = QPointF(m_m11 * e.x() + m_m21 * e.y() + m_dx,
                        m_m22 * e.y() + m_m12 * e.x() + m_dy);
        }
    } else {
        const QVectorPath vp((qreal *)elements, m_elements.size(),
                             m_element_types.size() ? m_element_types.data() : 0);
        QPainterPath path = vp.convertToPainterPath();
        path = QTransform(m_m11, m_m12, m_m13, m_m21, m_m22, m_m23, m_dx, m_dy, m_m33).map(path);
        if (!(m_outline.flags & QT_FT_OUTLINE_EVEN_ODD_FILL))
            path.setFillRule(Qt::WindingFill);
        uint old_txop = m_txop;
        m_txop = QTransform::TxNone;
        if (path.isEmpty())
            m_valid = false;
        else
            convertPath(path);
        m_txop = old_txop;
        return;
    }

    if (m_round_coords) {
        // round coordinates to match outlines drawn with drawLine_midpoint_i
        for (int i = 0; i < m_elements.size(); ++i)
            elements[i] = QPointF(qFloor(elements[i].x() + aliasedCoordinateDelta),
                                  qFloor(elements[i].y() + aliasedCoordinateDelta));
    }

    controlPointRect = boundingRect(elements, m_elements.size());

#ifdef QT_DEBUG_CONVERT
    printf(" - control point rect (%.2f, %.2f) %.2f x %.2f, clip=(%d,%d, %dx%d)\n",
           controlPointRect.x(), controlPointRect.y(),
           controlPointRect.width(), controlPointRect.height(),
           m_clip_rect.x(), m_clip_rect.y(), m_clip_rect.width(), m_clip_rect.height());
#endif


    // Check for out of dev bounds...
    const bool do_clip = !m_in_clip_elements && ((controlPointRect.left() < -QT_RASTER_COORD_LIMIT
                          || controlPointRect.right() > QT_RASTER_COORD_LIMIT
                          || controlPointRect.top() < -QT_RASTER_COORD_LIMIT
                          || controlPointRect.bottom() > QT_RASTER_COORD_LIMIT
                          || controlPointRect.width() > QT_RASTER_COORD_LIMIT
                          || controlPointRect.height() > QT_RASTER_COORD_LIMIT));

    if (do_clip) {
        clipElements(elements, elementTypes(), m_elements.size());
    } else {
        convertElements(elements, elementTypes(), m_elements.size());
    }
}
int main(int argc, char **argv) {
	dongleHandle dongle;
	unsigned char in[260];
	unsigned char out[260];
	int result;
	int sw;
	int apduSize;		
	char message[140];
	unsigned int keyPath[10];
	int keyPathLength;	
	int i;

	if (argc < 3) {
		fprintf(stderr, "Usage : %s [key path in a/b/c format using n' for hardened nodes] [message]\n", argv[0]);
		return 0;
	}
	keyPathLength = convertPath(argv[1], keyPath);
	if (keyPathLength < 0) {
		fprintf(stderr, "Invalid key path\n");
		return 0;
	}
	if (strlen(argv[2]) > sizeof(message) - 1) {
		fprintf(stderr, "Invalid message\n");
		return 0;
	}
	message[sizeof(message) - 1] = '\0';	
	strncpy(message, argv[2], sizeof(message) - 1);
	initDongle();
	dongle = getFirstDongle();
	if (dongle == NULL) {
		fprintf(stderr, "No dongle found\n");
		return 0;
	}	
	apduSize = 0;
	in[apduSize++] = BTCHIP_CLA;
	in[apduSize++] = BTCHIP_INS_SIGN_MESSAGE;
	in[apduSize++] = 0x00;
	in[apduSize++] = 0x00;
	in[apduSize++] = 0x00;
	in[apduSize++] = keyPathLength;
	for (i=0; i<keyPathLength; i++) {
		writeUint32BE(in + apduSize, keyPath[i]);
		apduSize += 4;
	}		
	in[apduSize++] = strlen(message);
	memcpy(in + apduSize, message, strlen(message));
	apduSize += strlen(message);
	in[OFFSET_CDATA] = (apduSize - 5);
	result = sendApduDongle(dongle, in, apduSize, out, sizeof(out), &sw);
	closeDongle(dongle);
	exitDongle();
	if (result < 0) {
		fprintf(stderr, "I/O error\n");
		return 0;
	}
	if (sw != SW_OK) {
		fprintf(stderr, "Dongle application error : %.4x\n", sw);
		return 0;
	}	
	apduSize = 0;
	if (out[apduSize] == 0x00) {
		printf("Message signature prepared, proceed with signing\n");
	}
	else
	if (out[apduSize] == 0x01) {
		printf("Message signature prepared, please powercycle to get the second factor then proceed with signing\n");
	}
	else {
		fprintf(stderr, "Invalid transaction state %.2x\n", out[apduSize]);
		return 0;
	}		
	return 1;
}
Example #14
0
void QOutlineMapper::endOutline()
{
    closeSubpath();

    int element_count = m_elements.size();

    if (element_count == 0) {
        memset(&m_outline, 0, sizeof(m_outline));
        return;
    }

    QPointF *elements;

    // Transform the outline
    if (m_txop == QTransform::TxNone) {
        elements = m_elements.data();
    } else {
        if (m_txop == QTransform::TxTranslate) {
            for (int i=0; i<m_elements.size(); ++i) {
                const QPointF &e = m_elements.at(i);
                m_elements_dev << QPointF(e.x() + m_dx, e.y() + m_dy);
            }
        } else if (m_txop == QTransform::TxScale) {
            for (int i=0; i<m_elements.size(); ++i) {
                const QPointF &e = m_elements.at(i);
                m_elements_dev << QPointF(m_m11 * e.x() + m_dx, m_m22 * e.y() + m_dy);
            }
        } else if (m_txop < QTransform::TxProject) {
            for (int i=0; i<m_elements.size(); ++i) {
                const QPointF &e = m_elements.at(i);
                m_elements_dev << QPointF(m_m11 * e.x() + m_m21 * e.y() + m_dx,
                                          m_m22 * e.y() + m_m12 * e.x() + m_dy);
            }
        } else {
            // ## TODO: this case needs to be plain code polygonal paths
            QPainterPath path;
            if (m_element_types.isEmpty()) {
                if (!m_elements.isEmpty())
                    path.moveTo(m_elements.at(0));
                for (int i=1; i<m_elements.size(); ++i)
                    path.lineTo(m_elements.at(i));
            } else {
                for (int i=0; i<m_elements.size(); ++i) {
                    switch (m_element_types.at(i)) {
                    case QPainterPath::MoveToElement:
                        path.moveTo(m_elements.at(i));
                        break;
                    case QPainterPath::LineToElement:
                        path.lineTo(m_elements.at(i));
                        break;
                    case QPainterPath::CurveToElement:
                        path.cubicTo(m_elements.at(i), m_elements.at(i+1), m_elements.at(i+2));
                        i += 2;
                        break;
                    default:
                        Q_ASSERT(false);
                        break;
                    }
                }
            }
            path = QTransform(m_m11, m_m12, m_m13, m_m21, m_m22, m_m23, m_dx, m_dy, m_m33).map(path);
            if (!(m_outline.flags & QT_FT_OUTLINE_EVEN_ODD_FILL))
                path.setFillRule(Qt::WindingFill);
            uint old_txop = m_txop;
            m_txop = QTransform::TxNone;
            if (path.isEmpty())
                m_valid = false;
            else
                convertPath(path);
            m_txop = old_txop;
            return;
        }
        elements = m_elements_dev.data();
    }

    if (m_round_coords) {
        // round coordinates to match outlines drawn with drawLine_midpoint_i
        for (int i = 0; i < m_elements.size(); ++i)
            elements[i] = QPointF(qFloor(elements[i].x() + aliasedCoordinateDelta),
                                  qFloor(elements[i].y() + aliasedCoordinateDelta));
    }

    controlPointRect = boundingRect(elements, element_count);

#ifdef QT_DEBUG_CONVERT
    printf(" - control point rect (%.2f, %.2f) %.2f x %.2f\n",
           controlPointRect.x(), controlPointRect.y(),
           controlPointRect.width(), controlPointRect.height());
#endif


    // Check for out of dev bounds...
    const bool do_clip = (controlPointRect.left() < -QT_RASTER_COORD_LIMIT
                          || controlPointRect.right() > QT_RASTER_COORD_LIMIT
                          || controlPointRect.top() < -QT_RASTER_COORD_LIMIT
                          || controlPointRect.bottom() > QT_RASTER_COORD_LIMIT);

    if (do_clip) {
        clipElements(elements, elementTypes(), element_count);
    } else {
        convertElements(elements, elementTypes(), element_count);
    }
}
Example #15
0
bool CResourceManager::LoadGameSounds()
{
    game_values.soundcapable = false;

#if !defined(_XBOX) && !defined(__EMSCRIPTEN__)  //xbox and emscripten has sound capabilities
    int frequency, channels;
    Uint16 format;

    if (0 == Mix_QuerySpec(&frequency, &format, &channels))
        return false;
#endif

    const char * soundpack = soundpacklist->current_name();

    sfx_mip.init(convertPath("sfx/packs/mip.wav", soundpack));
    sfx_deathsound.init(convertPath("sfx/packs/death.wav", soundpack));
    sfx_jump.init(convertPath("sfx/packs/jump.wav", soundpack));
    sfx_skid.init(convertPath("sfx/packs/skid.wav", soundpack));
    sfx_capejump.init(convertPath("sfx/packs/capejump.wav", soundpack));
    sfx_invinciblemusic.init(convertPath("sfx/packs/invincible.wav", soundpack));
    sfx_extraguysound.init(convertPath("sfx/packs/1up.wav", soundpack));
    sfx_sprout.init(convertPath("sfx/packs/sprout.wav", soundpack));
    sfx_collectpowerup.init(convertPath("sfx/packs/collectpowerup.wav", soundpack));
    sfx_collectfeather.init(convertPath("sfx/packs/feather.wav", soundpack));
    sfx_tailspin.init(convertPath("sfx/packs/tail.wav", soundpack));
    sfx_storepowerup.init(convertPath("sfx/packs/storeitem.wav", soundpack));
    sfx_breakblock.init(convertPath("sfx/packs/breakblock.wav", soundpack));
    sfx_bump.init(convertPath("sfx/packs/bump.wav", soundpack));
    sfx_coin.init(convertPath("sfx/packs/coin.wav", soundpack));
    sfx_fireball.init(convertPath("sfx/packs/fireball.wav", soundpack));
    sfx_springjump.init(convertPath("sfx/packs/springjump.wav", soundpack));
    sfx_timewarning.init(convertPath("sfx/packs/timewarning.wav", soundpack));
    sfx_hit.init(convertPath("sfx/packs/hit.wav", soundpack));
    sfx_chicken.init(convertPath("sfx/packs/chicken.wav", soundpack));
    sfx_transform.init(convertPath("sfx/packs/transform.wav", soundpack));
    sfx_yoshi.init(convertPath("sfx/packs/yoshi.wav", soundpack));
    sfx_pause.init(convertPath("sfx/packs/pause.wav", soundpack));
    sfx_bobombsound.init(convertPath("sfx/packs/bob-omb.wav", soundpack));
    sfx_areatag.init(convertPath("sfx/packs/dcoin.wav", soundpack));
    sfx_cannon.init(convertPath("sfx/packs/cannon.wav", soundpack));
    sfx_burnup.init(convertPath("sfx/packs/burnup.wav", soundpack));
    sfx_pipe.init(convertPath("sfx/packs/warp.wav", soundpack));
    sfx_thunder.init(convertPath("sfx/packs/thunder.wav", soundpack));
    sfx_slowdownmusic.init(convertPath("sfx/packs/clock.wav", soundpack));
    sfx_flyingsound.init(convertPath("sfx/packs/slowdown.wav", soundpack));
    sfx_storedpowerupsound.init(convertPath("sfx/packs/storedpowerup.wav", soundpack));
    sfx_kicksound.init(convertPath("sfx/packs/kick.wav", soundpack));
    sfx_racesound.init(convertPath("sfx/packs/race.wav", soundpack));
    sfx_bulletbillsound.init(convertPath("sfx/packs/bulletbill.wav", soundpack));
    sfx_boomerang.init(convertPath("sfx/packs/boomerang.wav", soundpack));
    sfx_spit.init(convertPath("sfx/packs/spit.wav", soundpack));
    sfx_starwarning.init(convertPath("sfx/packs/starwarning.wav", soundpack));
    sfx_powerdown.init(convertPath("sfx/packs/powerdown.wav", soundpack));
    sfx_switchpress.init(convertPath("sfx/packs/switchpress.wav", soundpack));
    sfx_superspring.init(convertPath("sfx/packs/superspring.wav", soundpack));
    sfx_stun.init(convertPath("sfx/packs/stun.wav", soundpack));
    sfx_inventory.init(convertPath("sfx/packs/inventory.wav", soundpack));
    sfx_worldmove.init(convertPath("sfx/packs/mapmove.wav", soundpack));
    sfx_treasurechest.init(convertPath("sfx/packs/treasurechest.wav", soundpack));
    sfx_flamecannon.init(convertPath("sfx/packs/flamecannon.wav", soundpack));
    sfx_wand.init(convertPath("sfx/packs/wand.wav", soundpack));
    sfx_enterstage.init(convertPath("sfx/packs/enter-stage.wav", soundpack));
    sfx_gameover.init(convertPath("sfx/packs/gameover.wav", soundpack));
    sfx_pickup.init(convertPath("sfx/packs/pickup.wav", soundpack));

    game_values.soundcapable = true;
    return true;
}
Example #16
0
int GameEngineMain(int argc, _TCHAR* argv[])
// int _main (int argc, const char * const* argv)
#endif
{
	bool bStdModuleExist = EngineStdReference();
	klb_assert(bStdModuleExist, "The links of a system are insufficient.");

	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH);
	glutCreateWindow("GLEW Test");

	GLenum err = glewInit();
	if (GLEW_OK != err)
	{
	  /* Problem: glewInit failed, something is seriously wrong. */
	  fprintf(stderr, "Error: %s\n", glewGetErrorString(err));
	}
	fprintf(stdout, "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));

#define HEIGHT	(768)
#define WIDTH	(1024)
#define POS_X	(10)
#define POS_Y	(10)
//#define HEIGHT	(800)
//#define WIDTH	(400)
	int scrW	= WIDTH;
	int scrH	= HEIGHT;
	
	int fixedDelta = 0;

	*g_basePath = 0;
	*g_fileName = 0;
	g_pathExtern	= PATH_EXTERN;
	g_pathInstall	= PATH_INSTALL;

	g_fileName[0] = 0;

	bool hasDefaultFont = true;
	bool hasDefaultDB   = false;

	if (argc > 1) {
		int parse	= 1;
		int max		= argc;
		while (parse < max) {
			if(*argv[parse] == '-') {
				if (strcmp("-w",argv[parse]) == 0) {
					sscanf_s(argv[parse+1],"%i",&scrW);
				}

				if (strcmp("-h",argv[parse]) == 0) {
					sscanf_s(argv[parse+1],"%i",&scrH);
				}

				if (strcmp("-i",argv[parse]) == 0) {
					g_pathInstall = convertPath(argv[parse+1]);
				}

				if (strcmp("-e",argv[parse]) == 0) {
					g_pathExtern = convertPath(argv[parse+1]);
				}

				if (strcmp("-t",argv[parse]) == 0) {
					fixedDelta = atoi(argv[parse+1]);
				}

				if (strcmp("-enc", argv[parse]) == 0) {
					bool encrypt = false;
					if (stricmp(argv[parse+1],"true") == 0) {
						encrypt = true;
					}

					if (stricmp(argv[parse+1],"1") == 0) {
						encrypt = true;
					}

					CWin32Platform::setEncrypt(encrypt);
				}

				if (strcmp("-no", argv[parse]) == 0) {
					if (strcmp("defaultfont", argv[parse+1]) == 0) {
						hasDefaultFont = false;
					}
				}

				parse += 2;
			} else {
				// Specify the boot file
				const char* file = argv[parse];
				int lenf = strlen(file);
				
				memcpy(g_fileName, file, lenf);
				g_fileName[lenf] = 0;

				// ファイル名そのものは start.lua に相当する起動ファイルとする。
                // File name of the file used as a start.lua
				parse++;
			}
		}
	}

	CWin32PathConv& pathconv = CWin32PathConv::getInstance();
	pathconv.setPath(g_pathInstall, g_pathExtern);

	WNDCLASS wc;
	HWND hwnd;
	HDC hDC;
	HGLRC hRC;
	HINSTANCE hInstance = GetModuleHandle(NULL);

	// register window class
	wc.style = CS_OWNDC;
	wc.lpfnWndProc = WndProc;
	wc.cbClsExtra = 0;
	wc.cbWndExtra = 0;
	wc.hInstance = hInstance;
	wc.hIcon = LoadIcon( NULL, IDI_APPLICATION );
	wc.hCursor = LoadCursor( NULL, IDC_ARROW );
	wc.hbrBackground = (HBRUSH)GetStockObject( BLACK_BRUSH );
	wc.lpszMenuName = NULL;
	wc.lpszClassName = "GameEngineGL";
	RegisterClass( &wc );
	
	// create main window
	hwnd = CreateWindow(
		"GameEngineGL", "Playground", 
		WS_CAPTION | WS_POPUPWINDOW | WS_VISIBLE,
		0, 0, 256, 256,
		NULL, NULL, hInstance, NULL );

/*		"EngineGL", NULL,
		WS_THICKFRAME|WS_DISABLED,
		CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
		NULL, NULL, 
		hInstance, 
		NULL
	);*/
	
	if (!hwnd)
		return -1;

	// enable OpenGL for the window
	EnableOpenGL( hwnd, &hDC, &hRC );

	// COM Initialization
	CoInitialize(NULL);

	EnableWindow(hwnd, TRUE);

	DragAcceptFiles(hwnd, true);

	RECT area;
	area.left = 0;
	area.top = 0;
#ifdef _WIN32_WCE
	area.right = GetSystemMetrics(SM_CXSCREEN);
	area.bottom = GetSystemMetrics(SM_CYSCREEN);

	SetWindowLong(hwnd, GWL_STYLE, WS_POPUP);

	SetWindowPos(hwnd, HWND_TOPMOST,
					area.left, area.top,
					area.right, area.bottom,
					SWP_FRAMECHANGED);
#else
	// Window border hard coded
	//area.right = scrW + 8;
	//area.bottom = scrH + 27;
	////area.right = GetSystemMetrics(SM_CXSCREEN);
	////area.bottom = GetSystemMetrics(SM_CYSCREEN);
	int addW = GetSystemMetrics(SM_CXSIZEFRAME) * 2;
	int addH = GetSystemMetrics(SM_CYSIZEFRAME) * 2 + GetSystemMetrics(SM_CYCAPTION);
	area.right = scrW + addW;
	area.bottom = scrH + addH;
	

	/*
	AdjustWindowRect(
		&area,
		WS_SYSMENU|WS_THICKFRAME|WS_DISABLED,
		false
	);*/

	SetWindowPos(hwnd, HWND_TOP,
					area.left, area.top,
					area.right, area.bottom,
					SWP_NOMOVE);
#endif

	/* set as foreground window to give this app focus in case it doesn't have it */
	SetForegroundWindow(hwnd);
	ShowWindow(hwnd, SW_SHOWNORMAL);

	glClearColor(1.0f, 0.7f, 0.2039f, 0.0f);
	glDisable( GL_CULL_FACE );

	//

	// testCodeInit();

	CPFInterface& pfif = CPFInterface::getInstance();
	CWin32Platform * pPlatform = new CWin32Platform(hwnd);

	if (!hasDefaultFont) {
		pPlatform->setNoDefaultFont();
	}

	pfif.setPlatformRequest(pPlatform);
	GameSetup();	// client side setup

	// Can only access client AFTER GameSetup.
	pfif.client().setInitParam((hasDefaultDB   ? IClientRequest::ENGINE_USE_DEFAULTDB   : 0)
							|  (hasDefaultFont ? IClientRequest::ENGINE_USE_DEFAULTFONT : 0), NULL); 

	// sound initialize
	SoundSystemInitFor_Win32();
	CWin32AudioMgr::getInstance().init(hwnd);

	// set screen size
	pfif.client().setScreenInfo(false, scrW, scrH);
	// boot path
	if (strlen(g_fileName)) {
		pfif.client().setFilePath(g_fileName);
	} else {
		pfif.client().setFilePath(NULL);
	}
	if (!pfif.client().initGame()) {
		klb_assertAlways("Could not initialize game, most likely memory error");
	} else {
		static DWORD lastTime = GetTickCount();

		// Main message loop:
		bool quit = false;
		s32 frameTime = pfif.client().getFrameTime();
		IClientRequest& pClient = pfif.client();

		while (!quit)
		{
			/* relay message queue messages to windowproc's */
			MSG msg;
			while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
			{
				TranslateMessage(&msg);

				if (msg.message == WM_QUIT)
				{
					quit = true;
					break;
				}

				DispatchMessage(&msg);
			}

			if (!quit) {
				// This is not the safest or best way to handle timing, but this code
				// is only added to make the triangle rotate at a basically constant
				// rate, independent of the target (Win32) platform
				DWORD newTime   = GetTickCount();
				DWORD delta     = newTime - lastTime;

				// Handle rollover
				if (newTime < lastTime) {
					delta = 0;
				} else {
					if (delta > (DWORD)frameTime) {
						sendEvents();

						lastTime = newTime;
						//dglClear(GL_COLOR_BUFFER_BIT);
	
						//
						// Rendering complete.
						//		
						//testCodeLoop(delta);
						pClient.frameFlip(fixedDelta ? fixedDelta : delta);

						// pfIF.platform().flipFrame();
						SwapBuffers( hDC );
					}
                    // コントロール(ex. TextBox)が作られている場合、その再描画を行う
					// If a Control (ex TextBox) is done, redraw them.
					CWin32Widget::ReDrawControls();
				}
			}
			Sleep(1);
		}
	}

	pfif.client().finishGame();

	SoundSystemExitFor_Win32();

	delete pPlatform;

	// shutdown OpenGL
	DisableOpenGL( hwnd, hDC, hRC );

	CWin32AudioMgr::getInstance().release();

	// End of COM
	CoUninitialize();

	if(DestroyWindow (hwnd)) {
		printf("DestroyWindow SUCCESS\n");
    }
	return 0;
}
int main(int argc, char **argv) {
	dongleHandle dongle;
	unsigned char in[260];
	unsigned char out[260];
	int result;
	int sw;
	int apduSize;		
	char pin[100];
	uint32_t lockTime;
	unsigned char sigHashType;
	unsigned int keyPath[10];
	int keyPathLength;		
	int i;

	if (argc < 5) {
		fprintf(stderr, "Usage : %s [key path in a/b/c format using n' for hardened nodes] [second factor ascii, or empty string] [locktime or empty for default] [sighashType or empty for SIGHASH_ALL]\n", argv[0]);
		return 0;
	}
	keyPathLength = convertPath(argv[1], keyPath);
	if (keyPathLength < 0) {
		fprintf(stderr, "Invalid key path\n");
		return 0;
	}
	if (strlen(argv[2]) > sizeof(pin) - 1) {
		fprintf(stderr, "Invalid second factor\n");
		return 0;
	}
	pin[sizeof(pin) - 1] = '\0';	
	strncpy(pin, argv[2], sizeof(pin) - 1);
	if (strlen(argv[3]) == 0) {
		lockTime = 0;
	}
	else {
		result = strtol(argv[3], NULL, 10);
		if (result < 0) {
			fprintf(stderr, "Invalid chain index\n");
			return 0;
		}
		lockTime = result;
	}
	if (strlen(argv[4]) == 0) {
		sigHashType = 0x01;
	}
	else {
		result = hexToBin(argv[4], &sigHashType, sizeof(sigHashType));
		if (result < 0) {
			fprintf(stderr, "Invalid sigHashType\n");
			return 0;
		}
	}
	initDongle();
	dongle = getFirstDongle();
	if (dongle == NULL) {
		fprintf(stderr, "No dongle found\n");
		return 0;
	}	
	apduSize = 0;
	in[apduSize++] = BTCHIP_CLA;
	in[apduSize++] = BTCHIP_INS_HASH_SIGN;
	in[apduSize++] = 0x00;
	in[apduSize++] = 0x00;
	in[apduSize++] = 0x00;
	in[apduSize++] = keyPathLength;
	for (i=0; i<keyPathLength; i++) {
		writeUint32BE(in + apduSize, keyPath[i]);
		apduSize += 4;
	}			
	in[apduSize++] = strlen(pin);
	memcpy(in + apduSize, pin, strlen(pin));
	apduSize += strlen(pin);
	writeUint32BE(in + apduSize, lockTime);
	apduSize += sizeof(lockTime);
	in[apduSize++] = sigHashType;
	in[OFFSET_CDATA] = (apduSize - 5);
	printf("Singing, please wait ...\n");
	result = sendApduDongle(dongle, in, apduSize, out, sizeof(out), &sw);
	closeDongle(dongle);
	exitDongle();
	if (result < 0) {
		fprintf(stderr, "I/O error\n");
		return 0;
	}
	if (sw != SW_OK) {
		fprintf(stderr, "Dongle application error : %.4x\n", sw);
		return 0;
	}	
	printf("Signature + hashtype : ");
	displayBinary(out, result);
	return 1;
}
Example #18
0
bool CResourceManager::LoadWorldGraphics()
{
    const char * graphicspack = worldgraphicspacklist->current_name();

    gfx_loadimage(&spr_worldbackground[0], convertPath("gfx/packs/world/world_background.png", graphicspack), false, false);
    gfx_loadimage(&spr_worldbackground[1], convertPath("gfx/packs/world/preview/world_background.png", graphicspack), false, false);

    gfx_loadimage(&spr_worldforeground[0], convertPath("gfx/packs/world/world_foreground.png", graphicspack), false, false);
    gfx_loadimage(&spr_worldforeground[1], convertPath("gfx/packs/world/preview/world_foreground.png", graphicspack), false, false);

    gfx_loadimage(&spr_worldforegroundspecial[0], convertPath("gfx/packs/world/world_foreground_special.png", graphicspack), false, false);
    gfx_loadimage(&spr_worldforegroundspecial[1], convertPath("gfx/packs/world/preview/world_foreground_special.png", graphicspack), false, false);

    gfx_loadimage(&spr_worldpaths[0], convertPath("gfx/packs/world/world_paths.png", graphicspack), false, false);
    gfx_loadimage(&spr_worldpaths[1], convertPath("gfx/packs/world/preview/world_paths.png", graphicspack), false, false);

    gfx_loadimage(&spr_worldvehicle[0], convertPath("gfx/packs/world/world_vehicles.png", graphicspack), false);
    gfx_loadimage(&spr_worldvehicle[1], convertPath("gfx/packs/world/preview/world_vehicles.png", graphicspack), false);

    gfx_loadimage(&spr_worlditems, convertPath("gfx/packs/world/world_powerups.png", graphicspack), false);
    gfx_loadimage(&spr_worlditempopup, convertPath("gfx/packs/world/world_item_popup.png", graphicspack), false);
    gfx_loadimage(&spr_worlditemssmall, convertPath("gfx/packs/world/world_powerupssmall.png", graphicspack), false);
    gfx_loadimage(&spr_worlditemsplace, convertPath("gfx/packs/world/world_bonusplace.png", graphicspack), false);
    gfx_loadimage(&spr_worldbonushouse, convertPath("gfx/packs/world/world_bonushouse.png", graphicspack), false);

    return true;
}
Example #19
0
bool CResourceManager::LoadMenuGraphics()
{
    const char * graphicspack = menugraphicspacklist->current_name();

    gfx_loadimagenocolorkey(&menu_shade, convertPath("gfx/packs/menu/menu_shade.png", graphicspack));
    menu_shade.setalpha(smw->MenuTransparency);

    gfx_loadimage(&spr_scoreboard, convertPath("gfx/packs/menu/scoreboard.png", graphicspack), false);
    gfx_loadimage(&menu_slider_bar, convertPath("gfx/packs/menu/menu_slider_bar.png", graphicspack), false);
    gfx_loadimage(&menu_plain_field, convertPath("gfx/packs/menu/menu_plain_field.png", graphicspack), false);
    gfx_loadimage(&menu_player_select, convertPath("gfx/packs/menu/menu_player_select.png", graphicspack), false);
    gfx_loadimage(&menu_dialog, convertPath("gfx/packs/menu/menu_dialog.png", graphicspack), false);
    gfx_loadimage(&menu_map_filter, convertPath("gfx/packs/menu/menu_map_filter.png", graphicspack), false);
    gfx_loadimage(&menu_match_select, convertPath("gfx/packs/menu/menu_match_select.png", graphicspack), false);

    gfx_loadimage(&menu_verticalarrows, convertPath("gfx/packs/menu/menu_vertical_arrows.png", graphicspack), false);

    gfx_loadimage(&menu_mode_small, convertPath("gfx/packs/menu/menu_mode_small.png", graphicspack), false);
    gfx_loadimage(&menu_mode_large, convertPath("gfx/packs/menu/menu_mode_large.png", graphicspack), false);

    gfx_loadimage(&spr_dialog, convertPath("gfx/packs/menu/dialog.png", graphicspack), false);
    gfx_loadimage(&spr_dialogbutton, convertPath("gfx/packs/menu/dialog_button.png", graphicspack), false);
    gfx_loadimage(&spr_tournament_background, convertPath("gfx/packs/menu/tournament_background.png", graphicspack), false);
    gfx_loadimage(&spr_tournament_powerup_splash, convertPath("gfx/packs/menu/tournament_powerup_splash.png", graphicspack), false);
    gfx_loadimage(&spr_player_select_background, convertPath("gfx/packs/menu/player_select_background.png", graphicspack), false);
    gfx_loadimage(&spr_player_select_ready, convertPath("gfx/packs/menu/player_select_ready.png", graphicspack), false);
    //gfx_loadimage(&spr_ipfield, convertPath("gfx/packs/menu/menu_ipfield.png", graphicspack), false);
    gfx_loadimage(&spr_selectfield, convertPath("gfx/packs/menu/menu_selectfield.png", graphicspack), false);
    gfx_loadimage(&spr_selectfielddisabled, convertPath("gfx/packs/menu/menu_selectfield_disabled.png", graphicspack), false);
    gfx_loadimage(&spr_map_filter_icons, convertPath("gfx/packs/menu/menu_map_flags.png", graphicspack), false);
    gfx_loadimage(&spr_tour_markers, convertPath("gfx/packs/menu/tour_markers.png", graphicspack), false);
    gfx_loadimage(&spr_menu_boxed_numbers, convertPath("gfx/packs/menu/menu_boxed_numbers.png", graphicspack), false);
    gfx_loadimage(&spr_countdown_numbers, convertPath("gfx/packs/menu/game_countdown_numbers.png", graphicspack), false);
    gfx_loadimage(&spr_thumbnail_warps[0], convertPath("gfx/packs/menu/menu_warp_preview.png", graphicspack), false);
    gfx_loadimage(&spr_thumbnail_warps[1], convertPath("gfx/packs/menu/menu_warp_thumbnail.png", graphicspack), false);
    gfx_loadimage(&spr_thumbnail_mapitems[0], convertPath("gfx/packs/menu/menu_mapitems_preview.png", graphicspack), false);
    gfx_loadimage(&spr_thumbnail_mapitems[1], convertPath("gfx/packs/menu/menu_mapitems_thumbnail.png", graphicspack), false);

    gfx_loadimage(&spr_announcementicons, convertPath("gfx/packs/menu/menu_announcement_icons.png", graphicspack), false);

    gfx_loadimage(&spr_platformstarttile, convertPath("gfx/leveleditor/leveleditor_platformstarttile.png"), 64, true, true);
    gfx_loadimage(&spr_platformendtile, convertPath("gfx/leveleditor/leveleditor_selectedtile.png"), 64, true, true);
    gfx_loadimage(&spr_platformpath, convertPath("gfx/leveleditor/leveleditor_platform_path.png"), 128, true, true);

    return true;
}
Example #20
0
  EReturn OMPLsolver::getSimplifiedPath(ompl::geometric::PathGeometric &pg,
      Eigen::MatrixXd & traj, ob::PlannerTerminationCondition &ptc)
  {
    if (smooth_->data)
    {
      HIGHLIGHT("Simplifying solution");
      int original_cnt = pg.getStateCount();
      ros::Time start = ros::Time::now();

      //ompl_simple_setup_->simplifySolution(d);
      // Lets do our own simplifier ~:)
      if (original_cnt >= 3)
      {
        og::PathSimplifierPtr psf_ = ompl_simple_setup_->getPathSimplifier();
        const ob::SpaceInformationPtr &si =
            ompl_simple_setup_->getSpaceInformation();

        bool tryMore = false;
        if (ptc == false) tryMore = psf_->reduceVertices(pg);
        if (ptc == false) psf_->collapseCloseVertices(pg);
        int times = 0;
        while (tryMore && ptc == false)
        {
          tryMore = psf_->reduceVertices(pg);
          times++;
        }
        if (si->getStateSpace()->isMetricSpace())
        {
          if (ptc == false)
            tryMore = psf_->shortcutPath(pg);
          else
            tryMore = false;
          times = 0;
          while (tryMore && ptc == false)
          {
            tryMore = psf_->shortcutPath(pg);
            times++;
          }
        }

        std::vector<ob::State*> &states = pg.getStates();
        //	Calculate number of states required
        unsigned int length = 0;
        const int n1 = states.size() - 1;
        for (int i = 0; i < n1; ++i)
          length += si->getStateSpace()->validSegmentCount(states[i],
              states[i + 1]);
//				//	Forward reducing
//				HIGHLIGHT("States before forward reducing: "<<pg.getStateCount());
//				pg.interpolate(length);
//
//				bool need_backward = true;
//				for (int i = states.size() - 1; i > 0; i--)
//				{
//					if (si->checkMotion(states[0], states[i]))
//					{
//						ob::State *start = si->cloneState(states[0]);
//						pg.keepAfter(states[i]);
//						pg.prepend(start);
//						need_backward = (i == states.size() - 1) ? false : true;
//						break;
//					}
//				}
//
//				//	Backward reducing
//				ob::State *mid;
//				if (need_backward)
//				{
//					HIGHLIGHT("States before backward reducing: "<<pg.getStateCount());
//					pg.interpolate(length);
//					for (int i = 1; i < states.size(); i++)
//					{
//						if (si->checkMotion(states[states.size() - 1], states[i]))
//						{
//							ob::State *goal = si->cloneState(states[states.size() - 1]);
//							pg.keepBefore(states[i]);
//							pg.append(goal);
//							mid = si->cloneState(states[i]);
//							break;
//						}
//					}
//				}

        pg.interpolate(length);
      }

//			if (ompl_simple_setup_->haveSolutionPath())
//			{
//				pg.interpolate();
//			}
      HIGHLIGHT_NAMED("OMPLSolver",
          "Simplification took "<<ros::Duration(ros::Time::now()-start).toSec()<<"sec. States: "<<original_cnt<<"->"<<pg.getStateCount());
    }
    convertPath(pg, traj);

    return SUCCESS;
  }
Example #21
0
void Lingo::func_goto(Datum &frame, Datum &movie) {
	_vm->_playbackPaused = false;

	if (!_vm->getCurrentScore())
		return;

	if (movie.type != VOID) {
		movie.toString();

		Common::String movieFilename = convertPath(*movie.u.s);
		Common::String cleanedFilename;

		bool fileExists = false;

		if (_vm->getPlatform() == Common::kPlatformMacintosh) {
			Common::MacResManager resMan;

			for (const byte *p = (const byte *)movieFilename.c_str(); *p; p++)
				if (*p >= 0x20 && *p <= 0x7f)
					cleanedFilename += (char) *p;

			if (resMan.open(movieFilename)) {
				fileExists = true;
				cleanedFilename = movieFilename;
			} else if (!movieFilename.equals(cleanedFilename) && resMan.open(cleanedFilename)) {
				fileExists = true;
			}
		} else {
			Common::File file;
			cleanedFilename = movieFilename + ".MMM";

			if (file.open(movieFilename)) {
				fileExists = true;
				cleanedFilename = movieFilename;
			} else if (!movieFilename.equals(cleanedFilename) && file.open(cleanedFilename)) {
				fileExists = true;
			}
		}

		if (!fileExists) {
			warning("Movie %s does not exist", movieFilename.c_str());
			return;
		}

		_vm->_nextMovie.movie = cleanedFilename;
		_vm->getCurrentScore()->_stopPlay = true;

		_vm->_nextMovie.frameS.clear();
		_vm->_nextMovie.frameI = -1;

		if (frame.type == VOID)
			return;

		if (frame.type == STRING) {
			_vm->_nextMovie.frameS = *frame.u.s;
			return;
		}

		frame.toInt();

		_vm->_nextMovie.frameI = frame.u.i;

		return;
	}

	if (frame.type == VOID)
		return;

	_vm->_skipFrameAdvance = true;

	if (frame.type == STRING) {
		if (_vm->getCurrentScore())
			_vm->getCurrentScore()->setStartToLabel(*frame.u.s);
		return;
	}

	frame.toInt();

	if (_vm->getCurrentScore())
		_vm->getCurrentScore()->setCurrentFrame(frame.u.i);
}
int main(int argc, char **argv) {
	dongleHandle dongle;
	unsigned char in[260];
	unsigned char out[260];
	int result;
	int sw;
	int apduSize;		
	char address[100];
	int64_t amount;
	int64_t fees;
	unsigned int keyPath[10];
	int keyPathLength;
	int i;

	if (argc < 5) {
		fprintf(stderr, "Usage : %s [output address] [amount (in BTC string)] [fees (in BTC string)] [key path for change address in a/b/c format using n' for hardened nodes]\n", argv[0]);
		return 0;
	}
	address[sizeof(address) - 1] = '\0';
	strncpy(address, argv[1], sizeof(address) - 1);
	if (parseStringAmount(argv[2], &amount) < 0) {
		fprintf(stderr, "Invalid amount\n");
		return 0;
	}
	if (parseStringAmount(argv[3], &fees) < 0) {
		fprintf(stderr, "Invalid fees\n");
		return 0;
	}
	keyPathLength = convertPath(argv[4], keyPath);
	if (keyPathLength < 0) {
		fprintf(stderr, "Invalid key path\n");
		return 0;
	}
	initDongle();
	dongle = getFirstDongle();
	if (dongle == NULL) {
		fprintf(stderr, "No dongle found\n");
		return 0;
	}	
	apduSize = 0;
	in[apduSize++] = BTCHIP_CLA;
	in[apduSize++] = BTCHIP_INS_HASH_INPUT_FINALIZE;
	in[apduSize++] = 0x02;
	in[apduSize++] = 0x00;
	in[apduSize++] = 0x00;
	in[apduSize++] = strlen(address);	
	memcpy(in + apduSize, address, strlen(address));
	apduSize += strlen(address);
	writeHexAmountBE(amount, in + apduSize);
	apduSize += sizeof(amount);
	writeHexAmountBE(fees, in + apduSize);
	apduSize += sizeof(fees);
	in[apduSize++] = keyPathLength;
	for (i=0; i<keyPathLength; i++) {
		writeUint32BE(in + apduSize, keyPath[i]);
		apduSize += 4;
	}	
	in[OFFSET_CDATA] = (apduSize - 5);
	result = sendApduDongle(dongle, in, apduSize, out, sizeof(out), &sw);
	closeDongle(dongle);
	exitDongle();
	if (result < 0) {
		fprintf(stderr, "I/O error\n");
		return 0;
	}
	if (sw != SW_OK) {
		fprintf(stderr, "Dongle application error : %.4x\n", sw);
		return 0;
	}	
	apduSize = 0;
	printf("Output data : ");
	displayBinary(out + 1, out[0]);
	apduSize = 1 + out[0];
	if (out[apduSize] == 0x00) {
		printf("Input finalized, proceed with signing\n");
	}
	else
	if (out[apduSize] == 0x01) {
		printf("Input finalized, please powercycle to get the second factor then proceed with signing\n");
	}
	else {
		fprintf(stderr, "Invalid transaction state %.2x\n", out[apduSize]);
		return 0;
	}	
	return 1;
}
 void init(const std::string& initPath) {
     path = convertPath(initPath);
     startupPath = convertPath(initPath);
 }
Example #24
0
//main main main
int main(int argc, char *argv[])
{
	if(argc != 2)
	{
		printf("Usage: screenshot mapfile.map\n");
		exit(0);
	}

    /* This must occur before any data files are loaded */
    Initialize_Paths();

	printf("-------------------------------------------------------------------------------\n");
	printf(" %s\n", MAPTITLESTRING);
	printf("-------------------------------------------------------------------------------\n");
	printf("\n---------------- startup ----------------\n");

	gfx_init(640, 480, false);
	blitdest = screen;

	spr_warps[0].init(convertPath("gfx/leveleditor/leveleditor_warp.png"), 255, 0, 255);
	spr_warps[1].init(convertPath("gfx/leveleditor/leveleditor_warp_preview.png"), 255, 0, 255);
	spr_warps[2].init(convertPath("gfx/leveleditor/leveleditor_warp_thumbnail.png"), 255, 0, 255);

	spr_platformarrows[0].init(convertPath("gfx/leveleditor/leveleditor_platform_arrows.png"), 255, 0, 255, 128);
	spr_platformarrows[1].init(convertPath("gfx/leveleditor/leveleditor_platform_arrows_preview.png"), 255, 0, 255, 128);
	spr_platformarrows[2].init(convertPath("gfx/leveleditor/leveleditor_platform_arrows_thumbnail.png"), 255, 0, 255, 128);

	printf("\n---------------- load map ----------------\n");

	std::string tileSetPNG[3];
	tileSetPNG[0] = convertPath("gfx/packs/Classic/tileset.png");
	tileSetPNG[1] = convertPath("gfx/packs/Classic/tileset_medium.png");
	tileSetPNG[2] = convertPath("gfx/packs/Classic/tileset_small.png");
	g_map.loadTileSet(convertPath("maps/tileset.tls"), tileSetPNG);
	
	//Setup Platforms
	for(short iPlatform = 0; iPlatform < MAX_PLATFORMS; iPlatform++)
	{
		g_Platforms[iPlatform].rIcon[0].x = (iPlatform % 6) * 32;
		g_Platforms[iPlatform].rIcon[0].y = (iPlatform / 6) * 32 + 224;
		g_Platforms[iPlatform].rIcon[0].w = 32;
		g_Platforms[iPlatform].rIcon[0].h = 32;

		g_Platforms[iPlatform].rIcon[1].x = (iPlatform % 4) * 42 + 240;
		g_Platforms[iPlatform].rIcon[1].y = (iPlatform / 4) * 42 + 174;
		g_Platforms[iPlatform].rIcon[1].w = 32;
		g_Platforms[iPlatform].rIcon[1].h = 32;

		for(short iCol = 0; iCol < MAPWIDTH; iCol++)
		{
			for(short iRow = 0; iRow < MAPHEIGHT; iRow++)
			{
				g_Platforms[iPlatform].tiles[iCol][iRow] = TILESETSIZE;
			}
		}

		g_Platforms[iPlatform].iVelocity = 4;
	}

	szMapName = argv[1];
	loadmap(szMapName);
	takescreenshot();

	return 0;
}
Example #25
0
void CResourceManager::LoadAllSprites() {
    const char * graphicspack = menugraphicspacklist->current_name();

    //Just load menu skins for now (just standing right sprite)
    for (short k = 0; k < MAX_PLAYERS; k++) {
        //LoadMenuSkin(k, game_values.skinids[k], game_values.colorids[k], false);
        LoadFullSkin(spr_shyguy[k], convertPath("gfx/packs/modeskins/shyguy.bmp", graphicspack), k);
        LoadFullSkin(spr_chocobo[k], convertPath("gfx/packs/modeskins/chicken.bmp", graphicspack), k);
        LoadFullSkin(spr_bobomb[k], convertPath("gfx/packs/modeskins/bobomb.bmp", graphicspack), k);
    }

    gfx_loadimage(&menu_survival, convertPath("gfx/packs/modeobjects/menu_survival.png", graphicspack), false);
    gfx_loadimage(&menu_stomp, convertPath("gfx/packs/modeobjects/menu_stomp.png", graphicspack), false);
    gfx_loadimage(&menu_egg, convertPath("gfx/packs/modeobjects/menu_egg.png", graphicspack), false);

    gfx_loadimage(&spr_clouds, convertPath("gfx/packs/eyecandy/cloud.png", graphicspack), 255, true, true);
    gfx_loadimage(&spr_ghosts, convertPath("gfx/packs/eyecandy/ghost.png", graphicspack), 128, true, true);
    gfx_loadimage(&spr_fish, convertPath("gfx/packs/eyecandy/fish.png", graphicspack), 128, true, true);
    gfx_loadimage(&spr_leaves, convertPath("gfx/packs/eyecandy/leaves.png", graphicspack), true);
    gfx_loadimage(&spr_snow, convertPath("gfx/packs/eyecandy/snow.png", graphicspack), true);
    gfx_loadimage(&spr_rain, convertPath("gfx/packs/eyecandy/rain.png", graphicspack), true);

    gfx_loadimage(&spr_noteblock, convertPath("gfx/packs/blocks/noteblock.png", graphicspack), false);
    gfx_loadimage(&spr_breakableblock, convertPath("gfx/packs/blocks/breakableblock.png", graphicspack), false);
    gfx_loadimage(&spr_powerupblock, convertPath("gfx/packs/blocks/powerupblock.png", graphicspack), false);
    gfx_loadimage(&spr_donutblock, convertPath("gfx/packs/blocks/donutblock.png", graphicspack), false);
    gfx_loadimage(&spr_flipblock, convertPath("gfx/packs/blocks/flipblock.png", graphicspack), false);
    gfx_loadimage(&spr_bounceblock, convertPath("gfx/packs/blocks/bounceblock.png", graphicspack), false);
    gfx_loadimage(&spr_throwblock, convertPath("gfx/packs/blocks/throwblock.png", graphicspack), false);
    gfx_loadimage(&spr_switchblocks, convertPath("gfx/packs/blocks/switchblock.png", graphicspack), false);
    gfx_loadimage(&spr_viewblock, convertPath("gfx/packs/blocks/viewblock.png", graphicspack), false);
    gfx_loadimage(&spr_weaponbreakableblock, convertPath("gfx/packs/blocks/weaponbreakableblock.png", graphicspack), false);

    gfx_loadimage(&spr_spring, convertPath("gfx/packs/powerups/spring.png", graphicspack), true);
    gfx_loadimage(&spr_spike, convertPath("gfx/packs/powerups/spike.png", graphicspack), true);
    gfx_loadimage(&spr_kuriboshoe, convertPath("gfx/packs/powerups/kuriboshoe.png", graphicspack), true);
    gfx_loadimage(&spr_throwbox, convertPath("gfx/packs/powerups/throwbox.png", graphicspack), true);

    gfx_loadimage(&spr_tileanimation[0], convertPath("gfx/packs/tilesets/tile_animation.png", graphicspack), false);
    gfx_loadimage(&spr_tileanimation[1], convertPath("gfx/packs/tilesets/tile_animation_preview.png", graphicspack), false);
    gfx_loadimage(&spr_tileanimation[2], convertPath("gfx/packs/tilesets/tile_animation_thumbnail.png", graphicspack), false);

    gfx_loadimage(&spr_blocks[0], convertPath("gfx/packs/tilesets/blocks.png", graphicspack), false);
    gfx_loadimage(&spr_blocks[1], convertPath("gfx/packs/tilesets/blocks_preview.png", graphicspack), false);
    gfx_loadimage(&spr_blocks[2], convertPath("gfx/packs/tilesets/blocks_thumbnail.png", graphicspack), false);

    gfx_loadimage(&spr_unknowntile[0], convertPath("gfx/packs/tilesets/unknown_tile.png", graphicspack), false);
    gfx_loadimage(&spr_unknowntile[1], convertPath("gfx/packs/tilesets/unknown_tile_preview.png", graphicspack), false);
    gfx_loadimage(&spr_unknowntile[2], convertPath("gfx/packs/tilesets/unknown_tile_thumbnail.png", graphicspack), false);

    gfx_loadimage(&spr_brokenyellowblock, convertPath("gfx/packs/eyecandy/brokenyellowblock.png", graphicspack), true);
    gfx_loadimage(&spr_brokenflipblock, convertPath("gfx/packs/eyecandy/brokenflipblock.png", graphicspack), true);
    gfx_loadimage(&spr_brokenblueblock, convertPath("gfx/packs/eyecandy/brokenblueblock.png", graphicspack), true);
    gfx_loadimage(&spr_brokengrayblock, convertPath("gfx/packs/eyecandy/brokengrayblock.png", graphicspack), true);

    gfx_loadimage(&spr_brokeniceblock, convertPath("gfx/packs/eyecandy/icecube.png", graphicspack), true);
    gfx_loadimage(&spr_iceblock, convertPath("gfx/packs/eyecandy/iceblock.png", graphicspack), true);

    gfx_loadimage(&spr_tanooki, convertPath("gfx/packs/powerups/tanooki.png", graphicspack), true);
    gfx_loadimage(&spr_statue, convertPath("gfx/packs/projectiles/statue.png", graphicspack), true);
    gfx_loadimage(&spr_starpowerup, convertPath("gfx/packs/powerups/starpowerup.png", graphicspack), true);
    gfx_loadimage(&spr_1uppowerup, convertPath("gfx/packs/powerups/1uppowerup.png", graphicspack), true);
    gfx_loadimage(&spr_2uppowerup, convertPath("gfx/packs/powerups/2uppowerup.png", graphicspack), true);
    gfx_loadimage(&spr_3uppowerup, convertPath("gfx/packs/powerups/3uppowerup.png", graphicspack), true);
    gfx_loadimage(&spr_5uppowerup, convertPath("gfx/packs/powerups/5uppowerup.png", graphicspack), true);
    gfx_loadimage(&spr_firepowerup, convertPath("gfx/packs/powerups/fireflower.png", graphicspack), true);
    gfx_loadimage(&spr_hammerpowerup, convertPath("gfx/packs/powerups/hammerpowerup.png", graphicspack), true);
    gfx_loadimage(&spr_icewandpowerup, convertPath("gfx/packs/powerups/icewandpowerup.png", graphicspack), true);
    gfx_loadimage(&spr_podobopowerup, convertPath("gfx/packs/powerups/podobopowerup.png", graphicspack), true);
    gfx_loadimage(&spr_poisonpowerup, convertPath("gfx/packs/powerups/poisonpowerup.png", graphicspack), true);
    gfx_loadimage(&spr_mysterymushroompowerup, convertPath("gfx/packs/powerups/mysterymushroom.png", graphicspack), true);
    gfx_loadimage(&spr_boomerangpowerup, convertPath("gfx/packs/powerups/boomerangpowerup.png", graphicspack), true);
    gfx_loadimage(&spr_clockpowerup, convertPath("gfx/packs/powerups/clockpowerup.png", graphicspack), true);
    gfx_loadimage(&spr_bobombpowerup, convertPath("gfx/packs/powerups/bobombpowerup.png", graphicspack), true);
    gfx_loadimage(&spr_powpowerup, convertPath("gfx/packs/powerups/powpowerup.png", graphicspack), true);
    gfx_loadimage(&spr_modpowerup, convertPath("gfx/packs/powerups/modpowerup.png", graphicspack), true);
    gfx_loadimage(&spr_bulletbillpowerup, convertPath("gfx/packs/powerups/bulletbillpowerup.png", graphicspack), true);
    gfx_loadimage(&spr_featherpowerup, convertPath("gfx/packs/powerups/featherpowerup.png", graphicspack), true);
    gfx_loadimage(&spr_leafpowerup, convertPath("gfx/packs/powerups/leafpowerup.png", graphicspack), true);
    gfx_loadimage(&spr_bombpowerup, convertPath("gfx/packs/powerups/bombpowerup.png", graphicspack), true);
    gfx_loadimage(&spr_pwingspowerup, convertPath("gfx/packs/powerups/pwings.png", graphicspack), true);

    gfx_loadimage(&spr_extraheartpowerup, convertPath("gfx/packs/powerups/heartpowerup.png", graphicspack), true);
    gfx_loadimage(&spr_extratimepowerup, convertPath("gfx/packs/powerups/extratimepowerup.png", graphicspack), true);
    gfx_loadimage(&spr_jailkeypowerup, convertPath("gfx/packs/powerups/jailkeypowerup.png", graphicspack), true);

    gfx_loadimage(&spr_secret1, convertPath("gfx/packs/powerups/secret1.png", graphicspack), true);
    gfx_loadimage(&spr_secret2, convertPath("gfx/packs/powerups/secret2.png", graphicspack), true);
    gfx_loadimage(&spr_secret3, convertPath("gfx/packs/powerups/secret3.png", graphicspack), true);
    gfx_loadimage(&spr_secret4, convertPath("gfx/packs/powerups/secret4.png", graphicspack), true);

    gfx_loadimage(&spr_shade[0], convertPath("gfx/packs/eyecandy/shade1.png", graphicspack), 64, false, true);
    gfx_loadimage(&spr_shade[1], convertPath("gfx/packs/eyecandy/shade2.png", graphicspack), 64, false, true);
    gfx_loadimage(&spr_shade[2], convertPath("gfx/packs/eyecandy/shade3.png", graphicspack), 64, false, true);
    gfx_loadimage(&spr_scorehearts, convertPath("gfx/packs/menu/score_hearts.png", graphicspack), false);
    gfx_loadimage(&spr_scorecards, convertPath("gfx/packs/menu/score_cards.png", graphicspack), false);
    gfx_loadimage(&spr_scorecoins, convertPath("gfx/packs/menu/score_coins.png", graphicspack), false);

    gfx_loadimage(&spr_timershade, convertPath("gfx/packs/eyecandy/timershade.png", graphicspack), 64, false, true);
    gfx_loadimage(&spr_scoretext, convertPath("gfx/packs/fonts/score.png", graphicspack), false);
    gfx_loadimage(&spr_racetext, convertPath("gfx/packs/fonts/race.png", graphicspack), false);

    gfx_loadimage(&spr_crown, convertPath("gfx/packs/eyecandy/crown.png", graphicspack), true);
    gfx_loadimage(&spr_cape, convertPath("gfx/packs/eyecandy/cape.png", graphicspack), true);
    gfx_loadimage(&spr_tail, convertPath("gfx/packs/eyecandy/tail.png", graphicspack), true);
    gfx_loadimage(&spr_wings, convertPath("gfx/packs/eyecandy/wings.png", graphicspack), true);

    gfx_loadimage(&spr_warplock, convertPath("gfx/packs/eyecandy/warplock.png", graphicspack), false);
    gfx_loadimage(&spr_coinsparkle, convertPath("gfx/packs/eyecandy/coinsparks.png", graphicspack), true);
    gfx_loadimage(&spr_shinesparkle, convertPath("gfx/packs/eyecandy/shinesparks.png", graphicspack), true);
    gfx_loadimage(&spr_shellbounce, convertPath("gfx/packs/eyecandy/shellbounce.png", graphicspack), true);
    gfx_loadimage(&spr_superstomp, convertPath("gfx/packs/eyecandy/supersmash.png", graphicspack), true);

    gfx_loadimage(&spr_egg, convertPath("gfx/packs/modeobjects/egg.png", graphicspack), true);
    gfx_loadimage(&spr_eggnumbers, convertPath("gfx/packs/modeobjects/eggnumbers.png", graphicspack), true);
    gfx_loadimage(&spr_star, convertPath("gfx/packs/modeobjects/star.png", graphicspack), true);
    gfx_loadimage(&spr_flags, convertPath("gfx/packs/modeobjects/flags.png", graphicspack), true);
    gfx_loadimage(&spr_frenzycards, convertPath("gfx/packs/modeobjects/frenzycards.png", graphicspack), true);
    gfx_loadimage(&spr_collectcards, convertPath("gfx/packs/modeobjects/collectcards.png", graphicspack), true);

    gfx_loadimage(&spr_yoshi, convertPath("gfx/packs/modeobjects/yoshi.png", graphicspack), true);
    gfx_loadimage(&spr_coin, convertPath("gfx/packs/modeobjects/coin.png", graphicspack), true);
    gfx_loadimage(&spr_thwomp, convertPath("gfx/packs/modeobjects/thwomp.png", graphicspack), true);
    gfx_loadimage(&spr_podobo, convertPath("gfx/packs/modeobjects/podobo.png", graphicspack), false);
    gfx_loadimage(&spr_bowserfire, convertPath("gfx/packs/modeobjects/bowserfire.png", graphicspack), false);
    gfx_loadimage(&spr_areas, convertPath("gfx/packs/modeobjects/areas.png", graphicspack), false);
    gfx_loadimage(&spr_kingofthehillarea, convertPath("gfx/packs/modeobjects/kingofthehill.png", graphicspack), 128, false, true);
    gfx_loadimage(&spr_jail, convertPath("gfx/packs/modeobjects/jail.png", graphicspack), 160, true, true);
    gfx_loadimage(&spr_goomba, convertPath("gfx/packs/modeobjects/goomba.png", graphicspack), true);
    gfx_loadimage(&spr_goombadead, convertPath("gfx/packs/eyecandy/goombadead.png", graphicspack), true);
    gfx_loadimage(&spr_goombadeadflying, convertPath("gfx/packs/eyecandy/goombadeadflying.png", graphicspack), true);
    gfx_loadimage(&spr_koopa, convertPath("gfx/packs/modeobjects/koopa.png", graphicspack), true);
    gfx_loadimage(&spr_buzzybeetle, convertPath("gfx/packs/modeobjects/buzzybeetle.png", graphicspack), true);
    gfx_loadimage(&spr_spiny, convertPath("gfx/packs/modeobjects/spiny.png", graphicspack), true);
    gfx_loadimage(&spr_paragoomba, convertPath("gfx/packs/modeobjects/paragoomba.png", graphicspack), true);
    gfx_loadimage(&spr_parakoopa, convertPath("gfx/packs/modeobjects/parakoopa.png", graphicspack), true);
    gfx_loadimage(&spr_redparakoopa, convertPath("gfx/packs/modeobjects/redparakoopa.png", graphicspack), true);
    gfx_loadimage(&spr_redkoopa, convertPath("gfx/packs/modeobjects/redkoopa.png", graphicspack), true);
    gfx_loadimage(&spr_cheepcheep, convertPath("gfx/packs/modeobjects/cheepcheep.png", graphicspack), true);
    gfx_loadimage(&spr_cheepcheepdead, convertPath("gfx/packs/eyecandy/cheepcheepdead.png", graphicspack), true);

    gfx_loadimage(&spr_sledgebrothers, convertPath("gfx/packs/modeobjects/sledgebrothers.png", graphicspack), true);
    gfx_loadimage(&spr_sledgebrothersdead, convertPath("gfx/packs/eyecandy/sledgebrothersdead.png", graphicspack), true);

    gfx_loadimage(&spr_bulletbill, convertPath("gfx/packs/projectiles/bulletbill.png", graphicspack), false);
    gfx_loadimage(&spr_bulletbilldead, convertPath("gfx/packs/eyecandy/bulletbilldead.png", graphicspack), false);
    gfx_loadimage(&spr_chicken, convertPath("gfx/packs/modeobjects/chicken.png", graphicspack), 160, true, true);
    gfx_loadimage(&spr_racegoal, convertPath("gfx/packs/modeobjects/racegoal.png", graphicspack), false);
    gfx_loadimage(&spr_pipegamebonus, convertPath("gfx/packs/modeobjects/pipeminigamebonuses.png", graphicspack), true);

    gfx_loadimage(&spr_phanto, convertPath("gfx/packs/modeobjects/phanto.png", graphicspack), true);
    gfx_loadimage(&spr_phantokey, convertPath("gfx/packs/modeobjects/key.png", graphicspack), true);

    gfx_loadimage(&spr_bonuschest, convertPath("gfx/packs/modeobjects/bonuschest.png", graphicspack), true);
    gfx_loadimage(&spr_teleportstar, convertPath("gfx/packs/eyecandy/teleportstar.png", graphicspack), false);

    gfx_loadimage(&spr_fireball, convertPath("gfx/packs/projectiles/fireball.png", graphicspack), true);
    gfx_loadimage(&spr_hammer, convertPath("gfx/packs/projectiles/hammer.png", graphicspack), true);
    gfx_loadimage(&spr_iceblast, convertPath("gfx/packs/projectiles/wandblast.png", graphicspack), true);
    gfx_loadimage(&spr_boomerang, convertPath("gfx/packs/projectiles/boomerang.png", graphicspack), true);
    gfx_loadimage(&spr_shell, convertPath("gfx/packs/projectiles/shell.png", graphicspack), true);
    gfx_loadimage(&spr_shelldead, convertPath("gfx/packs/eyecandy/shelldead.png", graphicspack), true);
    gfx_loadimage(&spr_blueblock, convertPath("gfx/packs/projectiles/throwblock.png", graphicspack), true);
    gfx_loadimage(&spr_bomb, convertPath("gfx/packs/projectiles/bomb.png", graphicspack), true);

    gfx_loadimage(&spr_superfireball, convertPath("gfx/packs/modeobjects/superfire.png", graphicspack), true);
    gfx_loadimage(&spr_sledgehammer, convertPath("gfx/packs/modeobjects/sledgehammer.png", graphicspack), true);

    gfx_loadimage(&spr_hazard_fireball[0], convertPath("gfx/packs/hazards/fireball.png", graphicspack), true);
    gfx_loadimage(&spr_hazard_fireball[1], convertPath("gfx/packs/hazards/fireball_preview.png", graphicspack), true);
    gfx_loadimage(&spr_hazard_fireball[2], convertPath("gfx/packs/hazards/fireball_thumbnail.png", graphicspack), true);

    gfx_loadimage(&spr_hazard_rotodisc[0], convertPath("gfx/packs/hazards/rotodisc.png", graphicspack), true);
    gfx_loadimage(&spr_hazard_rotodisc[1], convertPath("gfx/packs/hazards/rotodisc_preview.png", graphicspack), true);
    gfx_loadimage(&spr_hazard_rotodisc[2], convertPath("gfx/packs/hazards/rotodisc_thumbnail.png", graphicspack), true);

    gfx_loadimage(&spr_hazard_bulletbill[0], convertPath("gfx/packs/hazards/bulletbill.png", graphicspack), false);
    gfx_loadimage(&spr_hazard_bulletbill[1], convertPath("gfx/packs/hazards/bulletbill_preview.png", graphicspack), false);
    gfx_loadimage(&spr_hazard_bulletbill[2], convertPath("gfx/packs/hazards/bulletbill_thumbnail.png", graphicspack), false);

    gfx_loadimage(&spr_hazard_flame[0], convertPath("gfx/packs/hazards/flame.png", graphicspack), true);
    gfx_loadimage(&spr_hazard_flame[1], convertPath("gfx/packs/hazards/flame_preview.png", graphicspack), true);
    gfx_loadimage(&spr_hazard_flame[2], convertPath("gfx/packs/hazards/flame_thumbnail.png", graphicspack), true);

    gfx_loadimage(&spr_hazard_pirhanaplant[0], convertPath("gfx/packs/hazards/pirhanaplant.png", graphicspack), true);
    gfx_loadimage(&spr_hazard_pirhanaplant[1], convertPath("gfx/packs/hazards/pirhanaplant_preview.png", graphicspack), true);
    gfx_loadimage(&spr_hazard_pirhanaplant[2], convertPath("gfx/packs/hazards/pirhanaplant_thumbnail.png", graphicspack), true);

    gfx_loadimage(&spr_hazard_bulletbilldead, convertPath("gfx/packs/hazards/bulletbilldead.png", graphicspack), false);

    gfx_loadimage(&spr_fireballexplosion, convertPath("gfx/packs/eyecandy/fireballexplosion.png", graphicspack), 160, true, true);
    gfx_loadimage(&spr_frictionsmoke, convertPath("gfx/packs/eyecandy/frictionsmoke.png", graphicspack), 160, true, true);
    gfx_loadimage(&spr_bobombsmoke, convertPath("gfx/packs/eyecandy/bobombsmoke.png", graphicspack), 160, true, true);
    gfx_loadimage(&spr_explosion, convertPath("gfx/packs/eyecandy/explosion.png", graphicspack), true);
    gfx_loadimage(&spr_burnup, convertPath("gfx/packs/eyecandy/burnup.png", graphicspack), 192, true, true);
    gfx_loadimage(&spr_fireworks, convertPath("gfx/packs/eyecandy/fireworks.png", graphicspack), true);
    gfx_loadimage(&spr_poof, convertPath("gfx/packs/eyecandy/poof.png", graphicspack), true);

    gfx_loadimage(&spr_spawnsmoke, convertPath("gfx/packs/eyecandy/spawnsmoke.png", graphicspack), 128, true, true);
    gfx_loadimage(&spr_spawndoor, convertPath("gfx/packs/eyecandy/spawndoor.png", graphicspack), true);

    gfx_loadimage(&spr_bonus, convertPath("gfx/packs/eyecandy/bonus.png", graphicspack), true);
    gfx_loadimage(&spr_extralife, convertPath("gfx/packs/eyecandy/extralife.png", graphicspack), true);

    gfx_loadimage(&spr_windmeter, convertPath("gfx/packs/eyecandy/wind_meter.png", graphicspack), 192, true, true);
    gfx_loadimage(&spr_overlayhole, convertPath("gfx/packs/eyecandy/overlayholes.png", graphicspack), 0, 255, 0, true, true);

    gfx_loadimage(&spr_award, convertPath("gfx/packs/awards/killsinrow.png", graphicspack), 128, true, true);
    gfx_loadimage(&spr_awardsolid, convertPath("gfx/packs/awards/killsinrow.png", graphicspack), true);
    gfx_loadimage(&spr_awardsouls, convertPath("gfx/packs/awards/souls.png", graphicspack), true);
    gfx_loadimage(&spr_awardsoulspawn, convertPath("gfx/packs/awards/soulspawn.png", graphicspack), true);

    gfx_loadimage(&spr_awardkillsinrow, convertPath("gfx/packs/awards/killsinrownumbers.png", graphicspack), true);

    //gfx_loadteamcoloredimage(&spr_flagbases, convertPath("gfx/packs/modeobjects/flagbases.png", graphicspack), 255, 0, 255, 160, false, false);
    gfx_loadimage(&spr_flagbases, convertPath("gfx/packs/modeobjects/flagbases.png", graphicspack), 160, true, true);
    gfx_loadimage(&spr_ownedtags, convertPath("gfx/packs/modeobjects/ownedtags.png", graphicspack), 160, true, true);

    gfx_loadimage(&spr_storedpowerupsmall, convertPath("gfx/packs/powerups/small.png", graphicspack), true);
    gfx_loadimage(&spr_storedpoweruplarge, convertPath("gfx/packs/powerups/large.png", graphicspack), false);
    gfx_loadimage(&spr_powerupselector, convertPath("gfx/packs/awards/award.png", graphicspack), false);

    gfx_loadimage(&spr_abovearrows, convertPath("gfx/packs/eyecandy/abovearrows.png", graphicspack), true);
}