You are not logged in.
An interesting problem... check it out:
I upgraded to the new devkitpro...
therefore upgraded to GRRLIB 4.1.1
compile errors like crazy on my current project (which worked fine in 4.0)
changed all the:
GRRLIB_texImg img_rain = GRRLIB_LoadTexture(rain_png);
to:
GRRLIB_texImg* img_rain = GRRLIB_LoadTexture(rain_png);
and all the:
GRRLIB_InitTileSet(&img_rain, 48, 48, 0);
to:
GRRLIB_InitTileSet(img_rain, 48, 48, 0);
Compile errors went away,
Loaded up program, and after about 10 seconds it freezes... hard reboot wii.
After trouble shooting and commenting out tons of code, i've noticed that anytime i use DrawTile or DrawImg, it happens. (FillScreen works fine)
So trimmed everything down to what you see below:
#include <string.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <wiiuse/wpad.h> #include <ogcsys.h> #include <gccore.h> #include <math.h> #include <fat.h> #include <asndlib.h> #include <mp3player.h> #include <stdarg.h> #include <grrlib.h> #include <FreeTypeGX.h> #include <mxml.h> #include "table_png.h" #include "tabletop_png.h" #include "shoegl_png.h" #include "insurance_png.h" #include "background_jpg.h" #include "logos_png.h" #include "logot_png.h" #include "cashier_png.h" #include "wiibuttons_png.h" #include "wiidevices_png.h" #include "buttons_png.h" #include "pointer_png.h" #include "cardpoint_png.h" #include "chips_png.h" #include "clicktobet_png.h" #include "money_png.h" #include "cards2_png.h" #include "devkitpro_png.h" #include "GRRlib_png.h" #include "assistant_png.h" #include "bubble_png.h" #include "cbubble_png.h" #include "result_png.h" #include "rain_png.h" #include "pressa_png.h" #include "menubut_png.h" #include "vol1_png.h" #include "vol2_png.h" #include "sounds_png.h" #include "about_png.h" #include "selassistant_png.h" #include "selcassistant_png.h" #include "rumble_png.h" #include "rules_png.h" #include "decks_png.h" #include "cursym_png.h" #include "mdbrim_png.h" #include "mrnick_png.h" #include "quickoptions_png.h" #include "splashchar_png.h" #include "tables_png.h" #include "col1_png.h" #include "arrows_png.h" #include "tablec_png.h" #include "homebg_png.h" #include "homeback_png.h" #include "homebottom_png.h" #include "hometext_png.h" #include "homeoptions_png.h" #include "rulesicon_png.h" GRRLIB_texImg* img_pointer = GRRLIB_LoadTexture(pointer_png); GRRLIB_texImg* img_chips = GRRLIB_LoadTexture(chips_png); GRRLIB_texImg* img_clicktobet = GRRLIB_LoadTexture(clicktobet_png); GRRLIB_texImg* img_money = GRRLIB_LoadTexture(money_png); GRRLIB_texImg* img_buttons = GRRLIB_LoadTexture(buttons_png); GRRLIB_texImg* img_cards = GRRLIB_LoadTexture(cards2_png); GRRLIB_texImg* img_cardpoint = GRRLIB_LoadTexture(cardpoint_png); GRRLIB_texImg* img_table = GRRLIB_LoadTexture(table_png); GRRLIB_texImg* img_shoegl = GRRLIB_LoadTexture(shoegl_png); GRRLIB_texImg* img_tabletop = GRRLIB_LoadTexture(tabletop_png); GRRLIB_texImg* img_insurance = GRRLIB_LoadTexture(insurance_png); GRRLIB_texImg* img_Devkitlogo = GRRLIB_LoadTexture(devkitpro_png); GRRLIB_texImg* img_GRRLIBlogo = GRRLIB_LoadTexture(GRRlib_png); GRRLIB_texImg* img_background = GRRLIB_LoadTexture(background_jpg); GRRLIB_texImg* img_logos = GRRLIB_LoadTexture(logos_png); GRRLIB_texImg* img_logot = GRRLIB_LoadTexture(logot_png); GRRLIB_texImg* img_cashier = GRRLIB_LoadTexture(cashier_png); GRRLIB_texImg* img_wiibuttons = GRRLIB_LoadTexture(wiibuttons_png); GRRLIB_texImg* img_wiidevices = GRRLIB_LoadTexture(wiidevices_png); GRRLIB_texImg* img_assistant = GRRLIB_LoadTexture(assistant_png); GRRLIB_texImg* img_rain = GRRLIB_LoadTexture(rain_png); GRRLIB_texImg* img_result = GRRLIB_LoadTexture(result_png); GRRLIB_texImg* img_cbubble = GRRLIB_LoadTexture(cbubble_png); GRRLIB_texImg* img_bubble = GRRLIB_LoadTexture(bubble_png); GRRLIB_texImg* img_pressa = GRRLIB_LoadTexture(pressa_png); GRRLIB_texImg* img_menubut = GRRLIB_LoadTexture(menubut_png); GRRLIB_texImg* img_vol1 = GRRLIB_LoadTexture(vol1_png); GRRLIB_texImg* img_vol2 = GRRLIB_LoadTexture(vol2_png); GRRLIB_texImg* img_sounds = GRRLIB_LoadTexture(sounds_png); GRRLIB_texImg* img_about = GRRLIB_LoadTexture(about_png); GRRLIB_texImg* img_selassistant = GRRLIB_LoadTexture(selassistant_png); GRRLIB_texImg* img_selcassistant = GRRLIB_LoadTexture(selcassistant_png); GRRLIB_texImg* img_rumble = GRRLIB_LoadTexture(rumble_png); GRRLIB_texImg* img_rules = GRRLIB_LoadTexture(rules_png); GRRLIB_texImg* img_decks = GRRLIB_LoadTexture(decks_png); GRRLIB_texImg* img_cursym = GRRLIB_LoadTexture(cursym_png); GRRLIB_texImg* img_mdbrim = GRRLIB_LoadTexture(mdbrim_png); GRRLIB_texImg* img_mrnick = GRRLIB_LoadTexture(mrnick_png); GRRLIB_texImg* img_quickoptions = GRRLIB_LoadTexture(quickoptions_png); GRRLIB_texImg* img_splashchar = GRRLIB_LoadTexture(splashchar_png); GRRLIB_texImg* img_tables = GRRLIB_LoadTexture(tables_png); GRRLIB_texImg* img_col1 = GRRLIB_LoadTexture(col1_png); GRRLIB_texImg* img_arrows = GRRLIB_LoadTexture(arrows_png); GRRLIB_texImg* img_tablec = GRRLIB_LoadTexture(tablec_png); GRRLIB_texImg* img_homebg = GRRLIB_LoadTexture(homebg_png); GRRLIB_texImg* img_homeback = GRRLIB_LoadTexture(homeback_png); GRRLIB_texImg* img_homebottom = GRRLIB_LoadTexture(homebottom_png); GRRLIB_texImg* img_hometext = GRRLIB_LoadTexture(hometext_png); GRRLIB_texImg* img_homeoptions = GRRLIB_LoadTexture(homeoptions_png); GRRLIB_texImg* img_rulesicon = GRRLIB_LoadTexture(rulesicon_png); Mtx GXmodelView2D; int main() { GRRLIB_Init(); GRRLIB_InitTileSet(img_rain, 48, 48, 0); int rain=0; int raincount=0; while(1) { raincount++; if(raincount>59) raincount=0; if(raincount%60+1==5) rain=0; else if(raincount%60+1==10) rain=1; else if(raincount%60+1==15) rain=2; else if(raincount%60+1==20) rain=3; else if(raincount%60+1==25) rain=4; else if(raincount%60+1==30) rain=5; else if(raincount%60+1==35) rain=6; else if(raincount%60+1==40) rain=7; else if(raincount%60+1==45) rain=8; else if(raincount%60+1==50) rain=3; else if(raincount%60+1==55) rain=9; else if(raincount%60+1==60) rain=10; GRRLIB_FillScreen(0x000000FF); GRRLIB_DrawTile(200, 200, img_rain, 0, 1, 1, 0xFFFFFFFF, rain); GRRLIB_Render(); } return 0; }
As you can see, it loads a TON of images, but it only uses one... a simple tile that rotates thru on the screen.
After about 10 to 30 seconds (time varies) it freezes.
BUT, if i comment out all the GRRLIB_texImg* lines except the one i'm using... it seems to work. (now granted, it might freeze an hour into it, but ihvaen't gotten that far) but with all of them back in, it freezes.
ANy ideas? cuz i would rather finish my project on 4.1.1 than go back to my old computer!
Offline
RESOLVED!!!:
Crayon pointed out that i should / need to put GRRLIB_Init(); before all the LoadTexture lines...
which caused me to do the static GRRLIB_texImg* img_pointer stuff up top
and the img_pointer = LoadTexture stuff down under GRRLIB_Init();
works like a champ now.
Thanks crayon!
Funny thing was it worked in 4.0... but I wasn't savvy enough to understand how the changes in * and & would require that.
Last edited by mdbrim (2009-12-05 06:43:38)
Offline