About Store Forum Documentation Contact



Post Reply 
small request
Author Message
Qbound Offline
Member

Post: #1
small request
Hi,

may be i missed something. but i searched here in the forum and in the tutorials.

The D.viewRange() isn't saved by the configSave() and it is not loaded by configLoad().

So i have a little request to save and load this value too.

thanks
Oliver
06-20-2010 01:19 PM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #2
RE: small request
(06-20-2010 01:19 PM)Qbound Wrote:  So i have a little request to save and load this value too.

Me too.
08-19-2010 01:20 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #3
RE: small request
Code:
Flt CustomViewRange = D.viewRange();

save the custom to file and load it.

and instead of using D.viewRange() for everything, just call CustomViewRange?

if you want to adjust the ViewRange
you do

Code:
Flt CustomViewRange;

In game loop or own update function.
CustomViewRange= D.viewRange() +|-|/|* ViewModifier;

ViewModifier can be slider, or keybind it to adjust it up and down
(This post was last modified: 08-19-2010 01:26 PM by Zervox.)
08-19-2010 01:22 PM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #4
RE: small request
Yes, I have it now and it saves to another txt file but I want to have it in one config.txt file and I'm not sure is it possible to overwrite it.
(This post was last modified: 08-19-2010 01:25 PM by Harry.)
08-19-2010 01:24 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #5
RE: small request
Most games always have a key config in binary storage or the likes, and gives users their own config.

you could create your own config.txt file from scratch and ignore using the basic save.config
08-19-2010 01:28 PM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #6
RE: small request
(08-19-2010 01:28 PM)Zervox Wrote:  you could create your own config.txt file from scratch and ignore using the basic save.config

But overwrite file which is created by ConfigSave() will be faster than writing it from scratch smile
08-19-2010 01:35 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #7
RE: small request
I dont think it takes too much to write it. : p But again wouldnt complain if it wasnt needed to rewrite it : P
(This post was last modified: 08-19-2010 01:43 PM by Zervox.)
08-19-2010 01:41 PM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #8
RE: small request
I've almost finished my own config.txt but as always I have some problems:

1. How can I save and load enum values? when I have this code:
Code:
Flt renderer;
if(f.cur("Renderer"        ))renderer=f.getReal(); Renderer.type(renderer);
and I have errors.

2. Why some if(f.cur(""))) don't want to work? For example in this case:
Code:
f.put("ShadowMapSize    = ",D.shdMapSize()    );
if(f.cur("ShadowMapSize"   ))shadowmapsize=f.getInt();
08-19-2010 05:46 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Barthap Offline
Member

Post: #9
RE: small request
1. Enum value is integer. Save enum values as integers.
08-19-2010 07:29 PM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #10
RE: small request
I tried this but I still have errors:

error C2664: 'EE::RendererClass &EE::RendererClass::type(EE::RENDER_TYPE)' : cannot convert parameter 1 from 'Int' to 'EE::RENDER_TYPE'
1> Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
08-19-2010 07:32 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Barthap Offline
Member

Post: #11
RE: small request
try Int integer = dynamic_cast<int>(your enum value). It runs conversion from enum to int.
or (int->enum)
ENUM_TYPE value = dynamic_cast<ENUM_TYPE>(integer);
08-19-2010 07:36 PM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #12
RE: small request
Don't help.

Edit: static_cast helps but now I still have problem number 2.

Edit2: Solved wink
(This post was last modified: 08-19-2010 09:07 PM by Harry.)
08-19-2010 08:03 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply