pouët.net

TPTC for DevC (urgent help)

category: general [glöplog]
It just broke my nerves and time is too short and for one tiny detail I don't have it ready..

I am preparing an intro from Euskal. Actually it was a demo that I try to crunch into 64k and it happens but at 99,9% I got a problem that could cancel everything I have done so far Sad

1) Urgent need of TinyPTC compiled for gcc/DevC/windows. I can't find this! I found one tptc lib that relsoft provided, but when I finish and finally crunch under 64k and all my adventures are finished,.... arghhh IT DOESN'T GO FULLSCREEN, because the provided lib is only the GDI version of TPTC and there is no DDRAW or other version that can go fullscreen there, also I don't have time to see how can I compile TPTC for DevC. I want something fast and easy because my whole 64kb attempt will blow in the air just because NO_FULLSCREEN (and I got through adventures to squize, manage minifmod, find exe packers, etc... to be blown away because NO_FULLSCREEN. I have tried #define fullscreen thing on tinyptc.h but it doesn't work because GDI only)

PLEAZ. Someone must have done a fullscreen TPTC project in DevC++ windows in the past. Someone might have the lib and a files and the main h or source code it needs. Or a link where they are provided! Or a Devpak for tptc anywhere?

2) I did the attempt to port my project on Visual Studio 2008 with the good TPTC. And I get the most WTF error ever. Where I have int i; or for (int i=0; i<... etc etc, it tells me he can't find the int type. (WHAT?). In the original TPTC project you have to place the ints outside globally, like static int i; and only this way it works. But no time to place all the variables out of my project as static. That would be stupid. Why does this happen? Is it because tptc does something?

3) Of course if you have something for 1 I don't need to go to 2. The project is 99,9% ready, I just need to get the proper tptc files for devc and pray. Pitty to not release this as intro because it mostly fits as intro.

If you know something..
added on the 2008-07-23 08:54:19 by Optimus Optimus
as a quick hint for 2) i suggest reading this
added on the 2008-07-23 09:09:28 by RufUsul RufUsul
2) thanks but it's not just the scope
I even put the int outside like
int i;
for (i=0; blah blah)

and get the same thing.

Also,. something even more crazy. I had an old TPTC project in VS and it compiled. IT HAD INTS. When I write one additional code with int i; for (i=.. suddenly I get the error there. WHAT?
added on the 2008-07-23 09:24:20 by Optimus Optimus
So you are saying that VC++ can't find the int type at all? Is it happening only in for loops or everywhere?
added on the 2008-07-23 09:28:04 by masterm masterm
I can send you some code to open a window and dump a framebuffer that is much smaller than tinyptc. You only need one gdi function to copy a framebuffer to a hWnd.

static BITMAPINFO bmi = { {sizeof(BITMAPINFOHEADER), XRES, -YRES, 1, 32, BI_RGB, 0, 0, 0, 0, 0}, {0,0,0,0} };

StretchDIBits( hDC, 0, 0, XRES, YRES, 0,0, XRES,YRES, buffer, &bmi, DIB_RGB_COLORS, SRCCOPY );

We can have a look to it a euskal if you want, if you are going.
added on the 2008-07-23 10:26:08 by iq iq
something tells me that the content of this framebuffer will be some colourful plasmas and voxels :-)
added on the 2008-07-23 10:42:49 by Navis Navis
At least he's doing the oldschool thing right: Old effects with old dev tools, in glorious software rendering. :)
added on the 2008-07-23 10:51:25 by tomaes tomaes
now we're all thrilled to see that intro... mission accomplished! ;-)
added on the 2008-07-23 10:55:39 by v3nom v3nom
Optimus,
without your code or real error message its hard to help but I did this:
downloaded TPTC (latest), NASM (latest) etc.
Set the compile to be DDRAW based - the default actually.
Compiled test program with VC++2005 Express.
Works.

Commented static int index; out from test.c and instead tried 3 things:
int index;
for (int index=0; index<SIZE; index++)
.. fails.

for (int index=0; index<SIZE; index++)
.. fails.

int index;
for (index=0; index<SIZE; index++)
.. succeeds.

All obviously due to scoping like masterm said. So I can't duplicate the problem you describe. If you want someone to try compiling your project under another setup, I'm happy to try...send me a PM at bitfellas.
added on the 2008-07-23 10:58:34 by auld auld
Thank you.

