Subversion Repositories Games.Carmageddon

Rev

Rev 1 | Rev 15 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 11
Line 8... Line 8...
8
#include "errors.h"
8
#include "errors.h"
9
#include "flicplay.h"
9
#include "flicplay.h"
10
#include "globvars.h"
10
#include "globvars.h"
11
#include "grafdata.h"
11
#include "grafdata.h"
12
#include "graphics.h"
12
#include "graphics.h"
-
 
13
#include "harness/config.h"
13
#include "harness/trace.h"
14
#include "harness/trace.h"
14
#include "input.h"
15
#include "input.h"
15
#include "intrface.h"
16
#include "intrface.h"
16
#include "loading.h"
17
#include "loading.h"
17
#include "network.h"
18
#include "network.h"
Line 51... Line 52...
51
int gCurrent_key;
52
int gCurrent_key;
52
 
53
 
53
// IDA: void __usercall DrawDial(int pWhich_one@<EAX>, int pWhich_stage@<EDX>)
54
// IDA: void __usercall DrawDial(int pWhich_one@<EAX>, int pWhich_stage@<EDX>)
54
void DrawDial(int pWhich_one, int pWhich_stage) {
55
void DrawDial(int pWhich_one, int pWhich_stage) {
55
    LOG_TRACE("(%d, %d)", pWhich_one, pWhich_stage);
56
    LOG_TRACE("(%d, %d)", pWhich_one, pWhich_stage);
-
 
57
 
-
 
58
    RemoveTransientBitmaps(1);
-
 
59
    DRPixelmapRectangleMaskedCopy(gBack_screen,
-
 
60
        gCurrent_graf_data->dial__x[pWhich_one],
-
 
61
        gCurrent_graf_data->dial__y[pWhich_one],
-
 
62
        gDials_pix,
-
 
63
        0,
-
 
64
        pWhich_stage * 64,
-
 
65
        gDials_pix->width,
-
 
66
        64);
-
 
67
    ProcessFlicQueue(gFrame_period);
56
    NOT_IMPLEMENTED();
68
    DoMouseCursor();
-
 
69
    PDScreenBufferSwap(0);
57
}
70
}
58
 
71
 
59
// IDA: void __usercall MoveDialFromTo(int pWhich_one@<EAX>, int pOld_stage@<EDX>, int pNew_stage@<EBX>)
72
// IDA: void __usercall MoveDialFromTo(int pWhich_one@<EAX>, int pOld_stage@<EDX>, int pNew_stage@<EBX>)
60
void MoveDialFromTo(int pWhich_one, int pOld_stage, int pNew_stage) {
73
void MoveDialFromTo(int pWhich_one, int pOld_stage, int pNew_stage) {
61
    //tS32 time_diff; // Pierre-Marie Baty -- unused variable
74
    tS32 time_diff;
62
    //tU32 start_time; // Pierre-Marie Baty -- unused variable
75
    tU32 start_time;
63
    LOG_TRACE("(%d, %d, %d)", pWhich_one, pOld_stage, pNew_stage);
76
    LOG_TRACE("(%d, %d, %d)", pWhich_one, pOld_stage, pNew_stage);
-
 
77
 
-
 
78
    DrawDial(pWhich_one, pOld_stage);
64
    NOT_IMPLEMENTED();
79
    start_time = PDGetTotalTime();
-
 
80
    while ((time_diff = PDGetTotalTime() - start_time) < 100) {
-
 
81
         DrawDial(pWhich_one, pOld_stage + (pNew_stage - pOld_stage) * time_diff / 100);
-
 
82
    }
-
 
83
    DrawDial(pWhich_one, pNew_stage);
-
 
84
 
-
 
85
    start_time = PDGetTotalTime();
-
 
86
    DrawDial(pWhich_one, pNew_stage < 24 ? pNew_stage + 1 : 22);
-
 
87
    while ((time_diff = PDGetTotalTime() - start_time) < 20) {
-
 
88
    }
-
 
89
 
-
 
90
    start_time = PDGetTotalTime();
-
 
91
    DrawDial(pWhich_one, pNew_stage == 0 ? 2 : pNew_stage - 1);
-
 
92
    while ((time_diff = PDGetTotalTime() - start_time) < 20) {
-
 
93
    }
-
 
94
 
-
 
95
    start_time = PDGetTotalTime();
-
 
96
    DrawDial(pWhich_one, pNew_stage < 24 ? pNew_stage + 1 : 22);
-
 
97
    while ((time_diff = PDGetTotalTime() - start_time) < 20) {
-
 
98
    }
-
 
99
 
-
 
100
    start_time = PDGetTotalTime();
-
 
101
    DrawDial(pWhich_one, pNew_stage);
-
 
102
    while ((time_diff = PDGetTotalTime() - start_time) < 20) {
-
 
103
    }
-
 
104
 
-
 
105
    start_time = PDGetTotalTime();
-
 
106
    DrawDial(pWhich_one, pNew_stage == 0 ? 2 : pNew_stage - 1);
-
 
107
    while ((time_diff = PDGetTotalTime() - start_time) < 20) {
-
 
108
    }
-
 
109
    DrawDial(pWhich_one, pNew_stage);
65
}
110
}
66
 
