Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,449 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
bmap_process after level_load crashes #392382
01/22/12 02:08
01/22/12 02:08
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline OP
Serious User
Widi  Offline OP
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
If i use the example from the manual, all works perfectly if i use bmap_process before level_load. but if i use it after level_load, i become a error: "Script crash in main: SYS". Why is this?

Re: bmap_process after level_load crashes [Re: Widi] #392386
01/22/12 03:05
01/22/12 03:05
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
If that Bitmap is used in your level later on, did you remember you have to convert it back?
Originally Posted By: Manual
bmDest is automatically converted to a render target on the first call of this function. For accessing pixels of the bitmap afterwards, it can be converted back to a pixel format (bmap_to_format) or blitted onto another bitmap (bmap_blit).



Always learn from history, to be sure you make the same mistakes again...
Re: bmap_process after level_load crashes [Re: Uhrwerk] #392428
01/22/12 11:33
01/22/12 11:33
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline OP
Serious User
Widi  Offline OP
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
No, i use it like in the example from the manual in a Panel.

Code:
PANEL* panTarget = { bmap = "#256x256x24"; flags = SHOW; } // target bmap
BMAP* bmSrc = "image.tga"; // source bmap

MATERIAL* mtlSepia = { // sepia coloring pixel shader
  effect = "
  Texture TargetMap; // source bitmap
  sampler2D smpSrc = sampler_state { texture = <TargetMap>; };
          
  float4 SepiaColor1 = {0.2, 0.05, 0.0, 1.0};   
  float4 SepiaColor2 = {1.0, 0.9,  0.5, 1.0}; 

  float4 process_sepia(float2 Tex: TEXCOORD0): COLOR 
  {
    float4 Color = tex2D( smpSrc, Tex.xy);
    float sepiaLerp = dot( float3(0.3, 0.59, 0.11), Color);
    return lerp(SepiaColor1,SepiaColor2,sepiaLerp);
  }

  technique Sepia {
    pass p1 {
      AlphaBlendEnable = false;	
      PixelShader = compile ps_2_0 process_sepia();
    }
  }   
  ";
}

function main()
{
  wait(1); // until DirectX device is opened
  level_load ("Level_1.wmb");
  bmap_process(panTarget.bmap,bmSrc,mtlSepia);
}



That crashes, but without the level_load is all ok.

Re: bmap_process after level_load crashes [Re: Widi] #392512
01/23/12 16:59
01/23/12 16:59
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline OP
Serious User
Widi  Offline OP
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
bump...

Re: bmap_process after level_load crashes [Re: Widi] #392521
01/23/12 19:07
01/23/12 19:07
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
I just did a quick check on my computer. Your sample code runs perfectly fine on my machine, regardless if you comment or uncomment the level_load statement. So basically I see four possible error sources:

  • Your .wmb file is damaged. Recompiling should solve the issue then.
  • Your source image is somehow different or damaged. I made a 24 bit .tga file.
  • Your hardware or any of your drivers is causing the problem.
  • You posted only an excerpt of your code and something totally different is causing the problem.



Always learn from history, to be sure you make the same mistakes again...
Re: bmap_process after level_load crashes [Re: Uhrwerk] #392575
01/24/12 16:15
01/24/12 16:15
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline OP
Serious User
Widi  Offline OP
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Thank you for trying that out so i know the fault is here by me.

1. It also crashes if i use "level_load(NULL)" so i think my .wmb is not damaged. Will try later with a minimal level.
2. I save the image with paint.net as a 24 bit .tga file (tried already with .bmp)
3. Will try it next week on a other PC, no time this week because i am busy at WEF in Davos frown
4. No more code. I reduce all for testing to the code i posted already.

Re: bmap_process after level_load crashes [Re: Widi] #392580
01/24/12 17:42
01/24/12 17:42
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
I did some additional tests in order to help you hunt that down.

I used Paint.net as well, tga, 24 bits, RLE compressed, image sizes 256*256, 512*512 and 500*500. I tried it with level_load(NULL) and level_load("testmap.wmb"). In any of the above cases the code ran totally fine.


Always learn from history, to be sure you make the same mistakes again...

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1