src/misc.cpp

Wed, 17 Jul 2013 19:44:46 +0300

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Wed, 17 Jul 2013 19:44:46 +0300
changeset 8
e8f645d9f28f
parent 6
67b6ef6917ba
child 10
bc1414343e19
permissions
-rw-r--r--

Added a prompt for demo information

#include "misc.h"

uint32 makeByteID( uint8 a, uint8 b, uint8 c, uint8 d ) {
	return a | ( b << 8 ) | ( c << 16 ) | ( d << 24 );
}

// =============================================================================
// -----------------------------------------------------------------------------
str binaryConfigName( str ver ) {
	return fmt( "binaries/%1", ver );
}

// =============================================================================
// -----------------------------------------------------------------------------
str basename( str path ) {
	long lastpos = path.lastIndexOf( "/" );
	
	if( lastpos != -1 )
		return path.mid( lastpos + 1 );
	
	return path;
}

mercurial