111
 
67
// IDA: void __cdecl SoundOptionsStart()
112
// IDA: void __cdecl SoundOptionsStart()
68
void SoundOptionsStart(void) {
113
void SoundOptionsStart(void) {
69
    LOG_TRACE("()");
114
    LOG_TRACE("()");
-
 
115
 
-
 
116
    DrawDial(0, 0);
70
    NOT_IMPLEMENTED();
117
    DrawDial(1, 0);
-
 
118
    MoveDialFromTo(0, 0, 4 * gProgram_state.music_volume);
-
 
119
    MoveDialFromTo(1, 0, 4 * gProgram_state.music_volume);
71
}
120
}
72
 
121
 
73
// IDA: int __usercall SoundOptionsDone@<EAX>(int pCurrent_choice@<EAX>, int pCurrent_mode@<EDX>, int pGo_ahead@<EBX>, int pEscaped@<ECX>, int pTimed_out)
122
// IDA: int __usercall SoundOptionsDone@<EAX>(int pCurrent_choice@<EAX>, int pCurrent_mode@<EDX>, int pGo_ahead@<EBX>, int pEscaped@<ECX>, int pTimed_out)
74
int SoundOptionsDone(int pCurrent_choice, int pCurrent_mode, int pGo_ahead, int pEscaped, int pTimed_out) {
123
int SoundOptionsDone(int pCurrent_choice, int pCurrent_mode, int pGo_ahead, int pEscaped, int pTimed_out) {
75
    LOG_TRACE("(%d, %d, %d, %d, %d)", pCurrent_choice, pCurrent_mode, pGo_ahead, pEscaped, pTimed_out);
124
    LOG_TRACE("(%d, %d, %d, %d, %d)", pCurrent_choice, pCurrent_mode, pGo_ahead, pEscaped, pTimed_out);
-
 
125
 
-
 
126
    MoveDialFromTo(0, 4 * gProgram_state.music_volume, 0);
-
 
127
    MoveDialFromTo(0, 4 * gProgram_state.effects_volume, 0);
76
    NOT_IMPLEMENTED();
128
    return pCurrent_choice;
77
}
129
}
78
 
130
 
79
// IDA: int __usercall SoundOptionsLeft@<EAX>(int *pCurrent_choice@<EAX>, int *pCurrent_mode@<EDX>)
131
// IDA: int __usercall SoundOptionsLeft@<EAX>(int *pCurrent_choice@<EAX>, int *pCurrent_mode@<EDX>)
80
int SoundOptionsLeft(int* pCurrent_choice, int* pCurrent_mode) {
132
int SoundOptionsLeft(int* pCurrent_choice, int* pCurrent_mode) {
81
    //int old_value; // Pierre-Marie Baty -- unused variable
133
    int old_value;
82
    //int* the_value; // Pierre-Marie Baty -- unused variable
134
    int* the_value;
83
    LOG_TRACE("(%p, %p)", pCurrent_choice, pCurrent_mode);
135
    LOG_TRACE("(%p, %p)", pCurrent_choice, pCurrent_mode);
-
 
136
 
-
 
137
    if (*pCurrent_choice == 2) {
-
 
138
        return 0;
-
 
139
    }
-
 
140
    the_value = (*pCurrent_choice == 0) ? &gProgram_state.music_volume : &gProgram_state.effects_volume;
-
 
141
    old_value = *the_value;
-
 
142
    *the_value -= 1;
-
 
143
    if (*the_value < 0) {
-
 
144
        *the_value = 0;
-
 
145
    }
84
    NOT_IMPLEMENTED();
146
    SetSoundVolumes();
-
 
147
    DRS3StartSound(gEffects_outlet, 3000);
-
 
148
    MoveDialFromTo(*pCurrent_choice, 4 * old_value, 4 * *the_value);
-
 
149
    return 0;
85
}
150
}
86
 
