Subversion Repositories eduke32

Rev

Rev 4432 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4432 Rev 4440
Line 161... Line 161...
161
#elif defined HAVE_GTK2
161
#elif defined HAVE_GTK2
162
    if (gtkbuild_msgbox(name, buf) >= 0) return 1;
162
    if (gtkbuild_msgbox(name, buf) >= 0) return 1;
163
#elif defined _WIN32
163
#elif defined _WIN32
164
    MessageBox(win_gethwnd(),buf,name,MB_OK|MB_TASKMODAL);
164
    MessageBox(win_gethwnd(),buf,name,MB_OK|MB_TASKMODAL);
165
    return 0;
165
    return 0;
-
 
166
#elif defined __ANDROID__
-
 
167
    initprintf("wm_msgbox called. Message: %s: %s",name,buf);
-
 
168
    return 0;
166
#elif SDL_MAJOR_VERSION==2
169
#elif SDL_MAJOR_VERSION==2
167
# if !defined _WIN32
170
# if !defined _WIN32
168
    // Replace all tab chars with spaces because the hand-rolled SDL message
171
    // Replace all tab chars with spaces because the hand-rolled SDL message
169
    // box diplays the former as N/L instead of whitespace.
172
    // box diplays the former as N/L instead of whitespace.
170
    {
173
    {
Line 204... Line 207...
204
    if ((r = gtkbuild_ynbox(name, buf)) >= 0) return r;
207
    if ((r = gtkbuild_ynbox(name, buf)) >= 0) return r;
205
#elif defined _WIN32
208
#elif defined _WIN32
206
    r = MessageBox(win_gethwnd(),buf,name,MB_YESNO|MB_ICONQUESTION|MB_TASKMODAL);
209
    r = MessageBox(win_gethwnd(),buf,name,MB_YESNO|MB_ICONQUESTION|MB_TASKMODAL);
207
    if (r==IDYES) return 1;
210
    if (r==IDYES) return 1;
208
    return 0;
211
    return 0;
-
 
212
#elif defined __ANDROID__
-
 
213
    initprintf("wm_ynbox called, this is bad! Message: %s: %s",name,buf);
-
 
214
    initprintf("Returning false..");
-
 
215
    return 0;
209
#endif
216
#endif
210
    puts(buf);
217
    puts(buf);
211
    puts("   (type 'Y' or 'N', and press Return or Enter to continue)");
218
    puts("   (type 'Y' or 'N', and press Return or Enter to continue)");
212
    do c = getchar(); while (c != 'Y' && c != 'y' && c != 'N' && c != 'n');
219
    do c = getchar(); while (c != 'Y' && c != 'y' && c != 'N' && c != 'n');
213
    if (c == 'Y' || c == 'y') return 1;
220
    if (c == 'Y' || c == 'y') return 1;
Line 215... Line 222...
215
    return 0;
222
    return 0;
216
}
223
}
217
224
218
void wm_setapptitle(char *name)
225
void wm_setapptitle(char *name)
219
{
226
{
-
 
227
#ifdef __ANDROID__
-
 
228
         initprintf("wm_setapptitle called");
-
 
229
         return;
-
 
230
#endif
-
 
231
220
    if (name)
232
    if (name)
221
        Bstrncpyz(apptitle, name, sizeof(apptitle));
233
        Bstrncpyz(apptitle, name, sizeof(apptitle));
222
234
223
#if SDL_MAJOR_VERSION == 1
235
#if SDL_MAJOR_VERSION == 1
224
    SDL_WM_SetCaption(apptitle, NULL);
236
    SDL_WM_SetCaption(apptitle, NULL);
Line 502... Line 514...
502
#ifdef USE_OPENGL
514
#ifdef USE_OPENGL
503
    setvsync(vsync);
515
    setvsync(vsync);
504
#endif
516
#endif
505
}
517
}
506
518
-
 
519
#ifdef __ANDROID__
-
 
520
#include <android/log.h>
-
 
521
#endif
507
522
508
//
523
//
509
// initprintf() -- prints a string to the intitialization window
524
// initprintf() -- prints a string to the intitialization window
510
//
525
//
511
void initprintf(const char *f, ...)
526
void initprintf(const char *f, ...)
Line 516... Line 531...
516
531
517
    va_start(va, f);
532
    va_start(va, f);
518
    Bvsnprintf(buf, sizeof(buf), f, va);
533
    Bvsnprintf(buf, sizeof(buf), f, va);
519
    va_end(va);
534
    va_end(va);
520
535
-
 
536
#ifdef __ANDROID__
-
 
537
    __android_log_print(ANDROID_LOG_INFO,"DUKE", "%s",buf);
-
 
538
#endif
521
    OSD_Printf("%s", buf);
539
    OSD_Printf("%s", buf);
522
//    Bprintf("%s", buf);
540
//    Bprintf("%s", buf);
523
541
524
    mutex_lock(&m_initprintf);
542
    mutex_lock(&m_initprintf);
525
    if (Bstrlen(dabuf) + Bstrlen(buf) > 1022)
543
    if (Bstrlen(dabuf) + Bstrlen(buf) > 1022)
Line 2009... Line 2027...
2009
//
2027
//
2010
// setgamma
2028
// setgamma
2011
//
2029
//
2012
int32_t setgamma(void)
2030
int32_t setgamma(void)
2013
{
2031
{
-
 
2032
        //return 0;
-
 
2033
2014
    int32_t i;
2034
    int32_t i;
2015
    uint16_t gammaTable[768];
2035
    uint16_t gammaTable[768];
2016
    float gamma = max(0.1f,min(4.f,vid_gamma));
2036
    float gamma = max(0.1f,min(4.f,vid_gamma));
2017
    float contrast = max(0.1f,min(3.f,vid_contrast));
2037
    float contrast = max(0.1f,min(3.f,vid_contrast));
2018
    float bright = max(-0.8f,min(0.8f,vid_brightness));
2038
    float bright = max(-0.8f,min(0.8f,vid_brightness));
Line 2045... Line 2065...
2045
        i = SDL_SetWindowGammaRamp(
2065
        i = SDL_SetWindowGammaRamp(
2046
            sdl_window,&gammaTable[0],&gammaTable[256],&gammaTable[512]);
2066
            sdl_window,&gammaTable[0],&gammaTable[256],&gammaTable[512]);
2047
2067
2048
    if (i < 0)
2068
    if (i < 0)
2049
    {
2069
    {
-
 
2070
#ifndef __ANDROID__ //Don't do this check, it is really supported, TODO
2050
        if (i != INT32_MIN)
2071
        if (i != INT32_MIN)
2051
            initprintf("Unable to set gamma: SDL_SetWindowGammaRamp failed: %s\n", SDL_GetError());
2072
            initprintf("Unable to set gamma: SDL_SetWindowGammaRamp failed: %s\n", SDL_GetError());
-
 
2073
#endif
2052
    }
2074
    }
2053
    else
2075
    else
2054
#endif
2076
#endif
2055
    {
2077
    {
2056
        lastvidgcb[0] = gamma;
2078
        lastvidgcb[0] = gamma;