test worked
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package com.replaymod.render.frame;
|
||||
|
||||
import com.replaymod.render.rendering.Frame;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
|
||||
public class RealLensOpenGlFrame implements Frame {
|
||||
|
||||
private final OpenGlFrame[] frames;
|
||||
|
||||
public RealLensOpenGlFrame(OpenGlFrame[] frames) {
|
||||
Validate.notNull(frames, "frames");
|
||||
Validate.isTrue(frames.length > 0, "frames must not be empty");
|
||||
|
||||
int frameId = frames[0].getFrameId();
|
||||
int remaining = frames[0].getByteBuffer().remaining();
|
||||
|
||||
for (OpenGlFrame frame : frames) {
|
||||
Validate.isTrue(
|
||||
frame.getFrameId() == frameId,
|
||||
"Frame ids do not match."
|
||||
);
|
||||
Validate.isTrue(
|
||||
frame.getByteBuffer().remaining() == remaining,
|
||||
"Buffer sizes do not match."
|
||||
);
|
||||
}
|
||||
|
||||
this.frames = frames;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFrameId() {
|
||||
return frames[0].getFrameId();
|
||||
}
|
||||
|
||||
public OpenGlFrame[] getFrames() {
|
||||
return frames;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user