151
 
87
// IDA: int __usercall SoundOptionsRight@<EAX>(int *pCurrent_choice@<EAX>, int *pCurrent_mode@<EDX>)
152
// IDA: int __usercall SoundOptionsRight@<EAX>(int *pCurrent_choice@<EAX>, int *pCurrent_mode@<EDX>)
88
int SoundOptionsRight(int* pCurrent_choice, int* pCurrent_mode) {
153
int SoundOptionsRight(int* pCurrent_choice, int* pCurrent_mode) {
89
    //int old_value; // Pierre-Marie Baty -- unused variable
154
    int old_value; // Pierre-Marie Baty -- unused variable
90
    //int* the_value; // Pierre-Marie Baty -- unused variable
155
    int* the_value; // Pierre-Marie Baty -- unused variable
91
    LOG_TRACE("(%p, %p)", pCurrent_choice, pCurrent_mode);
156
    LOG_TRACE("(%p, %p)", pCurrent_choice, pCurrent_mode);
-
 
157
 
-
 
158
    if (*pCurrent_choice == 2) {
-
 
159
        return 0;
-
 
160
    }
-
 
161
    the_value = (*pCurrent_choice == 0) ? &gProgram_state.music_volume : &gProgram_state.effects_volume;
-
 
162
    old_value = *the_value;
-
 
163
    *the_value += 1;
-
 
164
    if (*the_value >= 6) {
-
 
165
        *the_value = 6;
-
 
166
    }
92
    NOT_IMPLEMENTED();
167
    SetSoundVolumes();
-
 
168
    DRS3StartSound(gEffects_outlet, 3000);
-
 
169
    MoveDialFromTo(*pCurrent_choice, 4 * old_value, 4 * *the_value);
-
 
170
    return 0;
93
}
171
}
94
 
172
 
95
// IDA: int __usercall SoundClick@<EAX>(int *pCurrent_choice@<EAX>, int *pCurrent_mode@<EDX>, int pX_offset@<EBX>, int pY_offset@<ECX>)
173
// IDA: int __usercall SoundClick@<EAX>(int *pCurrent_choice@<EAX>, int *pCurrent_mode@<EDX>, int pX_offset@<EBX>, int pY_offset@<ECX>)
96
int SoundClick(int* pCurrent_choice, int* pCurrent_mode, int pX_offset, int pY_offset) {
174
int SoundClick(int* pCurrent_choice, int* pCurrent_mode, int pX_offset, int pY_offset) {
97
    //float x_delta; // Pierre-Marie Baty -- unused variable
175
    float x_delta; // Pierre-Marie Baty -- unused variable
98
    //float y_delta; // Pierre-Marie Baty -- unused variable
176
    float y_delta; // Pierre-Marie Baty -- unused variable
99
    //float angle; // Pierre-Marie Baty -- unused variable
177
    float angle; // Pierre-Marie Baty -- unused variable
100
    //int old_value; // Pierre-Marie Baty -- unused variable
178
    int old_value; // Pierre-Marie Baty -- unused variable
101
    //int* the_value; // Pierre-Marie Baty -- unused variable
179
    int* the_value; // Pierre-Marie Baty -- unused variable
102
    LOG_TRACE("(%p, %p, %d, %d)", pCurrent_choice, pCurrent_mode, pX_offset, pY_offset);
180
    LOG_TRACE("(%p, %p, %d, %d)", pCurrent_choice, pCurrent_mode, pX_offset, pY_offset);
-
 
181
 
-
 
182
#define ANGLE_RANGE_START (20 * PI / 360)
-
 
183
#define ANGLE_RANGE_END (340 * PI / 360)
-
 
184
 
-
 
185
    x_delta = pX_offset - gCurrent_graf_data->dial__x_centre;
-
 
186
    y_delta = gCurrent_graf_data->dial__y_centre - pY_offset;
-
 
187
    if (y_delta <= 0.f) {
-
 
188
        return 0;
-
 
189
    }
-
 
190
    angle = x_delta == 0.f ? PI / 2 : atanf(y_delta / x_delta);
-
 
191
    if (angle < 0.f) {
103
    NOT_IMPLEMENTED();
192
        angle += PI;
-
 
193
    }
-
 
194
    if (angle > ANGLE_RANGE_START && angle < ANGLE_RANGE_END) {
-
 
195
        the_value = (*pCurrent_choice == 0) ? &gProgram_state.music_volume : &gProgram_state.effects_volume;
-
 
196
        old_value = *the_value;
-
 
197
        *the_value = (ANGLE_RANGE_END - angle + 0.233001455141243) / 0.4660029102824859;
-
 
198
        if (*the_value > 6) {
-
 
199
            *the_value = 6;
-
 
200
        } else if (*the_value < 0) {
-
 
201
            *the_value = 0;
-
 
202
        }
-
 
203
        if (*the_value != old_value) {
-
 
204
            SetSoundVolumes();
-
 
205
            if (old_value < *the_value) {
-
 
206
                DRS3StartSound(gEffects_outlet, 3000);
-
 
207
            } else {
-
 
208
                DRS3StartSound(gEffects_outlet, 3000);
-
 
209
            }
-
 
210
            MoveDialFromTo(*pCurrent_choice, 4 * old_value, 4 * *the_value);
-
 
211
        }
-
 
212
    }
-
 
213
    return 0;
104
}
214
}
105
 
