1
0
mirror of https://github.com/thes3m/XNI synced 2024-12-26 13:26:06 +01:00
XNI/Classes/Retronator/Xni/Framework/Content/BasicEffectReader.m
Matej Jan 49293a9610 View scaling fixes to support iOS before 4.0.
Adding Game Center classes skeletons.

git-svn-id: http://xni.googlecode.com/svn/XNI@62 ac433895-eea3-a490-d80a-17149a75e588
2011-03-29 15:00:49 +00:00

34 lines
1.1 KiB
Objective-C

//
// BasicEffectReader.m
// XNI
//
// Created by Matej Jan on 23.11.10.
// Copyright 2010 Retronator. All rights reserved.
//
#import "BasicEffectReader.h"
#import "Retronator.Xni.Framework.Content.h"
#import "Retronator.Xni.Framework.Graphics.h"
#import "Retronator.Xni.Framework.Content.Pipeline.Graphics.h"
@implementation BasicEffectReader
- (id) readFromInput:(ContentReader *)input into:(id)existingInstance {
BasicMaterialContent *content = input.content;
GraphicsDevice *graphicsDevice = [[input.contentManager.serviceProvider getServiceOfType:@protocol(IGraphicsDeviceService)] graphicsDevice];
BasicEffect *effect = [[[BasicEffect alloc] initWithGraphicsDevice:graphicsDevice] autorelease];
effect.alpha = [content.alpha floatValue];
effect.diffuseColor = content.diffuseColor;
effect.specularPower = [content.specularPower floatValue];
effect.specularColor = content.specularColor;
effect.emissiveColor = content.emissiveColor;
effect.texture = [input readSharedResourceFrom:content.texture];
effect.textureEnabled = effect.texture != nil;
return effect;
}
@end