Exemplo n.º 1
0
EXPORT(sqInt) primitiveGetRendererColorMasks(void) {
    sqInt arrayOop;
    sqInt i;
    sqInt handle;
    int masks[4];
    sqInt result;
    sqInt array;

	if (!((interpreterProxy->methodArgumentCount()) == 2)) {
		return interpreterProxy->primitiveFail();
	}
	array = interpreterProxy->stackObjectValue(0);
	handle = interpreterProxy->stackIntegerValue(1);
	if (interpreterProxy->failed()) {
		return null;
	}
	if (!((interpreterProxy->fetchClassOf(array)) == (interpreterProxy->classArray()))) {
		return interpreterProxy->primitiveFail();
	}
	if (!((interpreterProxy->slotSizeOf(array)) == 4)) {
		return interpreterProxy->primitiveFail();
	}
	result = b3dxGetRendererColorMasks(handle, masks);
	if (!(result)) {
		return interpreterProxy->primitiveFail();
	}
	arrayOop = array;
	for (i = 0; i <= 3; i += 1) {
		interpreterProxy->pushRemappableOop(arrayOop);
		result = interpreterProxy->positive32BitIntegerFor(masks[i]);
		arrayOop = interpreterProxy->popRemappableOop();
		interpreterProxy->storePointerofObjectwithValue(i, arrayOop, result);
	}
	return interpreterProxy->pop(2);
}
primitiveGetRendererColorMasks(void)
{
	// B3DAcceleratorPlugin>>#primitiveGetRendererColorMasks
    sqInt array;
    sqInt arrayOop;
    sqInt handle;
    sqInt i;
    int masks[4];
    sqInt result;

	if (!((methodArgumentCount()) == 2)) {
		return primitiveFail();
	}
	array = stackObjectValue(0);
	handle = stackIntegerValue(1);
	if (failed()) {
		return null;
	}
	if (!((fetchClassOf(array)) == (classArray()))) {
		return primitiveFail();
	}
	if (!((slotSizeOf(array)) == 4)) {
		return primitiveFail();
	}
	result = b3dxGetRendererColorMasks(handle, masks);
	if (!result) {
return primitiveFail();
	}
	arrayOop = array;
	for (i = 0; i <= 3; i += 1) {
pushRemappableOop(arrayOop);
		result = positive32BitIntegerFor(masks[i]);
		arrayOop = popRemappableOop();
		storePointerofObjectwithValue(i, arrayOop, result);
	}
	return pop(2);
}