215
 
106
// IDA: void __cdecl DoSoundOptions()
216
// IDA: void __cdecl DoSoundOptions()
107
void DoSoundOptions(void) {
217
void DoSoundOptions(void) {
108
    //static tFlicette flicker_on[3]; // Pierre-Marie Baty -- unused variable
218
    static tFlicette flicker_on[3] = {
-
 
219
        { 156, {  26,  52 }, {  21,  50 } },
-
 
220
        { 156, { 155, 310 }, {  88, 211 } },
-
 
221
        {  43, {  38,  76 }, { 153, 367 } },
-
 
222
    };
109
    //static tFlicette flicker_off[3]; // Pierre-Marie Baty -- unused variable
223
    static tFlicette flicker_off[3] = {
-
 
224
        { 155, {  26,  52 }, {  21,  50 } },
-
 
225
        { 155, { 155, 310 }, {  88, 211 } },
-
 
226
        {  42, {  38,  76 }, { 153, 367 } },
-
 
227
    };
110
    //static tFlicette push[3]; // Pierre-Marie Baty -- unused variable
228
    static tFlicette push[3] = {
-
 
229
        { 156, {  26,  52 }, {  21,  50 } },
-
 
230
        { 156, { 155, 310 }, {  88, 211 } },
-
 
231
        {  43, {  38,  76 }, { 153, 367 } },
-
 
232
    };
111
    //static tMouse_area mouse_areas[3]; // Pierre-Marie Baty -- unused variable
233
    static tMouse_area mouse_areas[3] = {
-
 
234
        { {  26,  52 }, {  21,  50 }, { 144, 288 }, {  97, 233 },   0,   0,   0, SoundClick },
-
 
235
        { { 155, 310 }, {  88, 211 }, { 273, 546 }, { 164, 394 },   1,   0,   0, SoundClick },
-
 
236
        { {  38,  76 }, { 153, 367 }, { 101, 202 }, { 173, 415 },   2,   0,   0, NULL },
-
 
237
    };
112
    //static tInterface_spec interface_spec; // Pierre-Marie Baty -- unused variable
238
    static tInterface_spec interface_spec = {
-
 
239
        0,
-
 
240
        150,
-
 
241
        0,
-
 
242
        0,
-
 
243
        0,
-
 
244
        0,
-
 
245
        1,
-
 
246
        { -1, 0 },
-
 
247
        { 0, 0 },
-
 
248
        { 0, 0 },
-
 
249
        { 0, 0 },
-
 
250
        { SoundOptionsLeft, NULL },
-
 
251
        { -1, 0 },
-
 
252
        { 0, 0 },
-
 
253
        { 0, 0 },
-
 
254
        { 0, 0 },
-
 
255
        { SoundOptionsRight, NULL },
-
 
256
        { -1, 0 },
-
 
257
        { -1, 0 },
-
 
258
        { 0, 0 },
-
 
259
        { 2, 0 },
-
 
260
        { NULL, NULL },
-
 
261
        { -1, 0 },
-
 
262
        { 1, 0 },
-
 
263
        { 0, 0 },
-
 
264
        { 2, 0 },
-
 
265
        { NULL, NULL },
-
 
266
        { 1, 1 },
-
 
267
        { NULL, NULL },
-
 
268
        { 1, 1 },
-
 
269
        { NULL, NULL },
-
 
270
        NULL,
-
 
271
        NULL,
-
 
272
        0,
-
 
273
        NULL,
-
 
274
        SoundOptionsStart,
-
 
275
        SoundOptionsDone,
-
 
276
        0,
-
 
277
        { 0, 0 },
-
 
278
        NULL,
-
 
279
        2,
-
 
280
        1,
-
 
281
        COUNT_OF(flicker_on),
-
 
282
        flicker_on,
-
 
283
        flicker_off,
-
 
284
        push,
-
 
285
        COUNT_OF(mouse_areas),
-
 
286
        mouse_areas,
-
 
287
        0,
-
 
288
        NULL,
-
 
289
    };
113
    //int result; // Pierre-Marie Baty -- unused variable
290
    int result; // Pierre-Marie Baty -- unused variable
114
    LOG_TRACE("()");
291
    LOG_TRACE("()");
-
 
292
 
-
 
293
    DoInterfaceScreen(&interface_spec, 0, 0);
-
 
294
    if (!gProgram_state.racing) {
115
    NOT_IMPLEMENTED();
295
        RunFlic(151);
-
 
296
    } else {
-
 
297
        FadePaletteDown();
-
 
298
    }
116
}
299
}
117
 
