Click Here
home features news forums classifieds faqs links search
6071 members 
Amiga Q&A /  Free for All /  Emulation /  Gaming / (Latest Posts)
Login

Nickname

Password

Lost Password?

Don't have an account yet?
Register now!

Support Amigaworld.net
Your support is needed and is appreciated as Amigaworld.net is primarily dependent upon the support of its users.
Donate

Menu
Main sections
» Home
» Features
» News
» Forums
» Classifieds
» Links
» Downloads
Extras
» OS4 Zone
» IRC Network
» AmigaWorld Radio
» Newsfeed
» Top Members
» Amiga Dealers
Information
» About Us
» FAQs
» Advertise
» Polls
» Terms of Service
» Search

IRC Channel
Server: irc.amigaworld.net
Ports: 1024,5555, 6665-6669
SSL port: 6697
Channel: #Amigaworld
Channel Policy and Guidelines

Who's Online
20 crawler(s) on-line.
 57 guest(s) on-line.
 0 member(s) on-line.



You are an anonymous user.
Register Now!
 amig_os:  11 mins ago
 cdimauro:  18 mins ago
 Gunnar:  44 mins ago
 Hypex:  1 hr 11 mins ago
 berylbruse:  1 hr 16 mins ago
 timothyferriss:  1 hr 16 mins ago
 Caspian:  1 hr 16 mins ago
 Hondo:  1 hr 16 mins ago
 AmiEnslaver:  1 hr 16 mins ago
 BrianHoskins:  1 hr 16 mins ago

/  Forum Index
   /  Amiga Development
      /  I tired read Datatypes documents and header files.I want know if i am correct.
Register To Post

PosterThread
Vanhapolle 
I tired read Datatypes documents and header files.I want know if i am correct.
Posted on 13-Dec-2014 1:29:08
#1 ]
Regular Member
Joined: 22-Sep-2014
Posts: 372
From: Unknown

I tired read Datatypes documents and header files form NDK3.9. i looked they
say (in one header) DTA_Width is not correct now they say use intuition/gadgetclass.h instead. But nothing more means this i use GA_Width instead? same or height and all other datatype object?
Is this correct when we talk image files? sounds odd but i somehow understanded Datatype at least picturefiles used like Gadgets?...
and makes me think if evenaudio used such way means this tiny playing button grooup then if i draw stuff to WIndow ?

 Status: Offline
Profile     Report this post  
Raffaele 
Re: I tired read Datatypes documents and header files.I want know if i am correct.
Posted on 14-Dec-2014 13:43:24
#2 ]
Super Member
Joined: 7-Dec-2005
Posts: 1906
From: Naples, Italy

@Vanhapolle

Quote:

Vanhapolle wrote:
I tired read Datatypes documents and header files form NDK3.9. i looked they
say (in one header) DTA_Width is not correct now they say use intuition/gadgetclass.h instead. But nothing more means this i use GA_Width instead? same or height and all other datatype object?
Is this correct when we talk image files? sounds odd but i somehow understanded Datatype at least picturefiles used like Gadgets?...
and makes me think if evenaudio used such way means this tiny playing button grooup then if i draw stuff to WIndow ?


If you need insert datatype callings or even proprietary file descriptors loaders/savers in your software I think that you could ask people who already encontered these kind of problems.

Ask to people who realized Perfect Paint in Amikit (Perfectpaint uses datatypes) Showgirls on MorphOS (proprietary loaders) and Picshow (AmigaOS 3.x, Amikit)

_________________
"When the Amiga came out, everyone [at Apple] was scared as hell." (J.L. Gassée, former CEO of Apple France and chief of devs of Mac II-fx, interviewed by Amazing Computing, Nov 1996).

 Status: Offline
Profile     Report this post  
broadblues 
Re: I tired read Datatypes documents and header files.I want know if i am correct.
Posted on 14-Dec-2014 14:01:15
#3 ]
Amiga Developer Team
Joined: 20-Jul-2004
Posts: 4446
From: Portsmouth England

@Vanhapolle

Yes you should use GA_Width et al when laying out datatype for display in a window.

*BUT* you probably don;t want the datatype to render itself in the context you are most often discussing.

The folloing code is quite long and shows how I use adatatype to load an image into my own internal buffer.


