Compiling with MinGW, help needed!
Moderator: OpenTTD Developers
Compiling with MinGW, help needed!
Hi,
I have installed MinGW couple of times. After first time svn didn't work propely. So I installed it again following strictly LKRaiders advices. Now everything is working but I wonder why it now compile every single file if I have modified only one. After first installation it only compiled those files I had modified. Now it takes long time to test simply things. Is there some attribute in makefile.config or somewhere else to control this issue?
Btw, what does this mean?
Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unrecognized
Thanks!
I have installed MinGW couple of times. After first time svn didn't work propely. So I installed it again following strictly LKRaiders advices. Now everything is working but I wonder why it now compile every single file if I have modified only one. After first installation it only compiled those files I had modified. Now it takes long time to test simply things. Is there some attribute in makefile.config or somewhere else to control this issue?
Btw, what does this mean?
Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unrecognized
Thanks!
Yeah!
-
- Transport Coordinator
- Posts: 340
- Joined: 06 Feb 2006 23:58
Re: Compiling with MinGW, help needed!
This is no problem, but a bit annyoing.escopena wrote: Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unrecognized
I want to get rid of this too

It has something to do with libpng or zlib or both....
Help needed =)
Hi,
I have now been messing with source code couple times. There is screenshot as attachment of finance table with my experimental Tax System. It calculates real income and takes 25% tax of it. Tax is take from player at 1st day of next year.
This is my first C-programing project so there is many quesitions in my mind.
How does int32 and int64 'types'(or what ever their are) work? Can they be mixed or how to get int64 value form int32? Is it posible to get int32 value from int64? How to handle overflow?
Strings are also problematic for me. How does StringID work(what is the idea behind)? SetDParam64() SetDParam() etc. are also mysterious. How to set up two different strings for example for ShowErrorMessage(). Is it possible, following does not work:
Is there better way to print out some debug info than use ShowErrorMessage()
I have many other questions also but I'll continue later... Thanks for help!
I have now been messing with source code couple times. There is screenshot as attachment of finance table with my experimental Tax System. It calculates real income and takes 25% tax of it. Tax is take from player at 1st day of next year.
This is my first C-programing project so there is many quesitions in my mind.
How does int32 and int64 'types'(or what ever their are) work? Can they be mixed or how to get int64 value form int32? Is it posible to get int32 value from int64? How to handle overflow?
Strings are also problematic for me. How does StringID work(what is the idea behind)? SetDParam64() SetDParam() etc. are also mysterious. How to set up two different strings for example for ShowErrorMessage(). Is it possible, following does not work:
Code: Select all
money = 5000;
cur_tax_sum = 3000;
str_money = STR_7028;
SetDParam64(0, money);
str_tax = STR_7028;
SetDParam64(0, cur_tax_sum);
ShowErrorMessage(str_money, str_tax, 0, 0);
Is there better way to print out some debug info than use ShowErrorMessage()
I have many other questions also but I'll continue later... Thanks for help!
- Attachments
-
- Tax System
- tax-system-001.png (26.83 KiB) Viewed 3071 times
Yeah!
The string system is bit hard to understand at the begining. But if you know how to use it you will see that it works good. You can use SetDParam with stringsID, too.escopena wrote:Hi,
I have now been messing with source code couple times. There is screenshot as attachment of finance table with my experimental Tax System. It calculates real income and takes 25% tax of it. Tax is take from player at 1st day of next year.
This is my first C-programing project so there is many quesitions in my mind.
How does int32 and int64 'types'(or what ever their are) work? Can they be mixed or how to get int64 value form int32? Is it posible to get int32 value from int64? How to handle overflow?
Strings are also problematic for me. How does StringID work(what is the idea behind)? SetDParam64() SetDParam() etc. are also mysterious. How to set up two different strings for example for ShowErrorMessage(). Is it possible, following does not work:
Code: Select all
money = 5000; cur_tax_sum = 3000; str_money = STR_7028; SetDParam64(0, money); str_tax = STR_7028; SetDParam64(0, cur_tax_sum); ShowErrorMessage(str_money, str_tax, 0, 0);
Is there better way to print out some debug info than use ShowErrorMessage()
I have many other questions also but I'll continue later... Thanks for help!
The most work with strings i did were in the additional orders patch. A few lines: (in hope they explain themself)
Code: Select all
Index: lang/english.txt
===================================================================
STR_NEW_GO_TO :Go to {STATION} ({STRING})
STR_NEW_GO_NON_STOP_TO :Go non-stop to {STATION} ({STRING})
STR_LOADING_BTN :{BLACK}Loading
STR_ORDER_TRANSFER :Transfer and take cargo
STR_ORDER_LOAD :{STRING} Load{STRING}{STRING}
STR_ORDER_LOAD_ONLY :{STRING} Load only{STRING}{STRING}
STR_ORDER_TRANSFER_LOAD :Transfer and wait for {STRING} load{STRING}{STRING}
STR_ORDER_TRANSFER_LOAD_ONLY :Transfer and wait for exact {STRING} load{STRING}{STRING}
STR_ORDER_UNLOAD :{STRING} Unload
STR_ORDER_UNLOAD_ONLY :{STRING} Unload only
STR_ORDER_TRANSFER_UNLOAD :Transfer and leave empty
STR_ORDER_PRIORITY : (priority)
STR_ORDER_PRIORITY_BTN :{BLACK}Priority
STR_ORDER_LOAD_EXACT :{BLACK}Load Exact
STR_ORDER_LOAD_EXACT_HINT :{BLACK}load not more then set
STR_ORDER_PRIORITY_HINT :{BLACK}train has priority loading
STR_ORDER_MISC_BTN :{BLACK}Misc.
STR_ORDER_PERCENT_BTN :{BLACK}% loading
STR_ORDER_PERCENT_HINT :{BLACK}load/unload 10 percent more or less
STR_ORDER_LOAD_PER_TRAIN : of train
STR_ORDER_LOAD_PER_CARGO : of any cargo
STR_ORDER_LOAD_PER_BTN :{BLACK}Load base
STR_ORDER_LOAD_PER_HINT :{BLACK}Train will be loaded based on any cargo or train
##### Range for Percentile loads #####
STR_ORDER_10 :10%
STR_ORDER_20 :20%
STR_ORDER_30 :30%
STR_ORDER_40 :40%
STR_ORDER_50 :half
STR_ORDER_60 :60%
STR_ORDER_70 :70%
STR_ORDER_80 :80%
STR_ORDER_90 :90%
STR_ORDER_100 :full
##### End of range for Percentile loads #####
Index: order_gui.c
===================================================================
if(HASBIT(order->flags, OFB_NON_STOP))
SetDParam(1, STR_880C_GO_NON_STOP_TO);
else
SetDParam(1, STR_8806_GO_TO);
// Use the originals if only Non stop is set (or not)
if (order->flags == OF_NON_STOP || order->flags == 0) {
SetDParam(2, order->station);
} else {
SetDParam(1, STR_NEW_GO_TO);
// Non-Stop
if(HASBIT(order->flags, OFB_NON_STOP))
SetDParam(1, STR_NEW_GO_NON_STOP_TO);
SetDParam(2, order->station);
// Transfer
if(HASBIT(order->flags, OFB_TRANSFER))
SetDParam(3, STR_ORDER_TRANSFER);
// Load
if(HASBIT(order->flags, OFB_FULL_LOAD))
SetDParam(3, STR_ORDER_LOAD + (HASBIT(order->flags, OFB_EXACT_LOAD)?1:0)+ (HASBIT(order->flags, OFB_TRANSFER)?2:0));
// Unload
else if(HASBIT(order->flags, OFB_UNLOAD))
SetDParam(3, STR_ORDER_UNLOAD + (HASBIT(order->flags, OFB_EXACT_LOAD)?1:0) + (HASBIT(order->flags, OFB_TRANSFER)?2:0));
// The percentile of load
if(HASBIT(order->flags, OFB_UNLOAD) || HASBIT(order->flags, OFB_FULL_LOAD)) {
if(order->percentilefill)
SetDParam(4, STR_ORDER_10 + (order->percentilefill / 10) -1);
else
SetDParam(4, STR_ORDER_10 + 9); // 100% load
}
if(HASBIT(order->flags, OFB_CARGO_LOAD)){
SetDParam(5, STR_ORDER_LOAD_PER_TRAIN);
} else {
SetDParam(5, STR_ORDER_LOAD_PER_CARGO);
}
if(HASBIT(order->flags, OFB_PRIORITY)){
SetDParam(6, STR_ORDER_PRIORITY);
} else {
SetDParam(6, STR_EMPTY);
}
}
For better debug:
Code: Select all
debug("text usage like printf and co %d", value);
Last edited by gigajum on 03 Sep 2006 12:19, edited 1 time in total.
They just refer to the size of the variable - int32 is a (signed, I think) 32-bit integer, and int64 has 64 bits. You can't get a 64-bit value from a variable that only has 32 bits, but if you mean you want to store the value from an int32 in an int64, you can "cast" the value:escopena wrote:How does int32 and int64 'types'(or what ever their are) work? Can they be mixed or how to get int64 value form int32? Is it posible to get int32 value from int64? How to handle overflow?
Code: Select all
int32 foo = 14;
int64 bar = (int64)foo;
The only thing you can do about overflows is make sure either that the value can never get that large, or check the new value is less than the maximum for that type (there may be enums for that in a header file somewhere).
No-one's more important than the earthworm.
We played first network game with my Tax Patch. It worked fine. But there was some problem when clients were connecting to my server. They got error message like:
We are using build r6239M. Anybody else got similar problems?
Next question is:
How to define new fields to save file? I need to save and load an array.
Code: Select all
Microsoft assertion failed.
network.c
line 1198
Next question is:
How to define new fields to save file? I need to save and load an array.
Yeah!
Who is online
Users browsing this forum: No registered users and 25 guests