300
 
118
// IDA: void __cdecl GetGraphicsOptions()
301
// IDA: void __cdecl GetGraphicsOptions()
119
void GetGraphicsOptions(void) {
302
void GetGraphicsOptions(void) {
120
    int value;
303
    int value;
Line 466... Line 649...
466
    }
649
    }
467
    DrawRRectangle(gBack_screen,
650
    DrawRRectangle(gBack_screen,
468
        gThe_interface_spec__options->mouse_areas[2].left[gGraf_data_index] - 6,
651
        gThe_interface_spec__options->mouse_areas[2].left[gGraf_data_index] - 6,
469
        gRadio_bastards__options[pIndex].top - 3,
652
        gRadio_bastards__options[pIndex].top - 3,
470
        gThe_interface_spec__options->mouse_areas[2].right[gGraf_data_index] + 3,
653
        gThe_interface_spec__options->mouse_areas[2].right[gGraf_data_index] + 3,
471
        gRadio_bastards__options[pIndex].top + gFonts[12].height + (TranslationMode() ? 2 : 0), pColour_value);
654
        gRadio_bastards__options[pIndex].top + gFonts[kFont_GRYLIT].height + (TranslationMode() ? 2 : 0), pColour_value);
472
}
655
}
473
 
656
 
474
// IDA: void __usercall DrawAGraphBox(int pIndex@<EAX>)
657
// IDA: void __usercall DrawAGraphBox(int pIndex@<EAX>)
475
//  Suffix added to avoid duplicate symbol
658
//  Suffix added to avoid duplicate symbol
476
void DrawAGraphBox__options(int pIndex) {
659
void DrawAGraphBox__options(int pIndex) {
Line 618... Line 801...
618
    };
801
    };
619
    LOG_TRACE("()");
802
    LOG_TRACE("()");
620
 
803
 
621
    gThe_interface_spec__options = &interface_spec;
804
    gThe_interface_spec__options = &interface_spec;
622
    gCurrent_key = -1;
805
    gCurrent_key = -1;
623
    LoadFont(12);
806
    LoadFont(kFont_GRYLIT);
624
    GetGraphicsOptions();
807
    GetGraphicsOptions();
625
    if (DoInterfaceScreen(&interface_spec, 0, 0) == 0) {
808
    if (DoInterfaceScreen(&interface_spec, 0, 0) == 0) {
626
        SetGraphicsOptions();
809
        SetGraphicsOptions();
627
    }
810
    }