struct SketchProject *DTLoadProject(STRPTR filename, struct SketchApp *skapp)
{

Object *dto = NULL;
struct SketchProject *newprj = NULL;
struct SketchLayer *newlay = NULL;

dto = IDataTypes->NewDTObject(filename,
DTA_SourceType,DTST_FILE,
DTA_GroupID,GID_PICTURE,
PDTA_DestMode,PMODE_V43,
TAG_DONE);

if(dto)
{
struct pdtBlitPixelArray bpa;
struct BitMapHeader *bmhd;
UWORD w,h;
STRPTR dtoname = NULL;
IDataTypes->GetDTAttrs(dto, DTA_ObjName, &dtoname, TAG_DONE);

if(IDataTypes->GetDTAttrs(dto, PDTA_BitMapHeader, &bmhd, TAG_DONE))
{

w = bmhd->bmh_Width;
h = bmhd->bmh_Height;


if((newprj = NewProject(w,h,dtoname?dtoname:"DataTypesLoaded",skapp)))
{
if((newlay = NewLayer(w,h,0,0,"Background",0,newprj)))
{
ARGB32 *tempbuffer = Allocmem(w * h * sizeof(ARGB32),MEMF_PRIVATE | MEMF_CLEAR);
if(tempbuffer)
{
//IExec->AddHead((struct List *)&newprj->sp_Layers,(struct Node *)newlay);
if(bmhd->bmh_Masking == mskHasAlpha)
{
newlay->sl_BufferHasAlpha = TRUE;
}



bpa.MethodID = PDTM_READPIXELARRAY;

bpa.pbpa_PixelData = tempbuffer;
bpa.pbpa_PixelFormat = PBPAFMT_ARGB;
bpa.pbpa_PixelArrayMod = w * sizeof(ARGB32);
bpa.pbpa_Left = 0;
bpa.pbpa_Top = 0;
bpa.pbpa_Height = newlay->sl_Height;
bpa.pbpa_Width = newlay->sl_Width;

IIntuition->IDoMethodA(dto,(Msg)&bpa);

if(0)
{
newlay->sl_Buffer->sb_WriteRawData(newlay->sl_Buffer,0,0,newlay->sl_Width,newlay->sl_Height,newlay->sl_Width,(UBYTE *)tempbuffer);

}
else
{
ARGB *row = Allocmem(sizeof(ARGB) * newlay->sl_Width,0);
if(row)
{
int x,y;
ARGB32 *q = tempbuffer;
for(y = 0; y < newlay->sl_Height; y++)
{
for(x = 0; x < newlay->sl_Width; x++,q++)
{
ARGB32toARGB(row + x,q);
}
newlay->sl_Buffer->sb_PutPixels(newlay->sl_Buffer,y * newlay->sl_Width,newlay->sl_Width,row);
}
Freemem(row);
}
}

AddLayerToProject(newprj,newlay);
SetProjectActiveLayer(newprj,newlay);
LayerOpenMagic(newlay);

Freemem(tempbuffer);
};

}
}
}
IDataTypes->DisposeDTObject(dto);
}
if(newprj)
{
MakeSketchWindowTitle(&newprj->sp_SW);
}
return newprj;
}


_________________
BroadBlues On Blues BroadBlues On Amiga Walker Broad

 Status: Offline
Profile     Report this post  
Raffaele 
Re: I tired read Datatypes documents and header files.I want know if i am correct.
Posted on 14-Dec-2014 14:31:01
#4 ]
Super Member
Joined: 7-Dec-2005
Posts: 1906
From: Naples, Italy

@broadblues

Broadblues thanks for your help to our new software developer.
I am not a programmer so I can't help more than giving suggestions and help people contatting each ones.

_________________
"When the Amiga came out, everyone [at Apple] was scared as hell." (J.L. Gassée, former CEO of Apple France and chief of devs of Mac II-fx, interviewed by Amazing Computing, Nov 1996).

 Status: Offline
Profile     Report this post  
Vanhapolle 
Re: I tired read Datatypes documents and header files.I want know if i am correct.
Posted on 14-Dec-2014 18:25:40
#5 ]
Regular Member
Joined: 22-Sep-2014
Posts: 372
From: Unknown

New and new made some things for my personal use about 20years ago for Amiga before that for C64 but nothing useful what i coded itself i dont count non useful things. but now some amiga speffic problems are gone which means truecolor (showing pics non truecolour mode when data is truecolour is not so easy) and i very likely understanded how datatypes work. Saddly this forum dont accept some charters makes posting code very hard.

Last edited by Vanhapolle on 14-Dec-2014 at 08:08 PM.
Last edited by Vanhapolle on 14-Dec-2014 at 06:26 PM.
Last edited by Vanhapolle on 14-Dec-2014 at 06:26 PM.

 Status: Offline
Profile     Report this post  
Raffaele 
Re: I tired read Datatypes documents and header files.I want know if i am correct.
Posted on 15-Dec-2014 7:26:40
#6 ]
Super Member
Joined: 7-Dec-2005
Posts: 1906
From: Naples, Italy

@Vanhapolle

Are you sure Amigaworld dose not accept some international characters?

Well, you can posting code where all kinds of characters are accepted, and just link html where you upload that...

