π
<-
Chat plein-écran
[^]

Need help with nGc "gui_gc_Sprite" structure

C, C++, ASM...

Need help with nGc "gui_gc_Sprite" structure

Message non lude SlyVTT » 30 Juil 2021, 13:11

Dear All,

I am in the process of writing a kind of universal renderer for the TI nSpire (for the GUI Toolkit NF) and then I need to write some methods able to translate the drawcalls either to SDL or to nGc.

Most of the primitives are now working great (pixels (read/write) / main blitting functions / line, rectangle, circle ...).

I need to create a function for sprites and hence try to understand the data structure of gui_gc_Sprite.
I know there are 3 members :
short width;
short height;
char * pixels;

but what is the convention used for the "pixels" member ?

On the CX/CX-II, the color screen uses 16bits (565 coding) so a pixel color should be coded on a short rather than on a char. Looking at some example in the ndless_sdk, it does not seem to use 3 values per pixel (there are not 3 char per actual pixel). It does not seem either to be using a palette (or I do not know where it is defined).

Right now I have my raw data in a table of unsigned short, each pixel coded on a 16bit value as per the 565 convention, How can I make it compatible with gui_gc_Sprite ?

I hope someone will be able to help.

BR

Sly
Some works in progress :
The GUI Toolkit NF for nSpireMyShmup for fxCG-50Magic Light for Casio Graph 90+E
and
Magic Light for nSpire CX/CX-II
Simple Text Editor for nSpireOutRun for Casio Graph 90+E
95%
50%
100%
75%
100%
And more to come ... stay tuned
Avatar de l’utilisateur
SlyVTTPremium
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 43.9%
 
Messages: 496
Images: 31
Inscription: 19 Jan 2021, 09:41
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
GitHub: SlyVTT

Re: Need help with nGc "gui_gc_Sprite" structure

Message non lude Ti64CLi++ » 30 Juil 2021, 14:09

Hi,

I remember using ngc some time ago, and I think that pixels should be 8bits colors for each pixel.
These colors are represented in this image : Image
Image
Avatar de l’utilisateur
Ti64CLi++Modo
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Prochain niv.: 32.4%
 
Messages: 3444
Images: 75
Inscription: 04 Juil 2014, 14:40
Localisation: Clermont-Ferrand 63
Genre: Homme
Calculatrice(s):
MyCalcs profile
Classe: ENS Rennes
GitHub: Ti64CLi

Re: Need help with nGc "gui_gc_Sprite" structure

Message non lude SlyVTT » 30 Juil 2021, 16:47

Hello Ti64CLi++

thanks for your feedback. I guess you are right, it seems that that structure uses a kind of "hidden" palette somewhere. So I cannot use it directly as I am using RGB coding for each pixel.
A better choice seems to be using TI_Image format and the corresponding gui_gc_drawImage function but, it does not seem to be able to consider transparency.

So I wrote a structure from scratch, able to handle sprite data either for SDL and for nGc (through conditional compiling) and integration of transparency.

I dropped the question to Vogtinator/Ndless team on the github repository, if a detailed answer comes, I will post it here.

BR

Sly
Some works in progress :
The GUI Toolkit NF for nSpireMyShmup for fxCG-50Magic Light for Casio Graph 90+E
and
Magic Light for nSpire CX/CX-II
Simple Text Editor for nSpireOutRun for Casio Graph 90+E
95%
50%
100%
75%
100%
And more to come ... stay tuned
Avatar de l’utilisateur
SlyVTTPremium
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 43.9%
 
Messages: 496
Images: 31
Inscription: 19 Jan 2021, 09:41
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
GitHub: SlyVTT


Retourner vers Native: Ndless, Linux, ...

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 29 invités

-
Rechercher
-
Social TI-Planet
-
Sujets à la une
"1 calculatrice pour tous", le programme solidaire de Texas Instruments. Reçois gratuitement et sans aucune obligation d'achat, 5 calculatrices couleur programmables en Python à donner aux élèves les plus nécessiteux de ton lycée. Tu peux recevoir au choix 5 TI-82 Advanced Edition Python ou bien 5 TI-83 Premium CE Edition Python.
Enseignant(e), reçois gratuitement 1 exemplaire de test de la TI-82 Advanced Edition Python. À demander d'ici le 31 décembre 2024.
Offre de test des nouveautés de rentrée 2024 par Casio. Enseignant(e), reçois gratuitement 1 exemplaire, à ton choix, de la Graph Light ou bien de la Graph Math+
14€ remboursés par Casio sur l'achat de ta calculatrice Graph 35 d'ici le 31 Octobre 2024
10€ remboursés par Casio sur l'achat de ta calculatrice Graph 90+E d'ici le 31 Décembre 2024
10€ remboursés par Casio sur l'achat de ta calculatrice Graph 25 d'ici le 31 Décembre 2024
8€ remboursés par Casio sur l'achat de ta calculatrice Graph Math+ d'ici le 31 Octobre 2024
Reprise de ton ancienne fx-92 Collège ou Graph 25/35/90 à 3€ peu importe son état. Même non fonctionnelle et donc invendable, même ancienne Graph 35 non conforme aux programmes (pas de Python), même ancienne Graph 25/35 inutilisable aux examens (pas de mode examen) et donc invendable. Etiquette de retour fournie, pas de frais de port à payer.
3€ remboursés par Casio sur l'achat de ta calculatrice fx-92 Collège d'ici le 30 Septembre 2024
5€ de remise immédiate sur l'achat de ta calculatrice TI-83 Premium CE Edition Python chez les revendeurs partenaires
4€ de remise immédiate sur l'achat de ta calculatrice TI-82 Advanced Edition Python chez les revendeurs partenaires
3€ de remise immédiate sur l'achat de ta calculatrice TI-82 Advanced chez les revendeurs partenaires
Comparaisons des meilleurs prix pour acheter sa calculatrice !
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
1234567891011121314
-
Faire un don / Premium
Pour plus de concours, de lots, de tests, nous aider à payer le serveur et les domaines...
Faire un don
Découvrez les avantages d'un compte donateur !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partenaires et pub
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
1307 utilisateurs:
>1286 invités
>16 membres
>5 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Autres sites intéressants
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)