IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage C++ Discussion :

Link sur une dll avec un objet contenu dans cette dll


Sujet :

Langage C++

  1. #1
    Nouveau membre du Club
    Inscrit en
    Mai 2004
    Messages
    35
    Détails du profil
    Informations forums :
    Inscription : Mai 2004
    Messages : 35
    Points : 26
    Points
    26
    Par défaut Link sur une dll avec un objet contenu dans cette dll
    bonjour,

    j'ai un pb de compilation bizarre, du moins au link en release. J'ai une dll dans laquelle j'ai une classe

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
     
    class KCLASS KW_GenWorld : public KW_GENWORLD_PARENT
    {
    protected:
    	virtual KBool					KMTH kInit();
    	virtual void						KMTH kShut();
    public:
    	inline virtual KInt32				KMTH kGetNbFields() const;
    	inline virtual const KFieldInfo		        KMTH kGetFieldInfo(KInt32 i) const;
    	virtual void						KMTH kUpdate();
    	virtual const KS_DisplayData *		KMTH kGetInternDisplayData(const KDrawInfo * di);
    			KBool					KMTH kGetDirectionnalShadow(KDD_Shadowed &kDD);
    	virtual	void					KMTH kBeforeReload(KS_InStream& Stream);
    	virtual KBool					KMTH kReadContents(KS_InStream& stream, KInt32 format=KS_IOFORMAT_DEFAULT);
    	virtual KBool					KMTH kWriteContents(KS_OutStream& stream, KInt32 format=KS_IOFORMAT_DEFAULT);
    			void					KMTH kInvalidateBBox()	{ kBBoxUpToDate = KFALSE; }
    	virtual KBBoxLocal					KMTH kGetBBox();
    	virtual void						KMTH kBBoxUpdate();
    		void						KMTH kSetRoot(KW_3DNodeHdl &_RootObjHdl);
    	inline	const KW_3DNodeHdl &		        KMTH kGetRoot(){return RootObjHdl;}
     
    ....
    KMTH est un define de __fastcall
    KCLASS est une define pour faire un __declspec( dllexport )

    toutes mes fonctions sont bien codé dans un CPP. Et pourtant j'ai cette erreur au link

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
     
    1>KW_GenWorld.obj : error LNK2001: symbole externe non résolu "public: virtual void __fastcall KW_GenWorld::kNeedSave(void)" (?kNeedSave@KW_GenWorld@@UAIXXZ)
    1>KW_GenWorld.obj : error LNK2001: symbole externe non résolu "public: virtual void __fastcall KW_GenWorld::kDoDependencies(bool)" (?kDoDependencies@KW_GenWorld@@UAIX_N@Z)
    1>KW_GenWorld.obj : error LNK2001: symbole externe non résolu "public: virtual int __fastcall KW_GenWorld::kGetAllDependencies(struct KW_DependenciesList &,bool)" (?kGetAllDependencies@KW_GenWorld@@UAIHAAUKW_DependenciesList@@_N@Z)
    1>KW_GenWorld.obj : error LNK2001: symbole externe non résolu "public: virtual void __fastcall KW_GenWorld::kUnSetDependencies(struct KW_GraphObjectHdl &,bool)" (?kUnSetDependencies@KW_GenWorld@@UAIXAAUKW_GraphObjectHdl@@_N@Z)
    1>KW_GenWorld.obj : error LNK2001: symbole externe non résolu "public: virtual void __fastcall KW_GenWorld::kChangeDependencies(struct KW_GraphObjectHdl &,struct KW_GraphObjectHdl &)" (?kChangeDependencies@KW_GenWorld@@UAIXAAUKW_GraphObjectHdl@@0@Z)
    1>KW_GenWorld.obj : error LNK2001: symbole externe non résolu "public: virtual void __fastcall KW_GenWorld::kBBoxUpdate(void)" (?kBBoxUpdate@KW_GenWorld@@UAIXXZ)
    1>KW_GenWorld.obj : error LNK2001: symbole externe non résolu "protected: virtual bool __fastcall KW_GenWorld::kInit(void)" (?kInit@KW_GenWorld@@MAI_NXZ)
    1>KW_GenWorld.obj : error LNK2001: symbole externe non résolu "protected: virtual void __fastcall KW_GenWorld::kShut(void)" (?kShut@KW_GenWorld@@MAIXXZ)
    1>KW_GenWorld.obj : error LNK2001: symbole externe non résolu "public: virtual void __fastcall KW_GenWorld::kUpdate(void)" (?kUpdate@KW_GenWorld@@UAIXXZ)
    1>KW_GenWorld.obj : error LNK2001: symbole externe non résolu "public: virtual void __fastcall KW_GenWorld::kBeforeReload(class KIStream &)" (?kBeforeReload@KW_GenWorld@@UAIXAAVKIStream@@@Z)
    1>KW_GenWorld.obj : error LNK2001: symbole externe non résolu "public: virtual bool __fastcall KW_GenWorld::kReadContents(class KIStream &,int)" (?kReadContents@KW_GenWorld@@UAI_NAAVKIStream@@H@Z)
    1>KW_GenWorld.obj : error LNK2001: symbole externe non résolu "public: virtual bool __fastcall KW_GenWorld::kWriteContents(class KOStream &,int)" (?kWriteContents@KW_GenWorld@@UAI_NAAVKOStream@@H@Z)
    1>KW_GenWorld.obj : error LNK2001: symbole externe non résolu "public: virtual struct KS_DisplayData const * __fastcall KW_GenWorld::kGetInternDisplayData(struct KDrawInfo const *)" (?kGetInternDisplayData@KW_GenWorld@@UAIPBUKS_DisplayData@@PBUKDrawInfo@@@Z)
    1>KW_GenWorld.obj : error LNK2001: symbole externe non résolu "public: virtual struct KBBoxLocal __fastcall KW_GenWorld::kGetBBox(void)" (?kGetBBox@KW_GenWorld@@UAI?AUKBBoxLocal@@XZ)
    1>KW_GenWorld.obj : error LNK2001: symbole externe non résolu "public: virtual bool __fastcall KW_GenWorld::kGetInfos(struct KDD_Tips &)" (?kGetInfos@KW_GenWorld@@UAI_NAAUKDD_Tips@@@Z)
    1>KW_GenWorld.obj : error LNK2001: symbole externe non résolu "public: virtual int __fastcall KW_GenWorld::kGetSubObjectTypedData(int,int,int,bool,bool)" (?kGetSubObjectTypedData@KW_GenWorld@@UAIHHHH_N0@Z)
    1>KW_GenWorld.obj : error LNK2001: symbole externe non résolu "public: virtual void __fastcall KW_GenWorld::kDelSubObjectTypedData(int,int,int,bool)" (?kDelSubObjectTypedData@KW_GenWorld@@UAIXHHH_N@Z)
    auriez-vous une idée de la solution. Merci d'avance

  2. #2
    Expert éminent sénior
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2005
    Messages
    5 074
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Conseil

    Informations forums :
    Inscription : Février 2005
    Messages : 5 074
    Points : 12 120
    Points
    12 120
    Par défaut
    Pouvez-vous nous donner le code de la définition (pas ça déclaration) de la méthode "kNeedSave" de la classe KW_GenWorld ?

  3. #3
    Nouveau membre du Club
    Inscrit en
    Mai 2004
    Messages
    35
    Détails du profil
    Informations forums :
    Inscription : Mai 2004
    Messages : 35
    Points : 26
    Points
    26
    Par défaut
    voila

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    void	KW_GenWorld::kNeedSave(void)

  4. #4
    Expert éminent sénior
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2005
    Messages
    5 074
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Conseil

    Informations forums :
    Inscription : Février 2005
    Messages : 5 074
    Points : 12 120
    Points
    12 120
    Par défaut
    Il ne manquerait pas un "KMTH" quelque par sur la ligne ?
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    KMTH void	KW_GenWorld::kNeedSave(void)

  5. #5
    Nouveau membre du Club
    Inscrit en
    Mai 2004
    Messages
    35
    Détails du profil
    Informations forums :
    Inscription : Mai 2004
    Messages : 35
    Points : 26
    Points
    26
    Par défaut
    Je viens de tester et j'ai toujours le même pb.

  6. #6
    Expert éminent sénior
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2005
    Messages
    5 074
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Conseil

    Informations forums :
    Inscription : Février 2005
    Messages : 5 074
    Points : 12 120
    Points
    12 120
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    virtual void KMTH KW_GenWorld::kNeedSave(void)

  7. #7
    Nouveau membre du Club
    Inscrit en
    Mai 2004
    Messages
    35
    Détails du profil
    Informations forums :
    Inscription : Mai 2004
    Messages : 35
    Points : 26
    Points
    26
    Par défaut
    non plus. de plus l'erreur apparait sur des fonctions virtuelle aussi ( genre kInit )

  8. #8
    Expert éminent sénior
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2005
    Messages
    5 074
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Conseil

    Informations forums :
    Inscription : Février 2005
    Messages : 5 074
    Points : 12 120
    Points
    12 120
    Par défaut
    Comme je vous trouve pas chaud pour nous postez tout le .h et tout le .cpp, on va jouez aux devinettes.
    Le cpp est bien compilé dans le projet ?

  9. #9
    Nouveau membre du Club
    Inscrit en
    Mai 2004
    Messages
    35
    Détails du profil
    Informations forums :
    Inscription : Mai 2004
    Messages : 35
    Points : 26
    Points
    26
    Par défaut
    Je n'ai pas mit tout le .cpp et .h parce que cela va faire un post de 4km de long. Si vous voulez le voir le voici.

    .Cpp
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    735
    736
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770
    771
    772
    773
    774
    775
    776
    777
    778
    779
    780
    781
    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    796
    797
    798
    799
    800
    801
    802
    803
    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    816
    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    829
    830
    831
    832
    833
    834
    835
    836
    837
    838
    839
    840
    841
    842
    843
    844
    845
    846
    847
    848
    849
    850
    851
    852
    853
    854
    855
    856
    857
    858
    859
    860
    861
    862
    863
    864
    865
    866
    867
    868
    869
    870
    871
    872
    873
    874
    875
    876
    877
    878
    879
    880
    881
    882
    883
    884
    885
    886
    887
    888
    889
    890
    891
    892
    893
    894
    895
    896
    897
    898
    899
    900
    901
    902
    903
    904
    905
    906
    907
    908
    909
    910
    911
    912
    913
    914
    915
    916
    917
    918
    919
    920
    921
    922
    923
    924
    925
    926
    927
    928
    929
    930
    931
    932
    933
    934
    935
    936
    937
    938
    939
    940
    941
    942
    943
    944
    945
    946
    947
    948
    949
    950
    951
    952
    953
    954
    955
    956
    957
    958
    959
    960
    961
    962
    963
    964
    965
    966
    967
    968
    969
    970
    971
    972
    973
    974
    975
    976
    977
    978
    979
    980
    981
    982
    983
    984
    985
    986
    987
    988
    989
    990
    991
    992
    993
    994
    995
    996
    997
    998
    999
    1000
    1001
    1002
    1003
    1004
    1005
    1006
    1007
    1008
    1009
    1010
    1011
    1012
    1013
    1014
    1015
    1016
    1017
    1018
    1019
    1020
    1021
    1022
    1023
    1024
    1025
    1026
    1027
    1028
    1029
    1030
    1031
    1032
    1033
    1034
    1035
    1036
    1037
    1038
    1039
    1040
    1041
    1042
    1043
    1044
    1045
    1046
    1047
    1048
    1049
    1050
    1051
    1052
    1053
    1054
    1055
    1056
    1057
    1058
    1059
    1060
    1061
    1062
    1063
    1064
    1065
    1066
    1067
    1068
    1069
    1070
    1071
    1072
    1073
    1074
    1075
    1076
    1077
    1078
    1079
    1080
    1081
    1082
    1083
    1084
    1085
    1086
    1087
    1088
    1089
    1090
    1091
    1092
    1093
    1094
    1095
    1096
    1097
    1098
    1099
    1100
    1101
    1102
    1103
    1104
    1105
    1106
    1107
    1108
    1109
    1110
    1111
    1112
    1113
    1114
    1115
    1116
    1117
    1118
    1119
    1120
    1121
    1122
    1123
    1124
    1125
    1126
    1127
    1128
    1129
    1130
    1131
    1132
    1133
    1134
    1135
    1136
    1137
    1138
    1139
    1140
    1141
    1142
    1143
    1144
     
    #include <edition/KS_Gui.h>
    #include <edition\KControl_PropertyCtrl.h>
    #include <edition/KS_Cfg.h>
    #include <runtime/KW_Bitmap.h>
    #include <DB/KS_LogicalObject.h>
    #include "edition\KS_EditionToolBox.h"
    #include <private\db\KFile.h>
    #include <db/KDB_Manager.h>
    #include "KW_GenWorld.h"
    #include "AGW_GenWorld.h"
    #include "KW_3DNode.h"
    #include "TBitmap.h"
    #include "KW_DLight.h"
    #include "KW_GwRoad.h"
    #include "KW_Road.h"
    #include "KW_Path.h"
     
    namespace Viewport_Z 
    {
    	Vec4f	Default_Bloom( 1.500385f, 5.000063f, 0.2f, 0.200004f );
    	Float	Default_AverageGrayLevel	= 0.9f;			// Il faut des Default lorsqu'aucune caméra est activé
    	Float	Default_WhiteLevel			= 25.f;			// Les Defaults sont mises dans chaque objet Viewport_Z
    	Float	Default_MinExposure			= 0.45f;			// Il faut donc changer les valeurs ici
    	Float	Default_MaxExposure			= 2.f;
    	Vec4f	Default_BlueShift(0.2f,0.3f,1.f,0.1f);
    	Float	Default_RainAmount			= 0.f;
    	Vec3f	Default_CubeMapOffset(0.0f,0.0f,0.0f);
    	Vec4f	Default_HDRSettings(0.f,0.4f,0.f,6.f);
    }
     
     
    KUInt32 gShadowMapPrimitiveFilter[NUM_SHADOW_TEXTURES] =
    	{
    		//Slice 0 
    		 (1<<RPPRIM_GROUND)
    		|(1<<RPPRIM_NODECAL_GROUND)
    		|(1<<RPPRIM_NODECAL_FARGROUND)
    		|(1<<RPPRIM_NODECAL_VERYFARGROUND)
    //		|(1<<RPPRIM_FADEGROUND)
    		|(1<<RPPRIM_FARGROUND)
    //		|(1<<RPPRIM_FARFADEGROUND)
    		|(1<<RPPRIM_VERYFARGROUND)
    		|(1<<RPPRIM_ROCHER)
    		|(1<<RPPRIM_BOIS)
    		|(1<<RPPRIM_GLOBALBOIS)
    		|(1<<RPPRIM_FARLEAVES)
    		|(1<<RPPRIM_FARBUSHES)
    		//		|(1<<RPPRIM_FADELEAVES)
    		|(1<<RPPRIM_LEAVES)
    		|(1<<RPPRIM_CLOSE_LEAVES)
    		|(1<<RPPRIM_MESHES)
    		,//Slice 1
    		 (1<<RPPRIM_GROUND)
    		|(1<<RPPRIM_NODECAL_GROUND)
    		|(1<<RPPRIM_NODECAL_FARGROUND)
    		|(1<<RPPRIM_NODECAL_VERYFARGROUND)
    //		|(1<<RPPRIM_FADEGROUND)
    		|(1<<RPPRIM_FARGROUND)
    //		|(1<<RPPRIM_FARFADEGROUND)
    		|(1<<RPPRIM_VERYFARGROUND)
    		|(1<<RPPRIM_ROCHER)
    		|(1<<RPPRIM_BOIS)
    		|(1<<RPPRIM_GLOBALBOIS)
    		|(1<<RPPRIM_FARLEAVES)
    		|(1<<RPPRIM_FARBUSHES)
    //		|(1<<RPPRIM_FADELEAVES)
    		|(1<<RPPRIM_LEAVES)
    		|(1<<RPPRIM_CLOSE_LEAVES)
    		|(1<<RPPRIM_MESHES)
    		,//Slice 2
    		 (1<<RPPRIM_GROUND)
    		|(1<<RPPRIM_NODECAL_GROUND)
    		|(1<<RPPRIM_NODECAL_FARGROUND)
    		|(1<<RPPRIM_NODECAL_VERYFARGROUND)
    //		|(1<<RPPRIM_FADEGROUND)
    		|(1<<RPPRIM_FARGROUND)
    //		|(1<<RPPRIM_FARFADEGROUND)
    		|(1<<RPPRIM_VERYFARGROUND)
    	//	|(1<<RPPRIM_ROCHER)
    	//	|(1<<RPPRIM_BOIS)
    	//	|(1<<RPPRIM_GLOBALBOIS)
    		|(1<<RPPRIM_FARLEAVES)
    		|(1<<RPPRIM_FARBUSHES)
    	//		|(1<<RPPRIM_FADELEAVES)
    		|(1<<RPPRIM_LEAVES)
    		|(1<<RPPRIM_CLOSE_LEAVES)
    		|(1<<RPPRIM_MESHES)
    		,//Slice 3
    		 (1<<RPPRIM_GROUND)
    		|(1<<RPPRIM_NODECAL_GROUND)
    		|(1<<RPPRIM_NODECAL_FARGROUND)
    		|(1<<RPPRIM_NODECAL_VERYFARGROUND)
    //		|(1<<RPPRIM_FADEGROUND)
    		|(1<<RPPRIM_FARGROUND)
    //		|(1<<RPPRIM_FARFADEGROUND)
    		|(1<<RPPRIM_VERYFARGROUND)
    	//	|(1<<RPPRIM_ROCHER)
    	//	|(1<<RPPRIM_BOIS)
    	//	|(1<<RPPRIM_GLOBALBOIS)
    		|(1<<RPPRIM_FARLEAVES)
    		|(1<<RPPRIM_FARBUSHES)
    //		|(1<<RPPRIM_FADELEAVES)
    		|(1<<RPPRIM_LEAVES)
    		|(1<<RPPRIM_CLOSE_LEAVES)
    		|(1<<RPPRIM_MESHES)
    	};
     
    //---------------------------------------------------------------------------------------------------
    //											KW_GenWorld
    //---------------------------------------------------------------------------------------------------
     
    KBool KW_GenWorld::kInit()
    {
    	m_bLoopingUpdateWorldThread=FALSE;
     
    	//Les Matieres & les BMap compressé 
    	KInt32	i;
    	pDefaultCompressedBmap=NULL;
    	for(i=0;i<GENWORLD_MATERIAL_NB;i++)
    	{
    		pCompressedBmap[i]=NULL;
    		kMaterialHdlList[i].kSetObjectType(KS.kWorldManager->kGetClassNum("TBitmap"));
    		kSetMaterial(i,kGetMaterial(i),
    						KFALSE,	//KFALSE no notify KW_GenWorld modified
    						KFALSE);	//KFALSE no need updatematerialdisplay
    	}
     
    	if( !KW_GENWORLD_PARENT::kInit() )
    		return KFALSE;
     
    	kBBoxUpToDate=KFALSE;
     
    	InitPrimitiveStates();
    	for(i=0;i<RPPRIM_COUNT;i++)	//Alors oué, faut inverser le cw par ccw
    		if(gPrimitiveStates[i].Ds&ds_cw)
    		{
    			gPrimitiveStates[i].Ds&=~ds_cw;
    			gPrimitiveStates[i].Ds|=ds_ccw;
    		}
    	m_DisplayWorld.SetHasDisplayWorld(FALSE);
    	m_DisplayWorld.SetHasTerraFormWorld(FALSE);
    	m_UpdateWorld.SetHasStackTerraFormWorld(TRUE);
    	m_DisplayWorld.SetCacheSizeRatio(0);
     
    	kCurPlayerTime=0.f;
    	kCurPlayerSpeed=1.f;
    	kUpdateDayCycle();	//DayCycle Default values
     
    	kSetWorldID(41,KFALSE);
     
    	//Recuper les Strings des Type de Road pour le PopUp
    	for(KInt32 Type=0;Type<cA_RoadTypeInfo::RoadTypeInfos_LAST;Type++)
    		AddRoadLinkType(KString(cA_RoadTypeInfo::TabRoadTypeInfos[Type].MyTypeStr));
     
    	kDDGenWorld.kGenWorldHdl=kGetHandle();
     
    	#define	ATHMOSPHERELIMIT	5000.f
    	#define	ATHMOSFORCEFORCE	0.5f
    	#define	HAZELIMIT			200.f
    	#define	HAZEFORCE			0.f
     
    	kID.kSetValue(41L);
    	kAtmLimit.kSetValue(ATHMOSPHERELIMIT);
    	kAtmForce.kSetValue(ATHMOSFORCEFORCE);
    	kAtmHazeLimit.kSetValue(HAZELIMIT);
    	kAtmHazeForce.kSetValue(HAZEFORCE);
     
    	kRoadHdl.kSetObjectType(KS.kWorldManager->kGetClassNum(KW_GWROAD_KCLASS));
     
    	//Ajoute Bank d objet "TREES" si non présente (on fera les boutons apres)
    	GetBankObj("TREES",KTRUE);
    	GetBankObj("BUSHES",KTRUE);
    	GetBankObj("ROCKS",KTRUE);
    	return KTRUE;
    }
     
    void KW_GenWorld::kShut()
    {
    	KW_GENWORLD_PARENT::kShut();
    	kCleanAllDatas();
    }
     
    void KW_GenWorld::kCleanAllDatas()
    {
    	m_bLoopingUpdateWorldThread=FALSE;		//Thread_Z Remove
    	while( m_UpdateThread.Join(2000*1000) != THREAD_WAIT_SIGNALED)
    	{
    		m_DisplayWorld.FlushCaches();
    		m_UpdateWorld.FlushCaches();
    	}
    	m_DisplayWorld.Reset();
    	m_UpdateWorld.Reset();
    //	PreLoadedTrees.Empty();
    //	PreLoadedBushes.Empty();
    	FlushMeshTypes();
    //	MyPrimitives.Empty(TRUE);
    //	MyPrimitives2.Empty(TRUE);
    //	MyPrimitives3.Empty(TRUE);
     
    	kFlushGenSurfaces();
    	kFlushRoads();
    }
     
    //---------------------------------------------------------------------------------------------------
    //											Update Handling
    //---------------------------------------------------------------------------------------------------
     
    void KW_GenWorld::kUpdate()
    {
    	KW_GENWORLD_PARENT::kUpdate();
     
    	//Check All Binary stuff to be reloaded, so rebuild converted compressed file
    	KBool	bNeedReloadBinary=KFALSE;
    	for(KInt32 MatId=GENWORLD_MATERIAL_TO_BINARY_FIRST;MatId<GENWORLD_MATERIAL_TO_BINARY_LAST ; MatId++)
    		for(int	i=0; ; i++)
    		{
    			if (gBinaryDescArray[i].ID<0) break;
    			S32	BinId=gBinaryDescArray[i].ID;
    			if (MatId!=BinId+GENWORLD_MATERIAL_TO_BINARY_FIRST)
    				continue;
    			KString			FullFileName;
    			KW_BitmapHdl	BitmapHdl=kGetCompressedBitmapHdl(MatId,FullFileName);
    			if(!BitmapHdl.kIsValid())
    				continue;
    			if(kDBManager->kGetLogicalObjectFromSharedHandle(BitmapHdl)->kGetHasBeenReloadedAndSetFalse())
    				bNeedReloadBinary=KTRUE;
    		}
     
    	if(bNeedReloadBinary)
    	{
    		//Flush GenWorld
    		kCleanAllDatas();
     
    		//Reload Data
    		for(KInt32 i=0;i<GENWORLD_MATERIAL_NB;i++)
    			kSetMaterial(i,kGetMaterial(i),
    							KFALSE,	//KFALSE no notify KW_GenWorld modified
    							(i==(GENWORLD_MATERIAL_NB-1))?KTRUE:KFALSE);	//KTRUE for last one, to updatematerialdisplay at end
     
    	}
    	kSetRoot(RootObjHdl);
     
    	kSyncGeneration();
     
    	//Materials
    	kUpdateMaterialsData();
    	kValidate();
    }
     
    //---------------------------------------------------------------------------------------------------
    //											Display Handling
    //---------------------------------------------------------------------------------------------------
    U32 _UpdateThreadUpdate(void* userdata)
    {
    	KW_GenWorld* pWorld = (KW_GenWorld*) userdata;
    	return pWorld->UpdateWorldThread();
    }
     
    S32 IdleFrames=0;
    S32 KW_GenWorld::UpdateWorldThread()
    {
    	CHECKFTOLMODE();
    	SetFloatControlDownward();
     
    	m_UpdateMutex.Lock();
    	m_UpdateWorld.SetDetailView(m_DetailView);
    	m_UpdateMutex.Unlock();
     
    	m_UpdateWorld.InitToCam(m_UpdateWorld.GetDetailCenter());
     
    	while (m_bLoopingUpdateWorldThread)
    	{
    		m_UpdateMutex.Lock();
    		m_UpdateWorld.SetDetailView(m_DetailView);
    		m_UpdateWorld.GetWorldSun()=m_DisplayWorld.GetWorldSun();
    		m_UpdateWorld.SetCloudsAmount(0.f);
    		m_UpdateMutex.Unlock();
     
    		m_UpdateWorld.InitLongUpdateComputations(2);
    		m_UpdateWorld.UpdateDisplayWorld(0.2f,0.2f,0.2f);
    		m_UpdateWorld.UpdateLogicalWorld(0.2f);
     
    		m_UpdateWorld.AddExternalTerraStacks(&m_UpdateWorld);
     
    		// Seb: Si cache saturé, on tanke la thread ici...
    		while (m_UpdateWorld.IsCacheSaturated())
    		{
    			Sleep_Z(10000);
    		}
    		if (m_UpdateWorld.UseOneLongUpdateComputations())
    		{
    			IdleFrames++;
    			if (IdleFrames>10)
    			{
    				Sleep_Z(10000);
    			}
    		}
    		else
    		{
    			IdleFrames=0;
    		}
    	};
    	return 0;
    }
     
    void	KW_GenWorld::kSyncGeneration()
    {
    	if(!m_UpdateThread.IsInited())
    		return;
    	m_UpdateWorld.A_FlushFreeBuffers();
    	m_UpdateWorld.AddRenderStacks();
    	m_UpdateWorld.AddTerraStacks(&m_DisplayWorld);
    }
     
    KBool	KW_GenWorld::kGetDirectionnalShadow(KDD_Shadowed &kDD)
    {
    	kDD.kDirectionnalDir=m_DisplayWorld.GetWorldAtmosphere().m_FakeLightingDir;
    	kDD.kEnabled=KTRUE;
    	return KFALSE;
    }
     
    const KS_DisplayData* KW_GenWorld::kGetInternDisplayData(const KDrawInfo *di)
    {
    	CHECKFTOLMODE();
    	kCheckObject();
    	if(!di->cam.kIsValid())
    		return	NULL;
    	kDDGroup.kElemAr.kSetSize(2);
    	if (kGetState(DISP_ID_TEXTURE))
    		kDDGroup.kElemAr[0]=kGetMaterialsDisplayData(di);
    	else
    		kDDGroup.kElemAr[0]=NULL;
     
    	KW_Camera *kCamera = kGetPtr(di->cam);
    	KMatrix3x3f		lMatRot(kCamera->kGetRotation());
    	Vec3f			lCameraPos=kCamera->kTranslation.kGetValue();
    	Vec3f			lCameraDir(-lMatRot.m[0][2],-lMatRot.m[1][2],-lMatRot.m[2][2]);
     
    	if(!m_bLoopingUpdateWorldThread)
    	{
    		SetFloatControlDownward();
     
    		//User Define des Couleurs la Dialog KD_GenWorldProperty
    		kUpdateUserDefined();
     
    		// Update à mettre dans le thread...
    		m_DisplayWorld.InitToCam(lCameraPos);
     
    		m_bLoopingUpdateWorldThread=TRUE;
     
    		ThreadParam_Z thp;
    		strcpy(thp.Name,"GenWorldUpdate");
    		thp.ThreadProc = &_UpdateThreadUpdate;
    		thp.UserData = this;
    		thp.StackSize = 0x100000;	// 1MB
    		m_UpdateThread.Init(thp);
    		m_UpdateThread.Start();
    	}
     
    	//View	& Frustrums
    	cA_View	&view=m_DetailView;
    	view.CamPos.x	=	lCameraPos.x;
    	view.CamPos.y	=	lCameraPos.y;
    	view.CamPos.z	=	lCameraPos.z;
    	view.NearClip	=	0.25f;
    	view.FarClip	=	80000.f;
    	view.Front		=	lCameraDir;
    	Vec3f	right=view.Front^VEC3F_UP;
    	right.CNormalize();
    	Vec3f	nup=right^view.Front;
    	nup.CNormalize();
    	view.Up			=nup;
    	Mat4x4 CamMat;
    	BuildLookAtMatrix(view.Front,view.Up,CamMat);
    	Float	HRatio=1.f;
    	Float	VRatio=1.f;
    	view.Plane.BuildFrustrum(CamMat,view.CamPos,HRatio,VRatio,view.NearClip,view.FarClip);
    	view.ExtPlane.BuildFrustrum	(CamMat,view.CamPos-view.Front*10.f,HRatio,VRatio,view.NearClip,view.FarClip);
     
    	m_DisplayWorld.SetDetailView(m_DetailView);
    	m_DisplayWorld.InitLongUpdateComputations(0);
    	m_DisplayWorld.UpdateDisplayWorld(0.2f,0.2f,0.2f);
    	m_DisplayWorld.UpdateLogicalWorld(0.2f);
     
    	kSyncGeneration();
     
    	m_DisplayWorld.UseOneLongUpdateComputations();
     
    	kDDGroup.kElemAr[1]=&kDDGenWorld;
    	return	&kDDGroup;
    }
     
    //---------------------------------------------------------------------------------------------------
    void	KW_GenWorld::kBBoxUpdate(void)
    {
    	kCheckObject();
    	KW_GENWORLD_PARENT::kBBoxUpdate();
    }
    KBBoxLocal KW_GenWorld::kGetBBox()
    {
    	KBBoxLocal	bb;
    	return	bb;
    }
    //---------------------------------------------------------------------------------------------------
    //											File Handling
    //---------------------------------------------------------------------------------------------------
     
    KBool KW_GenWorld::kReadContents(KS_InStream &Stream,KInt32 Format)
    {
    	if (!KW_GENWORLD_PARENT::kReadContents(Stream,Format))	
    		return KFALSE;
     
    	PWP_DELTA_MEMORY("KW_GenWorld::kReadContents");
    	kMinimizeMemory();
    	kSetWorldID(kID.kGetValue(),KFALSE);
     
    	kSetRoadObject(kGetRoadObject(),KFALSE);
     
    	for(KInt32 i=0;i<GENWORLD_MATERIAL_NB;i++)
    		kSetMaterial(i,kGetMaterial(i),KFALSE,	//KFALSE no notify KW_GenWorld modified
    						(i==(GENWORLD_MATERIAL_NB-1))?KTRUE:KFALSE);	//KTRUE for last one, to updatematerialdisplay at end
     
    	kUpdateDayCycle();	//DayCycle Default values
    	kUpdateUserDefined();
     
    	KInt32	indent=1;
    	char		Type[2049];
    	if(Stream.kGetWord(Type, 2048))
    	{
    		if(strcmp(Type,"{"))
    			return KFALSE;
    		while( indent && Stream.kGetWord(Type, 2048))
    		{
    			if(!strcmp(Type,"{"))			indent++;
    			else if(!strcmp(Type,"}"))		indent--;
    			else if(!strcmp(Type,"BankObj"))
    			{
    				kBankObj.kAdd();
    				if(!kBankObj[kBankObj.kGetSize()-1].kRead(Stream,Format))
    				{
    					KS.kMessage("KW_GenWorld::BankObj not recognised");
    					return KFALSE;
    				}
    				else
    					indent--;
    			}
    			else if(!strcmp(Type,"Missions")
    				|| !strcmp(Type,"PointOfInterests")
    				|| !strcmp(Type,"Zones"))
    			{
    				//Le Type
    				kUnknowData+=KString("\r\n")+KString("{ ")+KString(Type)+KString("\r\n");
    				KInt32	StreamStartPos=Stream.kGetPos();
    				//Cherche la fin
    				S32	mindent=1;
    				while(mindent && Stream.kGetWord(Type, 2048))
    				{
    					if(!strcmp(Type,"{"))			mindent++;
    					else if(!strcmp(Type,"}"))		mindent--;
    				}
    				KInt32		StreamEndPos=Stream.kGetPos()-1;	//Pour eviter le coup du demit retour de chariot
    				//Copie tout 
    				KUInt8DA	BufferRead;	BufferRead.kSetSize((StreamEndPos-StreamStartPos)+1);
    				BufferRead[StreamEndPos-StreamStartPos]=0;
    				Stream.kSetPos(StreamStartPos);
    				Stream.kReadData(BufferRead.kPtr(),StreamEndPos-StreamStartPos);
     
    				//Ajoute a la chaine
    				kUnknowData+=KString((const KChar*)BufferRead.kPtr());
     
    				//Au Revoir
    				indent--;
    			}
    		}
    	}
     
    	//Ajoute Bank d objet "TREES" si non présente (on fera les boutons apres)
    	GetBankObj("TREES",KTRUE);
    	GetBankObj("BUSHES",KTRUE);
    	GetBankObj("ROCKS",KTRUE);
     
    	return KTRUE;
    }
     
    KBool KW_GenWorld::kWriteContents(KS_OutStream &Stream,KInt32 Format)
    {
    	if (!KW_GENWORLD_PARENT::kWriteContents(Stream,Format))	
    		return KFALSE;
     
    	//Chunk !
    	Stream << Stream.kEOL() << "{ " << Stream.kEOL();
    	{
    		KInt32	i;
    		for(i=0;i<kBankObj.kGetSize();i++)
    			if(!kBankObj[i].kWrite(Stream))
    				return KFALSE;
     
    		//Missions et autres
    		if(kUnknowData.kGetLength())
    			Stream.kWrite(kUnknowData,kUnknowData.kGetLength());
    	}
    	//Fin
    	Stream << Stream.kEOL() << "}" << Stream.kEOL();
    	return	KTRUE;
    }
     
    //---------------------------------------------------------------------------------------------------------
    //							Empty all Array before new ReadContents
    //-------------------------------------------------------------------------------------------------------
     
    void KW_GenWorld::kBeforeReload(KS_InStream& Stream)
    {
    	KW_GENWORLD_PARENT::kBeforeReload(Stream);
    	kBankObj.kEmpty();
     
    }
    void	KW_GenWorld::kMinimizeMemory()
    {
    }
    KBool KW_GenWorld::kGetInfos(KDD_Tips &Tips)
    {
    	return	KTRUE;
    }
     
     
    //---------------------------------------------------------------------------------------------------------
    //							Dependencies
    //-------------------------------------------------------------------------------------------------------
     
    void	KW_GenWorld::kNeedSave(void)
    {
    	cNeedSave(kGetHandle());
    }
     
    void	KW_GenWorld::kSetRoadObject(KW_GraphObjectHdl &Hdl,KBool bNeedSave)
    {
    	kRoadHdl.kSetValue(Hdl);
     
    	m_UpdateWorld.TerraRoad.pStockRoads = NULL;
    	m_UpdateWorld.TerraRoad.pGPSRoads = NULL;
    	m_UpdateWorld.TerraRoad.pStockHubs = NULL;
    	m_UpdateWorld.TerraRoad.pStockATVs = NULL;
    	m_UpdateWorld.BigLakes.pStockLakes = NULL;
     
    	if(Hdl.kIsValid())
    	{
    		KW_GwRoadPtr	_Ptr(Hdl);
    		m_UpdateWorld.TerraRoad.pStockRoads = &(_Ptr->pStockRoads);
    		m_UpdateWorld.TerraRoad.pGPSRoads = &(_Ptr->pGPSRoads);
    		m_UpdateWorld.TerraRoad.pStockHubs = &(_Ptr->pStockHubs);
    		m_UpdateWorld.TerraRoad.pStockATVs = &(_Ptr->pStockATVs);
    		m_UpdateWorld.BigLakes.pStockLakes = &(_Ptr->pStockLakes);
    	}
    	if(bNeedSave)
    		kNeedSave();
    }
     
    void	KW_GenWorld::kDoDependencies(KBool bForce)
    {
    	KS_LogicalObject	*LoPtr=kDBManager->kGetLogicalObjectFromSharedHandle(kGetHandle());
    	KS_ASSERT(LoPtr);	
     
    	KW_DependenciesList	kDependenciesHdl;
    	KInt32	i,Nb=kGetAllDependencies(kDependenciesHdl);
     
    	if(LoPtr->kGetShouldBeSaved())
    	{
    		LoPtr->kRemoveAllDependencies();
    		for(i=0;i<Nb;i++)
    			if(kDBManager->kGetLogicalObjectFromSharedHandle(kDependenciesHdl[i]))
    				LoPtr->kNotifyUsesSharedObject(kDependenciesHdl[i],KTRUE);
    	}
    	for(i=0;i<Nb;i++)
    	{
    		KW_GraphObjectPtr	_Obj(kDependenciesHdl[i]);
    		_Obj->kDoDependencies();
    	}
    }
     
    KInt32	KW_GenWorld::kGetAllDependencies(KW_DependenciesList &Dep,KBool bRecurse)
    {
    	KW_GraphObjectHdlDA List;
    	for(KInt32 i=0;i<GENWORLD_MATERIAL_NB;i++)
    		if(kGetMaterial(i).kIsValid())
    			List.kAdd(kGetMaterial(i));
     
    	if(kGetRoadObject().kIsValid())
    		List.kAdd(kGetRoadObject());
     
    	KInt32	i;
    	for(i=0;i<kBankObj.kGetSize();i++)
    		kBankObj[i].kGetAllDependencies(Dep,bRecurse);
     
    	Dep.kAdd(List,bRecurse);
     
    	return	Dep.kGetSize();
    }
     
    void	KW_GenWorld::kUnSetDependencies(KW_GraphObjectHdl &kHdl,KBool bRecurse)
    {
    	KInt32	i;
    	for(i=0;i<kBankObj.kGetSize();i++)
    		if(kBankObj[i].kUnSetDependencies(kHdl,bRecurse))
    			kInvalidate();
    }
     
    void	KW_GenWorld::kChangeDependencies(KW_GraphObjectHdl &kOldHdl,KW_GraphObjectHdl &kNewHdl)
    {
    	KInt32	i;
    	for(i=0;i<kBankObj.kGetSize();i++)
    		if(kBankObj[i].kChangeDependencies(kOldHdl,kNewHdl))
    			kInvalidate();
    }
     
    KBool KW_GenWorld::kIsMaterialUsed(KW_GraphObjectHdl &Hdl)
    {
    	if(Hdl.kIsValid())
    		for(KInt32 i=0;i<GENWORLD_MATERIAL_NB;i++)
    			if(kAreSameHandles(kGetMaterial(i),Hdl))
    				return	KTRUE;
    	return	KFALSE;
    }
    TBitmapHdl		KW_GenWorld::kGetMaterial(KInt32 Id)
    {
    	return kMaterialHdlList[Id].kGetValue();
    }
     
    void	KW_GenWorld::kSetMaterial(KInt32 MatId,TBitmapHdl &MatHdl,KBool bNeedSave,KBool bUpdateMaterialDisplayData)
    {
    	kMaterialHdlList[MatId].kSetValue(MatHdl);
     
    	if(bUpdateMaterialDisplayData)
    	{
    		kUpdateMaterialsData();
    		kInvalidate();
    	}
    	if(bNeedSave)	kNeedSave();
     
    	#define	LANDSCAPESIZE	140000.f
     
    	//Scan Array for MatId ==
    	for(int	i=0; ; i++)
    	{
    		if (gBinaryDescArray[i].ID<0) break;
    		S32	BinId=gBinaryDescArray[i].ID;
    		if (MatId!=BinId+GENWORLD_MATERIAL_TO_BINARY_FIRST)
    			continue;
    		KBmap	*pCompBmap=kGetCompressedBMap(MatId);
    		if(!pCompBmap)	break;
     
    		KUInt32	*kCmdDicho=(KUInt32*)pCompBmap->kGetBmapDatas();
    		kCmdDicho+=4;//Header SizeX,SizeY,Bpp,Dummy
     
    		Float	Scale=((Float *)kCmdDicho)[0];
    		kCmdDicho++;
     
    		Float	hScale=pCompBmap->kSizeX/LANDSCAPESIZE;
    		Float	vScale=gBinaryDescArray[i].Scale/Scale;
     
    		if(!(pCompBmap->kSizeX*pCompBmap->kBytesPerPixel))
    		{
    			String_Z<ARRAY_CHAR_MAX> BinName;
    			GetGenWorldFieldName(MatId,BinName);
    			KS.kMessage("Mauvais format pour la map %s",BinName.Get());
    		}else{
    			m_UpdateWorld.SetBinaryData(BinId,
    											kCmdDicho,
    											pCompBmap->kSizeX*pCompBmap->kBytesPerPixel,
    											pCompBmap->kSizeX,
    											pCompBmap->kSizeY,
    											hScale,vScale,IM_DATATYPE_U16_CP0);
    			m_DisplayWorld.SetBinaryData(BinId,	
    											kCmdDicho,
    											pCompBmap->kSizeX*pCompBmap->kBytesPerPixel,
    											pCompBmap->kSizeX,
    											pCompBmap->kSizeY,
    											hScale,vScale,IM_DATATYPE_U16_CP0);
    		}
    	}
     
    	//HeighMap
    	if (MatId==HEIGHT_BINARY_ID+GENWORLD_MATERIAL_TO_BINARY_FIRST)
    	{
    		KBmap	*pCompBmap=kGetCompressedBMap(MatId);
    		if(pCompBmap)
    		{
    			KUInt32	*kCmdDicho=(KUInt32*)pCompBmap->kGetBmapDatas();
    			kCmdDicho+=4;//Header SizeX,SizeY,Bpp,Dummy
     
    			Float	Scale=((Float *)kCmdDicho)[0];
    			kCmdDicho++;
     
    			Float	hScale=pCompBmap->kSizeX/LANDSCAPESIZE;
    			m_UpdateWorld.SetAltitudeData(	kCmdDicho,
    											pCompBmap->kSizeX*pCompBmap->kBytesPerPixel,
    											pCompBmap->kSizeX,
    											pCompBmap->kSizeY,
    											hScale,10000.f/Scale,IM_DATATYPE_U16_CP0);
    			m_DisplayWorld.SetAltitudeData(	kCmdDicho,
    											pCompBmap->kSizeX*pCompBmap->kBytesPerPixel,
    											pCompBmap->kSizeX,
    											pCompBmap->kSizeY,
    											hScale,10000.f/Scale,IM_DATATYPE_U16_CP0);
    		}
    	}
    }
     
    KW_BitmapHdl	KW_GenWorld::kGetCompressedBitmapHdl(KInt32 MatId,KString &FullFileName)
    {
    	if(MatId<GENWORLD_MATERIAL_TO_BINARY_FIRST)		return	NULL;
    	TBitmapHdl	aTBitmapHdl		=	kGetMaterial(MatId);
    	if(!aTBitmapHdl.kIsValid())		return KHANDLE_NULL;
    	TBitmapPtr	_pTBitmap(aTBitmapHdl);
    	FullFileName = _pTBitmap->GetFileNameKey();
    	return	_pTBitmap->GetMaterialKey();
    }
     
    KBmap	*KW_GenWorld::kGetCompressedBMap(KInt32 MatId)
    {
    	KUInt32		*newBmapDatas=NULL;
     
    	//Creation Default Bitmap, applied an all AGW_GenWorld maps
    	if(!pDefaultCompressedBmap)
    	{
    		U8	*pDefaultR32F=(U8*)Alloc_Z(256*256*sizeof(Float));
    		memset(pDefaultR32F,0,256*256*sizeof(Float));
    		S32	newBmapSize=0;
    		newBmapDatas=ConvertFloatToU16_CP0("_S256",pDefaultR32F,256,256,newBmapSize);
    		KInt32	newBmapSizeX=newBmapDatas[0];
    		KInt32	newBmapSizeY=newBmapDatas[1];
    		pDefaultCompressedBmap = kNew KBmap((U8*)newBmapDatas,newBmapSizeX,newBmapSizeY,0,KPIXEL_U16_CP0);
    		Free_Z(pDefaultR32F);
    		newBmapDatas=NULL;
    	}
    	//Set Default
    	pCompressedBmap[MatId]=pDefaultCompressedBmap;
     
    	//Update
    	KString		FullFileName;
    	KW_BitmapHdl BitmapHdl = kGetCompressedBitmapHdl(MatId,FullFileName);
    	if(!BitmapHdl.kIsValid())
    		return pCompressedBmap[MatId];
    	Char		FileName[128];
    	_splitpath(FullFileName,NULL,NULL,FileName,NULL);
     
    	KString		FileExt(".R32FU16CP0.V1.0");
    	KString		File2Load;
    	FileDate_Z	File2SaveDate;
    	Bool		bConverted=kDBManager->kGetConvertedFileName(BitmapHdl,FileExt,File2Load,File2SaveDate);
    	if(bConverted)
    	{
    		KFile	lFile;
    		if(	lFile.Open(File2Load,FILE_RDONLY|NO_BUFFER))
    		{
    			KS_MALLOC(newBmapDatas,lFile.GetSize());
    			lFile.Read(newBmapDatas,lFile.GetSize());
    		}
    	}
    	else
    	{
    		KW_Bitmap*	pBitmap = (KW_Bitmap*)kGetPtr(BitmapHdl);
    		if(!pBitmap)	
    			return	pCompressedBmap[MatId];
    		KBmap* Bmap = pBitmap->kGetBmap();
    		if(Bmap->kFormat!=KPIXEL_R32F)	
    			return pCompressedBmap[MatId];
     
    		KS.kGUI->kSetStatusBarText( "Compressing R32F...", STATUS_BAR_PROCESS0, KFALSE );
     
    		S32	newBmapSize=0;
    		newBmapDatas=ConvertFloatToU16_CP0(FileName,Bmap->kGetBmapDatas(),Bmap->kSizeX,Bmap->kSizeY,newBmapSize);
     
    		KS.kGUI->kSetStatusBarText( "Done...", STATUS_BAR_PROCESS0, KTRUE );
     
    		//Save Converted
    		KFile	sFile;
    		if(sFile.Open(File2Load,FILE_WRONLY|FILE_CREAT|FILE_TRUNC))
    		{
    			sFile.Write(newBmapDatas,newBmapSize);
    			sFile.Close();
    			KFile::SetFileDate(File2Load,File2SaveDate);
    		}
    	}
     
     
    	if(newBmapDatas)
    	{
    		KInt32	newBmapSizeX=newBmapDatas[0];
    		KInt32	newBmapSizeY=newBmapDatas[1];
    		pCompressedBmap [MatId] = kNew KBmap((U8*)newBmapDatas,newBmapSizeX,newBmapSizeY,0,KPIXEL_U16_CP0);
    	}
    	return	pCompressedBmap[MatId];
    }
     
    void	KW_GenWorld::kUpdateMaterialsData(void)
    {
    	kMaterials.kRemoveAllObjects();
     
    	for(KInt32 i=0;i<GENWORLD_MATERIAL_NB;i++)
    	{
    		if(kGetMaterial(i).kIsValid())
    		{
    			TBitmapPtr		_Ptr(kGetMaterial(i));
    			kMaterials.kAddObject(_Ptr->MaterialHdl);
    			continue;
    		}
    		kMaterials.kAddObject(DefaultMaterialHdl);
    	}
    	//Force Update DisplayData
    	kGetMaterialsDisplayData(NULL);
    }
     
    AGW_GenWorld	*KW_GenWorld::kGetObject()
    {
    	kUpdateMaterialsData();
    //	Vec4f	p(-51213.f,0.f,32571.f,0.f);
    //	Float	y=m_DisplayWorld.GetIndCorrectAltitude(p);
    	return	&m_UpdateWorld;
    }
     
    AGW_GenWorld	*KW_GenWorld::kGetDisplayObject()
    {
    	kUpdateMaterialsData();
    	return	&m_DisplayWorld;
    }
     
    void	KW_GenWorld::kSetWorldID(KInt32 kId,KBool bNeedSave)
    {
    	if(kId!=m_UpdateWorld.GetWorldID())
    	{
    		m_UpdateWorld.AGW_SetWorldId(kId);
    		m_DisplayWorld.AGW_SetWorldId(kId);
     
    		kID.kSetValue(kId);
    		if(bNeedSave)
    			kNeedSave();
    		kInvalidate();
    	}
    }
     
    void	KW_GenWorld::kUpdateUserDefined()
    {
    	kCleanAllDatas();
     
    	String_Z<ARRAY_CHAR_USERDEFINE_MAX> Str;
    	Str.StrCpy(kGetUserDefined());
    	BF_UserDefine_Z::CleanUserDefine(Str);
     
    	UserDefineCmd_Z	aCmd;
    	aCmd.SetCmd(Str.Get());
     
    	m_UpdateWorld.SetColorData(&aCmd);
    	m_DisplayWorld.SetColorData(&aCmd);
    }
     
    /*
    void KW_GenWorld::kUpdateLight()
    {
    	KFloat		vDayTime=0.f;
    	KFloat		vFogAmount=0.f;
    	KFloat		vCloudAmount=0.f;
    	KString	KeyBuffer;
    	if(!KS.kCfg->kGetCfgString("KW_GenWorld","DayTime",KeyBuffer))			sscanf(KeyBuffer,"%f",&vDayTime);
    	if(!KS.kCfg->kGetCfgString("KW_GenWorld","FogAmount",KeyBuffer))		sscanf(KeyBuffer,"%f",&vFogAmount);
    	if(!KS.kCfg->kGetCfgString("KW_GenWorld","CloudAmount",KeyBuffer))		sscanf(KeyBuffer,"%f",&vCloudAmount);
     
    	m_DisplayWorld.GetWorldAtmosphere().SetDayTime(vDayTime,0.f);
    	m_DisplayWorld.GetWorldAtmosphere().SetWeatherStatus(vCloudAmount,
    														vFogAmount,
    														200.f,
    														5000.f,
    														500.f,
    														500.f,
    														0.f);
     
    	Viewport_Z::Default_BlueShift		=m_DisplayWorld.GetWorldAtmosphere().m_BlueShift;
    	Viewport_Z::Default_MinExposure		=m_DisplayWorld.GetWorldAtmosphere().Get_m_AdaptMin();
    	Viewport_Z::Default_MaxExposure		=m_DisplayWorld.GetWorldAtmosphere().Get_m_AdaptMax();
    	Viewport_Z::Default_HDRSettings.y	=m_DisplayWorld.GetWorldAtmosphere().Get_m_ScreenLuminance();
    	Viewport_Z::Default_Bloom.x			=m_DisplayWorld.GetWorldAtmosphere().Get_m_BloomFactor();
    }
    */
    KFloat KW_GenWorld::kUpdateDayCycle(KFloat PlayerdTime)
    {
    	ThreadViewportConstant_Z	&VpThread=kDDGenWorld.VpThread;
     
    	//Default 
    	VpThread.ToneMapping.x	= Viewport_Z::Default_AverageGrayLevel;
    	VpThread.ToneMapping.y	= Viewport_Z::Default_WhiteLevel;
    	VpThread.ToneMapping.z	= Viewport_Z::Default_MinExposure;
    	VpThread.ToneMapping.w	= Viewport_Z::Default_MaxExposure;
    	VpThread.BlueShift		= Viewport_Z::Default_BlueShift;
    	VpThread.HDRSettings	= Viewport_Z::Default_HDRSettings;
    	VpThread.HDRSettings.x	= powf(0.94f,gData.Update()*30.f);
    	VpThread.RainAmount		= Viewport_Z::Default_RainAmount;
    	VpThread.Bloom			= Viewport_Z::Default_Bloom;
    	VpThread.TintLerp		= VEC4F_NULL;
     
    	KString		Str=kGetDayCycleDefined();
    	KInt32		StrLen=Str.kGetLength();
    	KString		PropertyStr;
    		//Convertion 
    	for(KInt32 i=0;i<StrLen;i++)
    		if(Str[i]==';')
    				PropertyStr+=KString("\r\n");
    		else	PropertyStr+=Str[i];
     
     
    	KFloat	CurTime=12.f*3600.f;
    	if(PlayerdTime>0.f)					//From Player ? update kCurPlayerTime
    	{
    		kCurPlayerTime+=kCurPlayerSpeed*PlayerdTime;
    		kCurPlayerTime=fmodf(kCurPlayerTime,24.f*3600.f);
    	}
     
    	KFloat	PlayerSpeed=0;
    	KFloat	FogAmount=0.f;
    	KFloat	CloudAmount=0.f;
    	KInt32	PlayerOn=0;			//0 = Player off
    	KInt32	TempSunSky=0;	//0 = use Atm_Z & Sun_Z lightning
     
    	if(PropertyStr.kGetLength())
    	{
    		KS_InMem				StreamIn(KS_STREAM_ASCII,(const Char*)PropertyStr,PropertyStr.kGetLength());
    		KPropertyGridDescDA		ItemDescDA;
    		KRetPropertyScript	kRet=KControl_PropertyCtrl::kGet(StreamIn,ItemDescDA);
    		if(kRet!=KSCRIPT_OK)
    			return -1.f;
     
     
    		for(KInt32 i=0;i<ItemDescDA.kGetSize();i++)
    		{
    			KPropertyGridDesc	&ItemDesc=ItemDescDA[i];
     
    //			#define	PROPERTY_OUTPUT		KS.kInfo
    			#define	PROPERTY_OUTPUT		;
     
    			#define	PROPERTY_KEYFRAMER_FLOAT(DateStr,oValue)\
    				else if(!stricmp(ItemDesc.kItemCrc,DateStr))\
    				{\
    					KString			aKeysStr((const KChar *)ItemDesc.kItemValue+strlen("{ Keys"));\
    					KS_InMem		aStream(KS_STREAM_ASCII,aKeysStr,aKeysStr.kGetLength());\
    					KW_KeyframerFloat	Kfr;\
    					Kfr.Load(aStream,KTRUE,0);\
    					Kfr.GetValue(CurTime/(24.f*60.f*60.f),oValue);\
    					PROPERTY_OUTPUT("%s = %f",#oValue,oValue);\
    				}\
     
    			#define	PROPERTY_KEYFRAMER_COLOR(DateStr,oValue)\
    				else if(!stricmp(ItemDesc.kItemCrc,DateStr))\
    				{\
    					KString			aKeysStr((const KChar *)ItemDesc.kItemValue+strlen("{ Keys"));\
    					KS_InMem		aStream(KS_STREAM_ASCII,aKeysStr,aKeysStr.kGetLength());\
    					KW_KeyframerColor	Kfr;\
    					Kfr.Load(aStream,KTRUE,0);\
    					KColor	aCol;\
    					if(Kfr.GetValue(CurTime/(24.f*60.f*60.f),aCol))\
    					{\
    						oValue.x=aCol.r;\
    						oValue.y=aCol.g;\
    						oValue.z=aCol.b;\
    						PROPERTY_OUTPUT("%s R=%f G=%f B=%f",#oValue,aCol.r,aCol.g,aCol.b);\
    					}\
    				}\
     
    			#define	PROPERTY_KEYFRAMER_VALUE(DateStr,oValue,oValueConvert)\
    				else if(!stricmp(ItemDesc.kItemCrc,DateStr))\
    				{\
    					KString			aKeysStr((const KChar *)ItemDesc.kItemValue+strlen("{ Value"));\
    					oValue=oValueConvert(aKeysStr);\
    					PROPERTY_OUTPUT("%s = %s",#oValue,(const KChar *)aKeysStr);\
    				}\
     
     
    			ThreadViewportConstant_Z	&VpThread=kDDGenWorld.VpThread;
    			if(0)	{}
    			PROPERTY_KEYFRAMER_VALUE("{ Date \"17/06/2009 00:00\" }",CurTime	,	atof)
    			PROPERTY_KEYFRAMER_VALUE("{ Date \"18/06/2009 00:01\" }",PlayerOn	,	_ttoi)
    			PROPERTY_KEYFRAMER_VALUE("{ Date \"18/06/2009 00:02\" }",PlayerSpeed,	atof)
    			PROPERTY_KEYFRAMER_VALUE("{ Date \"18/06/2009 00:59\" }",TempSunSky	,	_ttoi)
     
    			PROPERTY_KEYFRAMER_FLOAT("{ Date \"18/06/2009 03:00\" }",FogAmount	)
    			PROPERTY_KEYFRAMER_FLOAT("{ Date \"18/06/2009 04:00\" }",CloudAmount)
    			PROPERTY_KEYFRAMER_FLOAT("{ Date \"18/06/2009 04:00\" }",CloudAmount)
     
    			PROPERTY_KEYFRAMER_FLOAT("{ Date \"18/06/2009 7:00\" }",VpThread.HDRSettings.y)
    			PROPERTY_KEYFRAMER_FLOAT("{ Date \"18/06/2009 8:00\" }",VpThread.Bloom.x)
    			PROPERTY_KEYFRAMER_FLOAT("{ Date \"18/06/2009 8:01\" }",VpThread.Bloom.y)
    			PROPERTY_KEYFRAMER_FLOAT("{ Date \"18/06/2009 8:02\" }",VpThread.Bloom.z)
    			PROPERTY_KEYFRAMER_FLOAT("{ Date \"18/06/2009 8:03\" }",VpThread.Bloom.w)
    			PROPERTY_KEYFRAMER_FLOAT("{ Date \"18/06/2009 8:04\" }",VpThread.ToneMapping.x)
    			PROPERTY_KEYFRAMER_FLOAT("{ Date \"18/06/2009 8:05\" }",VpThread.ToneMapping.y)
    			PROPERTY_KEYFRAMER_FLOAT("{ Date \"18/06/2009 8:06\" }",VpThread.ToneMapping.z)
    			PROPERTY_KEYFRAMER_FLOAT("{ Date \"18/06/2009 8:07\" }",VpThread.ToneMapping.w)
     
    			PROPERTY_KEYFRAMER_COLOR("{ Date \"18/06/2009 8:08\" }",VpThread.BlueShift)
    			PROPERTY_KEYFRAMER_FLOAT("{ Date \"18/06/2009 8:09\" }",VpThread.BlueShift.w)
     
    			PROPERTY_KEYFRAMER_COLOR("{ Date \"18/06/2009 8:10\" }",VpThread.TintLerp)
    			PROPERTY_KEYFRAMER_FLOAT("{ Date \"18/06/2009 8:11\" }",VpThread.TintLerp.w)
     
    			PROPERTY_KEYFRAMER_COLOR("{ Date \"18/06/2009 10:00\" }",kDDGenWorld.SunColWithIntensity)
    			PROPERTY_KEYFRAMER_FLOAT("{ Date \"18/06/2009 10:01\" }",kDDGenWorld.SunColWithIntensity.w)
    			PROPERTY_KEYFRAMER_COLOR("{ Date \"18/06/2009 10:10\" }",kDDGenWorld.SunAmbColorWithIntensity)
    			PROPERTY_KEYFRAMER_FLOAT("{ Date \"18/06/2009 10:11\" }",kDDGenWorld.SunAmbColorWithIntensity.w)
    			PROPERTY_KEYFRAMER_FLOAT("{ Date \"18/06/2009 10:12\" }",kDDGenWorld.SunInvIntensity)
     
    			PROPERTY_KEYFRAMER_COLOR("{ Date \"18/06/2009 11:00\" }",kDDGenWorld.SkyCol)
    			PROPERTY_KEYFRAMER_FLOAT("{ Date \"18/06/2009 11:01\" }",kDDGenWorld.SkyCol.w)
    			PROPERTY_KEYFRAMER_COLOR("{ Date \"18/06/2009 11:10\" }",kDDGenWorld.SkyAmb)
    			PROPERTY_KEYFRAMER_FLOAT("{ Date \"18/06/2009 11:11\" }",kDDGenWorld.SkyAmb.w)
     
     
    			if(PlayerOn)// "PlayerOn" updated while parsing, if PlayerOn is on we use PlayerCurTime instead of CurT
    						//	PlayerCurTime is a Timer Call Back
    						//	CurTime is from script slider
    				CurTime=kCurPlayerTime;
     
    			kCurPlayerSpeed=1.f+PlayerSpeed*100.f;
    		}
    	}
    	//Edition Color's * Multiplier
    	kDDGenWorld.SunColWithIntensity.x*=kDDGenWorld.SunColWithIntensity.w;
    	kDDGenWorld.SunColWithIntensity.y*=kDDGenWorld.SunColWithIntensity.w;
    	kDDGenWorld.SunColWithIntensity.z*=kDDGenWorld.SunColWithIntensity.w;
    	kDDGenWorld.SunColWithIntensity.w=1.f;
     
    	kDDGenWorld.SunAmbColorWithIntensity.x*=kDDGenWorld.SunAmbColorWithIntensity.w;
    	kDDGenWorld.SunAmbColorWithIntensity.y*=kDDGenWorld.SunAmbColorWithIntensity.w;
    	kDDGenWorld.SunAmbColorWithIntensity.z*=kDDGenWorld.SunAmbColorWithIntensity.w;
    	kDDGenWorld.SunAmbColorWithIntensity.w=1.f;
     
    	kDDGenWorld.SkyCol.x*=kDDGenWorld.SkyCol.w;
    	kDDGenWorld.SkyCol.y*=kDDGenWorld.SkyCol.w;
    	kDDGenWorld.SkyCol.z*=kDDGenWorld.SkyCol.w;
    	kDDGenWorld.SkyCol.w=1.f;
     
    	kDDGenWorld.SkyAmb.x*=kDDGenWorld.SkyAmb.w;
    	kDDGenWorld.SkyAmb.y*=kDDGenWorld.SkyAmb.w;
    	kDDGenWorld.SkyAmb.z*=kDDGenWorld.SkyAmb.w;
    	kDDGenWorld.SkyAmb.w=1.f;
     
    	Atmosphere_Z &aAtm=m_DisplayWorld.GetWorldAtmosphere();
     
    	aAtm.SetDayTime(CurTime,0.f);
    	aAtm.SetWeatherStatus(	CloudAmount,
    							FogAmount,
    							200.f,
    							5000.f,
    							500.f,
    							500.f,
    							0.f);
     
    	//Directions
    	kDDGenWorld.DirToSun				=aAtm.m_Sun.GetDirToSun();
    	kDDGenWorld.SunDir					=aAtm.m_FakeLightingDir;
    //	kDDGenWorld.SunInvIntensity			=1.f/aAtm.m_Sun.GetSunIntensity()/aAtm.m_BlueShift.w;
     
    	kDDGenWorld.SkyDir					=aAtm.m_Sun.GetDirToSun();
    	kDDGenWorld.SkyDir.y=0.f;
    	kDDGenWorld.SkyDir.CNormalize();
    	kDDGenWorld.SkyDir*=0.3f;
    	kDDGenWorld.SkyDir.y=1.f;
    	kDDGenWorld.SkyDir.CNormalize();
     
    	//Scattering
    	kDDGenWorld.Scat=aAtm.m_Scattering;
     
    	//Les Couleurs, que si l'utilisateur choisis de ne pas utiliser celles editeés
    	if(!TempSunSky)
    	{
    		//donc celles calculées par le aAtm.SetDayTime de Seb
    		kDDGenWorld.SunColWithIntensity			=(KVec4f&)aAtm.m_Sun.GetColorWithIntensity();
    		kDDGenWorld.SunAmbColorWithIntensity	=(KVec4f&)aAtm.m_Sun.GetHighColorWithIntensity();
    		kDDGenWorld.SkyCol						=(KVec4f&)aAtm.m_Sun.GetSkyWarpRelativeColor();
    		kDDGenWorld.SkyAmb						=(KVec4f&)aAtm.m_Sun.GetSkyWarpAmbientColor();
    	}
     
    	kRequestRedrawActiveEdition(KTRUE);
    	return CurTime/(24.f*60.f*60.f);	//return ratio 0 - 1.f 
    }/*
    		Vec3f SunDir=aAtm.m_FakeLightingDir;
    		Color SunCol=aSun.GetColorWithIntensity();
    		Color SunAmb=aSun.GetHighColorWithIntensity();
    		kSetDirectionnalColor((KColor&)SunCol);
    		kSetDirectionnalInvIntensity(1.f/aSun.GetSunIntensity()/aAtm.m_BlueShift.w);
    		kSetDirectionnalDir(SunDir.x,SunDir.y,SunDir.z);
    		kSetDirectionnalAmbient((KColor&)SunAmb);
    		//Sky
    		Color SkyCol=aSun.GetSkyWarpRelativeColor();
    		Color SkyAmb=aSun.GetSkyWarpAmbientColor();
    		kSetSkyColor((KColor&)SkyCol);
    		kSetSkyAmbient((KColor&)SkyAmb);
    		Vec3f	SkyDir=aSun.GetDirToSun();
    		SkyDir.y=0.f;
    		SkyDir.CNormalize();
    		SkyDir*=0.3f;
    		SkyDir.y=1.f;
    		SkyDir.CNormalize();
    		kSetSkyDir(SkyDir);*/
     
     
    void KW_GenWorld::kSetRoot(KW_3DNodeHdl &_RootObjHdl)
    {
    	RootObjHdl=_RootObjHdl;
    	kUpdateRoads();
    	kUpdateGenSurfaces();
    }
     
     
    KInt32	KW_GenWorld::kGetSubObjectTypedData(KInt32 ObjectId,KInt32 kGroupId,KInt32 TypeData,KBool bEdition,KBool bGetOrSet)
    {
    	if ( ObjectId  != -1 )
    	{
    		if(bGetOrSet)
    		{
    			if(kBankObj[kGroupId].ObjectsDef[ObjectId].kIsEnableFlag(TypeData))
    				return	TypeData;
    			return	0;
    		}
    		kBankObj[kGroupId].ObjectsDef[ObjectId].kEnableFlag(TypeData);
    		return 0;
    	}
    	else
    	{
    		if(bGetOrSet)
    		{
    			if(kBankObj[kGroupId].Flag&TypeData)
    				return	TypeData;
    			return	0;
    		}
    		kBankObj[kGroupId].Flag|=TypeData;
    		return 0;
    	}
    }
     
    void	KW_GenWorld::kDelSubObjectTypedData(KInt32 ObjectId,KInt32 kGroupId,KInt32 TypeData,KBool bEdition)
    {
    	if ( ObjectId  != -1 )
    		kBankObj[kGroupId].ObjectsDef[ObjectId].kDisableFlag(TypeData);
    	else
    		kBankObj[kGroupId].Flag&=~TypeData;
    }
    .h
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
     
    #pragma once
     
    #ifndef KW_GENWORLD_HEADER
    #define KW_GENWORLD_HEADER
     
    #include	<runtime/KW_GraphObject.h>
    #include	<runtime/KW_GeomDesc.h>
    #include	<KS_UseFullType.h>
    #include	<KW_GenWorldUndoRedo.h>
    #include	<Geometry.h>
    #include	<KW_3DNodeHdl.h>
    #include	<TBitmapHdl.h>
    #include	<KW_DLight.h>
    #include	<KW_Lod.h>
    #include	<KW_BankObj.h>
     
     
     
    #include <KS_BeginDef.h>
     
    #if defined(KW_GENWORLD_EXPORTS)
    #include<KS_ExportDefX.h>
    #else
    #include<KS_ImportDefX.h>
    #endif
     
     
    class Sys_Z{
    public:
    	// Makes a memcpy from Src to Dest and return Src + Size
    	static	void	*MemCpyFrom(void *Dest,void *Src,size_t Size);
    	static	void	MemCpy128(void *Dest,void *Src,size_t QSize);
    };
    class ResourceBinaryLoader_Z
    {
    public:
    	S32		GetNb()	{return 0;}
    	void	GetData(void *pDest,size_t DataSize){}
    };
     
    #include "..\..\Engine\Includes\Profiler_Z.h"
    #include "..\..\Engine\Includes\GenericQSort_Z.h"
    #include "..\..\Engine\Includes\AGW_GenWorld.h"
    #include "..\..\Engine\Includes\SkyObject.h"
    #include "..\..\Engine\Includes\A_Roads.h"
    #include "..\..\Engine\Includes\GenWorldMaterial_Z.h"
     
    float	EXTERN_Z	Globaltime;
     
    #define KW_GENWORLD_NB_FIELDS		3+GENWORLD_MATERIAL_NB+5	//pour les + voir kGetFieldInfo(KInt32 i)
    #define KW_GENWORLD_PARENT			KW_GeomDesc
    #define	KW_GENWORLD_KCLASS			"GenWorld"
    #define	KW_GENWORLD_PKCLASS			"GeomDesc"
    #define	KW_GENWORLD_VERSION			0.1
     
    namespace Viewport_Z 
    {
    	EXTERN_Z	Float	Default_AverageGrayLevel;
    	EXTERN_Z	Float	Default_WhiteLevel;
    	EXTERN_Z	Float	Default_MinExposure;
    	EXTERN_Z	Float	Default_MaxExposure;
    	EXTERN_Z	Vec4f	Default_BlueShift;
    	EXTERN_Z	Vec3f	Default_CubeMapOffset;
    	EXTERN_Z	Float	Default_RainAmount;
    	EXTERN_Z	Vec4f	Default_Bloom;
    	EXTERN_Z	Vec4f	Default_HDRSettings;
    }
     
    KEXTERN KUInt32	gShadowMapPrimitiveFilter[];
    KEXTERN KUInt32	KW_GenWorldPrimStateDraw;
    KUInt32 * ConvertFloatToU16_CP0(const Char *pFileName,U8 *Datas,S32 SizeX,S32 SizeY,S32 &PackedSize);
     
    class KCLASS KW_GwRoad;
    class KCLASS KX_GwRoadExt;
    class KCLASS KW_GenWorld;
    class KCLASS KS_GenWorldObj;
    class KCLASS KX_GenWorldExt;
     
    KS_CREATE_HANDLE( KW_GenWorld,KW_GENWORLD_KCLASS, KW_GENWORLD_PARENT )
     
    //Génération des Road en fonction de l'edition
    #define	KROADNODEHDL_SEGMENT_NB		(KW_CONTROLSPLINE_SEGMENT_NB_PT-1)	//ne pas mettre autre chose sinon le mapping des splines
    																		//ne sera pas correct
    struct KRoadObjectHdl {
    	KRoadObjectHdl()
    	{
    		IsModified=KFALSE;
    		BoundingSph.Radius=-1.f;
    		for(KInt32 i=0;i<KROADNODEHDL_SEGMENT_NB;i++)
    			IdSegment[i]=-1;
    		Type=cA_RoadTypeInfo::RoadTypeInfosRouteSimple;
    	}
    	inline	void	Release(AGW_GenWorld &UpdateWorld)
    	{
    		if(IdSegment[0] < 0)
    			return;
    		for(KInt32 i=0;i<KROADNODEHDL_SEGMENT_NB;i++)
    		{
    			if(IdSegment[i]<0)
    				continue;
    			UpdateWorld.ExternalRemoveTerraRoad(IdSegment[i]);
    			IdSegment[i]=-1;
    		}
    		if(BoundingSph.Radius<0.f)
    			return;
    		UpdateWorld.ExternalInvalidateZone(BoundingSph);
    		BoundingSph.Radius=-1.f;
    	}
    	inline	void	AddToRefresh(Sphere_Z &RefreshSphere)
    	{
    		if(BoundingSph.Radius<0)	return;
    		if(RefreshSphere.Radius<0)
    			RefreshSphere=BoundingSph;
    		else
    			RefreshSphere+=BoundingSph;
    	}
    	Bool							IsModified;
    	int								IdSegment[KROADNODEHDL_SEGMENT_NB];
    	cA_RoadTypeInfo::RoadTypeInfo	Type;
    	Float							Progression;	//Progression (Mapping) PointBasedId1
    	Float							ProgressionSign;//Sens 1.f / -1.f
    	Sphere_Z						BoundingSph;	//Le Signe sert pour détermnié si les KROADNODEHDL_SEGMENT_NB font + ou - de leur taille
    } ;
    KS_CLASS_DYN_ARRAY(KRoadObjectHdlDA,KRoadObjectHdl,256);
     
    struct KRoadNodeHdl {
    	#define	ROAD_ATTACH_DATA_KEY	0x41424344
    	KRoadNodeHdl()
    	{
    		kRoadLastTimeUpdate = KS.kGetTickCount();
    		kRoadLastTimeTouch = -1;
    	}
    	KW_3DNodeHdl		kNodeHdl;
    	KInt32				kRoadLastTimeUpdate;
    	KInt32				kRoadLastTimeTouch;
    	KInt32DA			kInvalidateSplineIDs;
    	KRoadObjectHdlDA	kSplineDA;
    };
    KS_CLASS_DYN_ARRAY(KRoadNodeHdlDA,KRoadNodeHdl,10);
     
    struct KGenSurfaceNodeHdl {
    	#define	GENSURFACE_ATTACH_DATA_KEY	0x45464748
    	KGenSurfaceNodeHdl()
    	{
    		kLastTimeTouchModified = KS.kGetTickCount();
    		IsModified=KFALSE;
    		BoundingSph.Radius=-1.f;
    		IdSurface=-1;
    	}
    	inline	void	Release(AGW_GenWorld &UpdateWorld)
    	{
    		if(IdSurface < 0)
    			return;
    		UpdateWorld.ExternalRemoveTerraRoad(IdSurface);
    		IdSurface=-1;
    		if(BoundingSph.Radius<0.f)
    			return;
    		UpdateWorld.ExternalInvalidateZone(BoundingSph);
    		BoundingSph.Radius=-1.f;
    	}
    	inline	void	AddToRefresh(Sphere_Z &RefreshSphere)
    	{
    		if(BoundingSph.Radius<0)	return;
    		if(RefreshSphere.Radius<0)
    			RefreshSphere=BoundingSph;
    		else
    			RefreshSphere+=BoundingSph;
    	}
    	Bool				IsModified;
    	int					IdSurface;
    	Sphere_Z			BoundingSph;	//Le Signe sert pour détermnié si les KROADNODEHDL_SEGMENT_NB font + ou - de leur taille
    	KW_3DNodeHdl		kNodeHdl;
    	KInt32				kLastTimeTouchModified;
    };
    KS_CLASS_DYN_ARRAY(KGenSurfaceNodeHdlDA,KGenSurfaceNodeHdl,10);
     
    #define	kGENWORLD 0x0bfd8643
    struct KCLASS KDD_GenWorld  : KS_DisplayData
    {
    	Scattering					Scat;
    	KVec3f						DirToSun;
    	KVec3f						SunDir;
    	KVec4f						SunColWithIntensity;
    	KVec4f						SunAmbColorWithIntensity;
    	KFloat						SunInvIntensity;
     
    	KVec3f						SkyDir;
    	KVec4f						SkyCol;
    	KVec4f						SkyAmb;
     
    	ThreadViewportConstant_Z	VpThread;
     
    	KW_GraphObjectHdl			kGenWorldHdl;
    	KDD_GenWorld() : KS_DisplayData(kGENWORLD) { }
    };
     
    //class AGW_GenWorld;
    class KCLASS KW_GenWorld : public KW_GENWORLD_PARENT
    {
    protected:
    	virtual KBool						KMTH kInit();
    	virtual void						KMTH kShut();
    public:
    	inline virtual KInt32				KMTH kGetNbFields()				const;
    	inline virtual const KFieldInfo		KMTH kGetFieldInfo(KInt32 i)	const;
    	virtual void						KMTH kUpdate();
    	virtual const KS_DisplayData *		KMTH kGetInternDisplayData(const KDrawInfo * di);
    			KBool						KMTH kGetDirectionnalShadow(KDD_Shadowed &kDD);
    	virtual	void						KMTH kBeforeReload(KS_InStream& Stream);
    	virtual KBool						KMTH kReadContents(KS_InStream& stream, KInt32 format=KS_IOFORMAT_DEFAULT);
    	virtual KBool						KMTH kWriteContents(KS_OutStream& stream, KInt32 format=KS_IOFORMAT_DEFAULT);
    			void						KMTH kInvalidateBBox()	{ kBBoxUpToDate = KFALSE; }
    	virtual KBBoxLocal					KMTH kGetBBox();
    	virtual void						KMTH kBBoxUpdate();
    			void						KMTH kSetRoot(KW_3DNodeHdl &_RootObjHdl);
    	inline	const KW_3DNodeHdl &		KMTH kGetRoot(){return RootObjHdl;}
    	//-----------------------
    	// Infos
    	//-----------------------
    	virtual	KBool						KMTH kGetInfos(KDD_Tips &Tips);
    	//-----------------------
    	// Variables
    	//-----------------------
    	inline	KW_GraphObjectHdl			KMTH kGetRoadObject()	{return kRoadHdl.kGetValue();}
    			void						KMTH kSetRoadObject(KW_GraphObjectHdl &Hdl,KBool bNeedSave=KTRUE);
    			void						KMTH kSetSunLightNode(KW_3DNodeHdl kHdl,KBool bNeedSave=KTRUE);
    			void						KMTH kSetSkyLightNode(KW_3DNodeHdl kHdl,KBool bNeedSave=KTRUE);
    			void						KMTH kUpdateMaterialsData(void);
    	inline	KInt32						KMTH kGetNbMaterial(){return GENWORLD_MATERIAL_NB;}
    			const KChar *				KMTH kGetMaterialDefName(KInt32 i);
    			KBool						KMTH kIsMaterialUsed(KW_GraphObjectHdl &Hdl);
    	inline	KBool						KMTH kIsBumpMaterial(KInt32 Id){return Id<BUMP_INDEX_NUMBER?KTRUE:KFALSE;}
    	inline	KBool						KMTH kIsCompressedMaterial(KInt32 Id){return Id>=GENWORLD_MATERIAL_TO_BINARY_FIRST;}
    			TBitmapHdl					KMTH kGetMaterial(KInt32 MatId);
    			void						KMTH kSetMaterial(KInt32 MatId,TBitmapHdl &MatHdl,KBool bNeedSave=KTRUE,KBool bUpdateMaterialDisplayData=KTRUE);
    			KInt32						KMTH kGetWorldID(){return kID.kGetValue();}
    			void						KMTH kSetWorldID(KInt32 kId,KBool bNeedSave=KTRUE);
     
    	inline	KString						KMTH kGetUserDefined(void)	{return kUserDefined.kGetValue(); }
    	inline	KF_String			&		KMTH kGetUserDefinedField(void)	{return kUserDefined; }
    	inline	void						KMTH kSetUserDefined(KString &s,KBool bNeedSave=KTRUE)	{ kUserDefined.kSetValue(s); if(bNeedSave) kNeedSave(); }
    			void						KMTH kUpdateUserDefined();
     
    	inline	KString						KMTH kGetDayCycleDefined(void)	{return kDayCycleDefined.kGetValue(); }
    	inline	KF_String			&		KMTH kGetDayCycleDefinedField(void)	{return kDayCycleDefined; }
    	inline	void						KMTH kSetDayCycleDefined(KString &s,KBool bNeedSave=KTRUE)	{ kDayCycleDefined.kSetValue(s); if(bNeedSave) kNeedSave(); }
     
    			KFloat						KMTH kUpdateDayCycle(KFloat PlayerdTime=-1.f);
    			KFloat						kCurPlayerTime,kCurPlayerSpeed;
     
    	//-----------------------
    	//Génération des Roads en fonction des Objets KW_Road de la map
    	//-----------------------
    			KRoadNodeHdlDA				kRoadNodeData;
    			void						KMTH kFlushRoads();
    			void						KMTH kUpdateRoads();
    	static	void						KMTH kRoadNodeCallback (KHandleAction inAction, const KHandle & inHandle, void * inUserValueP );
    	static	void						KMTH kRoadObjectCallback (KHandleAction inAction, const KHandle & inHandle, void * inUserValueP );
    	//-----------------------
    	//Génération des Surface en fonction des Objets KW_Road de la map
    	//-----------------------
    			KGenSurfaceNodeHdlDA		kGenSurfaceNodeData;
    			void						KMTH kFlushGenSurfaces();
    			void						KMTH kUpdateGenSurfaces();
    	static	void						KMTH kGenSurfaceNodeCallback (KHandleAction inAction, const KHandle & inHandle, void * inUserValueP );
    	static	void						KMTH kGenSurfaceObjectCallback (KHandleAction inAction, const KHandle & inHandle, void * inUserValueP );
    	//-----------------------
    	//Rapatrie de la Thread de génération
    	//-----------------------
    			void						KMTH kSyncGeneration();
    	//-----------------------
    	// Close Thread & Reset AGW_World Data
    	//-----------------------
    			void						KMTH kCleanAllDatas();
    	//-----------------------
    	//Bank Obj
    	//-----------------------
    	virtual	KInt32						KMTH kGetSubObjectTypedData(KInt32 /*i*/,KInt32 /*kGroupdId*/,KInt32 /*TypeData*/,KBool bEdition=KFALSE,KBool bGetOrSet=KTRUE);
    	virtual	void						KMTH kDelSubObjectTypedData(KInt32 /*i*/,KInt32 /*kGroupdId*/,KInt32 /*TypeData*/,KBool bEdition=KFALSE);
    	virtual	KInt32						KMTH kGetNbGroups(KBool bEdition=KFALSE)									{return kBankObj.kGetSize();}
    	virtual	const KChar *				KMTH kGetGroupName(KInt32 kGroupId,KBool bEdition=KFALSE)					{return kBankObj[kGroupId].Name; }
    	virtual	KInt32						KMTH kGetNbSubObjects(KInt32 kGroupId,KBool bEdition=KFALSE)				{return kBankObj[kGroupId].ObjectsDef.kGetSize();}
    	virtual	KS_WorldObjectHdl			KMTH kGetSubObject(KInt32 ObjectId,KInt32 kGroupId,KBool bEdition=KFALSE)	{return	kBankObj[kGroupId].ObjectsDef[ObjectId].kGetObject();}
    	virtual	KBool						KMTH kSortObj(KInt32 kBankId,KBool bEdition=KFALSE);
    	virtual	KBool						KMTH kRemoveObj(KInt32 kBankId,KW_GraphObjectHdl kHdl,KBool bEdition=KFALSE);
    	virtual	KInt32						KMTH kGetObjIndex(KInt32 kBankId,KW_GraphObjectHdl kHdl,KBool bEdition=KFALSE);
    	virtual	KInt32						KMTH kAddObj(KInt32 kBankId,KW_GraphObjectHdl kHdl,KW_GraphObjectHdl kInsertHdl,KBool bEdition=KFALSE,KBool bNeedSave=KTRUE);
    	const	KW_3DNodeHdl	&			KMTH kGetObjNode(KInt32 kBankId,KInt32 kObjectId);
    	//-----------------------
    	//Collision
    	//-----------------------
    	virtual	KBool						KMTH kGetCollision(KVec3f &kOrigin,KVec3f &kDir,KFloat kDist,KRayCollision &kResult,KMatrix4x4f &MatrixCurrent,KInt32 kType=-1);
    	virtual	KBool						KMTH kGetSphereCollision(KSphere &kSphere,KSphereCollisionDA &kResult,KSolidTransfo &TransCurrent,KInt32 kType=-1);
    	//-----------------------
    	//Dependencies
    	//-----------------------
    			void						KMTH kNeedSave();
    	virtual	void						KMTH kDoDependencies(KBool bForce=KFALSE);
    	virtual	KInt32						KMTH kGetAllDependencies(KW_DependenciesList &Dep,KBool bRecurse=KFALSE);
    	virtual	void						KMTH kUnSetDependencies(KW_GraphObjectHdl &kHdl,KBool bRecurse=KFALSE);
    	virtual	void						KMTH kChangeDependencies(KW_GraphObjectHdl &kOldHdl,KW_GraphObjectHdl &kNewHdl);
    	//-----------------------
    	//Undo&Redo Objet Simple
    	//-----------------------
    	virtual		KBool					KMTH kStoreUndo(KCRC32 kEditionID,const KChar *OperationTxt=NULL,KBool bRefreshBDFile=KTRUE);
    	virtual		void					KMTH kStoreUndoRedo(KBool bLinkedOnPrevious=KFALSE);
    	//-----------------------
    	// Mes
    	//-----------------------
    			void						KMTH kReceiveMessageDialog( const KEM* kMsg);
    	//-----------------------
    	// Shared GenWorld
    	//-----------------------
    				Float					KMTH GetGlobalWeatherClouds(const Vec3f &pos)
    				{
    					return m_DisplayWorld.GetGlobalWeatherClouds(pos);
    				}
    	AGW_GenWorld	*					KMTH kGetObject();
    	AGW_GenWorld	*					KMTH kGetDisplayObject();
     
    	friend void							KCALL kClassInit();
    	friend	KCLASS KS_GenWorldObj;
    	friend	KCLASS KX_GenWorldExt;
    	friend	KCLASS KW_GwRoad;
    	friend	KCLASS KX_GwRoadExt;
    	static KS_BaseObject *				KMTH kNewObjectProc() { return new KW_GenWorld; };
    	static	void						KMTH kStaticInit();
    						void			KMTH kMinimizeMemory();
     
    	KS_GenWorldObj			kClassUndo;
    	KBool					kBBoxUpToDate;
     
    private:
    	//-----------------------
    			BankObj_ZDA		&			KMTH GetBankObj()							{return kBankObj;}
    			KInt32						KMTH GetBankObj(const Char *pName,KBool bAddIfNotPresent=KFALSE);
    			BankObjDef_Z	&			KMTH GetObjDef(S32 kBankId,S32 kObjectId)	{return kBankObj[kBankId].ObjectsDef[kObjectId];}
    			KInt32						KMTH GetNbObj(S32 kBankId)					{return kBankObj[kBankId].ObjectsDef.kGetSize();}
     
    	KEM_DialogRefreshLight	kMsgRefreshedLights;
     
     
    	KDD_Group				kDDGroup;
    	KDD_GenWorld			kDDGenWorld;
     
    	SharedResource_Z		m_UpdateMutex;
    	Thread_Z				m_UpdateThread;					//Thread
    					S32		UpdateWorldThread();			//Méthode appelé par la Thread (si pas de thread appelé direct sur ca)	 
    					Bool	m_bLoopingUpdateWorldThread;
    			friend	U32 _UpdateThreadUpdate(void* userdata);//Thread Proc
     
    	AGW_GenWorld			m_UpdateWorld;
    	AGW_GenWorld			m_DisplayWorld;
    	Frustrum_Z				m_DetailView;
     
    	KW_3DNodeHdl			RootObjHdl;
    	KF_ObjectHdl			kRoadHdl;
    	KF_ObjectHdl			kMaterialHdlList[GENWORLD_MATERIAL_NB];
    	KBmap					*pCompressedBmap[GENWORLD_MATERIAL_NB];
    	KBmap					*pDefaultCompressedBmap;
    	KBmap			*		KMTH kGetCompressedBMap(KInt32 MatId);
    	KW_BitmapHdl			KMTH kGetCompressedBitmapHdl(KInt32 MatId,KString &FullFileName);
     
    	static	String_Z<ARRAY_CHAR_MAX>		kMaterialFieldName[GENWORLD_MATERIAL_NB];
     
    	KF_Int32				kID;
    	KF_Float				kAtmLimit;
    	KF_Float				kAtmForce;
    	KF_Float				kAtmHazeLimit;
    	KF_Float				kAtmHazeForce;
    	KF_String				kUserDefined;
    	KF_String				kDayCycleDefined;
    	BankObj_ZDA				kBankObj;
    	KString					kUnknowData;
    };
     
     
    inline KInt32 KW_GenWorld::kGetNbFields() const
    {
    	return KW_GENWORLD_PARENT::kGetNbFields() + KW_GENWORLD_NB_FIELDS;
    }
     
    inline const KFieldInfo KW_GenWorld::kGetFieldInfo(KInt32 i) const
    {
    	KS_ASSERT( i>=0 && i<KW_GenWorld::kGetNbFields() );
    	const int i0 = KW_GENWORLD_PARENT::kGetNbFields();
    	if (i < i0)
    		return KW_GENWORLD_PARENT::kGetFieldInfo(i);
     
    	KInt32	n=i-i0;
    	switch (n)
    	{
    		case	0:
    			return KFieldInfo("Roads",i,kRoadHdl);
    		case	1:
    			return KFieldInfo("User",i,kUserDefined);
    		case	2:
    			return KFieldInfo("DayCycle",i,kDayCycleDefined);
    	}
    	n-=3;	// <--- this value is the last case value of previous switch
     
    	if(n<GENWORLD_MATERIAL_NB)
    		return	KFieldInfo(kMaterialFieldName[n],i,kMaterialHdlList[n]);
     
    	n-=GENWORLD_MATERIAL_NB;
    	switch (n)
    	{
    		case	0:
    			return KFieldInfo("ID",i,kID);
    		case	1:
    			return KFieldInfo("AtmLimit",i,kAtmLimit);
    		case	2:
    			return KFieldInfo("AtmForce",i,kAtmForce);
    		case	3:
    			return KFieldInfo("AtmHazeLimit",i,kAtmHazeLimit);
    		case	4:
    			return KFieldInfo("AtmHazeForce",i,kAtmHazeForce);
    	}
     
     
     
    	KS_ASSERTC(KFALSE, "KW_GenWorld::kGetFieldInfo(KInt32 i) : le field i n'est pas défini");
    	return KFieldInfo::null();
    }
     
     
    #include <KS_EndDef.h>
     
    #endif
    Sinon bien sur que le .cpp se trouve dans le projet

  10. #10
    Expert éminent sénior
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2005
    Messages
    5 074
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Conseil

    Informations forums :
    Inscription : Février 2005
    Messages : 5 074
    Points : 12 120
    Points
    12 120
    Par défaut
    .h
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    class KCLASS KW_GenWorld : public KW_GENWORLD_PARENT{
    ...
    void KMTH kNeedSave();
    ...
    }
    .cpp
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    void	KW_GenWorld::kNeedSave(void)
    Sommes-nous d'accord que ce n'est pas la même chose ?

  11. #11
    Nouveau membre du Club
    Inscrit en
    Mai 2004
    Messages
    35
    Détails du profil
    Informations forums :
    Inscription : Mai 2004
    Messages : 35
    Points : 26
    Points
    26
    Par défaut
    Comme je l'ai marque 4 post plus haut. Ca ne résoud pas le pb. J'ai toujours la même erreur avec ou sans KMTH.

    Merci d'avoir essayé.

  12. #12
    Expert éminent sénior
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2005
    Messages
    5 074
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Conseil

    Informations forums :
    Inscription : Février 2005
    Messages : 5 074
    Points : 12 120
    Points
    12 120
    Par défaut
    Alors pourquoi 3 posts plus haut, le "KMTH" n'y est toujours pas.
    Il faut les ajouter à tous les endroits où cela est nécessaire.
    On verra les autres erreurs après. On marche un pied après l'autre.

Discussions similaires

  1. Réponses: 2
    Dernier message: 21/01/2015, 19h29
  2. Réponses: 21
    Dernier message: 03/06/2010, 18h26
  3. Accéder à une variable d'un objet contenu dans une collection
    Par derlone dans le forum Collection et Stream
    Réponses: 3
    Dernier message: 30/04/2009, 16h50
  4. Réponses: 9
    Dernier message: 22/10/2007, 09h38
  5. Réponses: 4
    Dernier message: 08/03/2006, 19h07

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo