gamedevlists-windows Mailing List for gamedev (Page 49)
Brought to you by:
vexxed72
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(48) |
Oct
(58) |
Nov
(49) |
Dec
(38) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(124) |
Feb
(83) |
Mar
(17) |
Apr
(37) |
May
(12) |
Jun
(20) |
Jul
(47) |
Aug
(74) |
Sep
(62) |
Oct
(72) |
Nov
(54) |
Dec
(13) |
2003 |
Jan
(36) |
Feb
(8) |
Mar
(38) |
Apr
(3) |
May
(6) |
Jun
(133) |
Jul
(20) |
Aug
(18) |
Sep
(12) |
Oct
(4) |
Nov
(28) |
Dec
(36) |
2004 |
Jan
(22) |
Feb
(51) |
Mar
(28) |
Apr
(9) |
May
(20) |
Jun
(9) |
Jul
(37) |
Aug
(20) |
Sep
(23) |
Oct
(15) |
Nov
(23) |
Dec
(27) |
2005 |
Jan
(22) |
Feb
(20) |
Mar
(5) |
Apr
(14) |
May
(10) |
Jun
|
Jul
(6) |
Aug
(6) |
Sep
|
Oct
(12) |
Nov
(1) |
Dec
|
2006 |
Jan
(18) |
Feb
(4) |
Mar
(3) |
Apr
(6) |
May
(4) |
Jun
(3) |
Jul
(16) |
Aug
(40) |
Sep
(6) |
Oct
(1) |
Nov
|
Dec
(2) |
2007 |
Jan
(5) |
Feb
(2) |
Mar
(4) |
Apr
(1) |
May
(13) |
Jun
|
Jul
(26) |
Aug
(3) |
Sep
(10) |
Oct
|
Nov
(4) |
Dec
(5) |
2008 |
Jan
(1) |
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Javier A. <ja...@py...> - 2002-07-31 15:00:09
|
Andrew Grant <ag...@cl...> wrote: > What formats are people using for images these days? We're currently > using TGA which "suffices" but isn't great due to Adobe less than > embracing the concept of alpha channels. Sad to see we're not the only ones bitten by Adobe's TGA zealotism. I had a few and completely unproductive email exchanges with Adobe about this, in the end I gave up talking to them, and our artists simply continued working with Photoshop 6. > Ideally I'd like something that > > Supports an alpha channel > Supports 32, 24, & 8 bit images > > I'm not sure if anything out there actually fits the bill for this > though. I've thought about writing a plugin for Photoshop to > supported saving to targa's that fit the above, but it looks like a > whole lot of pain. There are two things that can be of great help: 1 - Photoshop 7's TGA loader will load the image's alpha channel into a channel if you hold the ALT key while it does the loading. By default it will load the alpha channel into the layer transparency. It always saves the alpha from the layer opacity, so if you have your alpha in a separate channel, you must perform a couple steps (select from alpha, delete from layer). 2 - Using Image | Calculations, you can create a Photoshop action that will remove the layer transparency and put it into an alpha channel. I tried to write a plugin to perform this in a cleaner way, but failed miserably (couldn't even get the sample code to work, and again Adobe's support was worse than unproductive). We did (2) while using Photoshop 6, and along with 7's ALT-while-loading hack, makes things more useable if you adapt your working habits to it. Theory says that the PNG format is much better, but: - The complexity of the format makes for less immediate tools, link with zlib & libpng, test the varieties of the image pixelformat, all that crap. - Forget about loading PNGs during runtime on a PS2. - A full TGA loader is just a few hundred lines of straightforward code. - Dark stories about Adobe's PNG support being equally full of quirks abound. Javier Arevalo Pyro Studios |
From: Tom F. <to...@mu...> - 2002-07-31 14:38:55
|
There's nothing wrong with TGAs as a format - they support alpha channels just fine, and so does Photoshop. One of our artists just showed me that indeed it works just like you'd want (Photoshop 6.0 - we're just trying 7.0 now). What specifically is going wrong? Tom Forsyth - purely hypothetical Muckyfoot bloke. This email is the product of your deranged imagination, and does not in any way imply existence of the author. > -----Original Message----- > From: Andrew Grant [mailto:ag...@cl...] > Sent: 31 July 2002 15:13 > To: gam...@li... > Subject: [GD-Windows] Image formats (was [Algorithms] Scrolling > starfield) > > > What formats are people using for images these days? We're > currently using > TGA which "suffices" but isn't great due to Adobe less than > embracing the > concept of alpha channels. > > Ideally I'd like something that > > Supports an alpha channel > Supports 32, 24, & 8 bit images > > I'm not sure if anything out there actually fits the bill for > this though. > I've thought about writing a plugin for Photoshop to > supported saving to > targa's that fit the above, but it looks like a whole lot of pain. > > Ta. > > Andrew Grant- > Climax Brighton > > > > -----Original Message----- > From: brian hook [mailto:bri...@py...] > Sent: 31 July 2002 06:39 > To: gda...@li... > Subject: Re: [Algorithms] Scrolling starfield > > > > (That code is a few years old.) PSD has alpha, and RLE. Plus it's > > easy to export from Photoshop :) I even used the print-size > meta info > > to size my billboards. > > I didn't even realize PSD was a documented and/or open file format. > File format support these days is rather trying -- I use TGA by > default, primarily because it's more predictable than what I > get when I > save PNG in various packages. And TGA compresses very well > (similar to > PNG, if not identical) when ZIPped. And it supports a 16-bit file > format for those of us still stuck in the dark ages. =) > > > > - rationale for WEATHER_BLOCK_SIZE = 14? > > > > Just tweaked until the furthest flakes were invisible. > > Ah, okay, just wanted to make sure I wasn't misunderstanding what it > was. > > I mucked about with the code and it works beautifully! It took me a > bit to get my head screwed on straight with respect to scale at times > (the << 17 threw me off for a bit), but it seems to work. > > I have the ship centered in the star cloud right now, which > looks wrong > because stars can get between you and the ship, but a simple > translation "behind" the ship should fix that. > > The packing into integers and letting integer wrap handle wrap around > is just brilliant and elegant, if not obvious to everyone but me =) > > Brian > > > > > ------------------------------------------------------- > This sf.net email is sponsored by: Dice - The leading online job board > for high-tech professionals. Search and apply for tech jobs today! > http://seeker.dice.com/seeker.epl?rel_code=31 > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > > > ------------------------------------------------------- > This sf.net email is sponsored by: Dice - The leading online job board > for high-tech professionals. Search and apply for tech jobs today! > http://seeker.dice.com/seeker.epl?rel_code=31 > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > |
From: Andrew G. <ag...@cl...> - 2002-07-31 14:13:25
|
What formats are people using for images these days? We're currently using TGA which "suffices" but isn't great due to Adobe less than embracing the concept of alpha channels. Ideally I'd like something that Supports an alpha channel Supports 32, 24, & 8 bit images I'm not sure if anything out there actually fits the bill for this though. I've thought about writing a plugin for Photoshop to supported saving to targa's that fit the above, but it looks like a whole lot of pain. Ta. Andrew Grant- Climax Brighton -----Original Message----- From: brian hook [mailto:bri...@py...] Sent: 31 July 2002 06:39 To: gda...@li... Subject: Re: [Algorithms] Scrolling starfield > (That code is a few years old.) PSD has alpha, and RLE. Plus it's > easy to export from Photoshop :) I even used the print-size meta info > to size my billboards. I didn't even realize PSD was a documented and/or open file format. File format support these days is rather trying -- I use TGA by default, primarily because it's more predictable than what I get when I save PNG in various packages. And TGA compresses very well (similar to PNG, if not identical) when ZIPped. And it supports a 16-bit file format for those of us still stuck in the dark ages. =) > > - rationale for WEATHER_BLOCK_SIZE = 14? > > Just tweaked until the furthest flakes were invisible. Ah, okay, just wanted to make sure I wasn't misunderstanding what it was. I mucked about with the code and it works beautifully! It took me a bit to get my head screwed on straight with respect to scale at times (the << 17 threw me off for a bit), but it seems to work. I have the ship centered in the star cloud right now, which looks wrong because stars can get between you and the ship, but a simple translation "behind" the ship should fix that. The packing into integers and letting integer wrap handle wrap around is just brilliant and elegant, if not obvious to everyone but me =) Brian ------------------------------------------------------- This sf.net email is sponsored by: Dice - The leading online job board for high-tech professionals. Search and apply for tech jobs today! http://seeker.dice.com/seeker.epl?rel_code=31 _______________________________________________ GDAlgorithms-list mailing list GDA...@li... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=6188 |
From: Andrew G. <ag...@cl...> - 2002-07-18 09:47:26
|
append ,su to the variable name in the watch window. Andrew Grant- Climax Brighton > -----Original Message----- > From: Jacob Turner (Core Design Ltd) [mailto:Ja...@Co...] > Sent: 18 July 2002 09:53 > To: 'gam...@li...' > Subject: [GD-Windows] Debugging unicode strings > > > Is there anyway to get decent debugger support in MSVC for > unicode strings. > i.e. a cast on a pointer that tells MSVC the string is a > unicode string. > Note we are not using system libraries for unicode support, > so the unicode > pointer is just a pointer to "unsigned short" > > Cheers > > Jake > > |
From: Jacob T. (C. D. Ltd) <Ja...@Co...> - 2002-07-18 09:39:25
|
Is there anyway to get decent debugger support in MSVC for unicode strings. i.e. a cast on a pointer that tells MSVC the string is a unicode string. Note we are not using system libraries for unicode support, so the unicode pointer is just a pointer to "unsigned short" Cheers Jake |
From: Brian S. <bs...@mi...> - 2002-07-17 05:10:18
|
CFileDialog -----Original Message----- From: Idahosa I. O. Edokpayi [mailto:ida...@sw...] Sent: Tue 7/16/2002 8:50 PM To: Gam...@li... Cc:=09 Subject: [GD-Windows] MFC Does anybody know of a quick way to get an open file dialog in MFC? I am not opening actual documents. I need the user to be able to browse and locate an executable. =20 Idahosa Edokpayi O2Cool Games Software =20 |
From: Idahosa I. O. E. <ida...@sw...> - 2002-07-17 03:50:40
|
Does anybody know of a quick way to get an open file dialog in MFC? I am not opening actual documents. I need the user to be able to browse and locate an executable. Idahosa Edokpayi O2Cool Games Software |
From: Daniel V. <vo...@ep...> - 2002-07-15 20:23:49
|
In theory you should use QueryPerformanceCounter and Frequency but the following has worked fine for us so far: // CPU speed. guard(CheckCpuSpeed); FLOAT CpuSpeed; try { timeBeginPeriod( 1 ); GSecondsPerCycle = 1.f; for( INT i=0; i<3; i++ ) { LARGE_INTEGER StartCycles, EndCycles; volatile DOUBLE DoubleDummy = 0.0; volatile INT IntDummy = 0; __asm { rdtsc mov StartCycles.HighPart, edx mov StartCycles.LowPart, eax } DWORD StartMsec = timeGetTime(), EndMsec = StartMsec; while( EndMsec-StartMsec < 200 ) { DoubleDummy += appSqrt(DoubleDummy) + 3.14; IntDummy *= ((INT) (DoubleDummy) + 555) / 13; EndMsec = timeGetTime(); } __asm { rdtsc mov EndCycles.HighPart, edx mov EndCycles.LowPart, eax } DOUBLE C1 = (DOUBLE)(SQWORD)(((QWORD)StartCycles.LowPart) + ((QWORD)StartCycles.HighPart<<32)), C2 = (DOUBLE)(SQWORD)(((QWORD)EndCycles.LowPart) + ((QWORD)EndCycles.HighPart<<32)); GSecondsPerCycle = Min( GSecondsPerCycle, 1.0 / (1000.f * ( C2 - C1 ) / (EndMsec - StartMsec)) ); } timeEndPeriod( 1 ); debugf( NAME_Init, TEXT("CPU Speed=%f MHz"), 0.000001 / GSecondsPerCycle ); appStrcat( GMachineCPU, *FString::Printf(TEXT(" @ %d MHz"), appRound(0.000001 / GSecondsPerCycle) ) ); // gam } catch( ... ) { debugf( NAME_Init, TEXT("Timestamp not supported (Possibly 486 or Cyrix processor)") ); appStrcat( GMachineCPU, TEXT(" Unknown clock") ); // gam GSecondsPerCycle = 1; } -- Daniel, Epic Games Inc. > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...]On > Behalf Of Andrew Grant > Sent: Monday, July 15, 2002 3:13 PM > To: Gam...@li... > Subject: RE: [GD-Windows] Get exact CPU frequency > > > a) I think the method you are using is only supported on some > OSs. A better > approach is to use RDTSC before and then after a known time period has > elapsed, taking measures for slight variations and errors. Try searching > Intels developers site. > > b) GetTickCount can be rather inaccurate, use > QueryPerformanceCounter/Frequency > > Andrew Grant- > Climax Brighton > > > > > -----Original Message----- > > From: Grisha Spivak [mailto:_g...@tu...] > > Sent: 15 July 2002 12:52 > > To: Gam...@li... > > Subject: [GD-Windows] Get exact CPU frequency > > > > > > How can I get exact CPU frequency? I need it for timer which > > uses RDTSC > > instruction. Currently I read '~MHz' value from > > HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcesso > > r\0, but it > > not exact - after 2 min running difference between my timer > > and GetTickCount > > is 15 ms. > > > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > Gamedevlists-windows mailing list > > Gam...@li... > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > > Archives: > > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > |
From: Andrew G. <ag...@cl...> - 2002-07-15 19:13:14
|
a) I think the method you are using is only supported on some OSs. A better approach is to use RDTSC before and then after a known time period has elapsed, taking measures for slight variations and errors. Try searching Intels developers site. b) GetTickCount can be rather inaccurate, use QueryPerformanceCounter/Frequency Andrew Grant- Climax Brighton > -----Original Message----- > From: Grisha Spivak [mailto:_g...@tu...] > Sent: 15 July 2002 12:52 > To: Gam...@li... > Subject: [GD-Windows] Get exact CPU frequency > > > How can I get exact CPU frequency? I need it for timer which > uses RDTSC > instruction. Currently I read '~MHz' value from > HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcesso > r\0, but it > not exact - after 2 min running difference between my timer > and GetTickCount > is 15 ms. > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > |
From: Grisha S. <_g...@tu...> - 2002-07-15 19:02:37
|
How can I get exact CPU frequency? I need it for timer which uses RDTSC instruction. Currently I read '~MHz' value from HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0, but it not exact - after 2 min running difference between my timer and GetTickCount is 15 ms. |
From: Gareth L. <GL...@cl...> - 2002-07-12 13:12:09
|
Have you tried this in a totally clean project ? I ask because we find that deleting your .opt file for a project solves a lot of problems. If not, as I said before, try reinstalling you entire machine, normally fixes everything for atleast 4 months. -----Original Message----- From: Sergei Miloikov [mailto:se...@ha...] Sent: 12 July 2002 14:02 To: GD-Windows Subject: Fw: [GD-Windows] VC makes absurd code > Service Pack? Latest one for MSVC++ 6.0 is SP5 I think. That was the first thing I tried after comparing all the options between my machine and one with worlking compiler. ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Gadgets, caffeine, t-shirts, fun stuff. http://thinkgeek.com/sf _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=555 |
From: Sergei M. <se...@ha...> - 2002-07-12 13:04:59
|
Ok, you are right :) I was just hoping that somebody has experienced similar issues too, and could tell me something like "...change key X in registry and restart VC..", "...delete those files from VC folder and try again..", whatever. Because it is not ordinary linker bug (aka 'linker hell' :), it is compiler one... And thanx for casting suggestions! :) But I would like to leave the constructing of the new object to the compiler, it does it anyway, why should I bother...? Anyway, the problem is on the level below the C++ code, where the evil lurks... |
From: Sergei M. <se...@ha...> - 2002-07-12 13:03:29
|
> Service Pack? Latest one for MSVC++ 6.0 is SP5 I think. That was the first thing I tried after comparing all the options between my machine and one with worlking compiler. |
From: Javier A. <ja...@py...> - 2002-07-12 12:19:28
|
Sergei Miloikov <se...@ha...> wrote: > That is nothing to do with actual code, because as I said it happens > on single computer, everywhere it generates the right,working code. Service Pack? Latest one for MSVC++ 6.0 is SP5 I think. Javier Arevalo Pyro Studios |
From: Gareth L. <GL...@cl...> - 2002-07-12 11:03:38
|
The obvious solution would probably work. Reinstall OS Reinstall IDE Reinstall Libs -----Original Message----- From: Sergei Miloikov [mailto:se...@ha...] Sent: 12 July 2002 11:23 To: Gam...@li... Subject: Re: [GD-Windows] VC makes absurd code That is nothing to do with actual code, because as I said it happens on single computer, everywhere it generates the right,working code. I see the compiler to generate absurd code once, but it was about the 'else' clause of one 'if' that was supposed never to execute and was not written by that reason, but since compiler do not understand such thing it generates the 'else' clause which was totally absurd - but this dead code was there and remains in the executable. For no reason. My case is not like that - it is perfectly linear code, and one single cast - there are allocations in that cast (new std::string object comes to life), some RB_tree accessing (?!) and a lot of code actually, then optimizer assumes that allocator can not allocate code (?!?!) and pushes 0 to the stack, where the pointer must be pushed... then it is accessed and it crashes happily, god damn it! P.S. After seeing that piece of code, I use std::string <-> const char* casting very carefully, it is amazing how much code can produce one single line like that! ----- Original Message ----- From: "Andrew Grant" <ag...@cl...> To: <Gam...@li...> Sent: Friday, July 12, 2002 1:07 PM Subject: RE: [GD-Windows] VC makes absurd code > Maybe you could post a code snippet of what you're trying to do and where it > dies? > > Andrew Grant- > Climax Brighton ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Gadgets, caffeine, t-shirts, fun stuff. http://thinkgeek.com/sf _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=555 |
From: Gareth L. <GL...@cl...> - 2002-07-12 11:02:58
|
Only climax take offices over Ancient Indian Burial grounds. Which is quite impressive since there weren't many ancient Indians in England ;) -----Original Message----- From: Andrew Grant [mailto:ag...@cl...] Sent: 12 July 2002 11:39 To: Gam...@li... Subject: RE: [GD-Windows] VC makes absurd code I'm not sure what you want here.... Do you want us to randomly suggest possible reasons why something doesn't work on your machine and works on others? Memory issues Optimisation settings Your desk is located over an ancient indian burial ground Who knows! Without seeing what you're attempting to do it's very hard to even guess what the problem maybe. For what it's worth I wouldn't consider casting a char* to or from a std::string a clever thing to do. If you have a std::string and want a const char*, use .c_str(), that's what it's there for. If you have a char* and want a std::string, construct a new object. Andrew Grant- Climax Brighton > -----Original Message----- > From: Sergei Miloikov [mailto:se...@ha...] > Sent: 12 July 2002 11:23 > To: Gam...@li... > Subject: Re: [GD-Windows] VC makes absurd code > > > That is nothing to do with actual code, because as I said it > happens on > single computer, everywhere it generates the right,working > code. I see the > compiler to generate absurd code once, but it was about the > 'else' clause of > one 'if' that was supposed never to execute and was not > written by that > reason, but since compiler do not understand such thing it > generates the > 'else' clause which was totally absurd - but this dead code > was there and > remains in the executable. For no reason. > My case is not like that - it is perfectly linear code, and one single > cast - there are allocations in that cast (new std::string > object comes to > life), some RB_tree accessing (?!) and a lot of code actually, then > optimizer assumes that allocator can not allocate code (?!?!) > and pushes 0 > to the stack, where the pointer must be pushed... then it is > accessed and it > crashes happily, god damn it! > > P.S. After seeing that piece of code, I use std::string <-> > const char* > casting very carefully, it is amazing how much code can > produce one single > line like that! > > ----- Original Message ----- > From: "Andrew Grant" <ag...@cl...> > To: <Gam...@li...> > Sent: Friday, July 12, 2002 1:07 PM > Subject: RE: [GD-Windows] VC makes absurd code > > > > Maybe you could post a code snippet of what you're trying > to do and where > it > > dies? > > > > Andrew Grant- > > Climax Brighton > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Gadgets, caffeine, t-shirts, fun stuff. > http://thinkgeek.com/sf > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Gadgets, caffeine, t-shirts, fun stuff. http://thinkgeek.com/sf _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=555 |
From: Andrew G. <ag...@cl...> - 2002-07-12 10:39:19
|
I'm not sure what you want here.... Do you want us to randomly suggest possible reasons why something doesn't work on your machine and works on others? Memory issues Optimisation settings Your desk is located over an ancient indian burial ground Who knows! Without seeing what you're attempting to do it's very hard to even guess what the problem maybe. For what it's worth I wouldn't consider casting a char* to or from a std::string a clever thing to do. If you have a std::string and want a const char*, use .c_str(), that's what it's there for. If you have a char* and want a std::string, construct a new object. Andrew Grant- Climax Brighton > -----Original Message----- > From: Sergei Miloikov [mailto:se...@ha...] > Sent: 12 July 2002 11:23 > To: Gam...@li... > Subject: Re: [GD-Windows] VC makes absurd code > > > That is nothing to do with actual code, because as I said it > happens on > single computer, everywhere it generates the right,working > code. I see the > compiler to generate absurd code once, but it was about the > 'else' clause of > one 'if' that was supposed never to execute and was not > written by that > reason, but since compiler do not understand such thing it > generates the > 'else' clause which was totally absurd - but this dead code > was there and > remains in the executable. For no reason. > My case is not like that - it is perfectly linear code, and one single > cast - there are allocations in that cast (new std::string > object comes to > life), some RB_tree accessing (?!) and a lot of code actually, then > optimizer assumes that allocator can not allocate code (?!?!) > and pushes 0 > to the stack, where the pointer must be pushed... then it is > accessed and it > crashes happily, god damn it! > > P.S. After seeing that piece of code, I use std::string <-> > const char* > casting very carefully, it is amazing how much code can > produce one single > line like that! > > ----- Original Message ----- > From: "Andrew Grant" <ag...@cl...> > To: <Gam...@li...> > Sent: Friday, July 12, 2002 1:07 PM > Subject: RE: [GD-Windows] VC makes absurd code > > > > Maybe you could post a code snippet of what you're trying > to do and where > it > > dies? > > > > Andrew Grant- > > Climax Brighton > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Gadgets, caffeine, t-shirts, fun stuff. > http://thinkgeek.com/sf > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > |
From: Sergei M. <se...@ha...> - 2002-07-12 10:24:19
|
That is nothing to do with actual code, because as I said it happens on single computer, everywhere it generates the right,working code. I see the compiler to generate absurd code once, but it was about the 'else' clause of one 'if' that was supposed never to execute and was not written by that reason, but since compiler do not understand such thing it generates the 'else' clause which was totally absurd - but this dead code was there and remains in the executable. For no reason. My case is not like that - it is perfectly linear code, and one single cast - there are allocations in that cast (new std::string object comes to life), some RB_tree accessing (?!) and a lot of code actually, then optimizer assumes that allocator can not allocate code (?!?!) and pushes 0 to the stack, where the pointer must be pushed... then it is accessed and it crashes happily, god damn it! P.S. After seeing that piece of code, I use std::string <-> const char* casting very carefully, it is amazing how much code can produce one single line like that! ----- Original Message ----- From: "Andrew Grant" <ag...@cl...> To: <Gam...@li...> Sent: Friday, July 12, 2002 1:07 PM Subject: RE: [GD-Windows] VC makes absurd code > Maybe you could post a code snippet of what you're trying to do and where it > dies? > > Andrew Grant- > Climax Brighton |
From: Andrew G. <ag...@cl...> - 2002-07-12 10:07:27
|
Maybe you could post a code snippet of what you're trying to do and where it dies? Andrew Grant- Climax Brighton > -----Original Message----- > From: Sergei Miloikov [mailto:se...@ha...] > Sent: 12 July 2002 11:03 > To: Gam...@li... > Subject: [GD-Windows] VC makes absurd code > > > Hello everybody! > A nasty problem - MSVC 6.0 / SP 5 generates absolutely absurd code - a > conversion from 'const char *' to 'const std::string' crashes > in any target > configuration except Debug one. When looking closely at the > code we saw the > problem - compiler generates code like that: > push 0 > ... > pop edx > mov [edx], bla-bla > > STLport used. > So, it is a problem with the optimizer I guess, but what it > really wierd is > that it happens only on my computer - I check all possible > options, paths, > service packs (MSVC/Win2k), processor packs - still nothing. Now I use > Release builds from other computers, but I am totally > clueless what can > cause such a problem! Anyone experienced anything similar? Thanks! > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Gadgets, caffeine, t-shirts, fun stuff. > http://thinkgeek.com/sf > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > |
From: Sergei M. <se...@ha...> - 2002-07-12 10:04:56
|
Hello everybody! A nasty problem - MSVC 6.0 / SP 5 generates absolutely absurd code - a conversion from 'const char *' to 'const std::string' crashes in any target configuration except Debug one. When looking closely at the code we saw the problem - compiler generates code like that: push 0 ... pop edx mov [edx], bla-bla STLport used. So, it is a problem with the optimizer I guess, but what it really wierd is that it happens only on my computer - I check all possible options, paths, service packs (MSVC/Win2k), processor packs - still nothing. Now I use Release builds from other computers, but I am totally clueless what can cause such a problem! Anyone experienced anything similar? Thanks! |
From: Jon W. <hp...@mi...> - 2002-06-22 19:26:30
|
Some headers pull in libraries by using #pragmas. It's really annoying. I find that the One True Way (tm) to fix these problems is to use the "ignore default libraries" option (/NODEFAULT on the cmd line) and to specify all libraries you want, yourself. Also beware that if you use the Microsoft implementation of STL, then some deallocations are concretely implemented in the DLL for STL functions, whereas allocations happen in template code that gets expanded into your app. If you use custom new/delete, this doesn't work very well, because the MS STL DLL is hard-coded to use Microsoft's operator delete. Cheers, / h+ > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...]On Behalf Of > Brian Hook > Sent: Saturday, June 22, 2002 10:25 AM > To: gam...@li... > Subject: [GD-Windows] operator delete linker hell > > > I have my own globally defined operator delete and new which > allocate from > a custom heap, do memory tracking, etc. etc. Works great in my GUI app, > not a problem. > > Now I'm using my same libraries with a console app, and I'm getting a > linker error saying that operator delete() is multiply defined. After > doing a lot of Google and KB searching, it looks like a link > order problem, > but I've tried everything suggested on-line to fix it. > > The specific suggestions are to remove libcmtd.lib from the default libs > (i.e. put it in ignore libs) and then add it back in the object/library > modules setting in MSVC6. I've tried that to no avail. I've done > /verbose:lib to see the output of the linker, but it's pretty much > meaningless to me -- it shows me what it's searching, but there doesn't > seem to be anything else relevant in there (and it searches the same libs > multiple times). > > So, any ideas what else I can try to make this link. This is > _supposed_ to > work, and it has worked for me on my other projects, but for some reason > it's just getting pissy with this. I've double checked to make sure I'm > linking to the correct libraries consistently (LIBCMTD.LIB), etc. > > Thanks, > > Brian > > > > ------------------------------------------------------- > Sponsored by: > ThinkGeek at http://www.ThinkGeek.com/ > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > |
From: Brian H. <bri...@py...> - 2002-06-22 19:04:32
|
Well, I finally "fixed" it by doing "ignore all default libraries" then manually adding the ones I needed. Oh well. Brian |
From: Brian H. <bri...@py...> - 2002-06-22 18:21:02
|
At 06:34 PM 6/22/2002 +0100, Andrew Grant wrote: >Do you mean you have all your memory routines in a seperate library, or all >your libraries include the memory routines which are in a .cpp ? My memory routines are in a separate library that I have (it's just a project in the workspace). >I had a similar problem to this a while ago with multiply defined functions >in libraries, and the solution was indeed the link order. Jiggling the order >of the libraries in project settings solved it. The problem is that "jiggling the order of the libraries" isn't particularly descriptive enough for me to do anything with =) As far as I can tell, there are two obvious conflicts, my MEMORY.LIB and then MSVC's LIBCMTD.LIB. I put both of those in the "ignore libraries" line, then re-add them in various orders in the "Object/Library Files" line, and so far no difference, other than occasionally I get a new complaint about a conflict with "libcpmtd.lib", which I've never heard of before. Brian |
From: Andrew G. <ag...@cl...> - 2002-06-22 17:34:40
|
Do you mean you have all your memory routines in a seperate library, or all your libraries include the memory routines which are in a .cpp ? I had a similar problem to this a while ago with multiply defined functions in libraries, and the solution was indeed the link order. Jiggling the order of the libraries in project settings solved it. Andrew Grant- Climax Brighton > -----Original Message----- > From: Brian Hook [mailto:bri...@py...] > Sent: 22 June 2002 18:25 > To: gam...@li... > Subject: [GD-Windows] operator delete linker hell > > > I have my own globally defined operator delete and new which > allocate from > a custom heap, do memory tracking, etc. etc. Works great in > my GUI app, > not a problem. > > Now I'm using my same libraries with a console app, and I'm getting a > linker error saying that operator delete() is multiply > defined. After > doing a lot of Google and KB searching, it looks like a link > order problem, > but I've tried everything suggested on-line to fix it. > > The specific suggestions are to remove libcmtd.lib from the > default libs > (i.e. put it in ignore libs) and then add it back in the > object/library > modules setting in MSVC6. I've tried that to no avail. I've done > /verbose:lib to see the output of the linker, but it's pretty much > meaningless to me -- it shows me what it's searching, but > there doesn't > seem to be anything else relevant in there (and it searches > the same libs > multiple times). > > So, any ideas what else I can try to make this link. This is > _supposed_ to > work, and it has worked for me on my other projects, but for > some reason > it's just getting pissy with this. I've double checked to > make sure I'm > linking to the correct libraries consistently (LIBCMTD.LIB), etc. > > Thanks, > > Brian > > > > ------------------------------------------------------- > Sponsored by: > ThinkGeek at http://www.ThinkGeek.com/ > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > |
From: Brian H. <bri...@py...> - 2002-06-22 17:23:45
|
I have my own globally defined operator delete and new which allocate from a custom heap, do memory tracking, etc. etc. Works great in my GUI app, not a problem. Now I'm using my same libraries with a console app, and I'm getting a linker error saying that operator delete() is multiply defined. After doing a lot of Google and KB searching, it looks like a link order problem, but I've tried everything suggested on-line to fix it. The specific suggestions are to remove libcmtd.lib from the default libs (i.e. put it in ignore libs) and then add it back in the object/library modules setting in MSVC6. I've tried that to no avail. I've done /verbose:lib to see the output of the linker, but it's pretty much meaningless to me -- it shows me what it's searching, but there doesn't seem to be anything else relevant in there (and it searches the same libs multiple times). So, any ideas what else I can try to make this link. This is _supposed_ to work, and it has worked for me on my other projects, but for some reason it's just getting pissy with this. I've double checked to make sure I'm linking to the correct libraries consistently (LIBCMTD.LIB), etc. Thanks, Brian |