// Path: src/main/java/yk/senjin/DDDUtils.java
// public static void glMultMatrix4(Matrix4 m) {
//     m.store(multMatrixTemp);
//     multMatrixTemp.rewind();
//     GL11.glMultMatrix(multMatrixTemp);
// }
// 
// Path: src/main/java/yk/senjin/DDDUtils.java
// public static void glVec3f(Vec3f v) {
//     GL11.glVertex3f(v.x, v.y, v.z);
// }


import yk.jcommon.collections.YList;
import yk.jcommon.fastgeom.Quaternionf;
import yk.jcommon.fastgeom.Vec3f;
import java.awt.image.BufferedImage;
import static org.lwjgl.opengl.GL11.*;
import static yk.jcommon.collections.YArrayList.al;
import static yk.senjin.DDDUtils.glMultMatrix4;
import static yk.senjin.DDDUtils.glVec3f;
        st2.add(new SomeTexture(getSubImage(images, 1, 1)));
        st2.add(new SomeTexture(getSubImage(images, 2, 1)));
        st2.add(new SomeTexture(getSubImage(images, 3, 1)));
        st2.add(new SomeTexture(getSubImage(images, 1, 0)));
        st2.add(new SomeTexture(getSubImage(images, 1, 2)));
    }

    public void firstFrame3(YList<BufferedImage> images) {
        st2 = al();
        for (BufferedImage img : images) st2.add(new SomeTexture(img));
    }

    private BufferedImage getSubImage(BufferedImage images, int px, int py) {
        int w = images.getWidth() / 4;
        int h = images.getHeight() / 3;
        BufferedImage im0 = new BufferedImage(w, h, BufferedImage.TYPE_3BYTE_BGR);
        im0.getGraphics().drawImage(images, 0, 0, w, h, w * px, h * py, w * (px + 1), h * (py + 1), null);
        return im0;
    }

    public void render(Vec3f camPos) {
        if (st != null) render1(camPos);
        else render2(camPos);
    }

    private void renderQuad(SomeTexture st, Vec3f pos, Vec3f vx, Vec3f vy) {
        if (enableTexture) st.enable(0);

        glBegin(GL_QUADS);
        glColor3f(1, 1, 1);
// Path: src/main/java/yk/senjin/DDDUtils.java
// public static void glMultMatrix4(Matrix4 m) {
//     m.store(multMatrixTemp);
//     multMatrixTemp.rewind();
//     GL11.glMultMatrix(multMatrixTemp);
// }
// 
// Path: src/main/java/yk/senjin/DDDUtils.java
// public static void glVec3f(Vec3f v) {
//     GL11.glVertex3f(v.x, v.y, v.z);
// }


// Path: src/main/java/yk/senjin/SkyBox.java
import yk.jcommon.collections.YList;
import yk.jcommon.fastgeom.Quaternionf;
import yk.jcommon.fastgeom.Vec3f;
import java.awt.image.BufferedImage;
import static org.lwjgl.opengl.GL11.*;
import static yk.jcommon.collections.YArrayList.al;
import static yk.senjin.DDDUtils.glMultMatrix4;
import static yk.senjin.DDDUtils.glVec3f;

        st2.add(new SomeTexture(getSubImage(images, 1, 1)));
        st2.add(new SomeTexture(getSubImage(images, 2, 1)));
        st2.add(new SomeTexture(getSubImage(images, 3, 1)));
        st2.add(new SomeTexture(getSubImage(images, 1, 0)));
        st2.add(new SomeTexture(getSubImage(images, 1, 2)));
    }

    public void firstFrame3(YList<BufferedImage> images) {
        st2 = al();
        for (BufferedImage img : images) st2.add(new SomeTexture(img));
    }

    private BufferedImage getSubImage(BufferedImage images, int px, int py) {
        int w = images.getWidth() / 4;
        int h = images.getHeight() / 3;
        BufferedImage im0 = new BufferedImage(w, h, BufferedImage.TYPE_3BYTE_BGR);
        im0.getGraphics().drawImage(images, 0, 0, w, h, w * px, h * py, w * (px + 1), h * (py + 1), null);
        return im0;
    }

    public void render(Vec3f camPos) {
        if (st != null) render1(camPos);
        else render2(camPos);
    }

    private void renderQuad(SomeTexture st, Vec3f pos, Vec3f vx, Vec3f vy) {
        if (enableTexture) st.enable(0);

        glBegin(GL_QUADS);
        glColor3f(1, 1, 1);
        glTexCoord2f(0, 1); glVec3f(pos);