iq: I just remembered that I have your examples of 1k/4k frameworks somewhere on my HD. One of them is software ddraw and last time I checked it compiled properly. If I can't find the solution with tptc I will try this one and hopefully this one works and I am ready to kick ass! :)
added on the 2008-07-23 11:26:56 by Optimus Optimus
visual studio 6 and GCC >= 3.x have differen't ISO C++ scoping standards most notably in case of for loops. ISO C++ 2003(?) states that variable's scope in for statement is inside its braces and the older ISO standard described that the variable scope is in its parent function. This is one of the major portability issues regarding VC vs. GCC. IIRC VS 2005 and newer has newer ISO C++ standard in use.
added on the 2008-07-23 11:33:38 by waffle waffle
BB Image

OPTIMUS FTW :)
added on the 2008-07-23 11:34:38 by Zest Zest
Optimus: this is not the best place to write to you but... take beach clothes, these days are SO HOT at Malaga. At Bilbao the temperature will be moderate but not cold.
added on the 2008-07-23 13:53:37 by texel texel
hey I'm coming too ! Any advice ?

Are the waters ok for swimming ?
added on the 2008-07-23 14:11:25 by Navis Navis
Optimus: I don't get it... TinyPTC is shipped as source code. Just include the sources in your projects, and recompile? Anyway, using gcc for an intro is not a very good idea. I'd suggest using VC instead.
added on the 2008-07-23 14:35:46 by kusma kusma
there's also some msvc option about "force conformance in for loop" or something. maybe changing that option helps as well.
added on the 2008-07-23 14:40:08 by skrebbel skrebbel
Quote:
int index;
for (int index=0; index<SIZE; index++)
.. fails.

for (int index=0; index<SIZE; index++)
.. fails.

int index;
for (index=0; index<SIZE; index++)
.. succeeds.


Sounds like "compile as C code" (instead of "compile as C++ code") is turned on. In C, you just can't declare a variable inside a for statement.
added on the 2008-07-23 15:45:52 by KeyJ KeyJ
Navis: in Bilbao (north of Spain), I don't know. I'm at Malaga, in the south of Spain, where I am, weather is so hot and the sea is excelent right now for swimming. Optimus is going to be at Malaga some days after the party, if you are going to come to Málaga tell me so we can meet!
added on the 2008-07-23 15:54:14 by texel texel
KeyJ ... the settings for TPTC include "compile as C++" but also /Zc:forScope- which explains the behaviour *I* see, but not what Optimus sees. I was trying to show that at least I can get it to work with TPTC...so its not an insurmountable problem.
added on the 2008-07-23 15:55:16 by auld auld
I think we will have a quite warm Euskal, around 27 degrees or so :)
added on the 2008-07-23 16:05:58 by iq iq
thanks, I have to go back home and finish our demo for nvision :-(

Does anyone know when is the deadline for the euskal demo and when is the demo presentations ? I look at the timetable but I cannot find it
added on the 2008-07-23 16:27:12 by Navis Navis
It's usually around saturday at 18:00... presented at 22:00. From what I remember... but I may be wrong :)

Optimus: are you going to euskal too?
added on the 2008-07-23 17:12:15 by xernobyl xernobyl


Thank you all. I solved the problem. My good friend Relsoft from q/freebasic scene who also compiled the GDI DevC example helped me with some steps to compile the other ones. I am always afraid to compile a lib or someone else's code because I could get incomprehensible linker error messages and might spend the whole day fixing nothing. And I felt like I didn't have time to compile it from scratch. But I guess this was easier than I thought and maybe I should try first. Now it's solved ;P Finally!


As for the other problem it's still also for outside scope vars like

int i;
for (i=n0; i<=n1; i++)

and the error is:
syntax error: missing ';' before 'type'
'i' : undeclared identifier

And I wonder, does it have to do with these defines on tinyptc.h?
// integer types
typedef unsigned __int32 int32;
typedef unsigned __int16 short16;
typedef unsigned __int8 char8;


xernobyl: Yes of course. I was initially thinking of travelling to many demoparties (Euskal and then Assembly) but the flight costs would be too much. And the initial travel is to meet with Texel and so I find the opportunity to be at Euskal before meeting Texel and then spend my holidays for a week before going back to reality :)
added on the 2008-07-23 17:42:35 by Optimus Optimus
So, I'm finally going to meet you :/
added on the 2008-07-23 17:54:04 by xernobyl xernobyl
xernobyl, don't worry, optimus is actually a pretty cool guy. he has a bit much pouet time sometimes, but hey, so do you.
added on the 2008-07-23 18:59:28 by skrebbel skrebbel

login