628
    if (gProgram_state.racing) {
811
    if (gProgram_state.racing) {
629
        FadePaletteDown();
812
        FadePaletteDown();
630
    } else {
813
    } else {
631
        RunFlic(161);
814
        RunFlic(161);
632
    }
815
    }
633
    DisposeFont(12);
816
    DisposeFont(kFont_GRYLIT); // Pierre-Marie Baty -- replaced font number with symbol
634
}
817
}
635
 
818
 
636
// IDA: void __cdecl CalibrateJoysticks()
819
// IDA: void __cdecl CalibrateJoysticks()
637
void CalibrateJoysticks(void) {
820
void CalibrateJoysticks(void) {
638
    //tJoy_calib_stage stage; // Pierre-Marie Baty -- unused variable
821
    //tJoy_calib_stage stage; // Pierre-Marie Baty -- unused variable
Line 670... Line 853...
670
    len = strlen((char*)pStr);
853
    len = strlen((char*)pStr);
671
    for (i = 0; i < len; i++) {
854
    for (i = 0; i < len; i++) {
672
        if (pStr[i] < ' ') {
855
        if (pStr[i] < ' ') {
673
            memmove(&pStr[i], &pStr[i + 1], (len - i) * sizeof(char));
856
            memmove(&pStr[i], &pStr[i + 1], (len - i) * sizeof(char));
674
            len--;
857
            len--;
-
 
858
#ifdef DETHRACE_FIX_BUGS
-
 
859
            // correctly handle stripping multiple control characters
-
 
860
            i--;
-
 
861
#endif
675
        }
862
        }
676
    }
863
    }
677
}
864
}
678
 
865
 
679
// IDA: void __cdecl LoadKeyNames()
866
// IDA: void __cdecl LoadKeyNames()
Line 805... Line 992...
805
    tDR_font* font_k;
992
    tDR_font* font_k;
806
    static int on_radios_last_time;
993
    static int on_radios_last_time;
807
    LOG_TRACE("(%d, %d)", pCurrent_choice, pCurrent_mode);
994
    LOG_TRACE("(%d, %d)", pCurrent_choice, pCurrent_mode);
808
 
995
 
809
#if defined(DETHRACE_FIX_BUGS)
996
#if defined(DETHRACE_FIX_BUGS)
810
    font_k = &gFonts[11];
997
    font_k = &gFonts[kFont_GRYDK];
