branch | webgl |
changeset 8026 | 4a4f21070479 |
parent 8018 | 091293bc974f |
child 8032 | f8fcece14302 |
8023:7de85783b823 | 8026:4a4f21070479 |
---|---|
19 {$INCLUDE "options.inc"} |
19 {$INCLUDE "options.inc"} |
20 |
20 |
21 unit uVariables; |
21 unit uVariables; |
22 interface |
22 interface |
23 |
23 |
24 uses SDLh, uTypes, uFloat, GLunit, uConsts, Math, uMobile, uUtils; |
24 uses SDLh, uTypes, uFloat, GLunit, uConsts, Math, uMobile, uUtils, uMatrix; |
25 |
25 |
26 var |
26 var |
27 /////// init flags /////// |
27 /////// init flags /////// |
28 cMinScreenWidth : LongInt; |
28 cMinScreenWidth : LongInt; |
29 cMinScreenHeight : LongInt; |
29 cMinScreenHeight : LongInt; |
74 fastScrolling : boolean; |
74 fastScrolling : boolean; |
75 autoCameraOn : boolean; |
75 autoCameraOn : boolean; |
76 |
76 |
77 CheckSum : LongWord; |
77 CheckSum : LongWord; |
78 CampaignVariable: shortstring; |
78 CampaignVariable: shortstring; |
79 GameTicks : LongWord; |
79 GameTicks : LongInt; {xymeng:originally LongWord} |
80 GameState : TGameState; |
80 GameState : TGameState; |
81 GameType : TGameType; |
81 GameType : TGameType; |
82 InputMask : LongWord; |
82 InputMask : LongWord; |
83 GameFlags : Longword; |
83 GameFlags : Longword; |
84 TurnTimeLeft : Longword; |
84 TurnTimeLeft : Longword; |
195 |
195 |
196 hiTicks: Word; |
196 hiTicks: Word; |
197 |
197 |
198 LuaGoals : shortstring; |
198 LuaGoals : shortstring; |
199 |
199 |
200 LuaTemplateNumber : LongWord; |
200 LuaTemplateNumber : LongInt; {org: LongWord} |
201 |
201 |
202 VoiceList : array[0..7] of TVoice = ( |
202 VoiceList : array[0..7] of TVoice = ( |
203 ( snd: sndNone; voicepack: nil), |
203 ( snd: sndNone; voicepack: nil), |
204 ( snd: sndNone; voicepack: nil), |
204 ( snd: sndNone; voicepack: nil), |
205 ( snd: sndNone; voicepack: nil), |
205 ( snd: sndNone; voicepack: nil), |
243 'Sounds/voices', // ptVoices |
243 'Sounds/voices', // ptVoices |
244 'Graphics/Hats', // ptHats |
244 'Graphics/Hats', // ptHats |
245 'Graphics/Flags', // ptFlags |
245 'Graphics/Flags', // ptFlags |
246 'Missions/Maps', // ptMissionMaps |
246 'Missions/Maps', // ptMissionMaps |
247 'Graphics/SuddenDeath', // ptSuddenDeath |
247 'Graphics/SuddenDeath', // ptSuddenDeath |
248 'Graphics/Buttons' // ptButton |
248 'Graphics/Buttons', // ptButton |
249 'Shaders' // ptShaders |
|
249 ); |
250 ); |
250 |
251 |
252 var |
|
251 Fontz: array[THWFont] of THHFont = ( |
253 Fontz: array[THWFont] of THHFont = ( |
252 (Handle: nil; |
254 (Handle: nil; |
253 Height: 12; |
255 Height: 12; |
254 style: TTF_STYLE_NORMAL; |
256 style: TTF_STYLE_NORMAL; |
255 Name: 'DejaVuSans-Bold.ttf'), |
257 Name: 'DejaVuSans-Bold.ttf'), |
821 Ammo: TAmmo; |
823 Ammo: TAmmo; |
822 Slot: 0..cMaxSlotIndex; |
824 Slot: 0..cMaxSlotIndex; |
823 TimeAfterTurn: Longword; |
825 TimeAfterTurn: Longword; |
824 minAngle, maxAngle: Longword; |
826 minAngle, maxAngle: Longword; |
825 isDamaging: boolean; |
827 isDamaging: boolean; |
826 SkipTurns: Longword; |
828 SkipTurns: LongInt; {xymeng, org:LongWord} |
827 PosCount: Longword; |
829 PosCount: Longword; |
828 PosSprite: TSprite; |
830 PosSprite: TSprite; |
829 ejectX, ejectY: Longint; |
831 ejectX, ejectY: Longint; |
830 end = ( |
832 end = ( |
831 (NameId: sidNothing; |
833 (NameId: sidNothing; |
2487 |
2489 |
2488 PauseTexture, |
2490 PauseTexture, |
2489 SyncTexture, |
2491 SyncTexture, |
2490 ConfirmTexture: PTexture; |
2492 ConfirmTexture: PTexture; |
2491 cScaleFactor: GLfloat; |
2493 cScaleFactor: GLfloat; |
2494 cStereoDepth: GLfloat; |
|
2492 SupportNPOTT: Boolean; |
2495 SupportNPOTT: Boolean; |
2493 Step: LongInt; |
2496 Step: LongInt; |
2494 squaresize : LongInt; |
2497 squaresize : LongInt; |
2495 numsquares : LongInt; |
2498 numsquares : LongInt; |
2496 ProgrTex: PTexture; |
2499 ProgrTex: PTexture; |
2524 ControllerButtons: array[0..5] of array[0..19] of Byte; |
2527 ControllerButtons: array[0..5] of array[0..19] of Byte; |
2525 |
2528 |
2526 DefaultBinds : TBinds; |
2529 DefaultBinds : TBinds; |
2527 |
2530 |
2528 lastTurnChecksum : Longword; |
2531 lastTurnChecksum : Longword; |
2532 |
|
2533 mModelview: TMatrix4x4f; |
|
2534 mProjection: TMatrix4x4f; |
|
2535 vBuffer: GLuint; // vertex buffer |
|
2536 tBuffer: GLuint; // texture coords buffer |
|
2537 cBuffer: GLuint; // color buffer |
|
2538 |
|
2539 uCurrentMVPLocation: GLint; |
|
2540 |
|
2541 uMainMVPLocation: GLint; |
|
2542 uMainTintLocation: GLint; |
|
2543 |
|
2544 uWaterMVPLocation: GLint; |
|
2545 |
|
2546 aVertex: GLint; |
|
2547 aTexCoord: GLint; |
|
2548 aColor: GLint; |
|
2529 |
2549 |
2530 var trammo: array[TAmmoStrId] of ansistring; // name of the weapon |
2550 var trammo: array[TAmmoStrId] of ansistring; // name of the weapon |
2531 trammoc: array[TAmmoStrId] of ansistring; // caption of the weapon |
2551 trammoc: array[TAmmoStrId] of ansistring; // caption of the weapon |
2532 trammod: array[TAmmoStrId] of ansistring; // description of the weapon |
2552 trammod: array[TAmmoStrId] of ansistring; // description of the weapon |
2533 trmsg: array[TMsgStrId] of ansistring; // message of the event |
2553 trmsg: array[TMsgStrId] of ansistring; // message of the event |
2726 vobSDFramesCount:= 4; |
2746 vobSDFramesCount:= 4; |
2727 vobSDCount:= 30 * cScreenSpace div LAND_WIDTH; |
2747 vobSDCount:= 30 * cScreenSpace div LAND_WIDTH; |
2728 vobSDVelocity:= 15; |
2748 vobSDVelocity:= 15; |
2729 vobSDFallSpeed:= 250; |
2749 vobSDFallSpeed:= 250; |
2730 |
2750 |
2731 {$IFNDEF PAS2C} |
|
2732 //TODO: FIXME!! |
|
2733 cMinScreenWidth:= min(cScreenWidth, 640); |
2751 cMinScreenWidth:= min(cScreenWidth, 640); |
2734 cMinScreenHeight:= min(cScreenHeight, 480); |
2752 cMinScreenHeight:= min(cScreenHeight, 480); |
2735 cOrigScreenWidth:= cScreenWidth; |
2753 cOrigScreenWidth:= cScreenWidth; |
2736 cOrigScreenHeight:= cScreenHeight; |
2754 cOrigScreenHeight:= cScreenHeight; |
2737 {$ENDIF} |
|
2738 |
2755 |
2739 cNewScreenWidth := cScreenWidth; |
2756 cNewScreenWidth := cScreenWidth; |
2740 cNewScreenHeight := cScreenHeight; |
2757 cNewScreenHeight := cScreenHeight; |
2741 cScreenResizeDelay := 0; |
2758 cScreenResizeDelay := 0; |
2742 |
2759 |
2743 LuaGoals:= ''; |
2760 LuaGoals:= ''; |
2744 cMapName:= ''; |
2761 cMapName:= ''; |
2745 |
2762 |
2746 LuaTemplateNumber:= 0; |
2763 LuaTemplateNumber:= 0; |
2764 cStereoDepth := 0; |
|
2765 |
|
2766 MatrixLoadIdentity(mModelview); |
|
2767 MatrixLoadIdentity(mProjection); |
|
2768 aVertex:= 0; |
|
2769 aTexCoord:= 1; |
|
2770 aColor:= 2; |
|
2747 end; |
2771 end; |
2748 |
2772 |
2749 procedure freeModule; |
2773 procedure freeModule; |
2750 begin |
2774 begin |
2751 end; |
2775 end; |