Turo Lamminen
2016-02-02 afd46741a1a86da1c5b5e4c33ea794caf77de88d

Remove MOJODDS_TEXTURE_NONE

4 files modified
20 ■■■■ changed files
afl-mojodds.c 6 ●●●● patch | view | raw | blame | history
ddsinfo.c 7 ●●●● patch | view | raw | blame | history
glddstest.c 6 ●●●● patch | view | raw | blame | history
mojodds.h 1 ●●●● patch | view | raw | blame | history
afl-mojodds.c
@@ -55,7 +55,7 @@
    unsigned long texlen = 0;
    unsigned int glfmt = 0, w = 0, h = 0, miplevels = 0;
    unsigned int cubemapfacelen = 0;
    MOJODDS_textureType textureType = MOJODDS_TEXTURE_NONE;
    MOJODDS_textureType textureType = 0;
    int retval = MOJODDS_getTexture(contents, size, &tex, &texlen, &glfmt, &w, &h, &miplevels, &cubemapfacelen, &textureType);
    if (!retval) {
        free(contents);
@@ -64,10 +64,6 @@
    uint32_t hash = 0x12345678;
    switch (textureType) {
    case MOJODDS_TEXTURE_NONE:
        assert(false);  // this is not supposed to happen
        break;
    case MOJODDS_TEXTURE_2D:
    for (unsigned int miplevel = 0; miplevel < miplevels; miplevel++) {
        const void *miptex = NULL;
ddsinfo.c
@@ -45,7 +45,7 @@
        unsigned long texlen = 0;
        unsigned int glfmt = 0, w = 0, h = 0, miplevels = 0;
        unsigned int cubemapfacelen = 0;
        MOJODDS_textureType textureType = MOJODDS_TEXTURE_NONE;
        MOJODDS_textureType textureType = 0;
        int retval = MOJODDS_getTexture(contents, size, &tex, &texlen, &glfmt, &w, &h, &miplevels, &cubemapfacelen, &textureType);
        if (!retval) {
            printf("MOJODDS_getTexture failed\n");
@@ -61,11 +61,6 @@
        printf("miplevels: %u\n", miplevels);
        printf("textureType: ");
        switch (textureType) {
        case MOJODDS_TEXTURE_NONE:
            printf("none (bug?)\n");
            return 4;
            break;
        case MOJODDS_TEXTURE_2D:
            printf("2D\n");
        printf("\n");
glddstest.c
@@ -84,7 +84,7 @@
        unsigned long texlen = 0;
        unsigned int glfmt = 0, w = 0, h = 0, miplevels = 0;
        unsigned int cubemapfacelen = 0;
        MOJODDS_textureType textureType = MOJODDS_TEXTURE_NONE;
        MOJODDS_textureType textureType = 0;
        int retval = MOJODDS_getTexture(contents, size, &tex, &texlen, &glfmt, &w, &h, &miplevels, &cubemapfacelen, &textureType);
        if (!retval) {
            printf("MOJODDS_getTexture failed\n");
@@ -115,10 +115,6 @@
        glGenTextures(1, &texId);
        switch (textureType) {
        case MOJODDS_TEXTURE_NONE:
            assert(false);  // this is not supposed to happen
            break;
        case MOJODDS_TEXTURE_2D:
        glBindTexture(GL_TEXTURE_2D, texId);
mojodds.h
@@ -8,7 +8,6 @@
typedef enum MOJODDS_textureType
{
    MOJODDS_TEXTURE_NONE,
    MOJODDS_TEXTURE_2D,
    MOJODDS_TEXTURE_CUBE,
    MOJODDS_TEXTURE_VOLUME