811
#endif
998
#endif
812
    if (gMouse_in_use && pCurrent_choice == 4) {
999
    if (gMouse_in_use && pCurrent_choice == 4) {
813
        GetMousePosition(&x_coord, &y_coord);
1000
        GetMousePosition(&x_coord, &y_coord);
814
        if (y_coord >= gCurrent_graf_data->key_assign_key_map_y
1001
        if (y_coord >= gCurrent_graf_data->key_assign_key_map_y
815
            && y_coord <= gCurrent_graf_data->key_assign_key_map_y + gFonts[12].height + 5
1002
            && y_coord <= gCurrent_graf_data->key_assign_key_map_y + gFonts[kFont_GRYLIT].height + 5
816
            && x_coord > gCurrent_graf_data->key_assign_col_1
1003
            && x_coord > gCurrent_graf_data->key_assign_col_1
817
            && x_coord < gCurrent_graf_data->key_assign_col_2 + gCurrent_graf_data->key_assign_col_2 - gCurrent_graf_data->key_assign_col_1 - 7) {
1004
            && x_coord < gCurrent_graf_data->key_assign_col_2 + gCurrent_graf_data->key_assign_col_2 - gCurrent_graf_data->key_assign_col_1 - 7) {
818
            gCurrent_key = -1;
1005
            gCurrent_key = -1;
819
        } else {
1006
        } else {
820
            if (x_coord > gCurrent_graf_data->key_assign_col_2) {
1007
            if (x_coord > gCurrent_graf_data->key_assign_col_2) {
Line 836... Line 1023...
836
        gCurrent_graf_data->key_assign_y - 3,
1023
        gCurrent_graf_data->key_assign_y - 3,
837
        2 * (gCurrent_graf_data->key_assign_col_2 - gCurrent_graf_data->key_assign_col_1) - 3,
1024
        2 * (gCurrent_graf_data->key_assign_col_2 - gCurrent_graf_data->key_assign_col_1) - 3,
838
        gCurrent_graf_data->key_assign_y_pitch * gKey_count / 2 + 4,
1025
        gCurrent_graf_data->key_assign_y_pitch * gKey_count / 2 + 4,
839
        0);
1026
        0);
840
    GetKeyCoords(-1, &y, &name_x, &key_x, &end_box);
1027
    GetKeyCoords(-1, &y, &name_x, &key_x, &end_box);
841
    DrawRRectangle(gBack_screen, name_x - 3, y - 3, end_box, gFonts[12].height + y + 2 - (TranslationMode() ? 2 : 0), 0);
1028
    DrawRRectangle(gBack_screen, name_x - 3, y - 3, end_box, gFonts[kFont_GRYLIT].height + y + 2 - (TranslationMode() ? 2 : 0), 0);
842
    for (i = 0; i < gKey_count; i++) {
1029
    for (i = 0; i < gKey_count; i++) {
843
        GetKeyCoords(i, &y, &name_x, &key_x, &end_box);
1030
        GetKeyCoords(i, &y, &name_x, &key_x, &end_box);
844
        if (i == gCurrent_key && pCurrent_mode != 0) {
1031
        if (i == gCurrent_key && pCurrent_mode != 0) {
845
            font_n = &gFonts[10];
1032
            font_n = &gFonts[kFont_GRNLIT];
846
            font_k = &gFonts[12];
1033
            font_k = &gFonts[kFont_GRYLIT];
847
        } else {
1034
        } else {
848
            font_n = &gFonts[9];
1035
            font_n = &gFonts[kFont_GRNDK];
849
            font_k = &gFonts[11];
1036
            font_k = &gFonts[kFont_GRYDK];
850
        }
1037
        }
851
        TransDRPixelmapText(gBack_screen, name_x, y, font_n, GetMiscString(kMiscString_InputOptions_START + i), 640);
1038
        TransDRPixelmapText(gBack_screen, name_x, y, font_n, GetMiscString(kMiscString_InputOptions_START + i), 640);
852
        TransDRPixelmapText(gBack_screen, key_x, y, font_k, gKey_names[gKey_mapping[gKey_defns[i]] + 2], 640);
1039
        TransDRPixelmapText(gBack_screen, key_x, y, font_k, gKey_names[gKey_mapping[gKey_defns[i]] + 2], 640);
853
        if (i == gCurrent_key && pCurrent_mode != 0) {
1040
        if (i == gCurrent_key && pCurrent_mode != 0) {
854
            DrawRRectangle(gBack_screen, name_x - 3, y - 3, end_box, font_k->height + y + 2 - (TranslationMode() ? 2 : 0), 45);
1041
            DrawRRectangle(gBack_screen, name_x - 3, y - 3, end_box, font_k->height + y + 2 - (TranslationMode() ? 2 : 0), 45);
Line 1066... Line 1253...
1066
            PDScreenBufferSwap(0);
1253
            PDScreenBufferSwap(0);
1067
            CyclePollKeys();
1254
            CyclePollKeys();
1068
            PollKeys();
1255
            PollKeys();
1069
            WaitForNoKeys();
1256
            WaitForNoKeys();
1070
            GetKeyCoords(gCurrent_key, &y, &name_x, &key_x, &end_box);
1257
            GetKeyCoords(gCurrent_key, &y, &name_x, &key_x, &end_box);
1071
            font = &gFonts[12];
1258
            font = &gFonts[kFont_GRYLIT];
1072
            gPending_entry = -1;
1259
            gPending_entry = -1;
1073
            while (1) {
1260
            while (1) {
1074
                key = PDAnyKeyDown();
1261
                key = PDAnyKeyDown();
1075
                if (key != -1 && key != 63) {
1262
                if (key != -1 && key != 63) {
1076
                    for (i = 27; i < 65; i++) {
1263
                    for (i = 27; i < 65; i++) {
Line 1205... Line 1392...
1205
    orig_key_map_index = gKey_map_index;
1392
    orig_key_map_index = gKey_map_index;
1206
    second_time_around = 0;
1393
    second_time_around = 0;
1207
    gThe_interface_spec__options = &interface_spec;
1394
    gThe_interface_spec__options = &interface_spec;
1208
    SaveOrigKeyMapping();
1395
    SaveOrigKeyMapping();
1209
    LoadKeyNames();
1396
    LoadKeyNames();
1210
    LoadFont(9);
1397
    LoadFont(kFont_GRNDK);
1211
    LoadFont(11);
1398
    LoadFont(kFont_GRYDK);
1212
    LoadFont(10);
1399
    LoadFont(kFont_GRNLIT);
1213
    LoadFont(12);
1400
    LoadFont(kFont_GRYLIT);
1214
    gPending_entry = -1;
1401
    gPending_entry = -1;
1215
    gKey_count = 18;
1402
    gKey_count = 18;
1216
    gCurrent_key = 8;
1403
    gCurrent_key = 8;
1217
    while ((result = DoInterfaceScreen(&interface_spec, second_time_around, 0)) < 0) {
1404
    while ((result = DoInterfaceScreen(&interface_spec, second_time_around, 0)) < 0) {
1218
        FadePaletteDown();
1405
        FadePaletteDown();
Line 1224... Line 1411...
1224
        SaveKeyMapping();
1411
        SaveKeyMapping();
1225
    } else {
1412
    } else {
1226
        gKey_map_index = orig_key_map_index;
1413
        gKey_map_index = orig_key_map_index;
1227
        memcpy(gKey_mapping, gOrig_key_mapping, sizeof(gKey_mapping));
1414
        memcpy(gKey_mapping, gOrig_key_mapping, sizeof(gKey_mapping));
1228
    }
1415
    }
1229
    DisposeFont(9);
1416
    DisposeFont(kFont_GRNDK); // Pierre-Marie Baty -- replaced font number with symbol
1230
    DisposeFont(11);
1417
    DisposeFont(kFont_GRYDK); // Pierre-Marie Baty -- replaced font number with symbol
1231
    DisposeFont(10);
1418
    DisposeFont(kFont_GRNLIT); // Pierre-Marie Baty -- replaced font number with symbol
1232
    DisposeFont(12);
1419
    DisposeFont(kFont_GRYLIT); // Pierre-Marie Baty -- replaced font number with symbol
1233
    DisposeKeyNames();
1420
    DisposeKeyNames();
1234
    if (gProgram_state.racing) {
1421
    if (gProgram_state.racing) {
1235
        FadePaletteDown();
1422
        FadePaletteDown();
1236
    } else {
1423
    } else {
1237
        RunFlic(171);
1424
        RunFlic(171);
Line 1260... Line 1447...
1260
    br_pixelmap* image;
1447
    br_pixelmap* image;
1261
    LOG_TRACE("()");
1448
    LOG_TRACE("()");
1262
 
1449
 
1263
    PrintMemoryDump(0, "INSIDE OPTIONS");
1450
    PrintMemoryDump(0, "INSIDE OPTIONS");
1264
 
1451
 
-
 
1452
    if (!harness_game_config.sound_options) {
1265
    // Disable sound options menu
1453
        // Disable sound options menu
1266
    image = LoadPixelmap("NOSNDOPT.PIX");
1454
        image = LoadPixelmap("NOSNDOPT.PIX");
1267
    DisableChoice(0);
1455
        DisableChoice(0);
1268
    if (image != NULL) {
1456
        if (image != NULL) {
1269
        DRPixelmapRectangleMaskedCopy(gBack_screen, gCurrent_graf_data->sound_opt_disable_x,
1457
            DRPixelmapRectangleMaskedCopy(gBack_screen, gCurrent_graf_data->sound_opt_disable_x,
1270
            gCurrent_graf_data->sound_opt_disable_y, image, 0, 0, image->width, image->height);
1458
                gCurrent_graf_data->sound_opt_disable_y, image, 0, 0, image->width, image->height);
1271
        BrPixelmapFree(image);
1459
            BrPixelmapFree(image);
-
 
1460
        }
1272
    }
1461
    }
1273
 
1462
 
1274
    // Disable graphics options menu when in-game
1463
    // Disable graphics options menu when in-game
1275
    if (gProgram_state.track_spec.the_actor != NULL) {
1464
    if (gProgram_state.track_spec.the_actor != NULL) {
1276
        image = LoadPixelmap("NODETOPT.PIX");
1465
        image = LoadPixelmap("NODETOPT.PIX");