1. mocchai

    OP mocchai Newbie
    Newcomer

    Joined:
    Feb 10, 2021
    Messages:
    4
    Country:
    United States
    Whenever I try to compile my code, which is supposed to display a logo on the screen, that's all, it gives me an error that goes as follows:

    Code:
    Invalid Parameter - /Users
    make[1]: *** [/home/[name removed]/Desktop/mocha_rhythmTap_3ds/Makefile:205: logo.bgr] Error 4
    make: *** [Makefile:159: build] Error 2
    My code is here:

    Code:
    #include <citro2d.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <time.h>
    #include "mochalibs.h"
    #include "begin.h"
    #define TSW 400
    #define TSH 240
    #define BSW 360
    #define BSH 240
    
    int main(int argc, char *argx[])
    {
    
        // Init libs
        gfxInitDefault();
        C3D_Init(C3D_DEFAULT_CMDBUF_SIZE);
        C2D_Init(C2D_DEFAULT_MAX_OBJECTS);
        C2D_Prepare();
        u32 clrClear = C2D_Color32(0xFF, 0xD8, 0xB0, 0x68);
        // Create screens
        C3D_RenderTarget *top = C2D_CreateScreenTarget(GFX_TOP, GFX_LEFT);
        C3D_RenderTarget *bottom = C2D_CreateScreenTarget(GFX_BOTTOM, GFX_LEFT);
    
        C2D_Image logo;
        C3D_Tex tex;
        Tex3DS_SubTexture *subtex = new Tex3DS_SubTexture();
        subtex->left=subtex->top=0; subtex->width=400; subtex->height=240;
        subtex->right=subtex->bottom=1;
        logo.subtex = subtex;
        logo.tex = &tex;
        Tex3DS_Texture t3x = Tex3DS_TextureImport(logo_t3x, logo_t3x_size, &tex, NULL, false);
        C3D_TexSetFilter(&tex, GPU_LINEAR, GPU_NEAREST);
        // Delete the t3x object since we don't need it
        Tex3DS_TextureFree(t3x);
    
        while (aptMainLoop())
        {
            hidScanInput();
            u32 kDown = hidKeysDown();
            if (kDown & KEY_START)
                break;
    
            C3D_FrameBegin(C3D_FRAME_SYNCDRAW);
            C2D_TargetClear(top, clrClear);
            C2D_TargetClear(bottom, clrClear);
            C2D_SceneBegin(top);
    
            C2D_DrawImageAt(logo, 0, 0, 0);
           
    
            C3D_FrameEnd(0);
        }
    
        C2D_Fini();
        C3D_Fini();
        gfxExit();
        return 0;
    }
     
  2. iMackshun

    iMackshun Member
    Newcomer

    Joined:
    Mar 3, 2021
    Messages:
    10
    Country:
    United States
    Is there maybe something wrong with the image you're using in particular? If you use the image used with the sample(The kitten one), does it build successfully?
     
  3. mocchai

    OP mocchai Newbie
    Newcomer

    Joined:
    Feb 10, 2021
    Messages:
    4
    Country:
    United States
    I actually switched to a different way of drawing images since this didn't work. It also turned out that this was partly an issue with the makefile. Thanks for your input anyways though!
     
    iMackshun likes this.
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - Compiling, Issues, Image