Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] Undocumented or unused command SetImageSavePixels(1) ?? Also a possible BUG found using SETIMAGEWRAPU(ID,1) and SETIMAGEWRAPV(ID,1)

Author
Message
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 6th Oct 2018 16:26
Just wondering what the following command is for. It's probably unused, so doesn't matter, but I came across it whilst looking for a command that would do the SetSpriteUVBorder(sprite,1) trick for textures on a 3D 'sprite'....
SetImageSavePixels(1)

I'm using SetImageWrapU(ID,1) for scrolling textures on water, but now it forces ALL of my textures to be powers of 2. Even when explicitly stating that some images I load (for UI for example) should NEVER wrap, SetImageWrapU(not_scrolling,0). According to the manual this can be done, but doesn't seem true.

Ie. in pseudo code :
// load some UI images of arbitrary sizes:
load UI texture 1
load UI texture 2
load UI texture 3
setimagewrapu(UI1,0)
setimagewrapv(UI1,0)
setimagewrapu(UI2,0)
setimagewrapv(UI2,0)
setimagewrapu(UI3,0)
setimagewrapv(UI3,0)

// load scrolling textures all power of 2 size next :
load water texture
load lava texture
setimagewrapu(waterID,1)
setimagewrapv(waterID,1)
setimagewrapu(lavaID,1)
setimagewrapv(lavaID,1)

This results in an error message for any UI image that is not a power of 2 in size.

The author of this post has marked a post as an answer.

Go to answer

puzzler2018
User Banned
Posted: 6th Oct 2018 16:29
Are your images definately the power of 2?

2x2
4x4
8x8
16x16
32x32
64x64
128x128
256x256
512x512
1024x1024
and so on?
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 6th Oct 2018 17:00
Some were not, but only user interface images that would never scroll anyway. I'm thankful you're trying to help, but I do know what texture sizes in a power of 2 means puzzler2018.

Of course all my scrolling textures are power of 2 in size, my user interface images however are not. And that's kind of my point/problem.

I would have assumed that I could set the wrap modes on a per image basis. I've even tried using SetDefaultWrapU(0) and SetDefaultWrapV(0) to allow for non-power of 2 images simultaneous to those that can wrap.

But I guess this doesn't work?? I was really hoping to still use both non-power of 2 images and power of 2 images. If using SetImageWrapU(id,1) means I can't ever have 1:1 scale 12 pixel by 12 pixel images for example, that's kind of a downside in my opinion. Yes changing it to 16x16 is an option, but what if I want my game to be pixel accurate and have a smaller image?
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 6th Oct 2018 23:34 Edited at: 6th Oct 2018 23:35
This post has been marked by the post author as the answer.
So, firstly....SetImageSavePixels() is deprecated and currently does nothing at all - Literally nothing. It still exists in the command set, but thats probably so that anyone that did use it wont have their code broken by removing it from the comamnd set


Secondly, Loading a non power of 2 image then loading a power of 2 image and setting wrapping on the second image(the one that is a power of 2) doesnt cause the error...Ive just tried it on a few images. (256x256 and 128x128 both wrap fine even though I previously loaded a 710x433 was loaded. I used the SetImageWrapU/V() commands on the power of 2 image and it was fine. This was tested just now on windows 10.

So, are you sure your images are power of 2 and are you sure that your not doing something else wrong? Do you have some example code that we can try...even using our own images?
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 8th Oct 2018 14:55
Okey, I found and fixed the problem. It was indeed a simple mistake on my part.

I thought I had read SetImageWrapU required an object or sprite ID to work and that would point to the object's texture, however it requires the texture image ID itself.

So instead of setting the water texture to wrap (like once), I was trying to set hundreds of water objects to wrap causing it to either fail or give an error as the id matched an image that was not power of 2.

So I guess SetImageWrapU(object_ID, 1 ) would interfer basically always with whatever is no power of 2 having that image ID , whereas SetImageWrapU(water_image_ID,1) would work fine.

Strange thing is.... sometimes it would actually work without issues. Not sure why that was.
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 8th Oct 2018 14:59
Quote: "So, firstly....SetImageSavePixels() is deprecated and currently does nothing at all - Literally nothing. It still exists in the command set, but thats probably so that anyone that did use it wont have their code broken by removing it from the comamnd set"


Yeah that makes sense, thanks.

Login to post a reply

Server time is: 2024-04-24 00:38:50
Your offset time is: 2024-04-24 00:38:50