Ejemplo n.º 1
0
	void initFontReader(MAHandle file) {
		sData = new unsigned char[BUFFER_SIZE];
		if(!sData) maPanic(0, "Not enough memory for initialization of MAUI::Font");
		sFile = file;
		sFileSize = maGetDataSize(sFile);
		sBufPos = sFilePos = 0;
		readMoreData();
	}
Ejemplo n.º 2
0
	unsigned char readByte() {
		unsigned char b;
		if(sBufPos>=BUFFER_SIZE) readMoreData();
		b = sData[sBufPos];
		sFilePos++;
		sBufPos++;
		return b;
	}
Ejemplo n.º 3
0
	unsigned int readInt() {
		unsigned int ret = 0;
		if(sBufPos+3>=BUFFER_SIZE) readMoreData();
		for(int i = 0; i < 4; i++) {
			unsigned char b;
			b = sData[sBufPos+i];
			ret |= ((unsigned int)b)<<(i<<3);
		}
		sFilePos+=4;
		sBufPos+=4;
		return ret;
	}
Ejemplo n.º 4
0
	unsigned short readShort() {
		unsigned short ret = 0;
		if(sBufPos+1>=BUFFER_SIZE) readMoreData();

		/*
		if(sBufPos==43) {
			int a = 2;
		}
		*/

		for(int i = 0; i < 2; i++) {
			unsigned char b;
			b = sData[sBufPos+i];
			ret |= ((unsigned short)b)<<(i<<3);
		}
		sFilePos+=2;
		sBufPos+=2;
		return ret;
	}
Ejemplo n.º 5
0
	unsigned short readShort() {
		unsigned short ret = 0;
		if(sBufPos+1>=BUFFER_SIZE) {
			readMoreData();
		}

		// TODO: Document why commented out or delete.
		/*
		if(sBufPos==43) {
			int a = 2;
		}
		*/

		for(int i = 0; i < 2; i++) {
			unsigned char b;
			b = sData[sBufPos+i];
			ret |= ((unsigned short)b)<<(i<<3);
		}
		sFilePos+=2;
		sBufPos+=2;
		return ret;
	}