_________________
"When the Amiga came out, everyone [at Apple] was scared as hell." (J.L. Gassée, former CEO of Apple France and chief of devs of Mac II-fx, interviewed by Amazing Computing, Nov 1996).

 Status: Offline
Profile     Report this post  
Vanhapolle 
Re: I tired read Datatypes documents and header files.I want know if i am correct.
Posted on 15-Dec-2014 15:01:02
#7 ]
Regular Member
Joined: 22-Sep-2014
Posts: 372
From: Unknown

@Raffaele

Link to text file outside forum you mean ? and these are some charters what c language uses. Now i must found place where i can post such files.

Last edited by Vanhapolle on 15-Dec-2014 at 03:01 PM.

 Status: Offline
Profile     Report this post  
broadblues 
Re: I tired read Datatypes documents and header files.I want know if i am correct.
Posted on 15-Dec-2014 15:27:26
#8 ]
Amiga Developer Team
Joined: 20-Jul-2004
Posts: 4446
From: Portsmouth England

@Vanhapolle

The main issue will > and < in c code as they are html characters too.

You can uses HTML character references to get arround that.

foo->bar

foo-&gt;bar

&gt; = >
&lt; = <

Sometimes though as in the code I posted above you can get lucky

also put

<pre>

...
....
</pre>


arround the code to preserve the tabbed layout for readability.

[edited]
to put the character references back in, as editing removes them....

Last edited by broadblues on 15-Dec-2014 at 07:53 PM.
Last edited by broadblues on 15-Dec-2014 at 07:52 PM.
Last edited by broadblues on 15-Dec-2014 at 03:31 PM.
Last edited by broadblues on 15-Dec-2014 at 03:31 PM.
Last edited by broadblues on 15-Dec-2014 at 03:28 PM.

_________________
BroadBlues On Blues BroadBlues On Amiga Walker Broad

 Status: Offline
Profile     Report this post  
Vanhapolle 
Re: I tired read Datatypes documents and header files.I want know if i am correct.
Posted on 15-Dec-2014 16:01:02
#9 ]
Regular Member
Joined: 22-Sep-2014
Posts: 372
From: Unknown

@broadblues

What HTML references mean ? btw i try found place where i can post code and maybe even do my personal homepage for my projects.

 Status: Offline
Profile     Report this post  
Channel_Z 
Re: I tired read Datatypes documents and header files.I want know if i am correct.
Posted on 15-Dec-2014 18:57:32
#10 ]
Regular Member
Joined: 4-Mar-2009
Posts: 305
From: Unknown

@Vanhapolle

You can use f.e. http://pastebin.com/ to share your code.
It works with Amiga browsers like IBrowse, too.

 Status: Offline
Profile     Report this post  
Vanhapolle 
Re: I tired read Datatypes documents and header files.I want know if i am correct.
Posted on 15-Dec-2014 20:03:12
#11 ]
Regular Member
Joined: 22-Sep-2014
Posts: 372
From: Unknown

@Channel_Z

Giant thanks for it. now i also think i understanded how datatypes saving work if so good thing.

Last edited by Vanhapolle on 15-Dec-2014 at 08:03 PM.

 Status: Offline
Profile     Report this post  
salass00 
Re: I tired read Datatypes documents and header files.I want know if i am correct.
Posted on 15-Dec-2014 22:04:52
#12 ]
Elite Member
Joined: 31-Oct-2003
Posts: 2707
From: Finland

@Vanhapolle

There are also forums created specifically for AmigaOS programmers that do not have problems with < and > characters and also have fancy stuff like syntax coloring in posted source code:

http://os4coding.net/
http://www.amigacoding.de/

 Status: Offline
Profile     Report this post  
Vanhapolle 
Re: I tired read Datatypes documents and header files.I want know if i am correct.
Posted on 15-Dec-2014 22:14:07
#13 ]
Regular Member
Joined: 22-Sep-2014
Posts: 372
From: Unknown

@salass00

yes but i cannot post OS4coding i registered which goed fine but i cannot post anything new threads to this forum maybe needs getting OS4 before this , seems at least unsuitable now for my needs. I try get soon energy finish my current project and then look datatypes saving. and maybe libpng etc saving also. Which seems not so hard. i mean datatypes saving. libpng what i allreasy know is very easy if lib complies fine. also libjpeg etc.


Last edited by Vanhapolle on 15-Dec-2014 at 11:20 PM.
Last edited by Vanhapolle on 15-Dec-2014 at 10:34 PM.

 Status: Offline
Profile     Report this post  

[ home ][ about us ][ privacy ] [ forums ][ classifieds ] [ links ][ news archive ] [ link to us ][ user account ]
Copyright (C) 2000 - 2019 Amigaworld.net.
Amigaworld.net was originally founded by David Doyle